Proxy: setup progress stream, self-healing, uninstall, health check cron

- ProxyManager::runSetupOnRemote() — generator yields step-by-step
  progress; drives SSE stream from /api/proxy/setup-remote POST
- ProxyManager::uninstall(bool) — removes configs from remote or local;
  optionally apt-get removes nginx and sets mode=disabled
- ProxyManager::healthCheck() — called every 5 min from collect-stats.php;
  restarts nginx on remote if found stopped
- proxy.php: POST /api/proxy/setup-remote (SSE stream), DELETE /api/proxy/uninstall
- admin.js: proxyRunSetup() streams output to a live log modal;
  proxyUninstall() with configs-only vs full removal choice;
  'Run Setup on Remote VM' / 'Uninstall' buttons in page header

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 10:23:02 +00:00
parent 6b95571548
commit ed552cd5a6
4 changed files with 148 additions and 0 deletions
+4
View File
@@ -63,3 +63,7 @@ $db->execute(
// Prune rows older than 30 days
$db->execute("DELETE FROM server_stats WHERE recorded_at < DATE_SUB(NOW(), INTERVAL 30 DAY)");
// Proxy health check — restart nginx on remote proxy VM if it's stopped
require_once NOVACPX_LIB . '/ProxyManager.php';
ProxyManager::healthCheck();