From 46c220fd8fbd3b24c7d2f53a84d4652c60c0c1ca Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Mon, 23 Feb 2026 15:53:20 +0100 Subject: [PATCH] fix: show filebrowser subdomain link on stacks page Protected stacks like filebrowser have no .felhom.yml or app.yaml, so the subdomain lookup found nothing. Added well-known subdomain fallback map for programmatically managed protected stacks. Co-Authored-By: Claude Opus 4.6 --- controller/internal/web/handlers.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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