rdio.

Environment variables

Reference for API and web configuration.

This page lists the environment variables rdio uses. Copy apps/api/.env.example and apps/web/.env.example as starting points.

API variables

VariableRequiredDefaultPurpose
DATABASE_URLYes:Postgres connection string
BETTER_AUTH_SECRETYes:Signs auth cookies and tokens (min 32 chars)
BETTER_AUTH_URLYeshttp://localhost:3001Public API origin for auth
WEB_ORIGINYeshttp://localhost:5173Allowed browser origins (comma-separated)
API_PORTNo3001API listen port
ICECAST_HOSTNolocalhostIcecast hostname inside the container
ICECAST_PORTNo8000Icecast port inside the container
ICECAST_SOURCE_PASSWORDNosourcepassPassword for Liquidsoap → Icecast and harbor
HARBOR_PORTNo8005Plain harbor port for BUTT
HARBOR_TLS_PORTNo8443TLS harbor port for BUTT
PUBLIC_STREAM_BASE_URLNohttp://localhost:8000Used to build stream URLs in API responses
BROADCAST_HOSTNo:Public hostname for BUTT (defaults to stream URL host)
R2_ACCOUNT_IDYes:Cloudflare account ID
R2_ACCESS_KEY_IDYes:R2 API token access key
R2_SECRET_ACCESS_KEYYes:R2 API token secret
R2_BUCKETYes:R2 bucket name
R2_PUBLIC_URLYes:Public base URL for media objects
MEDIA_UPLOAD_MAX_BYTESNo524288000Max upload size (500 MB)
NODE_ENVNodevelopmentdevelopment, production, or test

WEB_ORIGIN

List every origin that calls the API in the browser. For split deployments:

WEB_ORIGIN=https://rdio-web.fly.dev,https://radio.example.com

Missing origins cause auth and CORS failures.

BROADCAST_HOST

Set this to the hostname presenters use in BUTT. On Fly, this is typically your API app hostname:

BROADCAST_HOST=rdio-api.fly.dev

Web variables

VariableRequiredDefaultPurpose
VITE_API_BASE_URLNo/apiAPI path prefix baked into the JS bundle

Keep VITE_API_BASE_URL=/api when nginx proxies API traffic on the same origin.

Docker Compose (root .env)

Optional overrides for local infrastructure:

VariableDefaultPurpose
POSTGRES_DBrdioDatabase name
POSTGRES_USERrdioDatabase user
POSTGRES_PASSWORDrdioDatabase password
ICECAST_SOURCE_PASSWORDsourcepassIcecast and harbor password
ICECAST_HOSTNAMElocalhostIcecast hostname in compose

Port reference

ServiceLocal devProduction (Fly API app)
Web admin5173443 (web app)
API3001443 /api
Icecast listeners8002 (host) → 8000 (container)8001
Harbor (BUTT plain)80058005
Harbor TLS (BUTT SSL):8443
Postgres5432Fly Postgres

See Cloudflare R2 for media storage setup.

On this page