# ── Required ──────────────────────────────────────────────────────────────── # PostgreSQL — see docs/infrastructure/postgres-portability.md # # Local dev (Docker): direct URL only DATABASE_URL=postgresql://cockpit:changeme@localhost:5432/cockpit # # Production (Vercel): set BOTH on the host — not in .env.local # DATABASE_URL — direct (:5432) for migrations + LISTEN/NOTIFY # DATABASE_POOL_URL — pooled (:6432 / PgBouncer / Neon pooler) for app queries # # Legacy Neon names still work: NEON_DATABASE_URL (pool), NEON_DATABASE_URL_DIRECT (direct) # Random secret for signing sessions — generate with: openssl rand -base64 32 AUTH_SECRET= # ── Authentication ─────────────────────────────────────────────────────────── # Local password (quick dev) — leave empty to use the /setup wizard on first run. # IMPORTANT: setting this alone does NOT enable the "Owner key" sign-in tab — # you must also set ENABLE_OWNER_KEY=1 below. The cloud Vercel deployment # keeps LOCAL_AUTH_PASSWORD set for legacy reasons, but the tab stays hidden # there because ENABLE_OWNER_KEY is unset. LOCAL_AUTH_PASSWORD= # Set to 1 only on local installs (cockpit-app systemd, dev machines). When # unset, the Owner-key sign-in tab is hidden AND the "local" credentials # provider rejects every authorize() call — structural defense in depth so a # stray LOCAL_AUTH_PASSWORD on a public deployment can't be brute-forced. ENABLE_OWNER_KEY= # GitHub OAuth (optional — get at github.com/settings/developers) GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= # ── Optional ───────────────────────────────────────────────────────────────── # Timezone for cron jobs and schedule display (e.g. America/New_York). # Reads APP_DEFAULT_TIMEZONE first, then COCKPIT_DEFAULT_TIMEZONE (legacy). APP_DEFAULT_TIMEZONE=Europe/Zurich # Locale for date/time formatting. APP_LOCALE preferred, COCKPIT_LOCALE accepted. APP_LOCALE=de-CH # Docker only — Postgres password (must match DATABASE_URL above) POSTGRES_PASSWORD=changeme # ── Brand alias scheme ─────────────────────────────────────────────────────── # Every env var below is read as APP_ first, then COCKPIT_ as a # legacy fallback (mirror of scripts/_brand.sh:_brand_env). Set whichever # prefix matches your environment — both work, APP_* takes precedence. # ── Daemon ⇄ Cloud bridge ──────────────────────────────────────────────────── # When the local daemon talks to a remote app instance, it authenticates with # a bearer token. Two paths exist: # # 1. Mint a per-user ck_* token from /settings (preferred, multi-tenant safe). # 2. Use APP_DAEMON_TOKEN as a shared bearer — single-tenant only. # # To enable path (2), set BOTH of these on the *server*. The flag is required # because the token maps to the "default" user and must not be on by accident # in multi-tenant deployments. APP_DAEMON_TOKEN= APP_ALLOW_LEGACY_DAEMON_TOKEN= # Set to 1 in the local daemon's environment when a local Next.js dev server # is running alongside a different cloud deployment. Without this, the daemon # prefers localhost:3000 (the local server's DB) and the cloud control # panel's runtime state goes stale. APP_DAEMON_FORCE_REMOTE= # Override the daemon's remote base URL (defaults to APP_DOMAIN from brand.ts). APP_BASE_URL= # ── Web Push (optional — ambient agent-ready notifications) ───────────────── # Generate keys: npx web-push generate-vapid-keys # Server-side (Vercel): VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, VAPID_SUBJECT (mailto: or https: URL) # Client-side (browser subscribe): NEXT_PUBLIC_VAPID_PUBLIC_KEY must match VAPID_PUBLIC_KEY VAPID_PUBLIC_KEY= VAPID_PRIVATE_KEY= VAPID_SUBJECT=mailto:you@example.com NEXT_PUBLIC_VAPID_PUBLIC_KEY= # ── OrangeCat integration (Loop A: mirror subscriptions to the economic layer) # Mint at https://orangecat.ch/settings/integrations, choose the FleetCrown # group actor at mint time. Format: ock_<48-hex>. Treat like a password — the # plaintext is shown once and stored as a sha256 hash on OrangeCat's side. # When unset, the integration no-ops (subscriptions are still saved locally). ORANGECAT_API_KEY= ORANGECAT_API_BASE=https://orangecat.ch