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 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 15:53:20 +01:00
parent 0a85b5cd69
commit 46c220fd8f
+15 -1
View File
@@ -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) {
}
}
}
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) {
}
}
}
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