Skip to content

Environment Variables

This page provides a complete reference of Rack Gateway environment variables. For a shorter overview, see Configuration.

VariableDefaultDescription
PORT8080TCP port the API listens on
DOMAIN(required)Gateway domain for OAuth redirect URLs
DEV_MODEfalseEnables development-friendly behavior
APP_SECRET_KEY(required)Secret for sessions and CSRF
COOKIE_SECUREtrueSet the Secure cookie attribute
TRUSTED_PROXY_CIDRSComma-separated proxy CIDRs
LOG_LEVELinfoLog level (debug, info, warn, error)
DEBUG_TOPICSComma-separated debug topics
VariableDefaultDescription
GOOGLE_CLIENT_ID(required)OAuth client ID
GOOGLE_CLIENT_SECRET(required)OAuth client secret
GOOGLE_ALLOWED_DOMAIN(required)Allowed email domain
GOOGLE_OAUTH_BASE_URLhttps://accounts.google.comOAuth issuer URL
VariableDescription
ADMIN_USERSComma-separated admin emails
VIEWER_USERSComma-separated viewer emails
DEPLOYER_USERSComma-separated deployer emails
OPERATIONS_USERSComma-separated ops emails
VariableDefaultDescription
RACK_HOSTConvox rack API URL
RACK_TOKENConvox rack API token
RACK_USERNAMEconvoxBasic auth username
RACKdefaultRack name (internal identifier)
RACK_ALIASRACKShort alias (user-facing)
RACK_DISPLAY_NAMERACK_ALIASHuman-friendly display name
ENABLE_RACK_TLS_PINNINGfalseEnable rack TLS pinning
VariableDescription
RGW_DATABASE_URLPreferred Postgres URL
GATEWAY_DATABASE_URLAlternate Postgres URL
DATABASE_URLAlternate Postgres URL
ADMIN_DATABASE_URLAdmin URL for migrations/reset
PGHOST / PGPORT / PGUSER / PGPASSWORD / PGDATABASElibpq connection fields
PGSSLMODESSL mode override
VariableDefaultDescription
DB_MAX_OPEN_CONNS25Max open connections
DB_MAX_IDLE_CONNS5Max idle connections
DB_CONN_MAX_LIFETIME30mConnection lifetime
DB_CONN_MAX_IDLE_TIME10mIdle timeout
VariableDescription
TEST_DATABASE_URLOverride database URL for tests
VariableDescription
YUBICO_CLIENT_IDYubiKey OTP client ID
YUBICO_SECRET_KEYYubiKey OTP secret
WEBAUTHN_RP_IDWebAuthn RPID
WEBAUTHN_ORIGINWebAuthn origin

Settings resolve in this order: DB value → env var → default.

VariableDescription
RGW_SETTING_SESSION_TIMEOUT_MINUTESBrowser session inactivity timeout
RGW_SETTING_MFA_REQUIRE_ALL_USERSRequire MFA for all users
RGW_SETTING_MFA_STEP_UP_WINDOW_MINUTESStep-up window
RGW_SETTING_MFA_TRUSTED_DEVICE_TTL_DAYSTrusted device TTL
RGW_SETTING_DEPLOY_APPROVALS_ENABLEDEnable deploy approvals
RGW_SETTING_DEPLOY_APPROVAL_WINDOW_MINUTESApproval window
RGW_SETTING_ALLOW_DESTRUCTIVE_ACTIONSAllow destructive actions
RGW_SETTING_DEFAULT_CI_PROVIDERDefault CI provider
RGW_SETTING_DEFAULT_VCS_PROVIDERDefault VCS provider

Per-app overrides use:

RGW_APP_<APP>_SETTING_<KEY>=value

Example:

RGW_APP_MYAPP_SETTING_CI_PROVIDER=circleci

See Deploy Approvals for common keys.

VariableDefaultDescription
AUDIT_HMAC_SECRET(required in prod)HMAC chain secret
AUDIT_ANCHOR_BUCKETS3 bucket for anchors
AUDIT_ANCHOR_CHAIN_IDChain identifier
AUDIT_ANCHOR_RETENTION_DAYS400Object Lock retention
AUDIT_ANCHOR_INTERVAL_MINUTES60Anchor interval
AWS_ENDPOINT_URL_S3Custom S3 endpoint
AWS_ACCESS_KEY_IDAWS access key
AWS_SECRET_ACCESS_KEYAWS secret key
AWS_REGIONus-east-1AWS region
VariableDefaultDescription
POSTMARK_API_TOKENPostmark API token
POSTMARK_FROMno-reply@{domain}Sender
POSTMARK_STREAMoutboundMessage stream
POSTMARK_API_BASEhttps://api.postmarkapp.comAPI base
DEV_EMAIL_LOGfalseLog emails in dev
VariableDescription
SLACK_CLIENT_IDSlack OAuth client ID
SLACK_CLIENT_SECRETSlack OAuth client secret
GITHUB_TOKENGitHub token for deploy approvals
CIRCLECI_TOKENCircleCI token for deploy approvals
VariableDefaultDescription
SENTRY_DSNBackend DSN
SENTRY_ENVIRONMENTEnvironment name
SENTRY_RELEASERelease tag
SENTRY_JS_DSNFrontend DSN
SENTRY_JS_TRACES_SAMPLE_RATE0Frontend perf rate
ENABLE_SENTRY_TEST_BUTTONSfalseShow test UI
VariableDescription
RACK_GATEWAY_RACKDefault rack name
RACK_GATEWAY_URLOverride gateway URL
RACK_GATEWAY_API_TOKENAPI token for automation
GATEWAY_CLI_CONFIG_DIROverride CLI config dir
VariableDescription
CONVOX_SECRET_ENV_VARSComma-separated env vars to redact

Ports are defined in mise.toml:

VariableDefaultDescription
GATEWAY_PORT8447Gateway API port (dev)
WEB_PORT5223Web dev server
MOCK_OAUTH_PORT3345Mock OAuth
MOCK_CONVOX_PORT5443Mock Convox
TEST_GATEWAY_PORT9447Test gateway
TEST_MOCK_OAUTH_PORT9345Test OAuth
TEST_MOCK_CONVOX_PORT6443Test Convox