Environment mapping

September 3, 2026 · View on GitHub

Upstream's configuration surface is engine/.env.example — well over a hundred settings. xBot translates app settings into an environment block the container receives. The user never edits a file.

Every upstream variable is tagged expose, default, ignore, or deferred. Decisions live in apps/mac/Sources/XBotRuntime/EngineEnvironment.swift and this table.


Core container (M3)

Upstream variablexBot decisionSource
DATABASE_URLNot passed. Embedded Postgres generates a password on first bootContainer init
EMBEDDED_POSTGRESonHardcoded in EngineEnvironment.compose
PORT / SERVER_PORTNegotiated loopback port; both set identicallyPortAllocator + compose
KEY_ENCRYPTION_KEYGenerated per install → KeychainKeyEncryptionKeyStore
XBOT_ENGINE_TOKENGenerated per install → KeychainEngineTokenStore
OPENBOT_SINGLE_USERtrueHardcoded
TRUSTED_ORIGINSxbot://appHardcoded
OPENBOT_TOOL_URLBuilt from hostGatewayAddress() and portEngineEnvironment.compose
COMPUTER_MAX_BROWSERSFrom host RAM (8 GB → 1, 16 GB → 2, 32 GB+ → 4)EngineEnvironment.browserLimit
Container memory limitFrom host RAM (4–12 GB cap)EngineEnvironment.memoryLimitBytesContainerSpec
AUDIT_RETENTION_DAYSUnset (keep everything). Advanced setting laterOptional in Inputs
AGENT_COMPUTER_ALLOW_PRIVATE_HOSTSOff unless Advanced enables itOptional in Inputs

Intelligence (deferred for v1 local mode)

Upstream variablexBot decisionNotes
INTELLIGENCE_API_URLDeferred — all four unset selects local historyADR-0007; v1 may set all four for Intelligence mode
INTELLIGENCE_GATEWAY_WS_URLDeferredSame
INTELLIGENCE_API_KEYDeferredKeychain when exposed in onboarding
COPILOTKIT_LICENSE_TOKENDeferredTelemetry only upstream

Model providers (M2)

Upstream variablexBot decisionNotes
BOT_PROVIDERIgnore — replaced by per-agent model routerADR-0002
OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY, XAI_API_KEYIgnore at container levelKeys from Keychain via model router
OLLAMA_BASE_URLVia model selectionbaseURL on the agent uses hostGatewayAddress()App probes host; engine uses gateway URL

Auth / multi-user (ignore in v1)

Upstream variablexBot decision
BETTER_AUTH_*, OAuth client IDsIgnore — single-user + bearer token
INITIAL_ADMIN_EMAILSIgnore

Deployment / dev-only (ignore)

Upstream variablexBot decision
TENANT_PACKAGE_DIRIgnore — not used in single-container image
DEPLOYMENT_IDIgnore
OPENBOT_GENERATIVE_UIIgnore — off unless explicitly enabled later
NODE_ENVSet in Dockerfile (production)

Computer / browser (defaults)

Upstream variablexBot decision
COMPUTER_BROWSER_IDLE_MSDefault upstream — not overridden by app yet
COMPUTER_TOKEN, SUPERVISOR_TOKENInternal — generated inside container

Health / versioning (M3)

VariablexBot decision
XBOT_ENGINE_VERSIONSet at image build (scripts/build-engine-image.sh → Docker ARG)
/health responseParsed by HTTPEngineClient.health(); version shown in diagnostics

Volumes

Three named volumes per RuntimeController: xbot-data (Postgres + audit), xbot-workspace, xbot-profiles (browser profiles). See docs/07-container-runtime.md.

When upstream adds a new .env setting, add a row here before merging the fork bump.