Mango reads its configuration from environment variables (and the deployment’s config file). The canonical engineering reference is generated from the source; this page groups the levers that matter operationally.
Variable Purpose
MANGO_HOST / MANGO_PORTBind address and port (default loopback posture)
MANGO_ENV / MANGO_DEPLOYMENT_MODEEnvironment and deployment posture (production refuses unsafe defaults)
MANGO_DOMAIN / MANGO_COOKIE_DOMAIN / MANGO_COOKIE_SECURECookie scope and security
MANGO_ALLOWED_HOSTSHost allowlist
MANGO_TRUSTED_PROXIESCIDRs allowed to set X-Forwarded-For / X-Real-IP (default loopback)
MANGO_CORS_ALLOWED_ORIGINSConsole origins
Variable Purpose
MANGO_DB_URLFull DSN (SQLite or PostgreSQL)
MANGO_DB_HOST / MANGO_DB_PORT / MANGO_DB_NAME / MANGO_DB_USER / MANGO_DB_PASSWORDDiscrete PG connection fields
MANGO_ALLOW_SCHEMA_AHEADPermits a schema newer than the code (explicit, loud)
Mango migrations run at boot through the migration runner. A failed or ahead schema refuses readiness unless explicitly acknowledged.
Variable Purpose
MANGO_ENABLE_TOKEN_AUTH / MANGO_ENABLE_RBAC / MANGO_REQUIRE_AUTHMaster auth switches
MANGO_SESSION_TTLSession lifetime
MANGO_SERVICE_TOKENStatic service token (bootstrap; prefer minted service tokens)
MANGO_SERVICE_TOKEN_TTL_SECONDSMinted service-token TTL (default 7d, clamped)
MANGO_MAX_LIVE_SERVICE_TOKENS_PER_USERLive-token cap (default 20; oldest evicted with journal rows)
MANGO_ALLOW_ANONYMOUS_ADMINNever enable in production
MANGO_BCRYPT_COSTPassword hash cost
Variable Purpose
MANGO_GLOBAL_RATE_LIMIT / MANGO_LOGIN_RATE_LIMIT / MANGO_ACCOUNT_RATE_LIMITGlobal, login, and per-account buckets
MANGO_VALIDATE_RATE_LIMIT / MANGO_VALIDATE_INVALID_RATE_LIMITToken validation buckets
MANGO_SERVICE_TOKEN_RATE_LIMIT / MANGO_PASSWORD_CHANGE_RATE_LIMIT / MANGO_LOOPBACK_RATE_LIMITPer-surface buckets
MANGO_DISABLE_RATE_LIMIT / MANGO_ALLOW_DISABLED_RATE_LIMITExplicit disable + ack
Variable Purpose
MANGO_AUDIT_CHAIN_SECRETHMAC chain key (random per-process + CRITICAL if unset with auth on)
MANGO_AUDIT_CHAIN_PRIOR_SECRETSPrior keys for verification across rotation
MANGO_AUDIT_ARCHIVE_SECRETShared secret for POST /api/mango/audit-archive
MANGO_AUDIT_ARCHIVE_REQUIRE_V2 / MANGO_AUDIT_ARCHIVE_ALLOW_V1Archive wire version posture
MANGO_REVOCATION_CHAIN_SECRETRevocation-journal chain
MANGO_BRIDGE_HMAC_SECRET / MANGO_BRIDGE_TS_WINDOW_MSSol bridge wire HMAC + freshness
MANGO_ZMQ_PUB_URL / MANGO_ZMQ_PULL_URL / MANGO_ZMQ_ALLOW_NONLOOPBACKEvent bridge transport
Variable Purpose
MANGO_LDAP_ENABLEDEnable directory federation
MANGO_LDAP_CIRCUIT_OPEN_MSOutage circuit
MANGO_LDAP_ALLOW_ACCOUNT_OVERRIDE / MANGO_LDAP_ALLOW_LOCAL_HASH_FALLBACKExplicit fallback levers
MANGO_LDAP_REVALIDATION_DRY_RUNReport-only revalidation
Variable Purpose
MANGO_ENABLE_METRICS / MANGO_METRICS_EXPOSEMetrics on/off and scrape surface
MANGO_METRICS_READ_TOKENBearer for the metrics surface
Non-loopback plaintext Mango is refused in production; terminate TLS in front of Mango and point Sol’s verified client at it.
A non-dict JSON body is 400 before auth.
MANGO_ALLOW_GLOBAL_TRUST and the anonymous-admin lever are ack-gated and CRITICAL-logged.
The full source of truth is mango/mango/conf.py; this page is the operator-oriented projection.
Mango HTTP API
Authentication flow
Configuration reference
Security model