controller v0.47.0: backups page — whole-guest backup visibility + manual trigger

Part 2 of the USB/backup spec. agentapi: StatusResponse.Backup record, DueResponse
age_seconds, RestoreTestStatus(). New "Rendszermentés (teljes mentés)" section
(read-only: last backup/target PBS-vs-local/next-due/restore-test) + "Mentés most"
manual trigger that goes through the quiesce loop (controller owns quiescing):
quiesce.Loop gains mutex + TriggerNow() (single-flight, async). New
/api/guest-backup/{trigger,status} (distinct from apiRouter's /api/backup/*).
App-data rows relabeled under an "Alkalmazás-mentések" divider. Config → slice 10.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-12 11:15:25 +02:00
parent cd76afeca1
commit bbed5af662
10 changed files with 558 additions and 15 deletions
+29
View File
@@ -1,5 +1,34 @@
## Changelog
### v0.47.0 — backups page: whole-guest backup visibility + manual trigger (agent-sourced) (2026-06-12)
The backups page previously showed only the app-data (DB-dump) tier and had **zero** view of the
agent's whole-guest PBS/vzdump backup. Adds visibility + a manual trigger over the agent's existing
per-guest backup API (no agent change). Cadence/retention CONFIG stays out (hub-served policy, slice 10).
- **agentapi (2A):** `StatusResponse` gains `Backup *BackupRecord` (the agent's latest recorded
whole-guest backup — target/archive/mode/size/success/started-at); `DueResponse` gains `age_seconds`;
new `RestoreTestStatus()``*RestoreTestRecord` (the "verified restorable" signal, nil until one
runs). Non-hollow client tests (`backup_test.go`): parse the documented JSON + assert `StartBackup`
POSTs to `/backup`.
- **Section "Rendszermentés (teljes mentés)" (2B):** new read-only cards above the app-data section —
last whole-guest backup (time + size + **target: PBS vs Helyi (local)**, surfaced from the archive
volid/target-id), next-due (from `/backup/due` age vs cadence), restore-test result, and the running
phase. Agent-unconfigured/unreachable degrades to a note, page still renders.
- **Manual trigger "Mentés most" (2C):** **the controller owns quiescing** (confirmed: the
`quiesce.Loop` stops stacks → `POST /backup` → polls → resumes; the agent's vzdump is crash-consistent
only). The button therefore goes **through the loop**, not a bare agent call. `quiesce.Loop` gains a
mutex + `TriggerNow()` (single-flight via `TryLock` + the existing marker; `ErrBackupInProgress` on
overlap) that runs the same stop→backup→resume cycle async, bypassing the due-check. New
`POST /api/guest-backup/trigger` + `GET /api/guest-backup/status` (distinct prefix from apiRouter's
app-data `/api/backup/{run,status}` to avoid shadowing). The button warns per mode (snapshot ≈ a few
seconds' downtime on lvm-thin; stop = full downtime).
- **App-data section (2D):** the existing per-app DB-dump rows/table are now under a clear
"Alkalmazás-mentések (adatbázis + konfiguráció)" divider, distinct from the whole-guest tier above
(whole-guest = appliance restore; app-backup = granular per-app). No structural change.
- **Config (2E):** OUT OF SCOPE — whole-guest cadence/retention is hub-served policy (slice 10), so it
survives re-provision; no agent config surface added.
### v0.46.0 — fix: /backups 500 (template referenced disk-tier fields stripped in 8C) (2026-06-12)
`GET /backups` returned **HTTP 500**. Root cause (from the live log, not guessed):