Admin: move deploy flow into settings and use secrets file

This commit is contained in:
2026-02-21 15:50:39 +03:00
parent 27691ba396
commit bc48e6959d
11 changed files with 305 additions and 136 deletions
+20
View File
@@ -22,6 +22,26 @@ function appConfig(): array
return $cfg;
}
function appSecrets(): array
{
static $secrets = null;
if ($secrets !== null) {
return $secrets;
}
$path = __DIR__ . '/../secrets.php';
if (!is_file($path)) {
throw new RuntimeException('secrets.php not found. Copy secrets.php.example');
}
$secrets = require $path;
if (!is_array($secrets)) {
throw new RuntimeException('Invalid secrets.php format');
}
return $secrets;
}
function db(): PDO
{
static $pdo = null;