# Public, non-secret environment configuration. Commit this file as `.env`.
#
# SECRETS DO NOT BELONG HERE — put API keys, OAuth client secrets, DB/Redis
# passwords in `.env.local` (gitignored). Keep every key in EXACTLY ONE file:
# `.env.local` is loaded after `.env` and overrides it, so a key in both makes
# edits behave confusingly (run LUCKYSTACK_ENV_DEBUG=1 to list any duplicates).
#
# Listen port and preset bundle are positional argv, not env-vars:
#   npm run server                              (default preset, port 80)
#   npm run server -- billing                   (one bundle, port 80)
#   npm run server -- billing,vehicles 4001     (merge bundles, listen on 4001)
NODE_ENV=development
SERVER_IP=127.0.0.1
SERVER_PORT=80
SECURE=false

# Public app URL — the origin where users BROWSE the app (post-login landing,
# email links, CORS). In DEV it's derived automatically as the Vite dev server
# (http://localhost:5173), so you don't set it here. In PRODUCTION, set PUBLIC_URL
# to your deployed domain (where the frontend + backend share one origin):
# PUBLIC_URL=https://your-domain.com
#
# The backend origin (where the OAuth `/auth/callback/<provider>` route lives) is
# derived from SERVER_IP:SERVER_PORT — in dev that's http://localhost:80. Register
# THAT as the provider's redirect URI: http://localhost:80/auth/callback/<provider>
# in dev, https://your-domain.com/auth/callback/<provider> in prod.

# Comma-separated list of additional origins permitted by the CORS layer. The
# public + backend origins are auto-included. OAuth callbacks arrive with the
# provider's origin as Referer, so every enabled provider's origin must be listed
# here — the scaffold pre-fills the providers you selected. Add more hosts (e.g. a
# separate frontend domain) comma-separated.
EXTERNAL_ORIGINS={{EXTERNAL_ORIGINS}}

# Project namespace — used as the prefix for Redis session/active-user keys.
PROJECT_NAME={{PROJECT_NAME}}

# Redis connection (the framework defaults match these values).
REDIS_HOST=127.0.0.1
REDIS_PORT=6379

# Override which env files the framework loads, in order ("later overrides earlier").
# Default ".env,.env.local". Set as a REAL environment variable (shell / process
# manager), NOT here — these files are only read after the list is resolved.
# LUCKYSTACK_ENV_FILES=.env,.env.local

# Set LUCKYSTACK_ENV_DEBUG=1 to log, at boot, every key defined in MORE THAN ONE
# loaded env file (and which file wins). Use it when a value "won't change" —
# usually it's still set in .env while you edited only .env.local (or vice-versa);
# removing a key from just one file lets the other file's value resurface.
# LUCKYSTACK_ENV_DEBUG=1

# Optional @luckystack/secret-manager (opt-in): commit POINTERS instead of secrets.
# A value of the shape <BASE>_V<n> is resolved at boot against the server at
# LUCKYSTACK_SECRET_MANAGER_URL. See config.ts + server.ts opt-in + the docs.
# LUCKYSTACK_SECRET_MANAGER_URL=
# OPENAI_KEY=OPENAI_AUTHORIZATION_KEY_V1
