Configuration

Environment variables, framework settings, and per-module configuration.

On this page

Configuration

Environment variables

Copy .env.example to .env and fill in your own values - read anywhere in the app via getSystemSetting( "VAR_NAME", "default" ):

VariablePurpose
APPNAMEApplication display name
ENVIRONMENTdevelopment or production
ASSET_URLPublic URL prefix for Vite production assets (defaults to /includes)
BOXLANG_DEBUGEnable BoxLang debug output
DB_CONNECTIONSTRINGFull JDBC connection string
DB_DRIVERDatabase driver (MySQL, PostgreSQL, ...)
DB_HOST / DB_PORT / DB_DATABASEDatabase connection details
DB_USER / DB_PASSWORDDatabase credentials
JWT_SECRETSigning key for cbsecurity's JWT support

Framework settings (app/config/Coldbox.bx)

SettingValue
defaultEventAuth.login — unauthenticated visitors land on the login page
requestStartHandlerMain.onRequestStart
applicationStartHandlerMain.onAppInit
exceptionHandlerMain.onException
modulesExternalLocation["/modules"]
autoMapModelstrue
jsonPayloadToRCtrue

A development() environment override enables the Whoops error template, WireBox singleton reload, and ColdBox debug mode. LogBox is configured with a console appender plus a rolling file appender writing to app/logs.

App settings vs. framework config

Two different things both live under app/config/, and it's easy to conflate them:

Framework config (Coldbox.bx, Router.bx, WireBox.bx, CacheBox.bx, Scheduler.bx) is static, file-based, and changes take effect on the next ?fwreinit.

App settings (cbAppName, cbAllowRegistration, cbMinPasswordLength, ...) are DB-backed, admin-editable at /settings, defined in SettingService.static.DEFAULTS, and cached with a 2-hour TTL.

SettingService.preFlightCheck() (called from Main.onAppInit) seeds any missing default into the database on boot, so adding a new key to DEFAULTS is enough to make it show up. A setting can also be overridden two other ways, both read by loadConfigOverrides()/loadEnvironmentOverrides():

  • Any cb*-prefixed key placed in Coldbox.bx's variables.settings
  • Any genesis_*-prefixed environment variable

Module configuration

Each installed module has its own settings file under app/config/modules/:

ModuleKey settings
cbsecuritycbauth provider, CSRF (rotating, 30 min), firewall with @secured annotation scanning, security headers, JWT (AES-256, HS512, 60 min) — see Security & Permissions
cbauthUserService as the identity provider, cache-based session storage
cbmailservicesBXMail protocol in production, files protocol in development — see Email
cbormEntity injection enabled, pagination maxRows: 25 / maxRowsLimit: 500
cbstoragesCache storage (sessions cache, 60 min TTL), AES-encrypted cookie storage
mementifierISO8601 dates, ORM auto-includes, UTC conversion
Edit this page Download Markdown Last updated Sep 1, 2026, 7:55:53 PM