Files
sofarr/.env.sample
Gronod a50e5a7d69
Some checks failed
Build and Push Docker Image / build (push) Failing after 40s
CI / Security audit (push) Failing after 27s
CI / Tests & coverage (push) Failing after 35s
Docs Check / Markdown lint (push) Successful in 32s
Docs Check / Mermaid diagram parse check (push) Successful in 1m12s
Licence Check / Licence compatibility and copyright header verification (push) Failing after 24s
feat: add rtorrent client via PDCA
- Implement RTorrentClient extending DownloadClient abstract class
- Use xmlrpc package (v1.3.2) for XML-RPC communication
- Support HTTP Basic Auth when credentials are configured
- Map rTorrent states (d.state, d.is_active, d.is_hash_checking) to normalized statuses
- Calculate ETA from download speed and remaining bytes
- Add getRtorrentInstances() to config.js
- Register RTorrentClient in downloadClients.js registry
- Add 8 comprehensive unit tests covering all functionality
- Update .env.sample with rtorrent configuration examples
- Update ARCHITECTURE.md with rtorrent client details
- Update ADDING-A-DOWNLOAD-CLIENT.md with rtorrent-specific notes
2026-05-19 11:40:31 +01:00

143 lines
6.7 KiB
Plaintext

# sofarr Configuration
# Copy this file to .env and update with your values
# =============================================================================
# SERVER SETTINGS
# =============================================================================
PORT=3001
# Logging level: debug, info, warn, error, silent
# - debug: Verbose logging for troubleshooting
# - info: Standard operational logging (default)
# - warn: Only warnings and errors
# - error: Only errors
# - silent: No logging
LOG_LEVEL=info
# Cookie signing secret for tamper-proof session cookies
# Required in production (server exits on startup if unset).
# Generate with: openssl rand -hex 32
COOKIE_SECRET=your-cookie-secret-here
# =============================================================================
# TLS / HTTPS
# =============================================================================
# TLS is enabled by default using the bundled snakeoil self-signed certificate
# (valid for localhost/127.0.0.1, 10-year expiry).
# Set TLS_CERT and TLS_KEY to use your own certificate (recommended).
# Set TLS_ENABLED=false to run in plain HTTP mode (e.g. behind a TLS proxy).
#
# To generate a self-signed cert for your own hostname:
# openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt \
# -days 365 -nodes -subj "/CN=yourhostname" \
# -addext "subjectAltName=DNS:yourhostname,IP:192.168.x.x"
#
# TLS_ENABLED=true
# TLS_CERT=/path/to/server.crt
# TLS_KEY=/path/to/server.key
# =============================================================================
# REVERSE PROXY & DEPLOYMENT
# =============================================================================
# Set to 1 when running behind a reverse proxy (Nginx, Caddy, Traefik).
# This makes Express trust X-Forwarded-For and X-Forwarded-Proto so that
# req.ip reflects the real client IP and cookies are marked secure correctly.
# Leave unset if sofarr is exposed directly to the internet.
# TRUST_PROXY=1
# Directory for persistent data (SQLite token store, server logs).
# Must be writable by the process user (UID 1000 in the container).
# Defaults to ./data relative to the project root.
# DATA_DIR=/app/data
# Number of days of completed download history to show in the Recently Completed section.
# Override per-request with ?days=N (capped at 90).
# RECENT_COMPLETED_DAYS=7
# Background polling interval in milliseconds (default: 5000)
# sofarr polls all services in the background and caches results so
# dashboard requests are near-instant.
# Set to 0, "off", "false", or "disabled" to disable background polling.
# When disabled, data is fetched on-demand when a user opens the dashboard
# and cached for 30 seconds so other users benefit from the same fetch.
# POLL_INTERVAL=5000
# =============================================================================
# EMBY (Authentication - Required)
# =============================================================================
EMBY_URL=https://emby.example.com
EMBY_API_KEY=your-emby-api-key-here
# =============================================================================
# SABNZBD INSTANCES (JSON Array Format)
# Add one or more SABnzbd instances as a single-line JSON array
# Format: [{"name":"instance-name","url":"https://...","apiKey":"..."}]
# =============================================================================
SABNZBD_INSTANCES=[{"name":"primary","url":"https://sabnzbd.example.com","apiKey":"your-sabnzbd-api-key"}]
# Legacy single-instance format (optional - still supported)
# SABNZBD_URL=https://sabnzbd.example.com
# SABNZBD_API_KEY=your-sabnzbd-api-key
# =============================================================================
# QBITTORRENT INSTANCES (JSON Array Format)
# Add one or more qBittorrent instances as a single-line JSON array
# Uses username/password authentication (not API key)
# Format: [{"name":"instance-name","url":"https://...","username":"...","password":"..."}]
# =============================================================================
QBITTORRENT_INSTANCES=[{"name":"main","url":"https://qbittorrent.example.com","username":"admin","password":"your-password"}]
# Legacy single-instance format (optional - still supported)
# QBITTORRENT_URL=https://qbittorrent.example.com
# QBITTORRENT_USERNAME=admin
# QBITTORRENT_PASSWORD=your-password
# =============================================================================
# RTORRENT INSTANCES (JSON Array Format)
# Add one or more rTorrent instances as a single-line JSON array
# Uses username/password authentication (optional)
# Format: [{"name":"instance-name","url":"https://...","username":"...","password":"..."}]
# XML-RPC endpoint is automatically appended: ${url}/RPC2
# =============================================================================
# RTORRENT_INSTANCES=[{"name":"main","url":"https://rtorrent.example.com","username":"rtorrent","password":"rtorrent"}]
# Legacy single-instance format (optional - still supported)
# RTORRENT_URL=https://rtorrent.example.com
# RTORRENT_USERNAME=rtorrent
# RTORRENT_PASSWORD=rtorrent
# =============================================================================
# SONARR INSTANCES (JSON Array Format)
# Add one or more Sonarr instances as a single-line JSON array
# Format: [{"name":"instance-name","url":"https://...","apiKey":"..."}]
# =============================================================================
SONARR_INSTANCES=[{"name":"main","url":"https://sonarr.example.com","apiKey":"your-sonarr-api-key"}]
# Legacy single-instance format (optional - still supported)
# SONARR_URL=https://sonarr.example.com
# SONARR_API_KEY=your-sonarr-api-key
# =============================================================================
# RADARR INSTANCES (JSON Array Format)
# Add one or more Radarr instances as a single-line JSON array
# Format: [{"name":"instance-name","url":"https://...","apiKey":"..."}]
# =============================================================================
RADARR_INSTANCES=[{"name":"main","url":"https://radarr.example.com","apiKey":"your-radarr-api-key"}]
# Legacy single-instance format (optional - still supported)
# RADARR_URL=https://radarr.example.com
# RADARR_API_KEY=your-radarr-api-key
# =============================================================================
# NOTES
# =============================================================================
# 1. All JSON arrays must be on a single line (no line breaks)
# 2. Instance "name" can be anything descriptive (e.g., "main", "4k", "backup")
# 3. URLs should include protocol (http:// or https://)
# 4. For qBittorrent, ensure Web UI is enabled in settings
# 5. User downloads are matched by tags in Sonarr/Radarr - tag your media!
# 6. Background polling keeps data fresh; disable it for low-resource setups
# =============================================================================