Skip to main content

Configuration

For the Shellui multi-service stack (shellui/shellui/dev), see Local dev stack for compose service name ai, host port 8006, internal URLs (http://identity:8000, …), and public issuers (http://localhost:8001, http://localhost:8006).

Required in production (DEBUG=false)​

VariableNotes
DEBUGMust be false in production
SECRET_KEYDjango sessions and CSRF
ALLOWED_HOSTSComma-separated hostnames
CSRF_TRUSTED_ORIGINSHTTPS origins for admin
IDENTITY_SERVICE_URLidentity origin; JWKS at {url}/.well-known/jwks.json when not pinned
IDENTITY_ISSUERJWT iss from identity. Protected-resource authorization_servers is this value (Identity metadata issuer), not IDENTITY_SERVICE_URL when the two differ
IDENTITY_AUDIENCETypically shellui
IDENTITY_JWKSPin JWKS JSON in production
IDENTITY_JWKS_FILEOr pin JWKS file path
IDENTITY_JWKS_URLFetch URL for dev
REDIS_URLShared cache for MCP gateway
POSTGRES_DATABASE_URLOptional; SQLite when empty
AI_SERVICE_SIGNING_KEYRSA PEM for RS256 delegation JWTs to identity (or AI_SERVICE_SIGNING_KEY_FILE)
AI_SERVICE_SIGNING_KIDJWKS kid (python manage.py generate_signing_key)
AI_SERVICE_ISSUERJWT iss on those requests; defaults to the first https:// entry in CSRF_TRUSTED_ORIGINS
AI_PUBLIC_URLPublic origin of the gateway; the MCP resource is {AI_PUBLIC_URL}/c/<company_id>/mcp. Defaults to AI_SERVICE_ISSUER

Identity verifies delegation requests with AI_SERVICE_JWKS / AI_SERVICE_JWKS_URL (default {AI_SERVICE_URL}/.well-known/jwks.json). This service publishes its public key at GET /.well-known/jwks.json.

MCP gateway​

VariableDefault
MCP_GATEWAY_TOOLS_CACHE_TTL_SECONDS30
MCP_TOOLS_LIST_MODEdiscovery. discovery returns the short search catalog. all returns every operational tool.
MCP_GATEWAY_DOWNSTREAM_TIMEOUT_SECONDS5
MCP_RATE_LIMIT_AGENT120
MCP_APPROVAL_ASSERTION_MAX_LIFETIME_SECONDS900
MCP_APPROVAL_SETUP_SESSION_TTL_MIN_SECONDS600
MCP_APPROVAL_SETUP_SESSION_TTL_MAX_SECONDS900
MCP_APPROVAL_CHANNEL_BY_COMPANYempty
MCP_APPROVAL_FORM_ELICITATION_WAIT_SECONDS90
MCP_CALL_LOG_RETENTION_DAYS90

setup_flow assertions and session grants always require absolute setup_expires_at (token + session-check response when setup) and absolute expires_at on the session-check response; there are no toggles.

Downstream services​

VariableDefault
STORAGE_SERVICE_URLempty
HOSTING_SERVICE_URLempty
EMAIL_SERVICE_URLhttps://email.shellui.com
EMAIL_SERVICE_API_KEYempty
SAAS_SERVICE_URLempty
STORAGE_SERVICE_PUBLIC_URLsame as STORAGE_SERVICE_URL
HOSTING_SERVICE_PUBLIC_URLsame as HOSTING_SERVICE_URL
EMAIL_SERVICE_PUBLIC_URLsame as EMAIL_SERVICE_URL
SAAS_SERVICE_PUBLIC_URLsame as SAAS_SERVICE_URL

The gateway calls each service at {*_SERVICE_URL}/mcp, and asks identity for a token bound to the public resource {*_SERVICE_PUBLIC_URL}/mcp (identity uses IDENTITY_ISSUER). Identity only mints tokens for resources in its catalog, so set the public URLs whenever the service URLs are internal. A URL that is not configured never gets a token.

JWKS tuning​

VariableDefault
JWKS_CACHE_TTL900
JWKS_TIMEOUT15
JWKS_RETRIES2
JWT_ALGORITHMSRS256
JWT_HS256_FALLBACK_SECRETempty
ALLOW_JWT_HS256_FALLBACKfalse

Docker Compose​

VariableDefault
AI_SERVICE_PORT8006

Runtime​

VariableDefault
LOG_LEVELINFO
DJANGO_ADMIN_ENABLEDtrue
SETUP_TOKENempty
SQLITE_PATHdb.sqlite3
POSTGRES_SSL_REQUIREtrue
CORS_ALLOW_ALL_ORIGINStrue
CORS_ALLOW_CREDENTIALSfalse
CORS_ALLOWED_ORIGINSempty
CORS_ALLOW_PRIVATE_NETWORKtrue
SECURE_SSL_REDIRECTtrue
SECURE_HSTS_SECONDS31536000
SECURE_HSTS_INCLUDE_SUBDOMAINStrue
SECURE_HSTS_PRELOADfalse
SESSION_COOKIE_SECUREtrue
CSRF_COOKIE_SECUREtrue
SENTRY_DSNempty
SENTRY_ENVIRONMENTproduction
SENTRY_RELEASEempty
SENTRY_TRACES_SAMPLE_RATE0
GUNICORN_WORKERS2
GUNICORN_THREADS2
GUNICORN_TIMEOUT120
GUNICORN_GRACEFUL_TIMEOUT30
GUNICORN_KEEP_ALIVE75
GUNICORN_MAX_REQUESTS1000
GUNICORN_MAX_REQUESTS_JITTER200
EMAIL_SERVICE_ALLOW_PRIVATEfalse