# ============================================================
# Miljövariabler (varumärke: se brand.config.json)
# Kopiera till .env och fyll i. .env checkas ALDRIG in.
# Produktion: AWS SSM/Secrets Manager (spec §50, §56).
# ============================================================

# --- Core ---
NODE_ENV=development
API_PORT=4000
API_BASE_URL=http://localhost:4000
CORS_ORIGINS=http://localhost:5173
LOG_LEVEL=info

# --- Databas (separat databas + minsta möjliga privilegier, spec §52) ---
DATABASE_URL=postgres://app_user:app_dev_password@localhost:5432/app
TEST_DATABASE_URL=postgres://app_user:app_dev_password@localhost:5432/cibello_test

# --- Redis (BullMQ-köer + cache) ---
REDIS_URL=redis://localhost:6379

# --- Auth ---
JWT_ACCESS_SECRET=dev-only-change-me
JWT_REFRESH_SECRET=dev-only-change-me-too
JWT_ACCESS_TTL_SECONDS=900
JWT_REFRESH_TTL_SECONDS=2592000

# --- Entitlements (signerad token med grace period, spec §44) ---
ENTITLEMENT_SIGNING_SECRET=dev-only-change-me-three
ENTITLEMENT_TTL_HOURS=24
ENTITLEMENT_GRACE_DAYS=7

# --- S3 (spec §53). mock = lokal lagring (dev). aws = RIKTIG S3 (AWS eller
# --- S3-kompatibel som MinIO/R2 via S3_ENDPOINT). Tomma nycklar = IAM-roll. ---
S3_MODE=mock
S3_BUCKET=   # default: <brand-slug>-production
S3_REGION=eu-north-1
S3_ENDPOINT=
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=

# --- AAMOS / Gemini-lärar-tier (nås ENDAST från backend, spec §31, §61.13) ---
# AAMOS_MODE: http = befintlig AAMOS, gemini = Gemini-lärar-tier, mock = lokal dev/test.
AAMOS_MODE=mock
AAMOS_API_URL=
AAMOS_API_KEY=
AAMOS_TIMEOUT_MS=60000
# GEMINI_API_KEY lämnas tom lokalt – hämtas från AWS SSM (/cibello/prod/gemini-api-key) i prod,
# inte inskriven för hand. Skriv aldrig over en .env som redan har riktiga varden.
GEMINI_API_KEY=
GEMINI_MODEL=gemini-3.1-flash-lite
GEMINI_TIMEOUT_MS=60000
GEMINI_DAILY_BUDGET_USD=25

# --- Prenumerationer (spec §45–47) ---
APPLE_BUNDLE_ID=   # default ur brand.config.json
APPLE_ISSUER_ID=
APPLE_KEY_ID=
APPLE_PRIVATE_KEY_PATH=
GOOGLE_PACKAGE_NAME=   # default ur brand.config.json
GOOGLE_SERVICE_ACCOUNT_JSON_PATH=

# --- Push-notiser ---
EXPO_PUSH_ENABLED=false

# --- Admin ---
ADMIN_PORT=5173
VITE_API_BASE_URL=http://localhost:4000

# --- Larm (valfritt): 5xx-fel och fallerade jobb POST:as som {"text": "..."} ---
ERROR_WEBHOOK_URL=

# --- E-post: log = mejl till loggen (dev). smtp = RIKTIGA mejl via valfri
# --- SMTP-leverantör (SES/Postmark/Resend/Brevo/egen server). ---
EMAIL_MODE=log
SMTP_HOST=
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=
SMTP_PASS=
MAIL_FROM=
