Skip to content

Configuration

RedCloud is configured through environment variables (a .env file in Compose, or a Secret in Kubernetes). In production the platform enforces a fail-fast policy: if a required secret is missing or an insecure setting is detected, the backend refuses to start. This page lists the variables and the exact conditions that block a boot.

VariablePurposeRequiredDefault
ENVIRONMENTproduction or developmentNoproduction
PORTBackend port (Cloud Run injects its own)No9900
LICENSE_PORTLicense server portNo7700
DATABASE_URLPostgreSQL DSNYes (prod)local dev DSN
DB_PASSWORDCompose database passwordYes (Compose)
TIMEZONEScheduler timezoneNoAsia/Jerusalem
VariablePurposeBlocks boot if…
HMAC_KEYSigns JWTs / tokensunset in production
API_KEYGlobal API authenticationunset in production
ENCRYPTION_KEYEncrypts config / data at restunset in production (no silent fallback)
STORAGE_MODEstrict / migration / compatset to compat/unknown in production
FRONTEND_ORIGINSCORS allowlist (CSV)(warning only; falls back to dev origins if unset)
RATE_LIMITGlobal API rate limit— (default 60/minute)

Generate secrets:

Terminal window
# HMAC_KEY / API_KEY / ENCRYPTION_KEY
python -c "import secrets; print(secrets.token_hex(32))"
VariablePurposeDefault
BREAK_GLASS_ENABLEDEnables break-glass accessfalse
MASTER_KEY / MASTER_KEY_FILEThe break-glass key (python -m api.master_key)
BREAK_GLASS_TTLSession TTL in seconds1800

If BREAK_GLASS_ENABLED=true without a MASTER_KEY, the boot is blocked. Break-glass grants a scoped permission set, is rate-limited and fully audited, and never bypasses tenant isolation.

VariablePurpose
LICENSE_KEYCustomer key (RC-...)
LICENSE_SERVER_URLMust be HTTPS in production
REDCLOUD_LICENSE_SECRETShared secret; must match the license server (missing logs a critical warning)

Google OAuth (GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET), SAML, 2FA (TOTP_ISSUER), and Google Cloud IAP:

VariableDefault
IAP_AUTH_ENABLEDfalse
IAP_EXPECTED_AUDIENCE— (/projects/<num>/global/backendServices/<id>)
IAP_ALLOWED_DOMAINS— (CSV, optional)
IAP_AUTO_PROVISION_ENABLEDfalse

AI_PROVIDER (one of anthropic, openai, gemini, vertex, xai, mistral, deepseek, ollama), AI_API_KEY, AI_MODEL, multi-provider AI_PROVIDERS (JSON), AI_FALLBACK_ORDER, and AI_BUDGET_MAX_USD. Vertex AI uses VERTEX_ENABLED, VERTEX_PROJECT_ID, VERTEX_REGION, and Workload Identity.

In production, any of the following blocks startup (the backend raises and exits):

  1. HMAC_KEY not set.
  2. API_KEY not set.
  3. ENCRYPTION_KEY not set (no silent fallback).
  4. REDCLOUD_DEV_MODE=true.
  5. STORAGE_MODE is compat or unknown (must be strict or migration).
  6. BREAK_GLASS_ENABLED=true without a MASTER_KEY.
  7. Any tenant-bypass flag is true (BYPASS_TENANT_CHECKS, TENANT_ISOLATION_DISABLED, TENANT_MIGRATION_MODE, DISABLE_TENANT_CHECK, DISABLE_TENANT_ISOLATION).
  8. A critical secret-validation issue (e.g. a weak/short key or a default DB_PASSWORD).
  9. The database is unreachable (a SELECT 1 probe runs before the gate).
  • Dev mode requires both ENVIRONMENT=development and REDCLOUD_DEV_MODE=true; it can never be enabled in production.
  • Database tables are created idempotently at startup; there is no separate migration step for the core schema.