Skip to content

Configuration

Pass values through Compose environment, docker run -e, or a secret manager. Avoid committing .env files. The current API fails startup unless provider, origin, and database requirements are present; checked-in defaults are development examples and are not suitable for production.

Core and network

VariableDefaultMeaning
DATABASE_URLImage: postgres://postgres@127.0.0.1:5432/lagRequired PostgreSQL connection
API_PORT3001Internal Fastify/gateway target port
PORTImage: 3000Public web gateway port inside container
ALLOWED_HOSTSNone; requiredComma-separated exact browser origins
PROXY_HEADERUnsetLowercase trusted client-IP header name
EXTERNAL_IPCompose: 127.0.0.1; scripts: autoLiveKit advertised address
LAG_VOICE_KEYdevkeyLiveKit/API shared key; insecure default
LAG_VOICE_SECRETsecretLiveKit/API shared secret; insecure default
VOICE_URLImage: ws://localhost:7880URL returned to browser voice joins
NODE_ENVImage: productionNode runtime mode

EXTERNAL_HOST, WEB_PORT, and VOICE_PORT affect /api/discover only; they do not configure listeners, TLS, or proxy routes.

Identity and sessions

VariableDefaultMeaning
AUTH_PROVIDERNone; requiredprism, oidc, or oauth2
AUTH_CLIENT_IDNone; requiredProvider client ID
AUTH_CLIENT_SECRETOptionalProvider client secret; required if PKCE disabled
ALLOWED_HOSTSNone; requiredComma-separated exact application origins; each origin produces /api/auth/callback
AUTH_SCOPESopenid profile emailSpace-separated provider scopes
AUTH_PKCErequiredrequired, auto, or disabled
GUEST_ENABLEDfalseAllow nickname-only session creation
SESSION_IDLE_SECONDS604800Sliding idle expiry (7 days)
SESSION_ABSOLUTE_SECONDS2592000Absolute expiry (30 days)
OAUTH_TRANSACTION_SECONDS600Login state lifetime
AUTH_ADMIN_CLAIM_PATHUnsetDot path for administrator claim
AUTH_ADMIN_CLAIM_VALUEUnsetExact expected value/array member

Provider-specific variables are covered in Prism, OIDC, and OAuth. Sessions are opaque database records; browser sessions do not use a signing-secret setting.

Minimal OIDC example

dotenv
ALLOWED_HOSTS=https://lag.example.com
AUTH_PROVIDER=oidc
OIDC_ISSUER=https://id.example.com
AUTH_CLIENT_ID=<OIDC_CLIENT_ID>
AUTH_CLIENT_SECRET=<OIDC_CLIENT_SECRET>
GUEST_ENABLED=false
LAG_VOICE_KEY=<RANDOM_VOICE_KEY>
LAG_VOICE_SECRET=<RANDOM_VOICE_SECRET>
EXTERNAL_IP=203.0.113.10

Use a deployment secret mechanism. Rotating voice credentials requires API and LiveKit to restart with matching values. Existing application sessions are stored as hashed opaque tokens in PostgreSQL and expire according to the session settings.

Container image

The canonical image is ghcr.io/wyf9/lag-server. Convenience scripts default to latest; override LAG_IMAGE with a reviewed release tag or immutable digest for production.

Independent fork documentation. Not an upstream Lag service.