Skip to content

Env configuration

Source: src/config/env.ts

This document lists all supported environment variables, their defaults, and what they control.

Usage

ts
import { Env } from '@zintrust/core';

// Example
// Env.NODE_ENV

Packed env mode

ZinTrust supports packed env resolution for Cloudflare-style secret bindings.

Use this when secrets are delivered as JSON strings under one or more env keys and you still want application code to read them through normal Env.get(...) calls.

env
USE_PACK=true
PACK_KEYS=WORKER_SECRETS
WORKER_SECRETS={"APP_KEY":"secret","JWT_SECRET":"jwt-secret"}

Resolved packed values are merged into the Env view, later pack keys override earlier pack keys, and direct env values override packed values.

For the full workflow, Cloudflare examples, .env.pack local development support, and diagnostics helpers such as Env.getSourceOf(...), see docs/cloudflare-packed-secrets.md.

Core application

KeyDefaultDescription
NODE_ENVdevelopmentRuntime mode: development, staging, production.
APP_MODENODE_ENVApp mode override (defaults to NODE_ENV).
APP_PORT3000Alternate port; PORT wins when set.
PORT3000HTTP server port.
HOSTlocalhostBind address for server listeners.
BASE_URLemptyBase origin used to build fully-qualified URLs.
APP_NAMEZinTrustApplication name (also used for proxy signing fallback).
APP_KEYemptyPrimary app secret (base64 or raw) used for encryption and signing.
APP_PREVIOUS_KEYSemptyOptional rotation keys (comma-separated or JSON array).
USE_PACKfalseEnables packed env resolution when set to true.
PACK_KEYSemptyComma-separated list of JSON env bindings to merge into Env.
APP_TIMEZONEUTCDefault timezone for the app runtime. TIME_ZONE is accepted as a compatibility alias.
CSRF_SKIP_PATHSemptyComma-separated paths to bypass CSRF, e.g. /api/*.
RUNTIMEemptyOptional runtime identifier.
DOCKER_WORKERfalseMarks a dedicated Docker worker container runtime mode.

Database (generic)

KeyDefaultDescription
DB_CONNECTIONsqliteDatabase driver: sqlite, postgresql, mysql, sqlserver, d1.
DB_HOSTlocalhostDefault database host.
DB_PORT5432Default database port.
DB_DATABASEzintrustDefault database name.
DB_USERNAMEpostgresDefault database user.
DB_PASSWORDemptyDefault database password.
DB_READ_HOSTSemptyOptional read replica hosts (comma-separated).

PostgreSQL-specific

KeyDefaultDescription
DB_PORT_POSTGRESQL5432PostgreSQL port.
DB_DATABASE_POSTGRESQLpostgresPostgreSQL database name.
DB_USERNAME_POSTGRESQLpostgresPostgreSQL user.
DB_PASSWORD_POSTGRESQLemptyPostgreSQL password.
DB_READ_HOSTS_POSTGRESQLemptyPostgreSQL read replica hosts.

SQL Server (MSSQL)

KeyDefaultDescription
DB_HOST_MSSQLDB_HOSTSQL Server host override.
DB_PORT_MSSQL1433SQL Server port.
DB_DATABASE_MSSQLzintrustSQL Server database name.
DB_USERNAME_MSSQLsaSQL Server user.
DB_PASSWORD_MSSQLemptySQL Server password.
DB_READ_HOSTS_MSSQLemptySQL Server read replica hosts.

Cloudflare & remote services

KeyDefaultDescription
D1_DATABASE_IDemptyD1 database binding ID.
KV_NAMESPACE_IDemptyKV namespace binding ID.
D1_REMOTE_URLemptyRemote D1 proxy URL.
D1_REMOTE_KEY_IDemptyRemote D1 key id for request signing.
D1_REMOTE_SECRETemptyRemote D1 secret for request signing.
D1_REMOTE_MODEregistryRemote D1 mode: registry or proxy.
KV_REMOTE_URLemptyRemote KV proxy URL.
KV_REMOTE_KEY_IDemptyRemote KV key id.
KV_REMOTE_SECRETemptyRemote KV secret.
KV_REMOTE_NAMESPACEemptyRemote KV namespace.
CLOUDFLARE_ACCOUNT_IDemptyCloudflare account id.
CLOUDFLARE_API_TOKENemptyCloudflare API token.
CLOUDFLARE_KV_NAMESPACE_IDemptyOptional Cloudflare KV namespace id.

Proxy client defaults

KeyDefaultDescription
ZT_PROXY_TIMEOUT_MS30000Default proxy request timeout in milliseconds.
ZT_PROXY_SIGNING_WINDOW_MS60000Default signing window in milliseconds.

Statement registry / learning mode

KeyDefaultDescription
ZT_D1_LEARN_FILEemptyWhen set, captures executed SQL statements to a JSONL file as { statementId, sql } (best-effort).
SQL_WRITERfalseAllow SQL capture outside development when ZT_D1_LEARN_FILE is set (use with care; avoid in production).

MySQL proxy (HTTP)

KeyDefaultDescription
MYSQL_PROXY_URLemptyFull proxy URL (overrides host/port).
MYSQL_PROXY_HOST127.0.0.1Proxy host.
MYSQL_PROXY_PORT8789Proxy port.
MYSQL_PROXY_MAX_BODY_BYTES131072Max request body size in bytes.
MYSQL_PROXY_POOL_LIMIT10Max connection pool size.
MYSQL_PROXY_KEY_IDemptySigning key id (defaults to APP_NAME when empty).
MYSQL_PROXY_SECRETemptySigning secret (defaults to APP_KEY when empty).
MYSQL_PROXY_TIMEOUT_MSZT_PROXY_TIMEOUT_MSRequest timeout in milliseconds.
MYSQL_PROXY_REQUIRE_SIGNINGtrueRequire request signing.
MYSQL_PROXY_SIGNING_WINDOW_MSZT_PROXY_SIGNING_WINDOW_MSAllowed clock skew window.
MYSQL_PROXY_MODEsqlProxy client mode: sql (send SQL) or registry (send { statementId, params }).
ZT_MYSQL_STATEMENTS_FILEemptyOptional: path to JSON registry { statementId: sql } used by POST /zin/mysql/statement.
ZT_MYSQL_STATEMENTS_JSONemptyOptional fallback: inline JSON registry (small setups only).

Postgres proxy (HTTP)

KeyDefaultDescription
POSTGRES_PROXY_URLemptyFull proxy URL (overrides host/port).
POSTGRES_PROXY_HOST127.0.0.1Proxy host.
POSTGRES_PROXY_PORT8790Proxy port.
POSTGRES_PROXY_MAX_BODY_BYTES131072Max request body size in bytes.
POSTGRES_PROXY_POOL_LIMIT10Max connection pool size.
POSTGRES_PROXY_KEY_IDemptySigning key id (defaults to APP_NAME when empty).
POSTGRES_PROXY_SECRETemptySigning secret (defaults to APP_KEY when empty).
POSTGRES_PROXY_TIMEOUT_MSZT_PROXY_TIMEOUT_MSRequest timeout in milliseconds.
POSTGRES_PROXY_REQUIRE_SIGNINGtrueRequire request signing.
POSTGRES_PROXY_SIGNING_WINDOW_MSZT_PROXY_SIGNING_WINDOW_MSAllowed clock skew window.
POSTGRES_PROXY_MODEsqlProxy client mode: sql (send SQL) or registry (send { statementId, params }).
ZT_POSTGRES_STATEMENTS_FILEemptyOptional: path to JSON registry { statementId: sql } used by POST /zin/postgres/statement.
ZT_POSTGRES_STATEMENTS_JSONemptyOptional fallback: inline JSON registry (small setups only).

Redis proxy (HTTP)

KeyDefaultDescription
REDIS_PROXY_URLemptyFull proxy URL (overrides host/port).
REDIS_PROXY_HOST127.0.0.1Proxy host.
REDIS_PROXY_PORT8791Proxy port.
REDIS_PROXY_MAX_BODY_BYTES131072Max request body size in bytes.
REDIS_PROXY_KEY_IDemptySigning key id (defaults to APP_NAME when empty).
REDIS_PROXY_SECRETemptySigning secret (defaults to APP_KEY when empty).
REDIS_PROXY_TIMEOUT_MSZT_PROXY_TIMEOUT_MSRequest timeout in milliseconds.
REDIS_PROXY_REQUIRE_SIGNINGtrueRequire request signing.
REDIS_PROXY_SIGNING_WINDOW_MSZT_PROXY_SIGNING_WINDOW_MSAllowed clock skew window.
USE_REDIS_PROXYfalseEnable Redis proxy.

MongoDB proxy (HTTP)

KeyDefaultDescription
MONGODB_PROXY_URLemptyFull proxy URL (overrides host/port).
MONGODB_PROXY_HOST127.0.0.1Proxy host.
MONGODB_PROXY_PORT8792Proxy port.
MONGODB_PROXY_MAX_BODY_BYTES131072Max request body size in bytes.
MONGODB_PROXY_KEY_IDemptySigning key id (defaults to APP_NAME when empty).
MONGODB_PROXY_SECRETemptySigning secret (defaults to APP_KEY when empty).
MONGODB_PROXY_TIMEOUT_MSZT_PROXY_TIMEOUT_MSRequest timeout in milliseconds.
MONGODB_PROXY_REQUIRE_SIGNINGtrueRequire request signing.
MONGODB_PROXY_SIGNING_WINDOW_MSZT_PROXY_SIGNING_WINDOW_MSAllowed clock skew window.
USE_MONGODB_PROXYfalseEnable MongoDB proxy.

SQL Server proxy (HTTP)

KeyDefaultDescription
SQLSERVER_PROXY_URLemptyFull proxy URL (overrides host/port).
SQLSERVER_PROXY_HOST127.0.0.1Proxy host.
SQLSERVER_PROXY_PORT8793Proxy port.
SQLSERVER_PROXY_MAX_BODY_BYTES131072Max request body size in bytes.
SQLSERVER_PROXY_POOL_LIMIT10Max connection pool size.
SQLSERVER_PROXY_KEY_IDemptySigning key id (defaults to APP_NAME when empty).
SQLSERVER_PROXY_SECRETemptySigning secret (defaults to APP_KEY when empty).
SQLSERVER_PROXY_TIMEOUT_MSZT_PROXY_TIMEOUT_MSRequest timeout in milliseconds.
SQLSERVER_PROXY_REQUIRE_SIGNINGtrueRequire request signing.
SQLSERVER_PROXY_SIGNING_WINDOW_MSZT_PROXY_SIGNING_WINDOW_MSAllowed clock skew window.
USE_SQLSERVER_PROXYfalseEnable SQL Server proxy.
SQLSERVER_PROXY_MODEsqlProxy client mode: sql (send SQL) or registry (send { statementId, params }).
ZT_SQLSERVER_STATEMENTS_FILEemptyOptional: path to JSON registry { statementId: sql } used by POST /zin/sqlserver/statement.
ZT_SQLSERVER_STATEMENTS_JSONemptyOptional fallback: inline JSON registry (small setups only).

Cache

KeyDefaultDescription
CACHE_DRIVERmemoryCache driver: memory, redis, mongodb, kv.
REDIS_HOSTlocalhostRedis host.
REDIS_PORT6379Redis port.
REDIS_PASSWORDemptyRedis password.
REDIS_DB0Redis database index.
REDIS_URLemptyOptional full Redis URL.
MONGO_URIemptyMongoDB Data API endpoint (cache).
MONGO_DBzintrust_cacheMongoDB cache database name.

Queue

KeyDefaultDescription
QUEUE_CONNECTIONemptyQueue connection name.
QUEUE_DRIVERemptyQueue driver.
QUEUE_HTTP_PROXY_ENABLEDfalseEnable HTTP proxy transport for queue operations (Cloudflare/serverless fallback).
QUEUE_HTTP_PROXY_GATEWAY_ENABLEDtrueMount Queue HTTP gateway route in Node/Docker API runtime.
QUEUE_HTTP_PROXY_URLemptyGateway base URL used by producer client.
QUEUE_HTTP_PROXY_PATH/api/_sys/queue/rpcGateway RPC path mounted by API server and called by producer client.
QUEUE_HTTP_PROXY_KEY_IDAPP_NAMESigning key id used to sign/verify queue RPC calls.
QUEUE_HTTP_PROXY_KEYAPP_KEYSigning secret used to sign/verify queue RPC calls.
QUEUE_HTTP_PROXY_TIMEOUT_MSZT_PROXY_TIMEOUT_MSQueue RPC request timeout in milliseconds.
QUEUE_HTTP_PROXY_RETRY_MAX2Number of timeout retries for HTTP queue proxy enqueue operations.
QUEUE_HTTP_PROXY_RETRY_DELAY_MS500Base retry delay in milliseconds for HTTP queue proxy retries.
QUEUE_HTTP_PROXY_MAX_SKEW_MSZT_PROXY_SIGNING_WINDOW_MSAllowed signature timestamp skew for gateway verification.
QUEUE_HTTP_PROXY_NONCE_TTL_MS120000Nonce TTL used for replay protection on queue gateway requests.
QUEUE_HTTP_PROXY_MIDDLEWAREemptyOptional comma-separated middleware names applied to gateway route registration.

Trace

KeyDefaultDescription
TRACE_ENABLEDfalseMaster switch for the trace runtime.
TRACE_DB_CONNECTIONemptyDatabase connection used to persist trace tables; falls back to DB_CONNECTION when unset.
TRACE_QUERY_CONNECTIONemptySeparate app-data connection to observe for SQL traces when storage uses another connection.
TRACE_PRUNE_HOURS24Trace retention window in hours.
TRACE_SLOW_QUERY_MS100Query duration threshold that marks a query trace as slow.
TRACE_LOG_LEVELinfoMinimum application log level recorded by the trace log watcher.
TRACE_CACHE_PAYLOADSfalseInclude cache payload values in cache trace entries.
TRACE_QUERY_BINDINGStrueInclude SQL binding values in query trace entries.
TRACE_AUTO_MOUNTfalseAuto-mount the trace dashboard during stock bootstrap.
TRACE_BASE_PATH/traceDashboard route base path used by the stock auto-mount flow.
TRACE_MIDDLEWAREemptyComma-separated middleware names applied to auto-mounted trace routes.
TRACE_CONTENT_QUEUE_DRIVERemptyRegistered async queue driver used to offload trace content writes from the request path.
TRACE_CONTENT_QUEUE_NAMEtrace-contentQueue name used for trace content offload jobs.
TRACE_CONTENT_QUEUE_ENQUEUE_TIMEOUT_MS25Max enqueue wait before trace falls back to fail-open persistence.
TRACE_CONTENT_QUEUE_WORKER_ENABLEDtrueEnable the internal trace queue drain worker.
TRACE_CONTENT_QUEUE_WORKER_INTERVAL_MS1000Poll interval in milliseconds for the internal trace queue drain worker.
TRACE_CONTENT_QUEUE_WORKER_MAX_DURATION_MS250Max duration in milliseconds for one internal trace worker drain pass.
TRACE_CONTENT_QUEUE_WORKER_CONCURRENCY1Number of concurrent internal trace queue drain loops.
TRACE_REDACT_KEYSpackage defaultExtra recursive key names redacted before trace persistence.
TRACE_REDACT_HEADERSpackage defaultHeader names redacted before trace persistence.
TRACE_REDACT_BODYpackage defaultBody-field names redacted before trace persistence.
TRACE_REDACT_QUERYemptyQuery-string keys redacted before trace persistence.

TRACE_CONTENT_QUEUE_DRIVER works with any queue driver already registered in the runtime. If you want first-class Cloudflare Queue support instead of generic driver wiring, add a dedicated Cloudflare Queue driver and register it in the queue runtime.

Job tracking

KeyDefaultDescription
JOB_TRACKING_ENABLEDtrueEnable in-memory job lifecycle tracking (includes pending_recovery and enqueued handoff state).
JOB_TRACKING_MAX_JOBS20000Maximum in-memory tracked job records before pruning oldest entries.
JOB_TRACKING_MAX_TRANSITIONS50000Maximum in-memory transition records before pruning oldest entries.
JOB_TRACKING_PERSISTENCE_ENABLEDfalseEnable durable persistence for tracking records.
JOB_TRACKING_PERSISTENCE_DRIVERdatabasePersistence backend driver (database currently supported).
JOB_TRACKING_DB_CONNECTIONdefaultDatabase connection name for tracker persistence.
JOB_TRACKING_DB_TABLEzintrust_jobsTable used for latest job state snapshots.
JOB_TRACKING_DB_TRANSITIONS_TABLEzintrust_job_transitionsTable used for append-only state transitions.
JOB_TRACKING_PERSIST_TRANSITIONS_ENABLEDfalsePersist append-only transition rows to JOB_TRACKING_DB_TRANSITIONS_TABLE (disable to store only snapshots in JOB_TRACKING_DB_TABLE).
JOB_HEARTBEAT_INTERVAL_MS10000Worker heartbeat interval used for stalled-job detection.
JOB_HEARTBEAT_GRACE_MS20000Heartbeat grace window before active jobs are marked stalled.
JOB_RECONCILIATION_INTERVAL_MS60000Interval for in-memory and persisted reconciliation scans.
JOB_RECONCILIATION_STALE_MS120000Staleness threshold for persisted enqueue-fallback (pending_recovery) buffer records.
JOB_RECOVERY_INTERVAL_MS30000Interval for automatic recovery daemon scans.
JOB_RECOVERY_MIN_AGE_MS5000Minimum age before a recoverable state is eligible for re-queue.
JOB_RECOVERY_DB_SCAN_LIMIT100Max rows scanned from JOB_TRACKING_DB_TABLE for persisted pending_recovery recovery attempts per daemon run.
JOB_TRACKING_CLEANUP_ENABLEDfalseEnable scheduled cleanup of JOB_TRACKING_DB_TABLE and JOB_TRACKING_DB_TRANSITIONS_TABLE.
JOB_TRACKING_CLEANUP_INTERVAL_MS21600000Cleanup schedule interval in ms (default: 6 hours).
JOB_TRACKING_CLEANUP_RETENTION_DAYS30Retention window for cleanup (rows older than this are eligible).
JOB_TRACKING_CLEANUP_RETENTION_HOURSemptyOptional (overrides days): retention window in hours (supports fractional values like 0.4).
JOB_TRACKING_CLEANUP_BATCH_SIZE5000Batch size for cleanup deletes when using MySQL (DELETE ... LIMIT).
JOB_TRACKING_CLEANUP_MAX_BATCHES1Max number of cleanup batches to run per schedule tick (bounded).
JOB_TRACKING_CLEANUP_LOCK_PROVIDERredisLock provider used for cleanup schedule withoutOverlapping() (e.g. redis or memory).
DLQ_REPLAY_MAX_BATCH_SIZE25Maximum number of dead-letter records replayed in one governed replay batch.
DLQ_REPLAY_MAX_QPS5Ceiling for dead-letter replay throughput (jobs per second).
DLQ_REPLAY_MIN_AGE_MS60000Minimum dead-letter age required before replay eligibility.
DLQ_REPLAY_ALLOWED_ACTORSemptyOptional comma-separated allow-list of actor IDs allowed to execute DLQ replay.
JOB_DASHBOARD_DEFAULT_QUEUEdefaultDefault queue name used by reliability dashboard snapshots when queue name is omitted.
JOB_RUNBOOK_BASE_URL/docs/runbooksBase path/URL used to generate alert-to-runbook links for queue reliability alerts.
JOB_ALERT_FAILURE_RATE_THRESHOLD0.1Alert threshold for failure rate ((failed + dead_letter) / completed).
JOB_ALERT_STALLED_THRESHOLD50Alert threshold for stalled job count.
JOB_ALERT_QUEUE_DEPTH_THRESHOLD1000Alert threshold for queue depth.
JOB_ALERT_MANUAL_REVIEW_THRESHOLD10Alert threshold for manual-review backlog count.
QUEUE_TRACING_ENABLEDfalseEnable queue operation tracing pipeline (enqueue, dequeue, ack, length, drain).
QUEUE_TRACING_SAMPLE_RATE1Queue trace sampling rate in range 0..1.
QUEUE_TRACING_MAX_EVENTS5000Maximum in-memory queue trace events retained after pruning.
QUEUE_TRACING_RETENTION_MS86400000Queue trace retention window in milliseconds before prune removes older events.
QUEUE_TRACING_EXPORT_BATCH_SIZE20Number of pending queue trace events before automatic exporter flush.
QUEUE_TRACING_EXPORT_OTELtrueExport queue trace events to OpenTelemetry spans when OTEL_ENABLED=true.
STALLED_JOB_CHECK_INTERVAL_MS30000Interval for heartbeat table stalled checks.

Scheduling

KeyDefaultDescription
SCHEDULES_ENABLEDfalseEnable schedule autostart in long-running runtimes (Node.js/Fargate only).
SCHEDULE_SHUTDOWN_TIMEOUT_MS30000Max time to wait for schedules to stop during shutdown (ms).
SCHEDULE_OVERLAP_LOCK_TTL_MS300000Default TTL for schedule overlap locks (ms).
SCHEDULE_OVERLAP_LOCK_ACQUIRE_TIMEOUT_MS2000Max time to wait for overlap-lock acquisition before running anyway (ms).
SCHEDULE_LEADER_ENABLEDfalseEnable leader lease gating so only one instance auto-runs schedules.
SCHEDULE_LEADER_LOCK_PROVIDERredisLock provider used for leader lease (redis or memory).
SCHEDULE_LEADER_LOCK_KEYscheduler:leaderLock key used for leader election.
SCHEDULE_LEADER_LOCK_TTL_MS30000TTL for leader lease lock (ms).
SCHEDULE_LEADER_LOCK_RENEW_MS15000How often to renew/extend leader lease TTL (ms).
SCHEDULE_LEADER_LOCK_RETRY_MS5000How often followers retry acquiring leadership (ms).
SCHEDULE_LEADER_LOCK_ACQUIRE_TIMEOUT_MS2000Max time to wait for leader-lock acquisition (ms).

Schedule HTTP gateway

KeyDefaultDescription
SCHEDULE_HTTP_PROXY_PATH/api/_sys/schedule/rpcInternal signed endpoint for schedule RPC (list, run).
SCHEDULE_HTTP_PROXY_KEY_IDAPP_NAMESigning key id used to sign/verify schedule RPC calls.
SCHEDULE_HTTP_PROXY_KEYAPP_KEYSigning secret used to sign/verify schedule RPC calls.
SCHEDULE_HTTP_PROXY_MAX_SKEW_MS60000Allowed signature timestamp skew for gateway verification.
SCHEDULE_HTTP_PROXY_NONCE_TTL_MS120000Nonce TTL used for replay protection on schedule gateway requests.
SCHEDULE_HTTP_PROXY_MIDDLEWAREemptyOptional comma-separated middleware names applied to schedule gateway route.
IDEMPOTENCY_DEFAULT_TTL_MS86400000Default TTL for idempotency keys and dedup locks (milliseconds).
JOB_RELIABILITY_ENABLEDtrueMaster toggle for queue reliability orchestration features.
JOB_RELIABILITY_AUTOSTARTfalseAuto-start reliability orchestrator when queue drivers are registered.

Rate limiting

KeyDefaultDescription
RATE_LIMIT_STOREemptyStore type for rate limiting.
RATE_LIMIT_DRIVERemptyRate limit driver implementation.
RATE_LIMIT_KEY_PREFIXzintrust:ratelimit:Key prefix used by rate limiter.

Notifications

KeyDefaultDescription
NOTIFICATION_DRIVERemptyNotification driver.
TERMII_API_KEYemptyTermii API key.
TERMII_SENDERZinTrustTermii sender name.

AWS

KeyDefaultDescription
AWS_REGIONus-east-1AWS region.
AWS_DEFAULT_REGIONemptyAWS default region override.
AWS_ACCESS_KEY_IDemptyAWS access key.
AWS_SECRET_ACCESS_KEYemptyAWS secret key.
AWS_SESSION_TOKENemptyAWS session token.
AWS_LAMBDA_FUNCTION_NAMEemptyLambda function name.
AWS_LAMBDA_FUNCTION_VERSIONemptyLambda function version.
AWS_EXECUTION_ENVemptyLambda execution environment.
LAMBDA_TASK_ROOTemptyLambda task root path.

Microservices

KeyDefaultDescription
MICROSERVICESemptyComma-separated list of microservices.
SERVICESemptyService names to load.
MICROSERVICES_TRACINGfalseEnable distributed tracing.
MICROSERVICES_TRACING_RATE1.0Trace sampling rate.
DATABASE_ISOLATIONsharedDatabase isolation mode.
SERVICE_API_KEYemptyService API key for inter-service auth.
SERVICE_JWT_SECRETemptyService JWT secret.

Security

KeyDefaultDescription
DEBUGfalseEnable debug mode.
ENABLE_MICROSERVICESfalseGlobal microservices feature flag.
TOKEN_TTL3600000Access token TTL in milliseconds.
TOKEN_LENGTH32Token length (random bytes/characters).
CSRF_STOREemptyCSRF store (e.g., redis).
CSRF_DRIVERemptyCSRF driver implementation.
CSRF_REDIS_DB1Redis DB index for CSRF store.
ENCRYPTION_CIPHERemptyCipher used by EncryptedEnvelope (aes-256-cbc or aes-256-gcm).
JWT_REVOCATION_DRIVERdatabaseJWT revocation store driver (database/redis/kv/kv-remote/memory).
JWT_REVOCATION_DB_CONNECTIONdefaultDB connection name used by JWT revocation store.
JWT_REVOCATION_DB_TABLEzintrust_jwt_revocationsTable name for JWT revocations.
JWT_REVOCATION_REDIS_DB0Redis DB index for JWT revocation store.
JWT_REVOCATION_REDIS_PREFIXzt:jwt:revoked:Redis key prefix for revoked JTIs.
JWT_REVOCATION_KV_BINDINGCACHECloudflare KV binding name for revocation store.
JWT_REVOCATION_KV_PREFIXzt:jwt:revoked:KV key prefix for revoked JTIs.

Deployment

KeyDefaultDescription
ENVIRONMENTdevelopmentDeployment environment label.
REQUEST_TIMEOUT30000Global request timeout (ms).
MAX_BODY_SIZE10485760Max request body size in bytes.
SHUTDOWN_TIMEOUT10000Graceful shutdown timeout (ms).

SSE

KeyDefaultDescription
SSE_HEARTBEAT_INTERVAL15000SSE heartbeat interval in ms.
SSE_SNAPSHOT_INTERVAL5000SSE snapshot interval in ms.

Logging

KeyDefaultDescription
LOG_LEVELdebug/info/errorLog level (depends on NODE_ENV).
LOG_FORMATtextLog format (text or json).
LOG_CHANNELemptyLog channel override (console/file/cloud).
SENSITIVE_FIELDSemptyComma-separated extra keys to redact in logs.
DISABLE_LOGGINGfalseDisable logging entirely.
LOG_HTTP_REQUESTtrueEnable request logging middleware.
LOG_COLORtrueANSI color output policy: true, auto, or false.
LOG_COLOR_THEMEarcticRequest-log color palette for text logs.
NO_COLORemptyDisable ANSI colors regardless of LOG_COLOR.
LOG_TO_FILEfalseEnable file logging output.
LOG_ROTATION_SIZE10485760Max log file size in bytes.
LOG_ROTATION_DAYS7Days to keep rotated logs.

ZinTrust tooling

KeyDefaultDescription
ZINTRUST_PROJECT_ROOTemptyProject root override.
ZINTRUST_ALLOW_POSTINSTALLemptyAllow postinstall scripts (CLI).
ZINTRUST_ENV_FILE.env.pullPull env file name.
ZINTRUST_SECRETS_MANIFESTsecrets.manifest.jsonSecrets manifest file.
ZINTRUST_ENV_IN_FILE.envEnv input file name.
ZINTRUST_SECRETS_PROVIDERemptySecrets provider (vault, cloud, etc.).
ZINTRUST_ALLOW_AUTO_INSTALLemptyAllow auto-install of dependencies.

CI / system

KeyDefaultDescription
CIemptyCI indicator.
HOMEemptyUser home directory (system).
USERPROFILEemptyUser profile directory (Windows).

Templates

KeyDefaultDescription
TEMPLATE_COPYRIGHT© 2025 ZinTrust Framework. All rights reserved.Template copyright text.
SERVICE_NAMEemptyService name override for templates.

Computed values (read-only)

These are derived at runtime and do not need to be set:

KeyDescription
NODE_BIN_DIRDerived from the runtime execPath.
SAFE_PATHSafe PATH constructed from system defaults and runtime bin dir.

Released under the MIT License.