Skip to content

Configuration

Rack Gateway is configured primarily through environment variables. This section covers all configuration options grouped by concern.

Rack Gateway uses mise for environment variable management:

  • mise.toml - Project defaults (committed to git)
  • mise.local.toml - Local overrides (gitignored)

For production deployment, you must configure:

mise.local.toml
[env]
GOOGLE_CLIENT_ID = "your-client-id.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET = "your-client-secret"
GOOGLE_ALLOWED_DOMAIN = "your-company.com"

See OAuth Setup for detailed instructions.

[env]
DATABASE_URL = "postgres://user:pass@host:5432/rack_gateway?sslmode=require"

Or, without DATABASE_URL, the standard libpq variables:

[env]
PGHOST = "your-db-host"
PGPORT = "5432"
PGUSER = "rack_gateway"
PGPASSWORD = "your-password"
PGDATABASE = "rack_gateway"
[env]
APP_SECRET_KEY = "your-32-byte-random-key" # Generate with: openssl rand -hex 32
COLUMN_ENCRYPTION_KEY = "your-column-key" # Generate once with: openssl rand -base64 32

COLUMN_ENCRYPTION_KEY encrypts stored TOTP seeds and the Slack token, so keep it and back it up. See Column Encryption.

[env]
RACK_HOST = "https://api.rack.convox.cloud"
RACK_TOKEN = "your-rack-api-token"
RACK_ALIAS = "production"
CategoryPurpose
Environment VariablesComplete reference of all options
OAuth SetupGoogle Workspace authentication
SessionsSession timeout and policies
SettingsMFA enforcement, timeouts, destructive actions, deploy approvals
Security HardeningProduction security configuration
EmailPostmark email configuration

Development mode (DEV_MODE=true) only exists in builds compiled with the testbypass Go build tag, which task dev and the Docker development and E2E stacks use. In development mode, Rack Gateway:

  • Uses non-secure cookies (no HTTPS required)
  • Auto-generates APP_SECRET_KEY if missing (COLUMN_ENCRYPTION_KEY is never generated: it is required in every mode)
  • Runs database migrations on startup (production never does: run rack-gateway-api migrate)
  • Logs emails to stdout instead of sending them, unless POSTMARK_API_TOKEN is set
  • Connects to mock services on localhost

The published Docker image is built without the tag, and refuses to start with DEV_MODE or any other test bypass set.

For production, run the published image (or an image built with task docker), serve it over HTTPS (cookies are always Secure), and set:

  • APP_SECRET_KEY (secure random value)
  • COLUMN_ENCRYPTION_KEY (generated once and backed up)
  • AUDIT_HMAC_SECRET (secure random value)
  • OAuth credentials (real Google Workspace)
  • DOMAIN (the gateway’s hostname)
  • Database URL (real PostgreSQL)
  • Rack credentials (real Convox rack)

Some settings can be configured via the web admin UI and stored in the database:

SettingEnvironment VariableDatabase Setting
Session timeoutRGW_SETTING_SESSION_TIMEOUT_MINUTESsession_timeout_minutes
Require MFARGW_SETTING_MFA_REQUIRE_ALL_USERSmfa_require_all_users
Step-up windowRGW_SETTING_MFA_STEP_UP_WINDOW_MINUTESmfa_step_up_window_minutes
Trusted device TTLRGW_SETTING_MFA_TRUSTED_DEVICE_TTL_DAYSmfa_trusted_device_ttl_days

Precedence: An environment variable takes priority over the database, and makes the setting read-only in the UI.