diff --git a/dist/debian/.gitignore b/dist/debian/.gitignore index e214825e..f32f229d 100644 --- a/dist/debian/.gitignore +++ b/dist/debian/.gitignore @@ -6,6 +6,8 @@ !copyright !lintian-overrides !rules +!config.php +!dbconfig-common.php !source/ source/* diff --git a/dist/debian/arsse.install b/dist/debian/arsse.install index f7a16b95..3b43e396 100644 --- a/dist/debian/arsse.install +++ b/dist/debian/arsse.install @@ -8,10 +8,11 @@ UPGRADING usr/share/arsse/ README.md usr/share/arsse/ arsse.php usr/share/arsse/ -dist/debian/bin/arsse usr/bin/ -manual usr/share/doc/arsse/ -dist/man/* usr/share/man/ -dist/nginx etc/arsse/ -dist/apache etc/arsse/ -dist/config.php etc/arsse -config.defaults.php etc/arsse/ +config.defaults.php etc/arsse/ +manual usr/share/doc/arsse/ +dist/man/* usr/share/man/ +dist/nginx etc/arsse/ +dist/apache etc/arsse/ +dist/debian/config.php etc/arsse/ +dist/debian/dbconfig-cmmon.php usr/share/arsse/ +dist/debian/bin/arsse usr/bin/ diff --git a/dist/debian/config.php b/dist/debian/config.php new file mode 100644 index 00000000..81f5e64f --- /dev/null +++ b/dist/debian/config.php @@ -0,0 +1,15 @@ + true, +] ++ (@include "/usr/share/arsse/dbconfig-common.php"); diff --git a/dist/debian/dbconfig-common.php b/dist/debian/dbconfig-common.php new file mode 100644 index 00000000..8c5533f3 --- /dev/null +++ b/dist/debian/dbconfig-common.php @@ -0,0 +1,44 @@ + "sqlite3"]; + if (strlen((string) $basepath) && strlen((string) $dbname)) { + $conf['dbSQLite3File'] = "$basepath/$dbname"; + } + } elseif ($dbtype === "pgsql") { + $conf = [ + 'dbDriver' => "postgresql", + 'dbPostgreSQLHost' => $dbserver ?? "", + 'dbPostgreSQLUser' => $dbuser ?? "arsse", + 'dbPostgreSQLPass' => $dbpass ?? "", + 'dbPostgreSQLPort' => $dbport ?? 5432, + 'dbPostgreSQLDb' => $dbname ?? "arsse", + ]; + } elseif ($dbtype === "mysql") { + $conf = [ + 'dbDriver' => "mysql", + 'dbMySQLHost' => $dbserver ?? "", + 'dbMySQLUser' => $dbuser ?? "arsse", + 'dbMySQLPass' => $dbpass ?? "", + 'dbMySQLPort' => $dbport ?? 3306, + 'dbMySQLDb' => $dbname ?? "arsse", + ]; + } else { + throw new \Exception("Debian dbconfig-common configuration file $dbconfpath is invalid"); + } + return $conf; +} else { + // if not configuration file exists simply return an empty array + return []; +} \ No newline at end of file