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.
.env.local secret loading
Section titled “.env.local secret loading”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.
- When
plat5 start(orplat5 doctor) loadsplat5.local.yml, it reads.env.localin the same directory if present (or the path inenv_file:if overridden). - String values in
plat5.local.ymlsupport${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. .env.localvariables are also passed into the stack and app compose interpolation environments.plat5 init/plat5 addalways create.env.localwith permissions0600and ensure.env.localis listed in.gitignore.plat5 doctorwarns if.env.localexists and is not ignored by git (when inside a git repo).
plat5.local.yml fields
Section titled “plat5.local.yml fields”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}"Field rules
Section titled “Field rules”infra.compose
Section titled “infra.compose”- 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 beforeapp.compose(after core Plat5), and auto-joins any service referenced byurlHostsonto theplat5network. - Unlike
app.compose,infra.composestays running when you passplat5 start -x appso host-run APIs can still reach local Cerbos/Topaz/Keycloak. Pass-x infrato skip it explicitly.
idp.client_id
Section titled “idp.client_id”- Optional string. When
modules.auth: false,stack.AppEnv()forwards:PLAT5_AUTH_URL=idp.issuerPLAT5_AUTH_CLIENT_ID=idp.client_id(empty if unset)PLAT5_AUTH_AUDIENCE=idp.audiences[0](whenidp.audiencesis non-empty and not"*")PLAT5_AUTH_SUBJECT_CLAIM=idp.subject_claim(default"sub")
operator.idp
Section titled “operator.idp”- Optional block. When any field is set:
issuerandaudiences(non-empty, no"*"wildcard—matching the operator IdP contract) are required;jwks_uriis optional (when omitted, the operator gateway discovers it via OIDC discovery fromissuer).- Local
operator-authcontainer is not started (andversions.authis not required ifmodules.authis alsofalse). - The operator gateway receives
AUTH_ISSUER,AUTH_JWKS_URI,AUTH_ALLOWED_AUDIENCES,AUTH_OPERATOR_ID_CLAIM(defaultsub), andAUTH_OPERATOR_EMAIL_CLAIM(defaultemail). stack.AppEnv()forwardsPLAT5_OPERATOR_AUTH_URL=operator.idp.issuerandPLAT5_OPERATOR_CLIENT_ID=operator.idp.client_id.
observability.mode and otel.headers
Section titled “observability.mode and otel.headers”observability.mode:local(default): runslgtm+alloy.alloy-only: runsalloywithoutlgtm, forwarding OTLP telemetry (traces, metrics, and scraped Docker logs) to a remote OTLP endpoint configured viaotel.endpoint+otel.headers(e.g., Grafana Cloud’s single OTLP Gateway).off: disables local observability containers (lgtmandalloy).
otel.headers: optional map of header name → value, serialized toOTEL_EXPORTER_OTLP_HEADERS(key=value,key2=value2, RFC 4317 OTLP standard) on every Plat5 container and inAppEnv().
Auto-networking
Section titled “Auto-networking”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.
External IdP & OTLP AppEnv variables
Section titled “External IdP & OTLP AppEnv variables”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) |