Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(config): list six missing operator knobs in .env.example

Yudhi Armyndharis6940fc3706b9
diff --git a/.env.example b/.env.example
index 70213a697..03f804586 100644
--- a/.env.example
+++ b/.env.example
@@ -99,6 +99,13 @@ CORS_ORIGINS=*
# per-key allowedIps restrictions, set this to the proxy's address/subnet, e.g.:
# TRUSTED_PROXIES=172.18.0.0/16
+# Docker daemon endpoint used to manage the built-in datastore containers (POSTGRES_BUILTIN,
+# REDIS_BUILTIN, MINIO_BUILTIN — each in its own section below). Only the tcp://host:port form is
+# parsed; anything else, including a unix:// path, falls back to /var/run/docker.sock. The bundled
+# compose sets this to its own socket-proxy and forwards no value from .env, so setting it here
+# affects a non-compose run only.
+# DOCKER_HOST=tcp://docker-proxy:2375 # set ONLY to reach a remote/proxied daemon; default is the socket
+
# =============================================================================
# ENGINE CONFIGURATION
# =============================================================================
@@ -244,6 +251,10 @@ BAILEYS_AUTH_DIR=./data/baileys
# re-resolution, or a defined empty result, so eviction never loses data. 0 disables the cap. Default 5000.
# BAILEYS_SESSION_STORE_MAX_ENTRIES=5000
+# Per-session cap on the Baileys message rows kept in the database: the newest N survive and older
+# rows are pruned after each write. A non-positive or non-numeric value falls back to the default.
+# BAILEYS_MESSAGE_STORE_LIMIT=5000
+
# Observability — Prometheus scrape endpoint at GET /api/metrics.
# Disabled by default; set a token to enable. Scrapers must send `Authorization: Bearer <token>`.
# METRICS_TOKEN=change-me-to-a-long-random-string
@@ -326,6 +337,11 @@ MINIO_BUILTIN=false # Use built-in MinIO container?
# Local storage path (if STORAGE_TYPE=local)
# STORAGE_LOCAL_PATH=./data/media
+# Cap on how many files one local-storage listing call enumerates, so a large media directory cannot
+# be walked into memory in a single request. A non-positive or non-numeric value falls back to the
+# default. Streaming reads are not affected — only the listing call is truncated.
+# STORAGE_LIST_MAX_FILES=100000
+
# S3/MinIO settings (if STORAGE_TYPE=s3, auto-configured if MINIO_BUILTIN=true)
# S3_ENDPOINT is OPTIONAL: leave it unset for standard AWS S3 (derived from region); set it only for
# an S3-compatible store (MinIO, R2, …), which also enables path-style addressing.
@@ -643,6 +659,9 @@ PLUGINS_DIR=./data/plugins # Plugin directory (default: ./data/plugins)
# downgrades AFTER an https hop is refused; a chain that starts on plain http is not itself a
# downgrade (though an http→https→http chain is still refused).
# PLUGIN_DOWNLOAD_ALLOW_INSECURE_REDIRECTS=false
+# Catalog the plugin browser reads its list of installable packages from. Point it at your own
+# published catalog to install from a private index instead of the public one.
+# PLUGIN_CATALOG_URL=https://raw.githubusercontent.com/rmyndharis/OpenWA-plugins/main/plugins.json
# =============================================================================
# SECURITY
@@ -656,6 +675,10 @@ PLUGINS_DIR=./data/plugins # Plugin directory (default: ./data/plugins)
# `dev-admin-key` instead. Ignored when API_MASTER_KEY is set.
# ALLOW_DEV_API_KEY=true
+# Where that generated first-boot key is written, and read back from on later boots. Override it when
+# the data directory is read-only, or when the key must land on a mounted secret path instead.
+# BOOTSTRAP_KEY_FILE=./data/.api-key
+
# Optional server-side pepper for API-key hashing (HMAC-SHA256 instead of plain SHA-256).
# Recommended in production. Note: setting or changing it invalidates all existing key hashes,
# so re-issue keys after enabling. Leave unset to keep the current (unpeppered) behaviour.
@@ -677,6 +700,12 @@ PLUGINS_DIR=./data/plugins # Plugin directory (default: ./data/plugins)
# pin the opt-in the production default exists to withhold. The mount is
# not behind the API-key guard, so serving it exposes the schema and the
# exact running version to anyone who can reach the port.
+# VALIDATION_ERROR_DETAIL=true # Return field-level messages on a 400 instead of a generic one.
+ # Default: ON outside production, OFF under NODE_ENV=production, so
+ # a rejected request there does not reflect the DTO shape back to
+ # the caller. Set true to debug an SDK or integration against a
+ # production instance without flipping NODE_ENV; false forces it off
+ # everywhere. Same exact-string contract as ENABLE_SWAGGER above.
# BODY_SIZE_LIMIT=25mb # Max request body size (base64 media sends ride in the JSON body)
# Aggregate cap on request-body bytes buffered across ALL connections. Once exceeded, new requests
# get 503 + Retry-After without their body being read (protects against slow-body memory pinning).
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 75738dc60..24d016f0c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Documentation
+- `.env.example` was missing six knobs the app reads at runtime — `DOCKER_HOST`, `BAILEYS_MESSAGE_STORE_LIMIT`, `STORAGE_LIST_MAX_FILES`, `PLUGIN_CATALOG_URL`, `BOOTSTRAP_KEY_FILE` and `VALIDATION_ERROR_DETAIL` — none of which any of the three key lists the completeness gate reads happens to enumerate, so the gate could not have caught them. All six are commented out, so copying the file still pins nothing.
- `docs/06-api-specification.md` restated the published contract by hand with nothing binding the two, so operations shipped without ever reaching it — the integration redrive route was documented nowhere at all. It now has a section, and a new spec compares the document's route headings to `openapi.json` in both directions; an operation deliberately documented elsewhere carries an allowlist entry naming that file, and the gate reads the file to confirm the route is really there.
- `.env.example` calls itself the single source of truth for configuration, and the Helm chart and `docs/10` both defer to it, but seven live operator knobs were missing from it — including `SERVE_DASHBOARD`, which the bundled compose forwards explicitly, so an operator wanting an API-only deployment was told the capability did not exist. A new spec binds the file to the key lists `env.validation.ts`, `env-precedence.ts` and compose already maintain, so the next one cannot go missing quietly.
- `RESOLVE_LID_TO_PHONE` was documented nowhere outside `.env.example`, so an operator receiving `@lid` senders had no path to the flag that resolves them; the event catalog now carries the `senderPhone` opt-in callout, the contact-phone endpoint points back to it, and the troubleshooting FAQ covers the symptom.