diff --git a/controller/internal/web/handlers.go b/controller/internal/web/handlers.go index 1b98a5b..bb90769 100644 --- a/controller/internal/web/handlers.go +++ b/controller/internal/web/handlers.go @@ -20,6 +20,12 @@ import ( ) +// protectedStackSubdomains maps programmatically managed protected stacks +// to their well-known subdomains (these stacks have no .felhom.yml or app.yaml). +var protectedStackSubdomains = map[string]string{ + "filebrowser": "files", +} + // StorageBarInfo holds data for rendering a storage usage bar on dashboard/monitoring. type StorageBarInfo struct { Label string // e.g., "USB HDD 1TB", "SYS Storage 350G" @@ -182,7 +188,11 @@ func (s *Server) dashboardHandler(w http.ResponseWriter, r *http.Request) { } } } - subdomains[stack.Name] = stack.Meta.Subdomain + if stack.Meta.Subdomain != "" { + subdomains[stack.Name] = stack.Meta.Subdomain + } else if sd, ok := protectedStackSubdomains[stack.Name]; ok { + subdomains[stack.Name] = sd + } } data["Subdomains"] = subdomains @@ -217,7 +227,7 @@ func (s *Server) stacksHandler(w http.ResponseWriter, r *http.Request) { } data["StorageLabels"] = storageLabels - // Build effective subdomain lookup (stored env > metadata fallback) + // Build effective subdomain lookup (stored env > metadata > well-known fallback) subdomains := make(map[string]string) for _, stack := range s.stackMgr.GetStacks() { if stack.Deployed { @@ -228,7 +238,11 @@ func (s *Server) stacksHandler(w http.ResponseWriter, r *http.Request) { } } } - subdomains[stack.Name] = stack.Meta.Subdomain + if stack.Meta.Subdomain != "" { + subdomains[stack.Name] = stack.Meta.Subdomain + } else if sd, ok := protectedStackSubdomains[stack.Name]; ok { + subdomains[stack.Name] = sd + } } data["Subdomains"] = subdomains