|
| 1 | +# ============================================================ |
| 2 | +# Cognipeer Console — Environment Configuration |
| 3 | +# ============================================================ |
| 4 | +# Copy this file to .env.local and fill in your values. |
| 5 | +# All variables have sensible defaults unless marked (required). |
| 6 | +# ============================================================ |
| 7 | + |
| 8 | +# ---- Database ------------------------------------------------ |
| 9 | +# Provider: sqlite (default, zero-dependency) | mongodb |
| 10 | +DB_PROVIDER=sqlite # Database backend |
| 11 | +MAIN_DB_NAME=console_main # Main database name |
| 12 | +SQLITE_DATA_DIR=./data/sqlite # SQLite data directory |
| 13 | + |
| 14 | +# MongoDB (only required when DB_PROVIDER=mongodb) |
| 15 | +# MONGODB_URI=mongodb://localhost:27017 # MongoDB connection string |
| 16 | +# MONGODB_MIN_POOL_SIZE=2 # Minimum connection pool size |
| 17 | +# MONGODB_MAX_POOL_SIZE=10 # Maximum connection pool size |
| 18 | +# MONGODB_CONNECT_TIMEOUT_MS=10000 # Connection timeout (ms) |
| 19 | +# MONGODB_SOCKET_TIMEOUT_MS=45000 # Socket timeout (ms) |
| 20 | +# MONGODB_SERVER_SELECTION_TIMEOUT_MS=30000 # Server selection timeout (ms) |
| 21 | + |
| 22 | +# ---- Authentication ------------------------------------------ |
| 23 | +JWT_SECRET= # (required) JWT signing secret — min 32 random chars |
| 24 | +JWT_EXPIRES_IN=7d # Token expiry (1d, 7d, 30d) |
| 25 | +# PROVIDER_ENCRYPTION_SECRET= # Provider credential encryption key (falls back to JWT_SECRET) |
| 26 | + |
| 27 | +# ---- License ------------------------------------------------- |
| 28 | +# ENFORCE_LICENSE=false # Set to "true" to enforce license tier restrictions (default: false = all features unlocked) |
| 29 | + |
| 30 | +# ---- Email (SMTP) -------------------------------------------- |
| 31 | +# Optional — emails will be skipped if not configured |
| 32 | +# SMTP_HOST=smtp.example.com # SMTP server hostname |
| 33 | +# SMTP_PORT=587 # SMTP port |
| 34 | +# SMTP_SECURE=false # Use TLS (true/false) |
| 35 | +# SMTP_USER= # SMTP username |
| 36 | +# SMTP_PASS= # SMTP password |
| 37 | +# SMTP_FROM=noreply@example.com # Sender address (defaults to SMTP_USER) |
| 38 | + |
| 39 | +# ---- Gateway / Resilience ------------------------------------ |
| 40 | +# GATEWAY_REQUEST_TIMEOUT_MS=120000 # Request timeout for provider calls (ms) |
| 41 | +# GATEWAY_RETRY_ENABLED=true # Enable retry on provider failures |
| 42 | +# GATEWAY_RETRY_MAX_ATTEMPTS=3 # Max retry attempts (1 = no retry) |
| 43 | +# GATEWAY_RETRY_INITIAL_DELAY_MS=200 # Initial retry delay (exponential backoff) |
| 44 | +# GATEWAY_CIRCUIT_BREAKER_ENABLED=true # Enable circuit breaker |
| 45 | +# GATEWAY_CIRCUIT_BREAKER_THRESHOLD=5 # Failures to trip the breaker |
| 46 | +# GATEWAY_CIRCUIT_BREAKER_RESET_MS=30000 # Time before half-open reset (ms) |
| 47 | + |
| 48 | +# ---- Cache --------------------------------------------------- |
| 49 | +# Provider: none | memory | redis |
| 50 | +CACHE_PROVIDER=memory # Cache provider (no fallback) |
| 51 | +# CACHE_TTL_SECONDS=300 # Default cache TTL (seconds) |
| 52 | +# REDIS_URL= # Redis connection URL (required when redis) |
| 53 | +# REDIS_KEY_PREFIX=console: # Redis key prefix |
| 54 | + |
| 55 | +# ---- Rate Limiting ------------------------------------------- |
| 56 | +# Provider: memory (default) | mongodb | redis |
| 57 | +RATE_LIMIT_PROVIDER=memory # Rate limit backend |
| 58 | +# RATE_LIMIT_SYNC_INTERVAL_MS=5000 # Sync interval for distributed counters |
| 59 | + |
| 60 | +# ---- Logging ------------------------------------------------- |
| 61 | +# LOG_LEVEL=debug # error | warn | info | debug |
| 62 | +# LOG_FORMAT=pretty # json | pretty (pretty = colorized dev output) |
| 63 | +# LOG_REQUEST_BODY=false # Log request bodies (caution: sensitive data) |
| 64 | +# LOG_RESPONSE_BODY=false # Log response bodies |
| 65 | + |
| 66 | +# ---- CORS ---------------------------------------------------- |
| 67 | +# CORS_ENABLED=false # Enable CORS for /api/client/* endpoints |
| 68 | +# CORS_ALLOWED_ORIGINS= # Comma-separated origins (required when CORS enabled) |
| 69 | +# CORS_MAX_AGE=86400 # Preflight cache max-age (seconds) |
| 70 | + |
| 71 | +# ---- Health --------------------------------------------------- |
| 72 | +# HEALTH_ENDPOINT_ENABLED=true # Enable /api/health/live and /api/health/ready |
| 73 | + |
| 74 | +# ---- Limits -------------------------------------------------- |
| 75 | +# NEXT_BODY_SIZE_LIMIT=10mb # Max body size for server actions |
| 76 | +# TRACING_MAX_BODY_SIZE_MB=10 # Max tracing session payload (MB) |
| 77 | + |
| 78 | +# ---- Application --------------------------------------------- |
| 79 | +NODE_ENV=development |
| 80 | +NEXT_PUBLIC_APP_URL=http://localhost:3000 # Public application URL (used in emails, links) |
| 81 | +# SHUTDOWN_TIMEOUT_MS=15000 # Graceful shutdown timeout (ms) |
| 82 | + |
| 83 | +# ---- Provider Runtime Pool ----------------------------------- |
| 84 | +# PROVIDER_RUNTIME_CACHE_TTL_SECONDS=300 # SDK client cache TTL (0 = no caching) |
0 commit comments