Skip to content

Environment variables

Reference for server/.env. The committed server/.env.example is the source of truth — this page mirrors it and groups by purpose.

VariableDefaultNotes
DATABASE_DRIVERpostgrespostgres or sqlite.
POSTGRES_HOST127.0.0.1
POSTGRES_PORT5432
POSTGRES_DATABASEreplayvod
POSTGRES_USERpostgres
POSTGRES_PASSWORD(empty)
POSTGRES_SSL_MODEdisabledisable, require, verify-ca, verify-full.
SQLITE_PATH./data/replayvod.dbUsed when DATABASE_DRIVER=sqlite.
VariableDefaultNotes
TWITCH_CLIENT_ID(empty)Required. From the Twitch dev console.
TWITCH_SECRET(empty)Required.
HMAC_SECRET(auto)Optional. EventSub HMAC secret. Seeds the database on first run if set; otherwise one is generated and stored there. Ignored on later boots.
TWITCH_SERVICE_ACCOUNT_REFRESH_TOKEN(empty)Optional. Refresh token for an authenticated playback account. Unlocks ad-free recording on Turbo accounts and HEVC on channels that gate it behind authentication.
VariableDefaultNotes
HOST0.0.0.0Bind address.
PORT8080HTTP port.
VariableDefaultNotes
SESSION_SECRET(empty)Required. 32+ bytes used to encrypt the session store.
WHITELIST_ENABLEDfalseRestrict sign-in to a known list of Twitch user IDs.
WHITELISTED_USER_IDS(empty)Comma-separated Twitch user IDs.
OWNER_TWITCH_ID(empty)Numeric Twitch user ID granted the owner role on first sign-in.
VariableDefaultNotes
CALLBACK_URLhttp://localhost:8080/api/v1/auth/twitch/callbackOAuth redirect. Must match the Twitch app config.
WEBHOOK_CALLBACK_URL(empty)Direct EventSub callback. Used only with SERVER_MODE=direct; must be public HTTPS.
FRONTEND_URLhttp://localhost:3000CORS allow-list entry. Set to the recorder’s own URL in production.
VariableDefaultNotes
SERVER_MODE(empty)Empty means configure server mode in the owner dashboard. Complete env config wins over app settings. Values: off, poll, direct, relay.
VariableDefaultNotes
RELAY_INGEST_URL(empty)Public HTTPS relay URL Twitch posts to. Required with SERVER_MODE=relay.
RELAY_SUBSCRIBE_URL(empty)WebSocket URL the recorder dials outbound. Required with SERVER_MODE=relay.
RELAY_LOCAL_CALLBACK_URL(empty)Where the relay agent replays signed EventSub frames. Defaults to http://127.0.0.1:${PORT}/api/v1/webhook/callback. Must stay on loopback.
VariableDefaultNotes
PUBLIC_BASE_URLhttp://localhost:8080Compose derives CALLBACK_URL and FRONTEND_URL from this.
COMPOSE_PROFILESsqlitesqlite or postgres. Without this (or an explicit --profile flag), docker compose up does nothing.
VariableDefaultNotes
VIDEO_DIR./data/videosWhere finished MP4s are stored (local backend).
THUMBNAIL_DIR./data/thumbnailsWhere thumbnails are stored.
SCRATCH_DIR./data/.scratchIn-progress segments. Must be on the same filesystem as VIDEO_DIR.
DASHBOARD_DIR(empty)Path to the built dashboard. The Docker image sets this automatically.