CONFIG & SCHEMAS
reference
8 min read

config/site.json, Environment Variables & JSON Schemas

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 vars

If 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:

FieldDefaultValidation & Constraints
version1Must 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)
port18766Non-zero u16 port
trusted_public_originnullOptional canonical http:// or https:// origin without paths, query strings, fragments, or userinfo
log_level"info"One of error, warn, info, debug, trace
recovery_safe_modefalseSafe 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

VariableApplies ToPurpose
OPENDASH_SITE_ROOTServer & CLISite data directory holding database/, uploads/, themes/, plugins/, and config/site.json
OPENDASH_DB_PATHServerOptional explicit SQLite file path overriding default site root DB
OPENDASH_PORTServerOverrides port from config/site.json
OPENDASH_PUBLIC_ORIGINServerOverrides trusted_public_origin (required when running behind HTTPS reverse proxy)
OPENDASH_LOG_LEVELServerOverrides log_level (error|warn|info|debug|trace)
OPENDASH_DEV_THEME_DIRDev ServerMounts a local folder theme with live-reload (equivalent to --dev-theme)
OPENDASH_DEV_PLUGIN_DIRDev ServerMounts local development plugin folder(s) (equivalent to --dev-plugin)
OPENDASH_PLUGIN_ALLOW_LOOPBACKPlugin RuntimeAllows localhost destinations in plugin HTTP allowlists during local integration testing
OPENDASH_URLCLI & MCP stdioTarget CMS base URL for remote blueprint apply and opendash mcp proxy calls
OPENDASH_TOKENCLI & MCP stdioBearer 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 CommandMCP Resource EquivalentOutput
opendash schema themeopendash://schemas/themeTheme Format V1 (theme.json) schema
opendash schema blockopendash://schemas/blockCustom Studio Block (block.json) schema
opendash schema pluginopendash://schemas/pluginPlugin Manifest (manifest.json) schema
opendash schema blueprintopendash://schemas/blueprintDeclarative Site Blueprint (blueprint.json) schema
opendash docs --aiopendash://docs/aiConcise AI-first Markdown reference compiled into the binary
Edit Source URL:

Search OpenDash

Use Arrow keys & Enter to navigate Full search page →