# Production environment template (AWS RDS MySQL). # Copy to .env.production on the EC2 host and fill in the real credentials. # The real .env.production is gitignored so secrets never land in git. # # For Prisma CLI commands (migrate/seed), export these first: # set -a && source .env.production && set +a # # Note: if the DB password contains URL-reserved characters, percent-encode them # (e.g. "@" -> %40, "/" -> %2F, ":" -> %3A). DATABASE_URL="mysql://USER:PASSWORD@it-cost-prod-db.c8hgbsblyypx.us-west-2.rds.amazonaws.com:3306/it_cost_dashboard" DATABASE_PROVIDER="mysql" NODE_ENV="production" # --- Microsoft Entra ID (Azure AD) SSO --- # Next.js does NOT load .env.local in production, so prod auth vars MUST live here. # Register the prod redirect URI in Azure: # https:///api/auth/callback/microsoft-entra-id AUTH_MICROSOFT_ENTRA_ID_ID="" AUTH_MICROSOFT_ENTRA_ID_SECRET="" AUTH_MICROSOFT_ENTRA_ID_ISSUER="https://login.microsoftonline.com//v2.0" # 32-byte random string used to sign session cookies (generate: npx auth secret). AUTH_SECRET="" # Canonical public URL of the app. If TLS is terminated by a proxy/ALB in front # of the app, set AUTH_TRUST_HOST=true instead of (or in addition to) AUTH_URL. AUTH_URL="https://" # AUTH_TRUST_HOST=true # --- Local break-glass admin + role model --- # In addition to SSO, /login offers a username/password form for a local admin. # A NON-EMPTY password ENABLES it; leave empty to disable local login entirely. # This account always has the admin role and bypasses config/users.json (so you # can still get in to fix a broken/empty allowlist). LOCAL_ADMIN_USERNAME="admin" LOCAL_ADMIN_PASSWORD="" # Role-based access is driven by the committed, hand-edited allowlist # config/users.json (email -> "admin" | "user"). SSO emails NOT listed there # cannot sign in (fail closed). Edit that file and re-login / restart to apply.