Fix FileBrowser integration config lost after SyncFileBrowserMounts
SyncFileBrowserMounts regenerates config.yaml from scratch, overwriting any integration config. The old approach used an async OnStackStart hook after container restart, which failed due to timing issues (stack state not yet refreshed). New approach: ReapplyConfigForTarget() writes integration config synchronously after config generation but before container restart, with a no-op RestartStack since the caller handles restart. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1605,6 +1605,11 @@ func (s *Server) SyncFileBrowserMounts() {
|
||||
return
|
||||
}
|
||||
|
||||
// Re-apply active integrations into config.yaml (before container restart)
|
||||
if s.integrationMgr != nil {
|
||||
s.integrationMgr.ReapplyConfigForTarget("filebrowser")
|
||||
}
|
||||
|
||||
// Generate and write compose (includes config.yaml mount)
|
||||
compose := generateFileBrowserCompose(domain, storageMounts)
|
||||
if err := os.WriteFile(composePath, []byte(compose), 0644); err != nil {
|
||||
@@ -1621,10 +1626,6 @@ func (s *Server) SyncFileBrowserMounts() {
|
||||
s.logger.Printf("[ERROR] Failed to recreate FileBrowser: %s — %v", string(out), err)
|
||||
} else {
|
||||
s.logger.Printf("[INFO] FileBrowser mounts synced — %d storage path(s), config updated", len(paths))
|
||||
// Re-apply active integrations (config regeneration overwrites config.yaml)
|
||||
if s.integrationMgr != nil {
|
||||
go s.integrationMgr.OnStackStart(context.Background(), "filebrowser")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user