v0.12.7: mandatory HDD backup, pre-dump, restore for all apps
Fix 1: HDD data backup is now mandatory for all deployed apps. resolveAppBackupPaths() iterates ListDeployedStacks() directly — no longer reads GetAppBackupMap() or checks the Enabled flag. DiscoverAppData() drops backupPrefs parameter; BackupEnabled is set from HasHDDData. Five dead settings methods removed: IsAppBackupEnabled, SetAppBackup, GetAppBackupMap, SetAppBackupBulk, GetAppBackupPrefs. Fix 2: Cross-drive backup now triggers a fresh DB dump (DumpStackDB) before running. DBDumper interface added to crossdrive.go; Manager implements it; SetDBDumper wired in main.go. Non-fatal — proceeds with user data backup even if DB dump fails. Fix 3: Restore dropdown shows ALL deployed apps (not just HDD+enabled). restore.go rewritten: always restores config+DB, adds user data if hasHDD. UI shows restore type banner (full / config+DB / config only) with color-coded styling. Snapshot API clarified for non-HDD apps. Fix 4: "Docker kötetek" → "Konfiguráció" — named volumes are not in the restic backup paths; compose files + app.yaml are what's backed up. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,35 @@
|
||||
## Changelog
|
||||
|
||||
### What was just completed (2026-02-18 session 43)
|
||||
- **v0.12.7 — Backup Architecture Overhaul (mandatory HDD backup, pre-dump, restore for all apps):**
|
||||
|
||||
**Fix 1: HDD data backup now mandatory (`backup.go`, `appdata.go`, `settings.go`)**
|
||||
- `resolveAppBackupPaths()` rewrote to iterate ALL deployed stacks via `ListDeployedStacks()` — no longer reads `GetAppBackupMap()` or checks `Enabled` flag
|
||||
- `DiscoverAppData()` signature simplified: dropped `backupPrefs map[string]bool` parameter; `BackupEnabled` is now derived from `HasHDDData` (if app has HDD data, it's always backed up)
|
||||
- `RefreshCache()` updated to call new `DiscoverAppData(m.stackProvider, status.DiscoveredDBs)` signature
|
||||
- 5 dead settings methods deleted: `IsAppBackupEnabled`, `SetAppBackup`, `GetAppBackupMap`, `SetAppBackupBulk`, `GetAppBackupPrefs` — `AppBackupPrefs.Enabled` field kept in struct for backward-compat JSON loading
|
||||
|
||||
**Fix 2: Cross-drive backup triggers fresh DB dump first (`crossdrive.go`, `backup.go`, `main.go`)**
|
||||
- New `DBDumper` interface with `DumpStackDB(ctx, stackName)` in `crossdrive.go`
|
||||
- `CrossDriveRunner` gets `dbDumper` field + `SetDBDumper(d DBDumper)` setter
|
||||
- `Manager.DumpStackDB()` discovers containers for that stack via `DiscoverDatabases()`, runs `DumpAll()`, persists validation cache — same logic as nightly dump but scoped to one stack
|
||||
- `RunAppBackup()` calls `DumpStackDB()` before `ValidateDestination()` — non-fatal on failure (logs warn, proceeds with user data)
|
||||
- `main.go` wires `crossDriveRunner.SetDBDumper(backupMgr)` after both are initialized
|
||||
|
||||
**Fix 3: Restore dropdown shows ALL deployed apps (`backups.html`, `restore.go`, `router.go`)**
|
||||
- `restore.go` rewritten: no `IsAppBackupEnabled()` check; resolves `GetStackComposePath` + `DBDumpDir` + HDD mounts; always restores config+DB, adds user data if `hasHDD`; logs restore type (`config+DB` vs `full (config+DB+userdata)`)
|
||||
- Restore dropdown template: removed `{{if and .HasHDDData .BackupEnabled}}` filter; every app gets an `<option>` with `data-has-hdd` and `data-has-db` attributes
|
||||
- New `#restore-type-info` div added between snapshot selector and warnings
|
||||
- `onRestoreAppChange()` JS updated: reads `data-has-hdd`/`data-has-db` from selected option, shows Hungarian restore type banner (full / config+DB / config only) with color-coded styling
|
||||
- `router.go` `backupSnapshots`: added clarifying comment for non-HDD apps (no filter = all snapshots returned)
|
||||
|
||||
**Fix 4: Honest UI label (`backups.html`)**
|
||||
- "Docker kötetek" renamed to "Konfiguráció" — Docker named volumes at `/var/lib/docker/volumes/` are NOT in the restic backup paths; what's actually backed up is compose files + app.yaml + .felhom.yml
|
||||
|
||||
**CSS: `.restore-info` and `.restore-info-partial` classes added to `style.css`**
|
||||
|
||||
**Files modified (9):** `internal/backup/backup.go`, `internal/backup/appdata.go`, `internal/settings/settings.go`, `internal/backup/crossdrive.go`, `internal/backup/restore.go`, `cmd/controller/main.go`, `internal/web/templates/backups.html`, `internal/web/templates/style.css`, `internal/api/router.go`
|
||||
|
||||
### What was just completed (2026-02-18 session 42)
|
||||
- **v0.12.6 — Cross-Drive Backup Rsync Fixes:**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user