69e91fd5d0
- Extended health endpoint: DB+Redis+Storage+Worker checks with degraded status - Prometheus metrics endpoint: admin-only, text/plain format - Metrics: http_requests_total, db_pool_connections, arq_jobs_total - Structured JSON logging (structlog): timestamp, level, method, path, status, duration_ms, tenant_id - Performance: page_size max 100 enforced (422), streaming CSV export (StreamingResponse) - Scripts: seed_perf_data.py, check_indexes.py - Docs: admin-guide.md (Deploy, Backup, Restore, Env-Vars, Troubleshooting), api-overview.md - README updated: prod setup, API section, env profiles, admin-guide link - .env.example: added SECRET_KEY, STORAGE_PATH, SMTP_* vars - 38 new tests, full regression 564/564 pass (0 failures) - Ruff: all checks passed
57 lines
1.3 KiB
Bash
57 lines
1.3 KiB
Bash
# LeoCRM v1.0 - Environment Variables Template
|
|
|
|
# === REQUIRED ===
|
|
DATABASE_URL=postgresql+asyncpg://leocrm:leocrm@localhost:5432/leocrm
|
|
REDIS_URL=redis://localhost:6379/0
|
|
|
|
# === OPTIONAL (with defaults) ===
|
|
|
|
# Environment: development | production | testing
|
|
ENVIRONMENT=development
|
|
|
|
# Log level: DEBUG | INFO | WARNING | ERROR
|
|
LOG_LEVEL=INFO
|
|
|
|
# Database pool
|
|
DB_POOL_SIZE=10
|
|
DB_MAX_OVERFLOW=20
|
|
DB_ECHO=false
|
|
|
|
# Session settings
|
|
SESSION_TTL_SECONDS=28800
|
|
SESSION_COOKIE_NAME=leocrm_session
|
|
SESSION_COOKIE_SECURE=false
|
|
SESSION_COOKIE_SAMESITE=strict
|
|
SESSION_COOKIE_HTTPONLY=true
|
|
|
|
# Password hashing
|
|
BCRYPT_ROUNDS=12
|
|
PASSWORD_RESET_EXPIRY_HOURS=1
|
|
|
|
# CORS allowed origins (comma-separated, NO wildcards)
|
|
CORS_ORIGINS=http://localhost:5173,http://localhost:3000
|
|
|
|
# Secret Key (for signing, sessions — use a secure random string ≥32 chars in prod)
|
|
SECRET_KEY=change-me-in-production-use-a-secure-random-string
|
|
|
|
# Storage (file uploads, DMS)
|
|
STORAGE_PATH=/tmp
|
|
|
|
# SMTP / Email
|
|
SMTP_HOST=localhost
|
|
SMTP_PORT=587
|
|
SMTP_USERNAME=
|
|
SMTP_PASSWORD=
|
|
SMTP_FROM_EMAIL=noreply@leocrm.local
|
|
SMTP_USE_TLS=true
|
|
|
|
# Rate limiting
|
|
RATE_LIMIT_LOGIN_MAX=5
|
|
RATE_LIMIT_LOGIN_WINDOW=900
|
|
RATE_LIMIT_RESET_MAX=3
|
|
RATE_LIMIT_RESET_WINDOW=3600
|
|
RATE_LIMIT_RESET_CONFIRM_MAX=5
|
|
RATE_LIMIT_RESET_CONFIRM_WINDOW=3600
|
|
RATE_LIMIT_GENERAL_MAX=60
|
|
RATE_LIMIT_GENERAL_WINDOW=60
|