# --------------------------------------------------------------------------- # FieldOps — environment variables # --------------------------------------------------------------------------- # Copy this file to .env (cp .env.example .env) and adjust as needed for your # local environment. Never commit .env. # Postgres connection string. Matches docker-compose.yml defaults. DATABASE_URL="postgresql://fieldops:fieldops@localhost:5432/fieldops?schema=public" # Auth.js v5 — secret used to sign session tokens. # In production, set this to a strong random value: `openssl rand -base64 32`. AUTH_SECRET="dev-secret-do-not-use-in-production-please-change-me" # Dev-only auto sign-in. # When set to "true", the app will silently sign in as the seed admin user # (admin@demo.local of the "Demo Factory" tenant) on every request that has # no session. This skips the login UI in local development and CI/E2E. # # !!! NEVER set this to "true" in production. !!! # Even if set to "true", this flag is IGNORED when NODE_ENV=production. # The default of "false" here is intentional — a developer setting up locally # must consciously opt in by editing their .env. See README "Auth" section. AUTH_DEV_AUTOLOGIN="false" # Base URL Auth.js uses to build callback/redirect URLs. It MUST match the host # of the app being served. This shared .env can hold only ONE value, set here to # the operator-pwa (:3000). The admin-web (:3001) therefore needs its OWN # AUTH_URL whenever autologin is OFF (real-login dev, or production) — otherwise # Auth.js redirects admin users to :3000 and the admin login breaks. # - Local with autologin ON: this value is harmless (middleware never redirects). # - E2E real-login: e2e/playwright.auth.config.ts passes AUTH_URL=:3001 to admin. # - Production: give EACH app its own AUTH_URL (per-app env), not this shared file. NEXT_PUBLIC_APP_URL="http://localhost:3000" AUTH_URL="http://localhost:3000" # Pino log level — one of: fatal, error, warn, info, debug, trace. LOG_LEVEL="info" # Node environment — intentionally NOT set here. # Next.js sets NODE_ENV automatically (development/production/test). # Setting it via dotenv-cli before `next build` forces the dev runtime and # breaks static page generation. # MinIO / S3-compatible object storage. Matches docker-compose.yml defaults. # S3_FORCE_PATH_STYLE=true is required for MinIO (and other self-hosted S3 impls). S3_ENDPOINT="http://localhost:9000" S3_REGION="us-east-1" S3_BUCKET="fieldops" S3_ACCESS_KEY="fieldops" S3_SECRET_KEY="fieldops123" S3_FORCE_PATH_STYLE="true" MINIO_ROOT_USER="fieldops" MINIO_ROOT_PASSWORD="fieldops123"