App URLs
- NEXT_PUBLIC_APP_URL: canonical origin (use http://127.0.0.1:13000 locally for OAuth).
- PREMORTEM_WEB_PORT (13000), PREMORTEM_API_PORT (18787), PREMORTEM_API_BASE_URL.
- CORS_ORIGIN: allowed browser origin for API worker.
Database
- DATABASE_URL: Supabase transaction pooler :6543 with pgbouncer=true.
- DIRECT_URL: session pooler :5432 for Prisma migrations.
- Offline: postgresql://postgres:postgres@127.0.0.1:5432/premortem via docker-compose.
Supabase
- NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY: client auth.
- SUPABASE_SERVICE_ROLE_KEY: server-side admin operations.
- SUPABASE_STORAGE_BUCKET: artifact storage (premortem-artifacts).
LLM routing
- GEMINI_API_KEY, LLM_MODEL (configured per environment; smoke harness defaults to gemini-2.5-flash-lite).
- Keep provider keys server-side only; do not expose them in browser bundles.
GitLab
- GITLAB_CLIENT_ID, GITLAB_CLIENT_SECRET: OAuth app.
- GITLAB_TOKEN: PAT with api scope for ingest/publish (server only).
- Redirect: {NEXT_PUBLIC_APP_URL}/api/integrations/callback/gitlab.
Warning
Do not mix localhost and 127.0.0.1 in NEXT_PUBLIC_APP_URL and GitLab OAuth redirect URI.
Neo4j
- NEO4J_URI, NEO4J_USERNAME, NEO4J_PASSWORD.
- NEO4J_DISABLED=1: skip graph writes when Bolt is unavailable.
Observability
- Sentry: NEXT_PUBLIC_SENTRY_DSN, SENTRY_DSN, SENTRY_TRACES_SAMPLE_RATE.
- PostHog: NEXT_PUBLIC_POSTHOG_KEY, NEXT_PUBLIC_POSTHOG_HOST, POSTHOG_API_KEY.
- Langfuse: LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_BASE_URL.
- Phoenix: PHOENIX_PROJECT_NAME, PHOENIX_COLLECTOR_ENDPOINT, PHOENIX_API_KEY, PHOENIX_LLM_EVAL.
Stripe billing
- STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET.
- STRIPE_PRICE_PRO, STRIPE_PRICE_TEAM, STRIPE_PRICE_SCALE, STRIPE_PRICE_PRO_ANNUAL, STRIPE_PRICE_TEAM_ANNUAL, STRIPE_PRICE_SCALE_ANNUAL.
Cloudflare
- CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN, CLOUDFLARE_ZONE_ID for deploy automation.
Runtime flags
- PREMORTEM_AUTH_DISABLED=1: local verification only, never production.
- PREMORTEM_INGEST_LOCAL=1: local verification repository ingest.
- PREMORTEM_PUBLISH_DRY_RUN=1, PREMORTEM_RECONCILE_DRY_RUN=1: skip remote side effects.
- PREMORTEM_SKIP_DOCKER=1, PREMORTEM_PRODUCTION_MODE=1: dev stack toggles.
Local dev
Copy .env.example to .env.local and fill values group by group.
Safe operation
- Never set PREMORTEM_AUTH_DISABLED=1 in production.
- Use PREMORTEM_INGEST_LOCAL=1 only for local verification imports or test workflows.
- Keep NEXT_PUBLIC_APP_URL, GitLab OAuth redirects, and provider callbacks on one canonical host.
- Run pnpm run verify:env before production cutover to confirm configured mode.