Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(infra): describe the status fallback and the saved built-in mode

Yudhi Armyndharis4de5af0f71c1
diff --git a/dashboard/src/services/api.ts b/dashboard/src/services/api.ts
index d134fcb34..db372189e 100644
--- a/dashboard/src/services/api.ts
+++ b/dashboard/src/services/api.ts
@@ -622,7 +622,8 @@ export interface UpdateCheck {
export interface InfraStatus {
// `builtIn` = OpenWA's own bundled container is actually running and backing this service (live),
- // not just the saved intent — falls back to the saved flag when Docker is unavailable. (#488)
+ // not just the saved intent; falls back to the saved flag (the environment's first) when Docker is
+ // unavailable. (#488)
database: { connected: boolean; type: string; host: string; builtIn: boolean };
redis: { enabled: boolean; connected: boolean; host: string; port: number; builtIn: boolean };
queue: {
@@ -656,8 +657,9 @@ export interface SavedConfig {
type: 'sqlite' | 'postgres';
builtIn: boolean;
// Whether the saved config states the built-in mode of this service. False when a host the environment
- // pins decides it, when the file does not select the service (the first boot writes every flag as false)
- // and when nothing is saved: the form then follows what /infra/status reports as running.
+ // pins decides it, when the file does not select the service (the first boot writes every flag as false),
+ // when the file holds the bundled host with the flag not true (the next boot dials the container) and when
+ // nothing is saved: the form then follows what /infra/status reports as running.
builtInSet: boolean;
host: string;
port: string;
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.md
index c31458707..b5da3eebe 100644
--- a/docs/06-api-specification.md
+++ b/docs/06-api-specification.md
@@ -5521,7 +5521,7 @@ Aggregate infrastructure status (database, Redis, queue, storage, engine).
The `queue.webhooks` counters are live BullMQ job counts (`pending` = waiting + active + delayed; plus `completed`/`failed`), degrading to zeros when the queue is disabled or Redis is unreachable. `redis.connected` is a live probe. `database.host` is the configured `DATABASE_HOST` (default `localhost`) and is reported on SQLite too, so read `type`, not `host`, to tell the database apart.
-`builtIn` (on `database`/`redis`/`storage`) reports whether OpenWA's own bundled container is actually running _and_ backing this service, detected live from the labelled container; when Docker is unreachable it falls back to the saved `*_BUILTIN` intent from `data/.env.generated`. In S3 mode `storage` additionally carries `bucket` (when one is configured) and `s3Available` (re-probed, throttled, while false; once true it stays true until a restart, so a later outage does not clear it); in local mode neither key is present. `engine.webVersion`/`engine.webVersionSource` (`pinned` / `auto` / `native`) appear only on `whatsapp-web.js`; `webVersion` is `null` until the auto-resolve first succeeds. `engine.browserArgs` is the effective launch argument list: `PUPPETEER_ARGS` (or the four defaults shown) with `--lang=en-US` appended unless a `--lang` flag is already present.
+`builtIn` (on `database`/`redis`/`storage`) reports whether OpenWA's own bundled container is actually running _and_ backing this service, detected live from the labelled container; when Docker is unreachable it falls back to the saved `*_BUILTIN` flag (one pinned by the environment first, else the one in `data/.env.generated`), and a host name alone counts for nothing there, since an external server may be called `postgres`. In S3 mode `storage` additionally carries `bucket` (when one is configured) and `s3Available` (re-probed, throttled, while false; once true it stays true until a restart, so a later outage does not clear it); in local mode neither key is present. `engine.webVersion`/`engine.webVersionSource` (`pinned` / `auto` / `native`) appear only on `whatsapp-web.js`; `webVersion` is `null` until the auto-resolve first succeeds. `engine.browserArgs` is the effective launch argument list: `PUPPETEER_ARGS` (or the four defaults shown) with `--lang=en-US` appended unless a `--lang` flag is already present.
`envPinned` lists which of `DATABASE_TYPE`, `REDIS_ENABLED`, `STORAGE_TYPE`, `STORAGE_LOCAL_PATH`, `ENGINE_TYPE`, `PUPPETEER_HEADLESS`, `SESSION_DATA_PATH` and `PUPPETEER_ARGS` the host environment or the project `.env` sets. Those layers win over `data/.env.generated`, so a value saved for one of these keys through `PUT /api/infra/config` cannot take effect until that layer is changed.
@@ -5651,7 +5651,7 @@ Read the effective infrastructure config used to hydrate the dashboard form. Eac
}
```
-`builtInSet` says whether the saved configuration states the built-in mode of the database, Redis or storage. It is `false` when a host pinned by the environment (`DATABASE_HOST`, `REDIS_HOST`, `S3_ENDPOINT`) decides the mode, in which case `builtIn` reports the pin (`true` for the bundled host `postgres`, `redis` or `http://minio:9000`), when the saved file does not select the service (the first boot writes every flag as `false` next to a service that is not in use), and when nothing is saved. Read what runs from `GET /api/infra/status` then. A flag pinned by the environment itself counts as stated.
+`builtInSet` says whether the saved configuration states the built-in mode of the database, Redis or storage. It is `false` when a host pinned by the environment (`DATABASE_HOST`, `REDIS_HOST`, `S3_ENDPOINT`) decides the mode, in which case `builtIn` reports the pin (`true` for the bundled host `postgres`, `redis` or `http://minio:9000`), when the saved file does not select the service (the first boot writes every flag as `false` next to a service that is not in use), when the file holds the bundled host with the flag not `true` (the next boot dials the container, so `builtIn` is `true`), and when nothing is saved. Read what runs from `GET /api/infra/status` then. A flag pinned by the environment itself counts as stated.
When nothing supplies a key — no pinned environment value and the file absent or silent about it — empty-string/default values are returned (`schema='public'`, `poolSize=10`, `sslRejectUnauthorized=true`, `engine.type='whatsapp-web.js'`, `headless=true`).
diff --git a/openapi.json b/openapi.json
index dad08c321..c55a4a11b 100644
--- a/openapi.json
+++ b/openapi.json
@@ -21875,7 +21875,7 @@
},
"builtIn": {
"type": "boolean",
- "description": "Whether OpenWA's own bundled container is actually running and backing this service, detected live from the labelled container rather than read from the saved intent. Falls back to the saved flag when Docker is unavailable.",
+ "description": "Whether OpenWA's own bundled container is actually running and backing this service, detected live from the labelled container rather than read from the saved intent. When Docker is unavailable it falls back to the saved flag (the environment's first), and a host name alone proves nothing.",
"example": true
}
},
@@ -22235,7 +22235,7 @@
},
"builtInSet": {
"type": "boolean",
- "description": "Whether the saved configuration states the built-in mode of this service. False when a host pinned by the environment decides it (builtIn then reports the pin: true for the bundled host), when the saved file does not select the service (the first boot writes every flag as false next to a service that is not in use), and when nothing is saved. When false, read what runs from /infra/status.",
+ "description": "Whether the saved configuration states the built-in mode of this service. False when a host pinned by the environment decides it (builtIn then reports the pin: true for the bundled host), when the saved file does not select the service (the first boot writes every flag as false next to a service that is not in use), when the file holds the bundled host with the flag not true (the next boot dials the container, builtIn is true), and when nothing is saved. When false, read what runs from /infra/status.",
"example": true
},
"host": {
@@ -22306,7 +22306,7 @@
},
"builtInSet": {
"type": "boolean",
- "description": "Whether the saved configuration states the built-in mode of this service. False when a host pinned by the environment decides it (builtIn then reports the pin: true for the bundled host), when the saved file does not select the service (the first boot writes every flag as false next to a service that is not in use), and when nothing is saved. When false, read what runs from /infra/status.",
+ "description": "Whether the saved configuration states the built-in mode of this service. False when a host pinned by the environment decides it (builtIn then reports the pin: true for the bundled host), when the saved file does not select the service (the first boot writes every flag as false next to a service that is not in use), when the file holds the bundled host with the flag not true (the next boot dials the container, builtIn is true), and when nothing is saved. When false, read what runs from /infra/status.",
"example": true
},
"host": {
@@ -22362,7 +22362,7 @@
},
"builtInSet": {
"type": "boolean",
- "description": "Whether the saved configuration states the built-in mode of this service. False when a host pinned by the environment decides it (builtIn then reports the pin: true for the bundled host), when the saved file does not select the service (the first boot writes every flag as false next to a service that is not in use), and when nothing is saved. When false, read what runs from /infra/status.",
+ "description": "Whether the saved configuration states the built-in mode of this service. False when a host pinned by the environment decides it (builtIn then reports the pin: true for the bundled host), when the saved file does not select the service (the first boot writes every flag as false next to a service that is not in use), when the file holds the bundled host with the flag not true (the next boot dials the container, builtIn is true), and when nothing is saved. When false, read what runs from /infra/status.",
"example": true
},
"localPath": {
diff --git a/src/modules/infra/dto/infra-response.dto.ts b/src/modules/infra/dto/infra-response.dto.ts
index 50e85ee0f..3abbbed04 100644
--- a/src/modules/infra/dto/infra-response.dto.ts
+++ b/src/modules/infra/dto/infra-response.dto.ts
@@ -24,8 +24,8 @@ export class InfraDatabaseStatusDto {
@ApiProperty({
description:
"Whether OpenWA's own bundled container is actually running and backing this service, " +
- 'detected live from the labelled container rather than read from the saved intent. Falls back ' +
- 'to the saved flag when Docker is unavailable.',
+ 'detected live from the labelled container rather than read from the saved intent. When Docker is ' +
+ "unavailable it falls back to the saved flag (the environment's first), and a host name alone proves nothing.",
example: true,
})
builtIn!: boolean;
@@ -238,8 +238,9 @@ export class InfraUpdateCheckResponseDto {
const BUILT_IN_SET_DESCRIPTION =
'Whether the saved configuration states the built-in mode of this service. False when a host pinned by the ' +
'environment decides it (builtIn then reports the pin: true for the bundled host), when the saved file does not ' +
- 'select the service (the first boot writes every flag as false next to a service that is not in use), and when ' +
- 'nothing is saved. When false, read what runs from /infra/status.';
+ 'select the service (the first boot writes every flag as false next to a service that is not in use), when the ' +
+ 'file holds the bundled host with the flag not true (the next boot dials the container, builtIn is true), and ' +
+ 'when nothing is saved. When false, read what runs from /infra/status.';
export class InfraConfigDatabaseDto {
@ApiProperty({ enum: ['sqlite', 'postgres'], example: 'postgres' })