feat(backup): Restore-Pfad — POST /backups/:id/restore + UI
backup.Service.Restore(id) schreibt /var/lib/edgeguard/restore.sh
und dispatcht via `sudo systemd-run --unit=edgeguard-restore.service`.
Skript-Ablauf:
1. tar -xzf der Backup-Datei → /var/lib/edgeguard/restore-tmp
2. state-files (setup.json/license/jwt/node.conf/acme-account) per
cp -a zurück, chown edgeguard
3. systemctl stop edgeguard-api + scheduler (DB-Connections freigeben)
4. sudo -u postgres psql -f dump.sql (--clean droppt + recreated)
5. edgeguard-ctl render-config (haproxy/nft/squid/unbound/chrony)
6. systemctl start edgeguard-api + scheduler
7. rm -rf restore-tmp + restore.sh
UI: pro Backup-Row neuer Restore-Button mit Popconfirm. Beim Trigger
zeigt sich das vertraute Fullscreen-Overlay (Klassen .update-modal*
re-used) mit 4 Steps (Extract / DB-Restore / Render / Restart) + Live-
Timer. Health-Poll alle 3s detektiert API-Restart + reload. Safety-
Timeout 3 min für große DB-Dumps.
postinst: sudoers für `systemd-run --unit=edgeguard-restore.service
--description=... --collect bash /var/lib/edgeguard/restore.sh` +
zugehöriges `systemctl reset-failed`. Pfad fix damit kein Wildcard
nötig wird.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -632,6 +632,20 @@
|
||||
"failed": "Backup failed",
|
||||
"deleted": "Backup deleted",
|
||||
"download": "Download",
|
||||
"restore": "Restore",
|
||||
"restoreOk": "Start restore",
|
||||
"restoreDone": "Restore complete — page reloading.",
|
||||
"restoreFailed": "Restore failed",
|
||||
"restoreRunning": "Restore in progress …",
|
||||
"restoreHint": "edgeguard-api will restart; the UI reloads after the restart.",
|
||||
"confirmRestoreTitle": "Restore this backup?",
|
||||
"confirmRestoreDesc": "Database content will be replaced with {{file}} + state files. edgeguard-api + scheduler will restart. Changes made since the backup are lost.",
|
||||
"step": {
|
||||
"extract": "Extract tar",
|
||||
"psql": "DB restore (psql)",
|
||||
"render": "Re-render configs",
|
||||
"restart": "Restart services"
|
||||
},
|
||||
"downloadTooltip": "Download tar.gz",
|
||||
"refreshTooltip": "Reload list",
|
||||
"confirmDelete": "Really delete backup {{file}}?",
|
||||
|
||||
Reference in New Issue
Block a user