Streaming terminals for PHP extensions, SSL certificates; UFW logging state fix

- php.php: install-extension and remove-extension now stream via SSE (real-time progress, proper error detection, sudo)
- ssl.php: issue action now streams certbot output via SSE
- admin.js: phpExtInstall/Remove use streaming terminal modal
- admin.js: adminIssueBulkSSL uses streaming modal with per-domain progress
- admin.js: adminRenewCert now confirms before renewing
- admin.js: adminIssueSingleSSL helper for per-domain streaming SSL
- admin.js: firewall page pre-selects current UFW logging level from API response
- admin.js: fwSetLogging reloads firewall page on success
- firewall.php: ufw_status() now parses and returns logging level

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 18:04:43 +00:00
parent 99cdc6f3dc
commit 1c2c11251c
4 changed files with 241 additions and 37 deletions
+7
View File
@@ -100,10 +100,17 @@ function ufw_status(): array {
// Default policy
preg_match('/Default:\s+(\w+) \(incoming\),\s+(\w+) \(outgoing\)/', $raw, $pol);
// Logging level
preg_match('/Logging:\s+(\S+)/i', $raw, $logm);
$logging = strtolower($logm[1] ?? 'off');
if ($logging === 'on (low)') $logging = 'low';
// Normalise: strip parentheses if present e.g. "on (low)" → "low"
if (preg_match('/\((\w+)\)/', $logging, $lm)) $logging = $lm[1];
return [
'active' => $active,
'default_incoming' => $pol[1] ?? 'deny',
'default_outgoing' => $pol[2] ?? 'allow',
'logging' => $logging,
'rules' => $rules,
'raw' => $raw,
];