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
- Localhost binding: backend (
:3000) and web (:3001) bind to127.0.0.1by default. - Worker repo & branch isolation: isolated git copies,
project_pushrestricted toagent/<runId>, plusdeny_write_paths&deny_commands. - Sandboxed workflow scripts: disabled by default (
WORKFLOW_SCRIPTS_ENABLED=1required); runs inbubblewrap/sandbox-execwith no network, isolated PID namespace, and no read access todataDiror.env. - Fail-closed HITL: approvals and questions persist in
pending_action; timeout = deny. - Server-side secret masking: provider keys and MCP auth headers stay on the backend and are masked on every HTTP read.
- Provider config isolation: child processes read model configs strictly from
$OMA_HOME/models.yml. - HTML artifact sandboxing: HTML previews render inside
<iframe sandbox="allow-scripts">withoutallow-same-origin.
Key Environment Variables
| Variable | Where | Purpose |
|---|---|---|
BACKEND_AUTH_TOKEN | Backend + Web .env | Shared bearer token between Next.js BFF and Elysia backend (auto-generated by scripts/predev.sh or oma gateway). |
SESSION_SECRET | Web .env | Signs Web session cookies. |
MOCK_PASSWORD | Web .env | Initial login password on fresh source dev boot (mode 0600). |
ANTHROPIC_API_KEY / OPENAI_API_KEY / DEEPSEEK_API_KEY / GROQ_API_KEY / OPENROUTER_API_KEY | Backend | Optional provider API keys (can also be configured in /system/settings). |
WORKFLOW_SCRIPTS_ENABLED | Backend | Set to 1 to opt into sandboxed workflow script nodes (off by default). |
OMA_HOME | Backend / CLI | Directory holding models.yml and gateway config (defaults to ~/.oma). |
Troubleshooting & FAQ
Forgot the Web Login Password
- Prebuilt gateway: run
oma gateway statusto display it, oroma gateway passwdto rotate it. - Source install: check
MOCK_PASSWORDinapps/web/.env, or runbash scripts/reset-login-password.shand 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.