Skip to content
Configuration

Configuration

All configuration is via environment variables, typically in a .env file.

Server

VariableDefaultDescription
TROVE_PORT8080Port to listen on
ENVproductiondevelopment or production
ENABLE_REGISTRATIONtrueAllow new user registration
TRUSTED_PROXY_CIDRSProxy network CIDR (required behind a reverse proxy)

Database

VariableDefaultDescription
DB_TYPEpostgrespostgres or sqlite
DB_HOSTPostgreSQL host
DB_NAMEDatabase name
DB_USERDatabase user
DB_PASSWORDDatabase password

Storage

VariableDefaultDescription
STORAGE_BACKENDdiskdisk, s3, or memory
STORAGE_PATH./data/filesPath for disk backend
DEFAULT_USER_QUOTA10GDefault storage quota per user
MAX_UPLOAD_SIZE500MMaximum single file upload size
TEMP_DIR/tmpTemp directory for uploads

Sizes support human-readable units: B, K/KB, M/MB, G/GB, T/TB.

Video Transcoding

Video uploads are converted in the background by the transcoder worker (separate container/binary with ffmpeg) into H.264/AAC MP4, max 1280x720, +faststart, so they can stream in the browser. The original file is always kept for downloads and the MP4 variant counts toward the user’s storage quota.

VariableDefaultDescription
TRANSCODE_ENABLEDtrueEnqueue transcode jobs on video upload (web server)
TRANSCODE_POLL_INTERVAL5sHow often the worker polls for new jobs
TRANSCODE_WORKERS1Concurrent jobs (ffmpeg is CPU-heavy)
TRANSCODE_MAX_ATTEMPTS3Retries before a job is marked failed
TRANSCODE_TIMEOUT2hPer-job timeout
TRANSCODE_PRESETmediumlibx264 preset (ultrafast..veryslow)
TRANSCODE_CRF23Quality value (lower = better, larger files)
TRANSCODE_MAX_HEIGHT720Maximum output height in pixels
TRANSCODE_THREADS0Cap ffmpeg thread count (0 = auto; e.g. 4 to limit CPU)
TRANSCODE_STALE_JOB_AGE30mRe-queue jobs stuck in processing after this long
FFMPEG_PATHffmpegffmpeg binary location (worker only)
FFPROBE_PATHffprobeffprobe binary location (worker only)

To convert videos uploaded before the transcoder was added, run the backfill once:

docker compose run --rm transcoder -backfill

Tips:

  • Set TRANSCODE_THREADS to limit CPU on shared hosts (a single job can otherwise saturate all cores).
  • Use TRANSCODE_PRESET=veryfast for weaker hardware; slow for smaller files at the cost of much longer encodes.
  • The worker must share the same STORAGE_* configuration and storage volume as the web server, and its TEMP_DIR needs room for roughly twice the size of the largest video being converted.

S3 / S3-Compatible

VariableDescription
S3_BUCKETBucket name
S3_USE_PATH_STYLESet true for MinIO or rustfs
AWS_REGIONAWS region
AWS_ACCESS_KEY_IDAccess key
AWS_SECRET_ACCESS_KEYSecret key
AWS_ENDPOINT_URLCustom endpoint for S3-compatible services

Security

VariableDefaultDescription
SESSION_SECRETRequired. openssl rand -base64 32
CSRF_ENABLEDtrueEnable CSRF protection

OIDC / SSO

VariableDefaultDescription
OIDC_ENABLEDfalseEnable OIDC
OIDC_ISSUER_URLProvider discovery URL
OIDC_CLIENT_IDClient ID
OIDC_CLIENT_SECRETClient secret
OIDC_REDIRECT_URLCallback URL (https://your-trove/auth/oidc/callback)
OIDC_SCOPESopenid email profileScopes to request
OIDC_USERNAME_CLAIMpreferred_usernameClaim to use as username
OIDC_EMAIL_CLAIMemailClaim to use as email
OIDC_ADMIN_CLAIMClaim that controls admin status
OIDC_ADMIN_VALUEValue that grants admin