package config import ( "strings" "github.com/spf13/viper" ) // DefaultDeploymentName is the value the console presents for itself when // no deployment-name is configured — the generic product name, chosen so a // fresh deployment's screenshots and first impressions stay brand-neutral // (openspec ux-honest-surfaces, deployment-identity spec). const DefaultDeploymentName = "Member Console" // DeploymentName returns the configured deployment-name value (the // `deployment-name` key / MC_DEPLOYMENT_NAME), trimmed, falling back to // DefaultDeploymentName when unset. ValidateStart rejects an explicitly // blank override at boot, so a running process never actually hits the // fallback in production; it exists so every caller — including template // render tests that build page data directly, without going through // cmd/start.go's viper.SetDefault — gets a safe, non-blank name. // // Registered as the "deploymentName" template func everywhere operator.html // or a member shell (index.html, billing.html, products.html, error.html) // is parsed, so every shell renders one configured identity instead of a // hardcoded per-deployment brand. func DeploymentName() string { if name := strings.TrimSpace(viper.GetString("deployment-name")); name != "" { return name } return DefaultDeploymentName }