Skip to main content

Configuration reference

Keys live under [riverbase] in riverbase.toml (or at the file root). Environment variables win over the file. See Configuration for loading rules.

Service​

KeyEnvDefaultMeaning
db_urlRIVERBASE_DB_URL, DB_URLplaceholderPostgres DSN
bind_addrRIVERBASE_BIND_ADDR0.0.0.0:8080Listen address
api_baseRIVERBASE_API_BASE/apiPrefix for every framework route
api_zoneRIVERBASE_API_ZONE (comma-separated)[]Register only routes allowed in these zones
service_modeRIVERBASE_SERVICE_MODEcoupledcoupled or split (informational)
deny_unknown_fieldsRIVERBASE_DENY_UNKNOWN_FIELDSfalseReject undeclared command payload properties
request_body_max_bytesRIVERBASE_REQUEST_BODY_MAX_BYTES262144 (256 KiB)JSON body limit
request_upload_max_bytesRIVERBASE_REQUEST_UPLOAD_MAX_BYTES20971520 (20 MiB)Multipart upload limit
rtc_wire_encodingRIVERBASE_RTC_WIRE_ENCODINGjsonDefault WebSocket codec

The split example binaries read RIVERBASE_COMMAND_BIND_ADDR (default :8081) and RIVERBASE_QUERY_BIND_ADDR (default :8082) themselves; follow the same pattern in your own split binaries.

Logging​

KeyEnvDefaultMeaning
log_levelRIVERBASE_LOG_LEVELinfoTracing filter; RUST_LOG overrides
log_formatRIVERBASE_LOG_FORMATcompactcompact, pretty, or json
log_http_requestsRIVERBASE_LOG_HTTP_REQUESTSfalseOne line per request

Database pool and queries​

KeyEnvDefault
dbpool_max_sizeRIVERBASE_DBPOOL_MAX_SIZE32 (clamped 1–128)
dbpool_acquire_timeout_secsRIVERBASE_DBPOOL_ACQUIRE_TIMEOUT_SECS30
dbpool_max_lifetime_secsRIVERBASE_DBPOOL_MAX_LIFETIME_SECS1800
database_statement_timeout_msRIVERBASE_DATABASE_STATEMENT_TIMEOUT_MS60000
query_max_limit500 (largest page size)
query_count_max_rows10000 (cap for exact counts)

Tenancy​

KeyEnvDefaultMeaning
tenantRIVERBASE_TENANT (alias RIVERBASE_REALM)emptyDeployment tenant: a UUID, or a name hashed to a UUID
tenant_access_policyRIVERBASE_TENANT_ACCESS_POLICYprofile-organizationWho may see which _tenant
tenant_stamp_policyRIVERBASE_TENANT_STAMP_POLICYprofile-organizationWhat new rows are stamped with

See Multi-tenancy.

[riverbase.audit_log]​

KeyEnvDefault
contextRIVERBASE_AUDIT_LOG_CONTEXTtrue
commandRIVERBASE_AUDIT_LOG_COMMANDtrue
eventRIVERBASE_AUDIT_LOG_EVENTtrue
messageRIVERBASE_AUDIT_LOG_MESSAGEtrue
activityRIVERBASE_AUDIT_LOG_ACTIVITYtrue
responseRIVERBASE_AUDIT_LOG_RESPONSEtrue
queryRIVERBASE_AUDIT_LOG_QUERYfalse
idempotencytrue

[riverbase.bus]​

KeyEnvDefault
urlRIVERBASE_BUS_URL, BUS_URLnats://127.0.0.1:4222
kindinferred from the URL scheme (nats, redis, postgres)

[riverbase.auth]​

KeyEnvMeaning
auth_providerRIVERBASE_AUTH_PROVIDERNone, MockAuth, or Keycloak (oidc)
issuerRIVERBASE_AUTH_ISSUER, RIVERBASE_OIDC_ISSUERToken issuer
audienceRIVERBASE_OIDC_AUDIENCEExpected aud
accepted_azpAccepted authorized parties; must be non-empty in production
jwks_ttl_secs, leeway_secs, http_timeout_secsJWKS caching and clock tolerance
keycloak_base_url, keycloak_realmRIVERBASE_AUTH_KEYCLOAK_REALMKeycloak location
oauth2_client_id, oauth2_client_secretRIVERBASE_AUTH_OAUTH2_CLIENT_ID, RIVERBASE_AUTH_OAUTH2_CLIENT_SECRETOAuth2 client
application_secret_keySession signing key; no default
session_cookie, cookie_https_only, cookie_same_site, validate_csrf_tokenCookie and CSRF settings
default_callback_uri, default_signin_redirect_uri, default_logout_redirect_uri, safe_redirect_domainsRedirects
create_initial_profileRIVERBASE_AUTH_CREATE_INITIAL_PROFILECreate a profile on first sign-in
require_realm_roleRealm role a user must have
mock_*, [[riverbase.auth.mock_users]]MockAuth identities

RIVERBASE_AUTH_ENABLED and RIVERBASE_AUTH_DISABLED=1 switch auth explicitly. RIVERBASE_OIDC_DISCOVERY_URL overrides OIDC discovery.

[riverbase.casbin]​

KeyEnvDefault
enabledRIVERBASE_CASBIN_ENABLEDfalse
omit_inaccessible_openapiRIVERBASE_CASBIN_OMIT_INACCESSIBLE_OPENAPIfalse
modelempty: the framework default model
policyempty: deny everything

[riverbase.media]​

KeyEnv
protocolRIVERBASE_MEDIA_PROTOCOL (fs, s3, http)
fs_rootRIVERBASE_MEDIA_FS_ROOT
fskeyRIVERBASE_MEDIA_FSKEY
root_pathRIVERBASE_MEDIA_ROOT_PATH
params.bucket, params.region, params.endpointRIVERBASE_MEDIA_BUCKET, RIVERBASE_MEDIA_REGION, RIVERBASE_MEDIA_ENDPOINT
access keysRIVERBASE_MEDIA_ACCESS_KEY_ID, RIVERBASE_MEDIA_SECRET_ACCESS_KEY
virtual-host-style S3 addressingRIVERBASE_MEDIA_ENABLE_VIRTUAL_HOST_STYLE

Signed tokens​

SectionEnv
[riverbase.link_token]RIVERBASE_LINK_TOKEN_SECRET, RIVERBASE_LINK_TOKEN_SALT
[riverbase.hook_token]RIVERBASE_HOOK_TOKEN_SECRET, RIVERBASE_HOOK_TOKEN_SALT

Process-level variables​

EnvMeaning
RIVERBASE_CONFIGPath to the config file
RIVERBASE_CONFIG_URI, RIVERBASE_CONFIG_FORMAT, RIVERBASE_CONFIG_SOPSRemote config (cfgfetch features)
RIVERBASE_CONFIG_HTTP_TOKEN, RIVERBASE_CONFIG_GIT_TOKEN, RIVERBASE_CONFIG_GIT_RAW_TEMPLATE, RIVERBASE_CONFIG_OCI_TOKENRemote config credentials
RIVERBASE_DEBUGVerbosity only
RIVERBASE_INSECURE_ALLOWComma-separated startup checks to waive
RIVERBASE_FORM_DB_URLDedicated database for riverbase_form