SIMON Master Console Rebuild
True command center for SIMON + WEB360
This rebuild gives you a cleaner production spine: interactive tree, live viewer, guarded editor, dynamic graphics, architecture map, and note storage. It is designed to sit beside your existing
console.php
and become the stronger replacement path.
Dashboard
Tree
Viewer
System Map
File Registry
Notes
Files
15,661
Folders
436
Scanned Size
3.88 GB
PHP Files
990
Editable Text Files
12,919
File viewer
guarded to /htdocs
/infinity/old/lulu/backup.php
<?php declare(strict_types=1); require __DIR__ . '/lib.php'; $c = cfg(); ensure_dirs(); $secret = admin_secret(); $key = trim((string)($_SERVER['HTTP_X_LULU_KEY'] ?? '')); if (!$secret || !$key || !hash_equals($secret, $key)) { log_audit('backup_forbidden'); json_out(['ok'=>false,'error'=>'Forbidden'], 403); } $logsDir = (string)$c['paths']['logs_dir']; $backupsDir = (string)$c['paths']['backups_dir']; $cfgDir = (string)$c['paths']['cfg_dir']; $ts = gmdate('Y-m-d_His'); $name = "lulu_backup_{$ts}.zip"; $zipPath = $backupsDir . '/' . $name; if (!class_exists('ZipArchive')) json_out(['ok'=>false,'error'=>'ZipArchive missing'], 500); $zip = new ZipArchive(); if ($zip->open($zipPath, ZipArchive::CREATE) !== true) json_out(['ok'=>false,'error'=>'Cannot create zip'], 500); // logs foreach (['lulu.ndjson','lulu_errors.ndjson','lulu_audit.ndjson','lulu_perf.ndjson'] as $f) { $p = $logsDir . '/' . $f; if (is_file($p)) $zip->addFile($p, "logs/{$f}"); } // config + key placeholder (NOT the secret itself) $zip->addFile(__DIR__ . '/config.php', 'app/config.php'); $zip->addFile(__DIR__ . '/lib.php', 'app/lib.php'); $zip->addFile(__DIR__ . '/index.php', 'app/index.php'); $zip->addFile(__DIR__ . '/api.php', 'app/api.php'); $zip->addFile(__DIR__ . '/health.php', 'app/health.php'); $zip->close(); // rotate older backups $keep = (int)($c['admin']['backup_keep'] ?? 14); $files = glob($backupsDir . '/lulu_backup_*.zip') ?: []; rsort($files); for ($i=$keep; $i<count($files); $i++) @unlink($files[$i]); log_audit('backup_now', ['file'=>$name]); json_out(['ok'=>true,'file'=>$name,'path'=>basename($zipPath)]);
Save file
Quick jump
open a path
Open