Skip to main content

Environment reference

Authoritative list of every environment variable the CRM service reads, grouped by concern. Source of truth for .env.example and Helm values (tenant-backend-crm/charts/values.yaml). When you add a new var, add it here in the same commit — the audit gate diffs this list against config:cache output.

Identity

VariablePurposeDefaultRequired
TENANT_IDPostgres-level tenant UUID, used for the per-deployment policy cache and audit logs.yes
TENANT_NAMESlug used in policy FQNs (tenant.{TENANT_NAME}.crm.*).yes
SERVICE_NAMEAlways crm; appears in policy FQNs and structured logs.crmyes

App

VariablePurposeDefaultRequired
APP_NAMEDisplay name only; used in mail "from" and queue worker tags.Tenant CRM Serviceyes
APP_ENVlocal / staging / production — toggles debug behavior and CSP.productionyes
APP_KEYLaravel encryption key.yes
APP_URLUsed by signed routes and absolute attachment URLs.yes
APP_DEBUGStack traces in responses. Must be false in production.falseyes
APP_LOCALEDefault UI/email locale (en/hu/de).enyes
APP_FALLBACK_LOCALELocale fallback when a translation is missing.enyes

Database

VariablePurposeDefaultRequired
DB_CONNECTIONDriver — must be pgsql in production (UUID + unaccent extension).pgsqlyes
DB_HOST / DB_PORT / DB_DATABASE / DB_USERNAME / DB_PASSWORDConnection.yes
DB_SCHEMAPostgres schema for this tenant deployment, e.g. tenant_crm.tenant_crmyes

Identity / OAuth

VariablePurposeDefaultRequired
IDENTITY_URLBase URL of the identity service used for /api/user + /.well-known/jwks.json.yes
OAUTH_CLIENT_IDClient ID issued by identity for this CRM deployment.yes
SYSTEM_API_TOKENLong-lived token for system-to-system endpoints (/api/system/*). Rotated quarterly.yes

Eventing

VariablePurposeDefaultRequired
RABBITMQ_HOST / RABBITMQ_PORT / RABBITMQ_USER / RABBITMQ_PASSWORDAMQP broker for identity event consumption.127.0.0.1 / 5672yes

Cache, queue, session

VariablePurposeDefaultRequired
CACHE_STOREPolicy cache, signed-URL cache. Use redis in production.fileyes
QUEUE_CONNECTIONDefault queue. database is OK for dev, rabbitmq/redis in production.databaseyes
SESSION_DRIVERShould be file; no human sessions on this service.fileyes
REDIS_HOST / REDIS_PORT / REDIS_PASSWORDUsed when CACHE_STORE=redis.127.0.0.1 / 6379conditional

Mail

VariablePurposeDefaultRequired
MAIL_MAILERlog locally, mailgun or smtp in real deployments.logyes
MAIL_HOST / MAIL_PORT / MAIL_USERNAME / MAIL_PASSWORD / MAIL_SCHEMESMTP transport.conditional
MAIL_FROM_ADDRESS / MAIL_FROM_NAMEDefault From: header.yes
MAILGUN_API_KEY / MAILGUN_DOMAIN / MAILGUN_ENDPOINT / MAILGUN_WEBHOOK_SIGNING_KEYMailgun transport + inbound webhook verification.https://api.eu.mailgun.netconditional

Inbound email (IMAP polling)

VariablePurposeDefaultRequired
EMAIL_IMAP_POLL_INTERVALMinutes between polls (0 disables).0yes
EMAIL_IMAP_POLL_BATCHMax messages per poll.50yes

Storage

VariablePurposeDefaultRequired
FILESYSTEM_DISKDefault disk for attachments/avatars. Use s3 in production.localyes
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_DEFAULT_REGION / AWS_BUCKET / AWS_USE_PATH_STYLE_ENDPOINTS3 credentials when FILESYSTEM_DISK=s3.conditional

CORS

VariablePurposeDefaultRequired
CORS_ALLOWED_ORIGINSComma-separated origin list for the frontend SPA.yes

Logging / OpenTelemetry

VariablePurposeDefaultRequired
LOG_CHANNELLaravel log stack.stackyes
LOG_STACKChannels stacked into LOG_CHANNEL=stack.singleyes
LOG_LEVELMinimum log severity.debug (dev) / info (prod)yes
OTEL_PHP_DISABLED_INSTRUMENTATIONSSet to all to fully disable OTel; otherwise leave unset.all (dev)no

Removed / deprecated

These were present in earlier CRM revisions but are no longer read; do not set them.

VariableRemoved inReplacement
DEFAULT_TENANT_ID2026-05-12TENANT_ID (was a duplicate of the same value).
CRM_LEGACY_AUTH_GUARD2026-04OAuth via identity is now the only auth path.
ENABLE_OLD_CHAT_WS2026-03Reverb WS is always on.

Verification

php artisan config:show app,database,queue | grep -v '^Array'
php artisan tinker --execute "print_r(array_keys(\$_ENV));" | grep -E 'TENANT|IDENTITY|RABBITMQ|MAIL_'

The CI gate (.github/workflows/env-drift.yml) extracts the variable list from this page and diffs it against .env.example — if you add a var to one without the other, the build fails.