fix: scope FileBrowser DB reset to restore-only path
Normal storage add/remove no longer nukes the FileBrowser database volume. A .fb-reset flag file is written during restore and consumed on next startup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -114,8 +114,16 @@ func NewServer(cfg *config.Config, stackMgr *stacks.Manager, cpuCollector *syste
|
||||
logger.Printf("[INFO] Auth: no password configured — dashboard is open")
|
||||
}
|
||||
|
||||
// Sync FileBrowser config on startup to ensure mounts and sources are current
|
||||
go s.SyncFileBrowserMounts()
|
||||
// Sync FileBrowser config on startup to ensure mounts and sources are current.
|
||||
// After a restore, a flag file signals that the database should be reset
|
||||
// (stale source prefs from initial install). Consume the flag and reset.
|
||||
fbResetFlag := filepath.Join(cfg.Paths.DataDir, ".fb-reset")
|
||||
if _, err := os.Stat(fbResetFlag); err == nil {
|
||||
os.Remove(fbResetFlag)
|
||||
go s.SyncFileBrowserMountsReset()
|
||||
} else {
|
||||
go s.SyncFileBrowserMounts()
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user