diff --git a/game/admin/config.inc b/game/admin/config.inc index d5b361c..e8b7ddb 100644 --- a/game/admin/config.inc +++ b/game/admin/config.inc @@ -1,18 +1,36 @@ '127.0.0.1', - 'database' => 'legacyworlds', - 'user' => 'legacyworlds', - 'password' => 'password for the standard database user', - 'adminUser' => 'legacyworlds_admin', - 'adminPassword' => 'password for the administrative database user', + 'host' => getenv('LW_DB_HOST') ?: '127.0.0.1', + 'database' => getenv('LW_DB_NAME') ?: 'legacyworlds', + 'user' => getenv('LW_DB_USER_NAME') ?: 'legacyworlds', + 'password' => readSecret('LW_DB_USER_PASS'), + 'adminUser' => getenv('LW_DB_ADMIN_NAME') ?: 'legacyworlds_admin', + 'adminPassword' => readSecret('LW_DB_ADMIN_PASS'), 'ctrlFifo' =>'/tmp/.lwFifo', 'ctrlPath' =>'/tmp/.lwControl' ); -function __dbConnect($admin = false) { +function __dbConnect(bool $admin = false): \PgSql\Connection|bool { global $aConfig; $h = $aConfig['host']; $d = $aConfig['database'];