feat: umfangreiches UI+API-Polish (v1.1.36–1.1.42)

Backend:
- Audit-Log: Search-Endpoint mit ILIKE-Filter (actor/action/subject/date)
- NTP: /ntp/status via chronyc tracking (Stratum, Offset, Quelle)
- System: /service-restart mit Allowlist (haproxy/squid/unbound/chrony/scheduler)
- Domain-Response-Headers + Rate-Limit (Migration 0024)
- Join-Tokens (Migration 0025), Cluster-mTLS, Aggregator-Fan-Out
- apt-Service für Update-Banner (apt-get update + Versionsprüfung)
- Backup-Retry mit exponential backoff (retry_apt 3×)
- publish.sh fail-fast + cleanup-old.sh (max 10 Versionen)

Frontend:
- Audit-Log-Page (/audit) mit Filter + Pagination
- ErrorBoundary an React-Root + Vite build-target festgenagelt (iOS 15+)
- Storage-Schema-Stamp: auto-wipe bei Versions-Mismatch (blank-page-Fix)
- EmptyState-Komponente überall ausgerollt
- SSL: Aggregate-Karte (total/expiring/expired/errors)
- Backups: Aggregate-Karte (letzter Backup/Größe/Fehlschläge 24h) + Backup-Now
- NTP: Sync-Status-Karte (chronyc tracking live)
- Domains: Backend-UP/DOWN-Chip aus HAProxy-Stats
- Backends: HAProxy-Status-Spalte (UP/DEGRADED/DOWN)
- Settings: Service-Neustart-Karte (haproxy/squid/unbound/chrony/scheduler)
- Settings: Upgrade-Status-Card, Wartungsmodus, Auto-Update, Retention
- Dashboard: Recent-Alerts, Cluster-Health, License-Chip, Onboarding-Hint
- System-Regeln im Firewall als eigener Tab

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-05-19 16:18:41 +02:00
parent 3178e25e78
commit 35b7308ce2
82 changed files with 8408 additions and 392 deletions

View File

@@ -0,0 +1,44 @@
// Storage-Schema-Stamp. Verhindert die „blank page nach Update"-Klasse
// von Bugs: wenn wir die Form von etwas das wir nach localStorage
// oder sessionStorage schreiben ändern, könnte das vorhandene Objekt
// auf dem Client nicht mehr zur neuen Code-Version passen → Render-
// throw → blank #root.
//
// Lösung: ein einziger Versions-Key. Beim App-Boot prüfen ob die
// gespeicherte Version stimmt — wenn nicht, alle bekannten Storage-
// Keys wegwerfen und neu stampen. Der Operator muss sich danach
// einmal neu einloggen, sieht aber nicht mehr blank.
//
// Bump SCHEMA_VERSION immer wenn:
// - eine SessionUser-Felddefinition geändert wird
// - der Format der Logs-Filter geändert wird
// - ein neuer Key zu KEYS hinzukommt der bei Mismatch raus muss
//
// Reine Additionen die abwärtskompatibel parsen brauchen keinen Bump.
const SCHEMA_VERSION = 1
const STAMP_KEY = 'eg_storage_schema'
// Alle Keys die wir selbst nach localStorage/sessionStorage schreiben.
// Drittanbieter-Keys (z.B. i18nextLng) wipen wir bewusst nicht — die
// Library kennt ihr eigenes Format und repariert sich selbst.
const SESSION_KEYS = ['eg_session']
const LOCAL_KEYS = ['edgeguard.logs.filters']
export function ensureStorageSchema(): void {
let stored: number | null = null
try {
const raw = localStorage.getItem(STAMP_KEY)
if (raw) stored = parseInt(raw, 10)
} catch { /* localStorage disabled — nichts zu tun */ }
if (stored === SCHEMA_VERSION) return
// Mismatch (oder erstmaliger Start) → unsere eigenen Keys wegwerfen.
// Try/catch pro Operation: ein einzelner Quota-/SecurityError soll
// den Cleanup nicht abbrechen, sonst bleiben halb-bereinigte Reste.
for (const k of SESSION_KEYS) { try { sessionStorage.removeItem(k) } catch { /* ignore */ } }
for (const k of LOCAL_KEYS) { try { localStorage.removeItem(k) } catch { /* ignore */ } }
try { localStorage.setItem(STAMP_KEY, String(SCHEMA_VERSION)) } catch { /* ignore */ }
}