# Document Translation API - Environment Configuration # Copy this file to .env and configure your settings # ============== Translation Services ============== # Default provider: google, ollama, deepl, libre, openai TRANSLATION_SERVICE=google # DeepL API Key (required for DeepL provider) DEEPL_API_KEY=your_deepl_api_key_here # Ollama Configuration (for LLM-based translation) OLLAMA_BASE_URL=http://localhost:11434 OLLAMA_MODEL=llama3 OLLAMA_VISION_MODEL=llava # ============== File Limits ============== # Maximum file size in MB MAX_FILE_SIZE_MB=50 # ============== Rate Limiting (SaaS) ============== # Enable/disable rate limiting RATE_LIMIT_ENABLED=true # Request limits RATE_LIMIT_PER_MINUTE=30 RATE_LIMIT_PER_HOUR=200 # Translation-specific limits TRANSLATIONS_PER_MINUTE=10 TRANSLATIONS_PER_HOUR=50 MAX_CONCURRENT_TRANSLATIONS=5 # ============== Cleanup Service ============== # Enable automatic file cleanup CLEANUP_ENABLED=true # Cleanup interval in minutes CLEANUP_INTERVAL_MINUTES=15 # File time-to-live in minutes FILE_TTL_MINUTES=60 INPUT_FILE_TTL_MINUTES=30 OUTPUT_FILE_TTL_MINUTES=120 # Disk space warning thresholds (GB) DISK_WARNING_THRESHOLD_GB=5.0 DISK_CRITICAL_THRESHOLD_GB=1.0 # ============== Security ============== # Enable HSTS (only for HTTPS deployments) ENABLE_HSTS=false # CORS allowed origins (comma-separated) CORS_ORIGINS=* # Maximum request size in MB MAX_REQUEST_SIZE_MB=100 # Request timeout in seconds REQUEST_TIMEOUT_SECONDS=300 # ============== Admin Authentication ============== # Admin username ADMIN_USERNAME=admin # Admin password (change in production!) ADMIN_PASSWORD=changeme123 # Or use SHA256 hash of password (more secure) # Generate with: python -c "import hashlib; print(hashlib.sha256(b'your_password').hexdigest())" # ADMIN_PASSWORD_HASH= # Token secret for session management (auto-generated if not set) # ADMIN_TOKEN_SECRET= # ============== User Authentication ============== # JWT secret key (auto-generated if not set) # JWT_SECRET_KEY= # Frontend URL for redirects FRONTEND_URL=http://localhost:3000 # ============== Stripe Payments ============== # Get your keys from https://dashboard.stripe.com/apikeys STRIPE_PUBLISHABLE_KEY=pk_test_... STRIPE_SECRET_KEY=sk_test_... STRIPE_WEBHOOK_SECRET=whsec_... # ============== Monitoring ============== # Log level: DEBUG, INFO, WARNING, ERROR LOG_LEVEL=INFO # Enable request logging ENABLE_REQUEST_LOGGING=true # Memory usage threshold (percentage) MAX_MEMORY_PERCENT=80