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:
2026-02-18 10:38:51 +01:00
parent 263b58dea0
commit 6c1762141a
11 changed files with 225 additions and 124 deletions
-65
View File
@@ -232,71 +232,6 @@ func (s *Settings) SetNotificationPrefs(prefs *NotificationPrefs) error {
return s.save()
}
// IsAppBackupEnabled returns whether backup is enabled for the given stack.
func (s *Settings) IsAppBackupEnabled(stackName string) bool {
s.mu.RLock()
defer s.mu.RUnlock()
if s.AppBackup == nil {
return false
}
return s.AppBackup[stackName].Enabled
}
// SetAppBackup enables or disables backup for a stack and saves to disk.
// Preserves existing CrossDrive config.
func (s *Settings) SetAppBackup(stackName string, enabled bool) error {
s.mu.Lock()
defer s.mu.Unlock()
if s.AppBackup == nil {
s.AppBackup = make(map[string]AppBackupPrefs)
}
existing := s.AppBackup[stackName]
existing.Enabled = enabled
s.AppBackup[stackName] = existing
return s.save()
}
// GetAppBackupMap returns a map of stack_name -> enabled for all app backup prefs.
func (s *Settings) GetAppBackupMap() map[string]bool {
s.mu.RLock()
defer s.mu.RUnlock()
if s.AppBackup == nil {
return nil
}
result := make(map[string]bool, len(s.AppBackup))
for k, v := range s.AppBackup {
result[k] = v.Enabled
}
return result
}
// SetAppBackupBulk updates backup prefs for all stacks at once and saves to disk.
// Preserves existing CrossDrive configs and stacks not present in the input.
func (s *Settings) SetAppBackupBulk(prefs map[string]bool) error {
s.mu.Lock()
defer s.mu.Unlock()
if s.AppBackup == nil {
s.AppBackup = make(map[string]AppBackupPrefs)
}
for name, enabled := range prefs {
existing := s.AppBackup[name] // preserves CrossDrive
existing.Enabled = enabled
s.AppBackup[name] = existing
}
return s.save()
}
// GetAppBackupPrefs returns the full AppBackupPrefs for a stack.
func (s *Settings) GetAppBackupPrefs(stackName string) (AppBackupPrefs, bool) {
s.mu.RLock()
defer s.mu.RUnlock()
if s.AppBackup == nil {
return AppBackupPrefs{}, false
}
prefs, ok := s.AppBackup[stackName]
return prefs, ok
}
// GetCrossDriveConfig returns the cross-drive backup config for a stack (nil if not set).
func (s *Settings) GetCrossDriveConfig(stackName string) *CrossDriveBackup {
s.mu.RLock()