Skip to content

Chuck Environment

Chuck Environment

This page lists every environment variable read by the Strapi process in apps/chuck/meat/. Source of truth is apps/chuck/meat/.env.example plus the four config/*.ts files. Values shown in .env.example are development defaults committed to the repo and must not be reused in preview, staging, or production.

For the cross-service env vocabulary (per-service *_STAGE, preview DB mapping) see standards/deployment-env.

Server (config/server.ts)

VariableDefaultPurpose
HOST0.0.0.0Bind address
PORT1337 (.env.example sets 1333)Strapi HTTP port
APP_KEYSnoneComma-separated array of Koa session signing keys. Rotate by prepending a new key.

Admin & Tokens (config/admin.ts)

VariablePurpose
ADMIN_JWT_SECRETSigns admin panel session JWTs. Rotation invalidates all admin sessions.
API_TOKEN_SALTSalt for API tokens issued in /admin → Settings → API Tokens. Rotation invalidates all issued API tokens — coordinate with brisket (STRAPI_TOKEN).
TRANSFER_TOKEN_SALTSalt for strapi transfer data export/import tokens. Ops-only.
FLAG_NPSBoolean — Strapi NPS prompt. Default true.
FLAG_PROMOTE_EEBoolean — Strapi EE upsell. Default true.
JWT_SECRETusers-permissions end-user JWT. Currently unused by brisket; required if end-user auth is enabled.

APP_KEYS, ADMIN_JWT_SECRET, API_TOKEN_SALT, TRANSFER_TOKEN_SALT, and JWT_SECRET are secrets. See standards/security-model.

Database (config/database.ts)

Strapi picks the client from DATABASE_CLIENT (default postgres). Production should be Postgres; sqlite is a fallback for local experimentation and ships in package.json via better-sqlite3.

VariableDefaultPurpose
DATABASE_CLIENTpostgresDriver selector
DATABASE_URLnoneFull connection string. If set, takes precedence over discrete fields.
DATABASE_HOSTlocalhostHost
DATABASE_PORT5432Port
DATABASE_NAMEstrapiDatabase name
DATABASE_USERNAMEstrapiUser
DATABASE_PASSWORDstrapiPassword
DATABASE_SCHEMApublicPostgres schema
DATABASE_SSLfalseToggle TLS
DATABASE_SSL_KEY / _CERT / _CA / _CAPATH / _CIPHERnoneTLS material
DATABASE_SSL_REJECT_UNAUTHORIZEDtrueValidate cert chain
DATABASE_POOL_MIN2Knex pool min
DATABASE_POOL_MAX10Knex pool max
DATABASE_CONNECTION_TIMEOUT60000Acquire timeout (ms)

TODO(@marty): document preview-environment naming and Neon branching for chuck. standards/deployment-env documents brain and sirloin preview wiring; chuck is not listed there (grep -i chuck docs/src/content/docs/standards/deployment-env.md returns no matches).

SQLite (local fallback only)

VariableDefaultPurpose
DATABASE_FILENAME.tmp/data.dbRelative to apps/chuck/meat/

MySQL (declared but unused)

config/database.ts carries a MySQL block. No MySQL driver is in package.json — assume MySQL is unsupported.

Upload — Cloudflare R2 (config/plugins.ts)

Provider: strapi-provider-cloudflare-r2.

VariablePurpose
CF_ACCESS_KEY_IDR2 access key
CF_ACCESS_SECRETR2 secret key
CF_ENDPOINTR2 S3-compatible endpoint (e.g. https://<account>.r2.cloudflarestorage.com)
CF_BUCKETBucket name
CF_PUBLIC_ACCESS_URLPublic CDN base URL — also added to CSP img-src and media-src in config/middlewares.ts

Rotation note: CF_PUBLIC_ACCESS_URL is referenced by CSP middleware, so changing the host requires a deploy, not just an env update — uploaded assets pinned to the old host will be blocked by CSP otherwise.

Email — SMTP via Nodemailer (config/plugins.ts)

Provider: @strapi/provider-email-nodemailer.

VariablePurpose
SMTP_HOSTSMTP server hostname
SMTP_PORTSMTP server port
SMTP_USERSMTP username
SMTP_PASSWORDSMTP password

Hard-coded in config/plugins.ts: defaultFrom and defaultReplyTo are both no-reply@foxy.ai. Change requires a code edit, not an env.

Stage / Deployment

Chuck does not appear in the per-service *_STAGE table in standards/deployment-env, and grep -rn 'CHUCK_STAGE' apps/chuck returns no matches — the codebase does not read a CHUCK_STAGE variable today. TODO(@marty): decide whether chuck should join the *_STAGE convention (the deployment-env table currently lists sirloin, strip, brain, brisket, flank).

There is no apps/chuck/railway.json or apps/chuck/meat/railway.json checked in (verified by find apps/chuck -name 'railway*'). TODO(@marty): document how chuck is deployed — the @strapi/plugin-cloud plugin is installed in apps/chuck/meat/package.json but not wired in config/plugins.ts, and pnpm strapi deploy is referenced in the runbook without a confirmed target host.

Consumer-side env (brisket)

apps/brisket/src/env.js declares the brisket → chuck contract:

VariableRequiredSource
STRAPI_URLyesPublic base URL of the chuck deployment
STRAPI_TOKENyesAPI token issued in chuck admin (salted by API_TOKEN_SALT)

When rotating chuck API_TOKEN_SALT or revoking the brisket token, brisket must be redeployed with the new STRAPI_TOKEN.

Local .env Bootstrap

Copy apps/chuck/meat/.env.example to apps/chuck/meat/.env and replace every value. The committed defaults for APP_KEYS, API_TOKEN_SALT, ADMIN_JWT_SECRET, TRANSFER_TOKEN_SALT, and JWT_SECRET are public (visible in git history) and must not be used outside throwaway local dev. Generate fresh values with:

Terminal window
node -e "console.log(require('crypto').randomBytes(16).toString('base64'))"

See chuck-local-dev for full setup.

Anchor Docs