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.

| Variable | Default | Notes | | -------------------- | ---------------------- | ----- | | DATABASE_DRIVER | postgres | postgres or sqlite. | | POSTGRES_HOST | 127.0.0.1 | | | POSTGRES_PORT | 5432 | | | POSTGRES_DATABASE | replayvod | | | POSTGRES_USER | postgres | | | POSTGRES_PASSWORD | (empty) | | | POSTGRES_SSL_MODE | disable | disable, require, verify-ca, verify-full. | | SQLITE_PATH | ./data/replayvod.db | Used when DATABASE_DRIVER=sqlite. |

| Variable | Default | Notes | | --------------------------------------- | ----------- | ----- | | 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. |

| Variable | Default | Notes | | -------- | --------- | ----- | | HOST | 0.0.0.0 | Bind address. | | PORT | 8080 | HTTP port. |

| Variable | Default | Notes | | ----------------------- | --------- | ----- | | SESSION_SECRET | (empty) | Required. 32+ bytes used to encrypt the session store. | | WHITELIST_ENABLED | false | Restrict sign-in to a known list of Twitch user IDs. | | WHITELISTED_USER_IDS | (empty) | Comma-separated Twitch user IDs. | | OWNER_TWITCH_ID | (empty) | Optional numeric Twitch user ID to preassign as owner. When empty, the first successful login becomes owner. |

| Variable | Default | Notes | | ---------------------- | ------------------------------------------------------ | ----- | | PUBLIC_BASE_URL | (empty) | Primary public scheme://host for normal deployments. The server derives its Twitch OAuth callback, dashboard redirects, recording-webhook signed download_url origins, and trusted browser origin for CSRF from it. | | TRUSTED_ORIGINS | (empty) | Optional comma-separated extra browser origins for split dashboard/API deployments. | | WEBHOOK_CALLBACK_URL | (empty) | Direct EventSub callback. Used only with SERVER_MODE=direct; must be public HTTPS. |

| Variable | Default | Notes | | --------------------- | ------- | ----- | | SERVER_MODE | (empty) | Empty means configure server mode in the owner dashboard. Complete env config wins over app settings. Values: off, poll, direct, relay. |

| Variable | Default | Notes | | -------------------------- | ------- | ----- | | 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. |

| Variable | Default | Notes | | ----------------------------- | ------------------------ | ----- | | COMPOSE_PROFILES | sqlite | sqlite or postgres. Without this (or an explicit --profile flag), docker compose up does nothing. |

PUBLIC_BASE_URL (see URLs) is passed through Compose and resolved by the binary.

| Variable | Default | Notes | | ---------------- | --------------------- | ----- | | VIDEO_DIR | ./data/videos | Where finished MP4s are stored (local backend). | | THUMBNAIL_DIR | ./data/thumbnails | Where thumbnails are stored. | | DASHBOARD_DIR | (empty) | Optional path to a built dashboard for manual/source packaging. The Docker image serves /app/dashboard automatically. | | SCRATCH_DIR | ./data/.scratch | In-progress segments. Must be on the same filesystem as VIDEO_DIR. |