Reference Security & env

Security, Env & Troubleshooting

Language: English · 简体中文

Single-Operator Threat Model

CrewDesk is built strictly for a single-operator, local / self-hosted setup. Web login, the BFF proxy, and the backend share one operator identity — there is no multi-tenant isolation. Do not expose CrewDesk directly to the public internet as a shared multi-user service.

Full specification: Security Model.

Runtime Boundaries Enforced in Code

  1. Localhost binding: backend (:3000) and web (:3001) bind to 127.0.0.1 by default.
  2. Worker repo & branch isolation: isolated git copies, project_push restricted to agent/<runId>, plus deny_write_paths & deny_commands.
  3. Sandboxed workflow scripts: disabled by default (WORKFLOW_SCRIPTS_ENABLED=1 required); runs in bubblewrap / sandbox-exec with no network, isolated PID namespace, and no read access to dataDir or .env.
  4. Fail-closed HITL: approvals and questions persist in pending_action; timeout = deny.
  5. Server-side secret masking: provider keys and MCP auth headers stay on the backend and are masked on every HTTP read.
  6. Provider config isolation: child processes read model configs strictly from $OMA_HOME/models.yml.
  7. HTML artifact sandboxing: HTML previews render inside <iframe sandbox="allow-scripts"> without allow-same-origin.

Key Environment Variables

VariableWherePurpose
BACKEND_AUTH_TOKENBackend + Web .envShared bearer token between Next.js BFF and Elysia backend (auto-generated by scripts/predev.sh or oma gateway).
SESSION_SECRETWeb .envSigns Web session cookies.
MOCK_PASSWORDWeb .envInitial login password on fresh source dev boot (mode 0600).
ANTHROPIC_API_KEY / OPENAI_API_KEY / DEEPSEEK_API_KEY / GROQ_API_KEY / OPENROUTER_API_KEYBackendOptional provider API keys (can also be configured in /system/settings).
WORKFLOW_SCRIPTS_ENABLEDBackendSet to 1 to opt into sandboxed workflow script nodes (off by default).
OMA_HOMEBackend / CLIDirectory holding models.yml and gateway config (defaults to ~/.oma).

Troubleshooting & FAQ

Forgot the Web Login Password

  • Prebuilt gateway: run oma gateway status to display it, or oma gateway passwd to rotate it.
  • Source install: check MOCK_PASSWORD in apps/web/.env, or run bash scripts/reset-login-password.sh and restart the backend.

Backend Health Check

curl -s http://127.0.0.1:3000/health
# Expected: {"status":"ok"}

Harness Unavailable in Team / Model Picker

Verify that claude, pi, or omp is installed and on PATH for the user running the backend service, and that its provider API key is configured. oma is bundled directly with CrewDesk.

Schema Error After Pulling Latest Source (Dev Only)

If a development schema update conflicts with an old local SQLite database, stop the servers, remove apps/backend/.backend-data/, and restart bun run dev.