Fix: setup.php now add a key in existing setup post update.

This commit is contained in:
Johnnybegood90
2026-03-13 21:28:18 +01:00
parent 76dbd18ca7
commit 8460771d20
+5
View File
@@ -14,6 +14,11 @@ if (file_exists($config_path)) {
unset($existing['epg_url'], $existing['m3u_url']); unset($existing['epg_url'], $existing['m3u_url']);
file_put_contents($config_path, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); file_put_contents($config_path, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
} }
// Bootstrap : config existante sans cle admin -> on en genere une maintenant
if (empty($existing['admin_key'])) {
$existing['admin_key'] = bin2hex(random_bytes(16));
file_put_contents($config_path, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
}
} }
$is_first_setup = !file_exists($config_path); $is_first_setup = !file_exists($config_path);