webstation-broker
Configuration

Broker settings

Every environment variable the broker itself reads, with its default and what it controls.

All configuration is by environment variable, read once at import time. None of these need setting inside the stock image except BROKER_SECRET, and SUBFOLDER when the container is mounted somewhere other than /streaming/.

Env varDefaultPurpose
SUBFOLDER/streaming/URL prefix for the whole app. The same value drives the container's nginx templating, the FastAPI mount and the vite base.
BROKER_SECRETunsetShared secret for the lifecycle endpoints, sent as the X-Broker-Secret header. Unset disables the check.
BROKER_HOST127.0.0.1Interface uvicorn binds. nginx is the only intended client.
BROKER_PORT8000Port uvicorn binds. The image's nginx template points at 8000.
ROM_ROOT/rommActivate rejects rom paths outside this root.
BROKER_EXPORT_DIR/config/broker-exportsWhere exit writes save archives: always in dev mode, otherwise only when the upload fails.
BROKER_IMPORT_DIR/config/broker-importsWhere uploaded save archives land, ready to pass to activate as save.archive.
BROKER_FRONTEND_DIST/usr/share/webstation-broker/wwwThe built room UI served outside dev mode.
BROKER_DISPLAY:0X display emulators are launched onto.
BROKER_WAYLAND_DISPLAYwayland-0Wayland display emulators are launched onto.
BROKER_PID_FILE/config/broker-emulator.jsonWhere the running emulator's pid is recorded so a restarted broker can still kill it.
BROKER_SAVE_UPLOAD_PATH/api/webstation/savesPath appended to the callback base URL when exit POSTs the save archive.
BROKER_SAVE_UPLOAD_TIMEOUT30Seconds allowed for the exit save upload.
BROKER_STATE_FILE_MAX_BYTES268435456Ceiling on one state file over the state-file routes (256 MiB). RomM caps the same transfer, so raising one end alone only moves which end refuses.
BROKER_STATE_SCREENSHOT_MAX_BYTES16777216Ceiling on the frame served with a state (16 MiB). Same two-sided cap.
BROKER_GAMEPAD_SLOTS4Number of virtual gamepad slots the room can assign.
BROKER_DEV_MODEunsettrue runs from mounted source with uvicorn and vite hot reload, and disables the exit save upload (report-only). See Dev mode.

Variables the image sets for the broker

These are written by the container's init scripts rather than by you, and are listed so their role is clear when reading logs.

Env varSet byPurpose
SELKIES_CONTROL_URLinit-romm-configBase URL of the selkies control plane, http://127.0.0.1:<CUSTOM_WS_PORT><SUBFOLDER>stream. The broker posts token maps to <url>/api/tokens, falling back to <url>/tokens. Unset, it tries 127.0.0.1:8082 and 8083 directly.
SELKIES_MASTER_TOKENinit-romm-configBearer token for those pushes. Generated per boot when not supplied.
XDG_RUNTIME_DIRbase imageWhere PCSX2's PINE socket is looked for (pcsx2.sock), default /config/.XDG.

Paths the launchers share

HOME inside the container is /config, and XDG_CONFIG_HOME / XDG_DATA_HOME are honoured where the emulator honours them. The per-launcher defaults on the next page all fall out of that, so none of them need setting unless the image layout changes.

On this page