WaferCMS

Operations

Env, readiness, and useful knobs

Production env

With NODE_ENV=production or CMS_STRICT_CONFIG=true, the server checks required config at startup and exits if something is missing:

VariableNotes
BETTER_AUTH_SECRETRandom secret (≥32 chars)
CMS_PUBLIC_BASE_URLPublic API origin (https://…)
CORS_ORIGINAdmin UI origin
COOKIE_SECUREtrue
CMS_API_KEY_PEPPERRequired while API keys are required (default)

Behind a proxy that sets X-Forwarded-*, set CMS_TRUST_PROXY=true so Express trusts one hop for client IP / scheme (the example Caddy overlay sets this).

AI stays off until you set CMS_AI_DRAFTS_ENABLED / CMS_AI_AGENT_ENABLED and OPENROUTER_API_KEY.

Defaults worth knowing

SettingDefault
Upload isPublicfalse — mark public when you need a keyless URL
CMS_REQUIRE_API_KEYtrue
CMS_AI_*false

Limits

ScopeEnv prefix
LoginCMS_RATE_LIMIT_LOGIN_*
AICMS_RATE_LIMIT_AI_*
GlobalCMS_RATE_LIMIT_GLOBAL_*
Upload sizeCMS_UPLOAD_MAX_BYTES
Image decodeCMS_IMAGE_MAX_BYTES, CMS_IMAGE_MAX_DIMENSION

In-process rate limits suit a single API replica; put shared limits at the proxy if you run more than one.

Health

  • /ok — liveness
  • /ready — includes DB (use for HEALTHCHECK / orchestration)

Apply migrations before relying on /ready (pnpm db:migrate or your image entrypoint).

API keys & drafts

Use read keys from your app’s server. Default list endpoints omit drafts; pass includeDrafts=true when you need them.

On this page