Skip to content

Configuration Reference

Complete environment variable reference for all QS-Bridge services.


SpacetimeDB

Variable Default Required Description
SPACETIMEDB_LOG info No Log level (error, warn, info, debug, trace)
SPACETIMEDB_DATA_DIR ~/.spacetimedb No Data directory for databases
SPACETIMEDB_LISTEN_ADDR 0.0.0.0:3000 No Bind address and port

API Gateway (panel/api)

Variable Default Required Description
GATEWAY_PORT 3081 No Port the gateway listens on
GATEWAY_URL Public URL of the panel (e.g., https://panel.qs-zuq.com). Used for Steam OpenID return URL
JWT_SECRET 64-character secret for HS256 JWT signing. Generate with openssl rand -hex 32
JWT_EXPIRY 8h No Session duration
STDB_HOST ws://localhost:3000 SpacetimeDB WebSocket endpoint
STDB_TOKEN SpacetimeDB authentication token. Get with spacetime identity token
STDB_MODULE qs-bridge No SpacetimeDB module name
BISECT_API_KEY No BisectHosting Starbase API key. Required for server lifecycle controls
BISECT_API_URL https://api.bisecthosting.com/v1 No BisectHosting API base URL
RATE_LIMIT_WINDOW 60 No Seconds between lifecycle actions per server
LOG_LEVEL info No Gateway log level

Panel Build (panel/ui)

These are build-time variables, embedded via import.meta.env:

Variable Default Required Description
VITE_API_URL /api No API gateway base URL (relative or absolute)
VITE_STDB_HOST ws://localhost:3000 SpacetimeDB WebSocket endpoint for subscriptions
VITE_STDB_MODULE qs-bridge No SpacetimeDB module name
VITE_APP_TITLE QS-Bridge No Browser tab title

Bridge (libqsbridge.so)

Variable Default Required Description
QSB_SERVER_ID Unique identifier for this game server (e.g., server-01)
QSB_STDB_HOST ws://localhost:3000 SpacetimeDB WebSocket endpoint
QSB_STDB_MODULE qs-bridge SpacetimeDB module name
QSB_HMAC_SECRET Shared secret for HMAC-SHA256 reducer signing
QSB_HOSTING_ID No BisectHosting server UUID (for lifecycle API)
QSB_HEARTBEAT_INTERVAL 30 No Seconds between heartbeat reducer calls
QSB_LOG_LEVEL info No Bridge log level (error, warn, info, debug, trace)
QSB_GAME_MODULE No Game module name (auto-detected from loaded .so)

Wiki.js (wiki/)

Variable Default Required Description
WIKI_DB_HOST wiki-db No PostgreSQL host
WIKI_DB_PORT 5432 No PostgreSQL port
WIKI_DB_NAME wiki No Database name
WIKI_DB_USER wiki No Database user
WIKI_DB_PASS Database password
WIKI_API_KEY Wiki.js GraphQL API key (for seed/theme scripts)
WIKI_URL https://wiki.qs-zuq.com No Public wiki URL

Mod Registry (registry/)

Variable Default Required Description
REGISTRY_STDB_HOST ws://localhost:3000 SpacetimeDB endpoint
REGISTRY_STDB_MODULE qs-mod-registry No Registry STDB module name
MINIO_ENDPOINT localhost:9000 MinIO S3-compatible endpoint
MINIO_ACCESS_KEY MinIO access key
MINIO_SECRET_KEY MinIO secret key
MINIO_BUCKET qs-mods No Bucket for mod file storage
REGISTRY_UPLOAD_MAX_MB 500 No Maximum upload size per mod version

Secret Generation

# JWT secret (64 hex characters = 256 bits)
openssl rand -hex 32

# HMAC shared secret
openssl rand -hex 32

# Database password
openssl rand -base64 24

# Wiki API key (generate via Wiki.js admin panel)
# Admin → API Access → Create API Key

Example .env Files

API Gateway

# panel/api/.env
GATEWAY_PORT=3081
GATEWAY_URL=https://panel.qs-zuq.com
JWT_SECRET=a1b2c3d4e5f6...  # 64 hex chars
STDB_HOST=ws://localhost:3000
STDB_TOKEN=eyJhbGciOi...     # spacetime identity token
BISECT_API_KEY=bh_live_...    # optional

Bridge (per game server)

# /opt/qs-bridge/bridge.env
QSB_SERVER_ID=server-01
QSB_STDB_HOST=ws://10.0.0.1:3000
QSB_STDB_MODULE=qs-bridge
QSB_HMAC_SECRET=d4e5f6a7b8c9...
QSB_HOSTING_ID=a1b2c3d4-e5f6-7890-abcd-ef1234567890