Files
member-console/internal/config/deployment.go
T
cgalo5758 8e3c68c6be Make UI surfaces honestly reflect system state
- Add deployment-name branding to titles, mastheads, and OG tags
- Share one grant delivery-state query with lineage across grants
  surfaces
- Show pool status/usage, org owners, and config readiness
- Make billing views projection-aware with recency and sync vocabulary
- Guard FedWiki creation without domains and render route-aware 404s
2026-08-23 01:45:52 -05:00

33 lines
1.3 KiB
Go

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
}