205 lines
6.9 KiB
Bash
205 lines
6.9 KiB
Bash
# WiFi-DensePose API Environment Configuration Template
|
|
# Copy this file to .env and modify the values according to your setup
|
|
|
|
# =============================================================================
|
|
# APPLICATION SETTINGS
|
|
# =============================================================================
|
|
|
|
# Application metadata
|
|
APP_NAME=WiFi-DensePose API
|
|
VERSION=1.0.0
|
|
ENVIRONMENT=development # Options: development, staging, production
|
|
DEBUG=true
|
|
|
|
# =============================================================================
|
|
# SERVER SETTINGS
|
|
# =============================================================================
|
|
|
|
# Server configuration
|
|
HOST=0.0.0.0
|
|
PORT=8000
|
|
RELOAD=true # Auto-reload on code changes (development only)
|
|
WORKERS=1 # Number of worker processes
|
|
|
|
# =============================================================================
|
|
# SECURITY SETTINGS
|
|
# =============================================================================
|
|
|
|
# IMPORTANT: Change these values for production!
|
|
SECRET_KEY=your-secret-key-here-change-for-production
|
|
JWT_ALGORITHM=HS256
|
|
JWT_EXPIRE_HOURS=24
|
|
|
|
# Allowed hosts (restrict in production)
|
|
ALLOWED_HOSTS=* # Use specific domains in production: example.com,api.example.com
|
|
|
|
# CORS settings (restrict in production)
|
|
CORS_ORIGINS=* # Use specific origins in production: https://example.com,https://app.example.com
|
|
|
|
# =============================================================================
|
|
# DATABASE SETTINGS
|
|
# =============================================================================
|
|
|
|
# Database connection (optional - defaults to SQLite in development)
|
|
# For PostgreSQL (recommended for production):
|
|
DATABASE_URL=postgresql://wifi_user:wifi_password@localhost:5432/wifi_densepose
|
|
DATABASE_POOL_SIZE=10
|
|
DATABASE_MAX_OVERFLOW=20
|
|
|
|
# Alternative: Individual database connection parameters
|
|
# DB_HOST=localhost
|
|
# DB_PORT=5432
|
|
# DB_NAME=wifi_densepose
|
|
# DB_USER=wifi_user
|
|
# DB_PASSWORD=wifi_password
|
|
|
|
# Database failsafe settings
|
|
ENABLE_DATABASE_FAILSAFE=true
|
|
SQLITE_FALLBACK_PATH=./data/wifi_densepose_fallback.db
|
|
|
|
# =============================================================================
|
|
# REDIS SETTINGS (Optional - for caching and rate limiting)
|
|
# =============================================================================
|
|
|
|
# Redis connection (optional - defaults to localhost in development)
|
|
REDIS_URL=redis://localhost:6379/0
|
|
# REDIS_PASSWORD=your-redis-password
|
|
REDIS_DB=0
|
|
REDIS_ENABLED=true
|
|
REDIS_REQUIRED=false
|
|
ENABLE_REDIS_FAILSAFE=true
|
|
|
|
# Redis connection settings
|
|
REDIS_HOST=localhost
|
|
REDIS_PORT=6379
|
|
REDIS_MAX_CONNECTIONS=10
|
|
REDIS_SOCKET_TIMEOUT=5
|
|
REDIS_CONNECT_TIMEOUT=5
|
|
|
|
# =============================================================================
|
|
# HARDWARE SETTINGS
|
|
# =============================================================================
|
|
|
|
# WiFi interface configuration
|
|
WIFI_INTERFACE=wlan0
|
|
CSI_BUFFER_SIZE=1000
|
|
HARDWARE_POLLING_INTERVAL=0.1
|
|
|
|
# Hardware mock settings (for development/testing)
|
|
MOCK_HARDWARE=true
|
|
MOCK_POSE_DATA=true
|
|
|
|
# =============================================================================
|
|
# POSE ESTIMATION SETTINGS
|
|
# =============================================================================
|
|
|
|
# Model configuration
|
|
# POSE_MODEL_PATH=/path/to/your/pose/model.pth
|
|
POSE_CONFIDENCE_THRESHOLD=0.5
|
|
POSE_PROCESSING_BATCH_SIZE=32
|
|
POSE_MAX_PERSONS=10
|
|
|
|
# =============================================================================
|
|
# STREAMING SETTINGS
|
|
# =============================================================================
|
|
|
|
# Real-time streaming configuration
|
|
STREAM_FPS=30
|
|
STREAM_BUFFER_SIZE=100
|
|
WEBSOCKET_PING_INTERVAL=60
|
|
WEBSOCKET_TIMEOUT=300
|
|
|
|
# =============================================================================
|
|
# FEATURE FLAGS
|
|
# =============================================================================
|
|
|
|
# Enable/disable features
|
|
ENABLE_AUTHENTICATION=false # Set to true for production
|
|
ENABLE_RATE_LIMITING=false # Set to true for production
|
|
ENABLE_WEBSOCKETS=true
|
|
ENABLE_REAL_TIME_PROCESSING=true
|
|
ENABLE_HISTORICAL_DATA=true
|
|
|
|
# Development features
|
|
ENABLE_TEST_ENDPOINTS=true # Set to false for production
|
|
|
|
# =============================================================================
|
|
# RATE LIMITING SETTINGS
|
|
# =============================================================================
|
|
|
|
# Rate limiting configuration
|
|
RATE_LIMIT_REQUESTS=100
|
|
RATE_LIMIT_AUTHENTICATED_REQUESTS=1000
|
|
RATE_LIMIT_WINDOW=3600 # Window in seconds
|
|
|
|
# =============================================================================
|
|
# LOGGING SETTINGS
|
|
# =============================================================================
|
|
|
|
# Logging configuration
|
|
LOG_LEVEL=INFO # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
|
|
LOG_FORMAT=%(asctime)s - %(name)s - %(levelname)s - %(message)s
|
|
# LOG_FILE=/path/to/logfile.log # Optional: specify log file path
|
|
LOG_MAX_SIZE=10485760 # 10MB
|
|
LOG_BACKUP_COUNT=5
|
|
|
|
# =============================================================================
|
|
# STORAGE SETTINGS
|
|
# =============================================================================
|
|
|
|
# Storage directories
|
|
DATA_STORAGE_PATH=./data
|
|
MODEL_STORAGE_PATH=./models
|
|
TEMP_STORAGE_PATH=./temp
|
|
MAX_STORAGE_SIZE_GB=100
|
|
|
|
# =============================================================================
|
|
# MONITORING SETTINGS
|
|
# =============================================================================
|
|
|
|
# Monitoring and metrics
|
|
METRICS_ENABLED=true
|
|
HEALTH_CHECK_INTERVAL=30
|
|
PERFORMANCE_MONITORING=true
|
|
|
|
# =============================================================================
|
|
# API SETTINGS
|
|
# =============================================================================
|
|
|
|
# API configuration
|
|
API_PREFIX=/api/v1
|
|
DOCS_URL=/docs # Set to null to disable in production
|
|
REDOC_URL=/redoc # Set to null to disable in production
|
|
OPENAPI_URL=/openapi.json # Set to null to disable in production
|
|
|
|
# =============================================================================
|
|
# PRODUCTION SETTINGS
|
|
# =============================================================================
|
|
|
|
# For production deployment, ensure you:
|
|
# 1. Set ENVIRONMENT=production
|
|
# 2. Set DEBUG=false
|
|
# 3. Use a strong SECRET_KEY
|
|
# 4. Configure proper DATABASE_URL
|
|
# 5. Restrict ALLOWED_HOSTS and CORS_ORIGINS
|
|
# 6. Enable ENABLE_AUTHENTICATION=true
|
|
# 7. Enable ENABLE_RATE_LIMITING=true
|
|
# 8. Set ENABLE_TEST_ENDPOINTS=false
|
|
# 9. Disable API documentation URLs (set to null)
|
|
# 10. Configure proper logging with LOG_FILE
|
|
|
|
# Example production settings:
|
|
# ENVIRONMENT=production
|
|
# DEBUG=false
|
|
# SECRET_KEY=your-very-secure-secret-key-here
|
|
# DATABASE_URL=postgresql://user:password@db-host:5432/wifi_densepose
|
|
# REDIS_URL=redis://redis-host:6379/0
|
|
# ALLOWED_HOSTS=yourdomain.com,api.yourdomain.com
|
|
# CORS_ORIGINS=https://yourdomain.com,https://app.yourdomain.com
|
|
# ENABLE_AUTHENTICATION=true
|
|
# ENABLE_RATE_LIMITING=true
|
|
# ENABLE_TEST_ENDPOINTS=false
|
|
# DOCS_URL=null
|
|
# REDOC_URL=null
|
|
# OPENAPI_URL=null
|
|
# LOG_FILE=/var/log/wifi-densepose/app.log |