fix: SyncFileBrowserMounts reads domain from controller config instead of missing .env

The filebrowser stack has no .env file — domain is baked into compose labels
by docker-setup.sh. The sync always bailed with a WARN and storage paths
were never applied to FileBrowser's config.yaml or docker-compose.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 18:01:43 +01:00
parent 64072f1936
commit b8ab9264f4
2 changed files with 8 additions and 12 deletions
+3 -12
View File
@@ -1470,19 +1470,10 @@ func (s *Server) SyncFileBrowserMounts() {
// Get all active storage paths
paths := s.settings.GetStoragePaths()
// Read domain from .env
envPath := stackDir + "/.env"
domain := ""
if data, err := os.ReadFile(envPath); err == nil {
for _, line := range strings.Split(string(data), "\n") {
if strings.HasPrefix(line, "DOMAIN=") {
domain = strings.TrimPrefix(line, "DOMAIN=")
break
}
}
}
// Use domain from controller config
domain := s.cfg.Customer.Domain
if domain == "" {
s.logger.Printf("[WARN] Cannot read DOMAIN from FileBrowser .env — skipping mount sync")
s.logger.Printf("[WARN] Cannot sync FileBrowser mounts — customer domain not configured")
return
}