diff --git a/packages/system/dashboard/images/token-proxy/main.go b/packages/system/dashboard/images/token-proxy/main.go index 3fb2ce7a7..caae63ec7 100644 --- a/packages/system/dashboard/images/token-proxy/main.go +++ b/packages/system/dashboard/images/token-proxy/main.go @@ -10,6 +10,7 @@ import ( "flag" "fmt" "html/template" + "io/fs" "log" "net/http" "net/http/httputil" @@ -37,6 +38,7 @@ var ( jwksURL string saTokenPath string saCACertPath string + brandingConfigPath string ) func init() { @@ -51,6 +53,12 @@ func init() { flag.StringVar(&jwksURL, "jwks-url", "https://kubernetes.default.svc/openid/v1/jwks", "JWKS URL for token verification") flag.StringVar(&saTokenPath, "sa-token-path", "/var/run/secrets/kubernetes.io/serviceaccount/token", "Path to service account token") flag.StringVar(&saCACertPath, "sa-ca-cert-path", "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt", "Path to service account CA certificate") + // The dashboard branding lives in the cozy-dashboard-console-config + // ConfigMap, which the SPA reaches only through the authenticated kube-api. + // Mounting the same config.json here gives the pre-auth login page a source + // for the deployment's branding; an absent or unreadable file falls back to + // the unbranded page, so a cluster without branding renders as before. + flag.StringVar(&brandingConfigPath, "branding-config-path", "/etc/cozystack/branding/config.json", "Path to the dashboard branding config.json mounted from the console ConfigMap") } // newJWKCache builds the JWK cache used to verify Kubernetes-issued JWTs. @@ -144,7 +152,7 @@ var loginTmpl = template.Must(template.New("login").Parse(`
-