# ═══════════════════════════════════════════════════════════════════════════════ # Mission Control — Environment Variables # ═══════════════════════════════════════════════════════════════════════════════ # Copy to .env and adjust for your deployment mode. # # IMPORTANT: NEXT_PUBLIC_* variables are baked into the client-side JavaScript # bundle at build time (pnpm build). If you change any NEXT_PUBLIC_* variable, # you MUST run `pnpm build` again for the change to take effect in the browser. # Server-side variables (OPENCLAW_*, AUTH_*, etc.) are read at runtime and do # not require a rebuild. # === Server Port === # PORT=3000 # ═══════════════════════════════════════════════════════════════════════════════ # Authentication # ═══════════════════════════════════════════════════════════════════════════════ # On first run, visit http://localhost:3000/setup to create your admin account. # Alternatively, set AUTH_USER/AUTH_PASS to seed an admin from env (useful for CI/automation). # AUTH_USER=admin # AUTH_PASS=your-strong-password-here # If your password includes "#", use base64: AUTH_PASS_B64= # API key for headless/external access (x-api-key header) # Auto-generated on first run if not set. Persisted to .data/.auto-generated. # API_KEY= # Auto-generated on first run if not set. Persisted to .data/.auto-generated. # AUTH_SECRET= MC_COOKIE_SECURE= MC_COOKIE_SAMESITE=strict # Network access control (production: blocked unless host is explicitly allowed) # Patterns: exact "app.example.com", subdomain "*.example.com", prefix "100.*" # MC_ALLOW_ANY_HOST= MC_ALLOWED_HOSTS=localhost,127.0.0.1,::1 # Set to 1 to skip probing local CLI binaries (claude, codex, hermes, ...) for # install/version/auth status. Useful for demo instances, screenshots, and CI # where the dashboard should not read tool versions off the host machine. # MC_DISABLE_RUNTIME_SCAN=1 # Trusted reverse proxy / header authentication # MC_PROXY_AUTH_HEADER=X-User-Email # MC_PROXY_AUTH_DEFAULT_ROLE=viewer # MC_PROXY_AUTH_TRUSTED_IPS=127.0.0.1,::1 # REQUIRED when MC_PROXY_AUTH_HEADER is set # Google OAuth (optional) GOOGLE_CLIENT_ID= NEXT_PUBLIC_GOOGLE_CLIENT_ID= # ═══════════════════════════════════════════════════════════════════════════════ # OpenClaw Gateway — Deployment Modes # ═══════════════════════════════════════════════════════════════════════════════ # # There are TWO sets of gateway variables: # # 1. OPENCLAW_GATEWAY_* — Server-side. MC backend uses these to reach the gateway. # 2. NEXT_PUBLIC_GATEWAY_* — Browser-side. The user's browser uses these for WebSocket. # # For local development, both point to the same machine (127.0.0.1). # For Docker or remote servers, they will differ. # ─── Local Development ──────────────────────────────────────────────────────── # Both MC and gateway run on the same machine. No special config needed. OPENCLAW_GATEWAY_HOST=127.0.0.1 OPENCLAW_GATEWAY_PORT=18789 # OPENCLAW_GATEWAY_TOKEN= NEXT_PUBLIC_GATEWAY_HOST= NEXT_PUBLIC_GATEWAY_PORT=18789 # ─── Docker ─────────────────────────────────────────────────────────────────── # MC runs in a container; gateway runs on the Docker host. # # Server-side: use host.docker.internal (auto-mapped to the host IP). # OPENCLAW_GATEWAY_HOST=host.docker.internal # OPENCLAW_GATEWAY_PORT=18789 # # Browser-side: leave NEXT_PUBLIC_GATEWAY_HOST empty — MC auto-detects the # browser's hostname (the IP/domain you use to access the dashboard). # Only set this if the gateway is on a different host than the dashboard. # NEXT_PUBLIC_GATEWAY_HOST= # NEXT_PUBLIC_GATEWAY_PORT=18789 # # If your gateway runs in another container on the same Docker network: # OPENCLAW_GATEWAY_HOST= # ─── Server / VPS ───────────────────────────────────────────────────────────── # MC and gateway run on a remote server. # # Server-side: gateway is on localhost (same machine) or a private IP. # OPENCLAW_GATEWAY_HOST=127.0.0.1 # # Browser-side: must be the public hostname your browser can reach. # If behind a reverse proxy (nginx/caddy) that proxies WebSocket on /gw: # NEXT_PUBLIC_GATEWAY_URL=wss://yourdomain.com/gw # If gateway port is directly exposed: # NEXT_PUBLIC_GATEWAY_HOST=yourdomain.com # NEXT_PUBLIC_GATEWAY_PORT=18789 # ─── Standalone (no gateway) ────────────────────────────────────────────────── # Run Mission Control without an OpenClaw gateway. # Core CRUD features work; live gateway events do not. # NEXT_PUBLIC_GATEWAY_OPTIONAL=true # ═══════════════════════════════════════════════════════════════════════════════ # OpenClaw Integration # ═══════════════════════════════════════════════════════════════════════════════ OPENCLAW_HOME= # OPENCLAW_CONFIG_PATH= OPENCLAW_TOOLS_PROFILE=coding NEXT_PUBLIC_GATEWAY_PROTOCOL= NEXT_PUBLIC_GATEWAY_URL= # When MC is accessed via HTTPS through a reverse proxy (nginx, Caddy, Tailscale # Serve, etc.) that also proxies the gateway WebSocket, set this to 1. This tells # the browser to use wss:// instead of ws:// for localhost connections, matching # the reverse proxy's TLS termination. # NEXT_PUBLIC_GATEWAY_REVERSE_PROXY=1 # Do not expose gateway tokens via NEXT_PUBLIC_* variables. NEXT_PUBLIC_GATEWAY_CLIENT_ID=openclaw-control-ui MC_DEFAULT_GATEWAY_NAME=primary MC_COORDINATOR_AGENT=coordinator NEXT_PUBLIC_COORDINATOR_AGENT=coordinator # ═══════════════════════════════════════════════════════════════════════════════ # Data Paths (all optional, defaults to .data/ in project root) # ═══════════════════════════════════════════════════════════════════════════════ # MISSION_CONTROL_DATA_DIR=.data # MISSION_CONTROL_TOKENS_PATH=.data/mission-control-tokens.json # ═══════════════════════════════════════════════════════════════════════════════ # OpenClaw Paths (derived from OPENCLAW_HOME if not set) # ═══════════════════════════════════════════════════════════════════════════════ # OPENCLAW_LOG_DIR=/path/to/.openclaw/logs # OPENCLAW_MEMORY_DIR=/path/to/.openclaw/memory # NOTE: Agent memory lives in each agent's workspace (e.g. ~/clawd-agents/{agent}/memory/). # OPENCLAW_MEMORY_DIR=/home/you/clawd-agents # OPENCLAW_SOUL_TEMPLATES_DIR=/path/to/.openclaw/templates/souls # OPENCLAW_BIN=openclaw # Remote runtime installer integrity (required for dashboard-triggered installs) # Fetch each installer through a trusted channel, review it, then record the # lowercase SHA-256 digest here. Mission Control fails closed if the digest is # absent or if the downloaded bytes change. # MC_ENABLE_RUNTIME_INSTALLS=1 # MC_OPENCLAW_INSTALLER_SHA256= # MC_HERMES_INSTALLER_SHA256= # Per-user installs from the super-admin organization flow are separately pinned: # MC_OPENCLAW_GIT_COMMIT= # MC_CLAUDE_CODE_VERSION= # MC_CODEX_VERSION= # ═══════════════════════════════════════════════════════════════════════════════ # 1Password Integration (optional) # ═══════════════════════════════════════════════════════════════════════════════ OP_VAULT_NAME=default # ═══════════════════════════════════════════════════════════════════════════════ # Super Admin / Provisioning (optional) # ═══════════════════════════════════════════════════════════════════════════════ # MISSION_CONTROL_REPO_ROOT=/path/to/mission-control # MC_SUPER_TEMPLATE_OPENCLAW_JSON=/path/to/openclaw.json # MC_TENANT_HOME_ROOT=/home # MC_TENANT_WORKSPACE_DIRNAME=workspace # ═══════════════════════════════════════════════════════════════════════════════ # Data Retention (days, 0 = keep forever) # ═══════════════════════════════════════════════════════════════════════════════ # MC_RETAIN_ACTIVITIES_DAYS=90 # MC_RETAIN_AUDIT_DAYS=365 # MC_RETAIN_LOGS_DAYS=30 # MC_RETAIN_NOTIFICATIONS_DAYS=60 # MC_RETAIN_PIPELINE_RUNS_DAYS=90 # MC_RETAIN_TOKEN_USAGE_DAYS=90