# Cinephage Environment Variables # When using manual install or Docker Compose with env_file, copy this file to .env and configure your settings as needed. # ============================================================================= # APPLICATION CONFIGURATION # ============================================================================= # Host address to bind to (default: 0.0.0.0 = all interfaces) # Use 127.0.0.1 if running behind a reverse proxy on the same machine # HOST=0.0.0.0 # User/Group IDs for Docker entrypoint (find yours: id -u && id -g) # Docker only: Used by entrypoint to drop privileges and fix ownership # PUID=1000 # PGID=1000 # Port to expose/listen on (default: 3000) # PORT=3000 # Trusted origin for CSRF protection (required if accessing via IP/FQDN) # Set this to your access URL, e.g., http://192.168.1.100:3000 # ORIGIN=http://localhost:3000 # Optional explicit Better Auth base URL for callbacks, redirects, and auth links. # Recommended when accessing Cinephage through a reverse proxy or public domain. # If unset, Cinephage uses the saved External URL from Settings > System when available, # otherwise falls back to localhost for local bootstrap. # BETTER_AUTH_URL=http://localhost:3000 # Optional comma-separated extra origins to trust for Better Auth. # Useful when Cinephage is reachable by multiple hostnames. # BETTER_AUTH_TRUSTED_ORIGINS=http://cinephage.local,http://192.168.1.100:3000 # Disable secure cookies (auto-detected from BETTER_AUTH_URL). # Secure cookies are enabled automatically when BETTER_AUTH_URL starts with https://. # Set to 'true' only if you use an HTTPS reverse proxy but HTTP internally. # BETTER_AUTH_DISABLE_SECURE_COOKIES=false # Optional public base URL used when generating external-facing links/paths. # If unset, ORIGIN is used where applicable. # PUBLIC_BASE_URL=http://localhost:3000 # REQUIRED - Better Auth secret used for session signing and API key encryption. # Generate one with any of: # openssl rand -base64 32 # node -e "console.log(require('crypto').randomBytes(32).toString('base64'))" # python3 -c "import secrets,base64; print(base64.b64encode(secrets.token_bytes(32)).decode())" # # WARNING: Changing this value will invalidate all active sessions and make # encrypted API keys permanently unrecoverable. Back it up. # # In dev, Vite loads .env automatically. In production, server.js loads it via dotenv. # Docker users can also pass it via docker-compose environment or -e flag. BETTER_AUTH_SECRET= # Timezone for scheduled tasks and logs (default: UTC) # Use TZ database names, e.g., America/New_York, Europe/London # TZ=UTC # ============================================================================= # LOGGING CONFIGURATION # ============================================================================= # Log level (default: debug in development, info in production) # LOG_LEVEL=info # Include error stack traces in logs. # Default: enabled in development, disabled in production. # Set true to always include, false to always suppress. # LOG_INCLUDE_STACK=false # Disable sensitive value redaction in logs (debug only, NOT recommended in production). # Default: false (redaction enabled). # LOG_SENSITIVE=false # ============================================================================= # DATA DIRECTORIES (Advanced) # ============================================================================= # These are auto-configured for Docker and manual installs. # Only override if you need custom paths. # Data directory - stores database, indexer definitions, caches, etc. # Docker default: /config/data (persisted via ./config:/config volume mount) # Manual install default: ./data # DATA_DIR=./data # Indexer definitions directory - YAML indexer configurations # Docker default: /config/data/indexers/definitions # Manual install default: ./data/indexers/definitions # INDEXER_DEFINITIONS_PATH=./data/indexers/definitions # INDEXER_CUSTOM_DEFINITIONS_PATH=./data/indexers/definitions/custom # External lists preset directory - YAML list configurations # Docker default: /config/data/external-lists/presets # Manual install default: ./data/external-lists/presets # EXTERNAL_LISTS_PRESETS_PATH=./data/external-lists/presets # EXTERNAL_LISTS_CUSTOM_PRESETS_PATH=./data/external-lists/presets/custom # IMPORTANT: For Docker, avoid mounting /app as it contains application code. # Use the single ./config:/config mount which includes data, logs, and indexers. # ============================================================================= # MEDIA INFO (OPTIONAL) # ============================================================================= # Path to ffprobe binary (default: searches PATH) # Used for extracting media info from video files (codecs, resolution, etc.) # Note: ffprobe is NOT included in Synology DSM 7 by default # Install ffmpeg/ffprobe: # Ubuntu/Debian: sudo apt install ffmpeg # macOS: brew install ffmpeg # Windows: Download from https://ffmpeg.org/download.html # FFPROBE_PATH=/usr/bin/ffprobe # ============================================================================= # WORKER CONFIGURATION # ============================================================================= # Maximum concurrent workers by type # Adjust based on your system resources # Stream workers - for proxying HLS streams (default: 10) # WORKER_MAX_STREAMS=10 # Import workers - for moving/copying downloaded files (default: 5) # WORKER_MAX_IMPORTS=5 # Scan workers - for library folder scanning (default: 2) # WORKER_MAX_SCANS=2 # Monitoring workers - for automated search tasks (default: 5) # WORKER_MAX_MONITORING=5 # Search workers - for indexer searches (default: 3) # WORKER_MAX_SEARCH=3 # Subtitle search workers - for subtitle provider searches (default: 3) # WORKER_MAX_SUBTITLE_SEARCH=3 # Portal scan workers - for Stalker portal scanning (default: 2) # WORKER_MAX_PORTAL_SCANS=2 # Channel sync workers - for Live TV channel sync tasks (default: 3) # WORKER_MAX_CHANNEL_SYNCS=3 # Worker cleanup interval in milliseconds (default: 1800000 = 30 minutes) # WORKER_CLEANUP_MS=1800000 # Maximum log entries per worker in memory (default: 1000) # WORKER_MAX_LOGS=1000 # ============================================================================= # CAPTCHA / CLOUDFLARE BROWSER SOLVING (Advanced) # ============================================================================= # Cinephage solves Cloudflare/DDoS-Guard challenges with an embedded headless # Firefox (Camoufox). Each browser is a full Firefox process (300MB-1GB+ RSS), # so concurrency is hard-capped to avoid OOM under heavy fan-out. # Maximum concurrent Camoufox browsers (default: 2, minimum: 1). # Lower to 1 on memory-constrained hosts (e.g. small LXCs); raise only if you # also raise the container's shm_size. # CAPTCHA_MAX_BROWSERS=2 # Force-close a browser if it lives longer than this many ms (default: 120000). # Safety net for wedged/orphaned browsers; must exceed the solve timeout. # CAPTCHA_BROWSER_MAX_AGE_MS=120000 # NOTE on /dev/shm: headless Firefox uses shared memory. Containers default to # 64MB which causes crashes. docker-compose.yaml sets shm_size: 256m. For # `docker run`, add `--shm-size=256m`. On Proxmox LXC, the host's /dev/shm may # also need raising (mount a larger tmpfs at /dev/shm inside the container). # ============================================================================= # STREAMING CONFIGURATION (Advanced) # ============================================================================= # Settings for the HLS proxy and stream handling # Proxy fetch timeout in milliseconds (default: 30000 = 30 seconds) # PROXY_FETCH_TIMEOUT_MS=30000 # Maximum segment size in bytes (default: 52428800 = 50MB) # PROXY_SEGMENT_MAX_SIZE=52428800 # Maximum retry attempts for proxy fetches on 5xx errors (default: 2) # PROXY_MAX_RETRIES=2 # Default referer header for proxy requests (default: https://videasy.net) # DEFAULT_PROXY_REFERER=https://videasy.net # ============================================================================= # PROVIDER CONFIGURATION (Advanced) # ============================================================================= # Circuit breaker and caching settings for streaming providers # Maximum consecutive failures before circuit opens (default: 3) # PROVIDER_MAX_FAILURES=3 # Time in ms before circuit breaker enters half-open state (default: 30000) # PROVIDER_CIRCUIT_HALF_OPEN_MS=30000 # Time in ms before circuit breaker fully resets (default: 60000) # PROVIDER_CIRCUIT_RESET_MS=60000 # TTL for provider result cache entries in ms (default: 30000) # PROVIDER_CACHE_TTL_MS=30000 # Number of providers to try in parallel mode (default: 3) # PROVIDER_PARALLEL_COUNT=3 # ============================================================================= # LIVE TV (Advanced) # ============================================================================= # EPG and Live TV scheduling settings # Startup grace period before EPG tasks run in ms (default: 30000 = 30 seconds) # EPG_STARTUP_GRACE_MS=30000 # Streaming API key per-key rate limit window in milliseconds (default: 3600000 = 1 hour) # Applies to Better Auth API key limiter for streaming/livetv keys. # STREAMING_API_KEY_RATE_LIMIT_WINDOW_MS=3600000 # Streaming API key max requests per window (default: 10000) # Increase for heavy playback workloads or reduce for stricter abuse protection. # STREAMING_API_KEY_RATE_LIMIT_MAX=10000 # ============================================================================= # GRACEFUL SHUTDOWN # ============================================================================= # Seconds to wait for connections to close during shutdown (default: 30) # SHUTDOWN_TIMEOUT=30 # ============================================================================= # DATABASE (Auto-configured) # ============================================================================= # Database is SQLite stored at data/cinephage.db # This is created automatically on first run # ============================================================================= # APPLICATION MODE (Usually auto-detected) # ============================================================================= # Node environment - set automatically by npm scripts # NODE_ENV=production