Skip to content

Environment Variables

All variables are read from the hosting platform's environment (Render for the API, Cloudflare for the Workers, Pages build env for the frontend). This documentation lists names and purposes only — no values. Secrets are never committed, never logged, and never exposed to the browser.

API — production (legacy names; PRODUCTION_* overrides)

VariableRequiredPurpose
SUPABASE_URLyesSupabase project URL
SUPABASE_KEYyesservice_role key (server only)
OAUTH_SESSION_SECRETyesSession cookie signing secret
API_KEYfor bot featuresBotGhost shared key (Authorization header)
DISCORD_CLIENT_ID / DISCORD_CLIENT_SECRET / DISCORD_REDIRECT_URIfor loginDiscord OAuth app
DASHBOARD_ORIGINyesAllowlisted CORS origin(s), comma-separated
TRAINING_ORIGINnoDefault https://training.eccdps.org
SUPABASE_ANON_KEYfor RealtimePublic anon key (served to sessions)
SUPABASE_JWT_SECRETfor RealtimeSigns browser Realtime JWTs (server only)
DISCORD_OAUTH_PROXY_URL / DISCORD_OAUTH_PROXY_SECRETnoOAuth Worker proxy
ERLC_RELAY_URLS / ERLC_RELAY_TOKENyesER:LC residential relay (comma-separated URLs, primary first)
ERLC_SERVER_KEYdev onlyDirect ER:LC server key fallback (local dev/tests)
SESSION_COOKIE_SECUREnoDefault true
SESSION_COOKIE_SAMESITEnoDefault Lax
REALTIME_TOKEN_TTL_SECONDSnoDefault 600
PRODUCTION_API_HOSTSnoDefault api.eccdps.org
PRODUCTION_SESSION_COOKIE_NAMEnoDefault eccdps_production_session
PRODUCTION_INGRESS_SECRETnoHMAC ingress assertion (when enabled)
ECCDPS_DEV_HOSTSdev onlyLocal host → environment mapping

API — demo (all DEMO_*, no legacy fallback)

VariablePurpose
DEMO_SUPABASE_URL / DEMO_SUPABASE_SERVICE_KEY / DEMO_SUPABASE_ANON_KEY / DEMO_SUPABASE_JWT_SECRETDemo Supabase project
DEMO_OAUTH_SESSION_SECRETDemo session secret
DEMO_API_KEYDemo bot key
DEMO_DISCORD_CLIENT_ID / DEMO_DISCORD_CLIENT_SECRET / DEMO_DISCORD_REDIRECT_URIDemo Discord app (https://demo-api.eccdps.org/auth/discord/callback)
DEMO_DISCORD_OAUTH_PROXY_URL / DEMO_DISCORD_OAUTH_PROXY_SECRETDemo OAuth proxy
DEMO_DASHBOARD_ORIGINSDefault https://demo.eccdps.org
DEMO_TRAINING_ORIGINOptional demo training host
DEMO_API_HOSTSDefault demo-api.eccdps.org
DEMO_SESSION_COOKIE_NAMEDefault eccdps_demo_session
DEMO_INGRESS_SECRETDemo ingress assertion
DEMO_ALLOWED_DISCORD_IDSReal Discord IDs allowed into the demo (id or real_id:demo_agent_id)
DEMO_AUTO_RESET_ENABLEDEnable the daily demo auto-reset daemon

An incomplete demo configuration makes the demo environment unavailable; it never falls back to production credentials. The API fails fast at boot when the production environment is not configured.

Frontend (browser bundle — public only)

VariablePurpose
VITE_DPS_API_BASE_URLPublic API base URL (production https://api.eccdps.org; demo https://demo-api.eccdps.org)
VITE_APP_ENVOptional explicit environment hint (demo)
DPS_API_BASE_URL / DPS_API_KEYDev-server proxy only (never in the bundle; vite.config.ts)

Workers

VariableWherePurpose
DISCORD_CLIENT_ID / DISCORD_CLIENT_SECRETdiscord-oauth-proxy Worker secretsOAuth token exchange
WORKER_SECRETdiscord-oauth-proxy Worker secretAuthenticates the API (X-Worker-Secret)
PRODUCTION_INGRESS_SECRET / DEMO_INGRESS_SECRETcloudflare/ingress_worker.jsHMAC assertion signing
PRODUCTION_ORIGIN / DEMO_ORIGINingress WorkerRender origins to forward to

Security rules

  • Server-only values (SUPABASE_KEY, SUPABASE_JWT_SECRET, OAUTH_SESSION_SECRET, API_KEY, client secrets, ingress secrets, relay token) never enter the browser bundle or this documentation.
  • db.url and .env* files are secret-bearing, git-ignored, and only used locally (apply_rpc_migrations.py, dev servers).
  • Rotate via the platform consoles; after rotating the session secret, existing sessions invalidate once (environment-bound sessions).