Skip to content

Local config (plat5.local.yml & .env.local)

Reference for plat5.local.yml and .env.local in plat5 start — covering secret loading, external IdPs, Operator SSO, external AuthZEN authorizers, Grafana Cloud / OTLP vendors, and project-owned infrastructure containers.

The minimum CLI schema version is tracked in internal/config/cliversion.go.

Secrets collected by plat5 init / plat5 add (or added manually by a developer) live in .env.local beside plat5.local.yml, never plaintext inside plat5.local.yml.

  1. When plat5 start (or plat5 doctor) loads plat5.local.yml, it reads .env.local in the same directory if present (or the path in env_file: if overridden).
  2. String values in plat5.local.yml support ${VAR} and ${VAR:-default} expansion sourced from process env first, then .env.local. Unresolved ${VAR} without a default is a startup error naming the key and variable.
  3. .env.local variables are also passed into the stack and app compose interpolation environments.
  4. plat5 init / plat5 add always create .env.local with permissions 0600 and ensure .env.local is listed in .gitignore.
  5. plat5 doctor warns if .env.local exists and is not ignored by git (when inside a git repo).
env_file: .env.local # optional; default .env.local if present
infra: # project-owned infra (authorizers, local IdPs)
compose: ./docker-compose.infra.yml # stays running on `plat5 start -x app`
compose_overrides: # optional extra compose files merged onto the core stack
- ./docker-compose.override.yml
authorizer: # external AuthZEN PDP runtime wiring (when plat5.yml sets authorizer.mode: authzen)
url: http://topaz:9393 # AUTHORIZER_URL on gateway and identity
token: ${PLAT5_AUTHORIZER_TOKEN} # AUTHORIZER_TOKEN
timeout: 2s # AUTHORIZER_TIMEOUT
cache_ttl: 5s # AUTHORIZER_CACHE_TTL (gateway)
negative_cache_ttl: 2s # AUTHORIZER_NEGATIVE_CACHE_TTL (gateway)
idp: # customer IdP (when modules.auth: false)
issuer: https://acme.us.auth0.com/
jwks_uri: https://acme.us.auth0.com/.well-known/jwks.json
audiences: [https://api.acme.com]
client_id: abc123spa # forwarded to customer-console as PLAT5_AUTH_CLIENT_ID
subject_claim: sub
name_claims: [name, nickname]
operator:
config: ./operator.yml
console:
compose: ./operator-console/docker-compose.yml
web: http://localhost:5412
origins: []
idp: # external operator IdP (turns off local operator-auth)
issuer: https://acme.okta.com/oauth2/default
jwks_uri: https://acme.okta.com/oauth2/default/v1/keys
audiences: [plat5-operator]
client_id: op123spa # forwarded to operator-console as PLAT5_OPERATOR_CLIENT_ID
operator_id_claim: sub # AUTH_OPERATOR_ID_CLAIM (default: sub)
operator_email_claim: email # AUTH_OPERATOR_EMAIL_CLAIM (default: email)
observability: # controls local observability containers
mode: local # local (lgtm + alloy, default) | alloy-only | off
otel:
endpoint: https://otlp-gateway-prod-us-east-0.grafana.net/otlp
headers: # passed as OTEL_EXPORTER_OTLP_HEADERS (comma-separated k=v)
Authorization: "Basic ${GRAFANA_CLOUD_OTLP_AUTH}"
  • Optional path to a project-owned Compose file (typically ./docker-compose.infra.yml) for local infrastructure containers such as AuthZEN PDPs (cerbos, topaz, openfga) or local IdPs (keycloak, dex).
  • Runs under compose project <project_id>-infra, starts before app.compose (after core Plat5), and auto-joins any service referenced by urlHosts onto the plat5 network.
  • Unlike app.compose, infra.compose stays running when you pass plat5 start -x app so host-run APIs can still reach local Cerbos/Topaz/Keycloak. Pass -x infra to skip it explicitly.
  • Optional string. When modules.auth: false, stack.AppEnv() forwards:
    • PLAT5_AUTH_URL = idp.issuer
    • PLAT5_AUTH_CLIENT_ID = idp.client_id (empty if unset)
    • PLAT5_AUTH_AUDIENCE = idp.audiences[0] (when idp.audiences is non-empty and not "*")
    • PLAT5_AUTH_SUBJECT_CLAIM = idp.subject_claim (default "sub")
  • Optional block. When any field is set:
    • issuer and audiences (non-empty, no "*" wildcard—matching the operator IdP contract) are required; jwks_uri is optional (when omitted, the operator gateway discovers it via OIDC discovery from issuer).
    • Local operator-auth container is not started (and versions.auth is not required if modules.auth is also false).
    • The operator gateway receives AUTH_ISSUER, AUTH_JWKS_URI, AUTH_ALLOWED_AUDIENCES, AUTH_OPERATOR_ID_CLAIM (default sub), and AUTH_OPERATOR_EMAIL_CLAIM (default email).
    • stack.AppEnv() forwards PLAT5_OPERATOR_AUTH_URL = operator.idp.issuer and PLAT5_OPERATOR_CLIENT_ID = operator.idp.client_id.
  • observability.mode:
    • local (default): runs lgtm + alloy.
    • alloy-only: runs alloy without lgtm, forwarding OTLP telemetry (traces, metrics, and scraped Docker logs) to a remote OTLP endpoint configured via otel.endpoint + otel.headers (e.g., Grafana Cloud’s single OTLP Gateway).
    • off: disables local observability containers (lgtm and alloy).
  • otel.headers: optional map of header name → value, serialized to OTEL_EXPORTER_OTLP_HEADERS (key=value,key2=value2, RFC 4317 OTLP standard) on every Plat5 container and in AppEnv().

plat5 start joins compose services whose names appear as hostnames in plat5.yml (services.*.url), plat5.local.yml (authorizer.url, idp.jwks_uri, operator.idp.jwks_uri, otel.endpoint), and operator.yml (services.*.url, authorizer.url) onto the plat5 Docker network.

In addition to the base AppEnv variables documented in the CLI README:

Env Value
PLAT5_AUTH_AUDIENCE First non-wildcard audience from idp.audiences (empty with local Auth)
PLAT5_AUTH_SUBJECT_CLAIM sub with local Auth; idp.subject_claim (default sub) with external IdP
OTEL_EXPORTER_OTLP_HEADERS Comma-separated k=v headers from otel.headers (empty if unset)