OpenDash configures its single-binary runtime via a portable JSON file (config/site.json inside the site root) and explicit environment variable overrides, alongside machine-readable JSON Schemas compiled directly into the executable.
Configuration Precedence
Configuration loads deterministically in three layers:
Built-in defaults < config/site.json (PortableRuntimeConfigV1) < Non-empty OPENDASH_* env varsIf a READY.json restore marker is present and config/site.json has not cleared recovery mode yet, recovery_safe_mode remains forced to true on startup.
config/site.json (PortableRuntimeConfigV1)
The file must be a regular non-symlink file no larger than 64 KiB validated against strict rules:
| Field | Default | Validation & Constraints |
|---|---|---|
version | 1 | Must equal 1 |
listen_ip | "127.0.0.1" | Restricted to loopback only: "127.0.0.1" or "::1" (place Nginx/Caddy in front for TLS) |
port | 18766 | Non-zero u16 port |
trusted_public_origin | null | Optional canonical http:// or https:// origin without paths, query strings, fragments, or userinfo |
log_level | "info" | One of error, warn, info, debug, trace |
recovery_safe_mode | false | Safe Recovery lock flag (cleared atomically via /api/admin/operations/recovery/activate) |
csp_extra_script_origins | [] | Max 16 https:// origins; rejects *, ;, and unsafe-eval |
csp_extra_style_origins | [] | Max 16 https:// origins; same validation rules |
csp_extra_frame_origins | [] | Max 16 https:// origins; same validation rules |
{
"version": 1,
"listen_ip": "127.0.0.1",
"port": 18766,
"trusted_public_origin": "https://example.com",
"log_level": "info",
"recovery_safe_mode": false
}OPENDASH_* Environment Variables
| Variable | Applies To | Purpose |
|---|---|---|
OPENDASH_SITE_ROOT | Server & CLI | Site data directory holding database/, uploads/, themes/, plugins/, and config/site.json |
OPENDASH_DB_PATH | Server | Optional explicit SQLite file path overriding default site root DB |
OPENDASH_PORT | Server | Overrides port from config/site.json |
OPENDASH_PUBLIC_ORIGIN | Server | Overrides trusted_public_origin (required when running behind HTTPS reverse proxy) |
OPENDASH_LOG_LEVEL | Server | Overrides log_level (error|warn|info|debug|trace) |
OPENDASH_DEV_THEME_DIR | Dev Server | Mounts a local folder theme with live-reload (equivalent to --dev-theme) |
OPENDASH_DEV_PLUGIN_DIR | Dev Server | Mounts local development plugin folder(s) (equivalent to --dev-plugin) |
OPENDASH_PLUGIN_ALLOW_LOOPBACK | Plugin Runtime | Allows localhost destinations in plugin HTTP allowlists during local integration testing |
OPENDASH_URL | CLI & MCP stdio | Target CMS base URL for remote blueprint apply and opendash mcp proxy calls |
OPENDASH_TOKEN | CLI & MCP stdio | Bearer token (od_pat_*) for remote CLI and stdio MCP proxy calls |
Internal reserved variables: OPENDASH_WORKER_CHILD, OPENDASH_STORAGE_FAILPOINT, OPENDASH_STORAGE_E2E_FIXTURE, and OPENDASH_SOURCE_SHA are reserved for internal subprocess isolation, test harnesses, and release metadata rather than operator tuning.
Built-in JSON Schemas & AI Grounding Commands
Every OpenDash binary embeds machine-readable Draft 2020-12 schemas and an AI quick-reference document:
| CLI Command | MCP Resource Equivalent | Output |
|---|---|---|
opendash schema theme | opendash://schemas/theme | Theme Format V1 (theme.json) schema |
opendash schema block | opendash://schemas/block | Custom Studio Block (block.json) schema |
opendash schema plugin | opendash://schemas/plugin | Plugin Manifest (manifest.json) schema |
opendash schema blueprint | opendash://schemas/blueprint | Declarative Site Blueprint (blueprint.json) schema |
opendash docs --ai | opendash://docs/ai | Concise AI-first Markdown reference compiled into the binary |