diff --git a/setup.php b/setup.php index 2358d11..12d20df 100644 --- a/setup.php +++ b/setup.php @@ -14,6 +14,11 @@ if (file_exists($config_path)) { unset($existing['epg_url'], $existing['m3u_url']); 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);