# ModComms Deployment Configuration
# Copy this file to .env.deploy and fill in your values.
# .env.deploy is gitignored — safe to store secrets here.
#
# The deploy script auto-generates backend/.env and frontend/.env.local
# from the variables below. You do NOT need to create those files manually.

# -----------------------------------------------------------------------
# Docker / Compose
# -----------------------------------------------------------------------

# Unique name per instance (creates unique container names)
# Examples: modcomms-prod, modcomms-dev
COMPOSE_PROJECT_NAME=modcomms-prod

# Backend port (must be unique per instance on this host)
BACKEND_PORT=8000

# PostgreSQL port (must be unique per instance on this host)
POSTGRES_PORT=5432

# PostgreSQL credentials
POSTGRES_USER=modcomms
POSTGRES_PASSWORD=change_this_in_production
POSTGRES_DB=modcomms

# -----------------------------------------------------------------------
# Apache / Frontend
# -----------------------------------------------------------------------

# Directory where the built frontend is served from
FRONTEND_DEPLOY_DIR=/var/vhosts/baic.oliver.solutions/htdocs/modcomms

# Subpath the app is served under (trailing slash required).
# Use / if served from the domain root.
VITE_BASE_PATH=/modcomms/

# -----------------------------------------------------------------------
# Backend URLs
# -----------------------------------------------------------------------

# HTTP base URL of the backend (no trailing slash)
VITE_BACKEND_URL=https://baic.oliver.solutions/back

# WebSocket URL for the analysis endpoint
VITE_BACKEND_WS_URL=wss://baic.oliver.solutions/back/ws/analyze

# CORS origins allowed by the backend (must match VITE_BACKEND_URL origin)
CORS_ORIGINS=https://baic.oliver.solutions

# -----------------------------------------------------------------------
# Azure AD
# -----------------------------------------------------------------------

AZURE_TENANT_ID=your_azure_tenant_id
AZURE_CLIENT_ID=your_azure_client_id

# URL Azure redirects back to after login/logout (must match App Registration)
VITE_AZURE_REDIRECT_URI=https://baic.oliver.solutions/modcomms/

# Set to true only for local dev without Azure AD
DISABLE_AUTH=false

# -----------------------------------------------------------------------
# AI / LLM APIs
# -----------------------------------------------------------------------

GEMINI_API_KEY=your_gemini_api_key
LLAMA_CLOUD_API_KEY=your_llama_cloud_api_key
# Optional: set regional base URL to fix 401 errors (US is default).
# EU region: https://api.eu.cloud.llamaindex.ai
# Leave blank to use the default US endpoint.
LLAMA_CLOUD_BASE_URL=

# -----------------------------------------------------------------------
# Email (Mailgun)
# -----------------------------------------------------------------------

MAILGUN_API_URL=https://api.mailgun.net/v3/oliver.solutions/messages
MAILGUN_API_KEY=your_mailgun_api_key
MAILGUN_FROM=admin@oliver.solutions
SUPPORT_EMAIL=BAICsupport@oliver.agency

# -----------------------------------------------------------------------
# Apache proxy config (for reference — configure in Apache vhost, not here)
# -----------------------------------------------------------------------
#
#   ProxyPass /back/ws/analyze ws://localhost:8000/ws/analyze
#   ProxyPass /back/ http://localhost:8000/
#   ProxyPassReverse /back/ http://localhost:8000/
#
#   # SPA fallback (serve index.html for all non-file routes under /modcomms/)
#   <Directory /var/vhosts/baic.oliver.solutions/htdocs/modcomms>
#       FallbackResource /modcomms/index.html
#   </Directory>
