@dokebi/cli 0.4.43 → 0.4.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI.md +1 -1
- package/catalog.json +9 -7
- package/dist/output.d.ts +1 -1
- package/dist/output.js +1 -1
- package/dist/server.js +2 -1
- package/dist/verify.js +29 -21
- package/package.json +1 -1
package/AI.md
CHANGED
|
@@ -79,7 +79,7 @@ The `blog` plan, depending on the answers: `init` (when the folder is not a proj
|
|
|
79
79
|
| `dokebi deploy init [--target <systemd\|compose>] [--instance <name>]... [--port <n>] [--dry-run]` | **An existing project made ready for a server** (D-0184, §11): per instance (with @dokebi/web: `production` port 3000, `staging` 3001, another name needs `--port`, two instances never share a port: `PORT_IN_USE`; without it nothing listens: no port (0, `— (no web server)` in DEPLOY.md) and `--port` is `USAGE`) `deploy/<instance>/dokebi.example.yaml` (the sample without its secrets, with the instance's web host/port/trustProxy, storage folder and a `secrets:` list), `deploy/<instance>/secrets.example.yaml` (the secret paths with placeholders; a secret inside a list item is that field only, named by the item: `logging.targets.studio.token`, the list staying in the settings sample), `deploy/systemd/<app>-<instance>.service` (or `deploy/compose/<instance>.yaml` with `--target compose`, and Dockerfile/.dockerignore when missing), with @dokebi/db also `deploy/systemd/<app>-<instance>-backup.service`/`.timer`, `deploy/backup.mjs` and `deploy/restore-drill.mjs`, and `DEPLOY.md`. Result `{ app, target, instances[{instance, port, unit, settings, secrets, code, data, logs, backups, database}], secrets, changed, unchanged, kept }`. A second run changes nothing; a file you edited since is kept (`kept`, warning `DEPLOY_FILE_KEPT`); an untouched one is rewritten (DEPLOY.md gains a new instance). Errors `NOT_A_PROJECT`, `APP_NAME_INVALID` (package.json name), `EXAMPLE_MISSING`, `PORT_REQUIRED`, `PORT_IN_USE`, `OPTIONS_SCHEMA_UNREADABLE` (npm install first: without a plugin's schema its secrets cannot be told apart) |
|
|
80
80
|
| `dokebi deploy proxy --caddy\|--nginx --domain <host>... [--instance <name>] [--dry-run]` | The reverse proxy file of an instance (D-0184): `deploy/proxy/<app>-<instance>.Caddyfile` or `.nginx.conf`, from `deploy/<instance>/dokebi.example.yaml` (port, health routes, body limit, request timeout): TLS (Caddy's automatic certificates; nginx with certbot's paths and an http → https redirect), `X-Forwarded-For/Proto/Host`, WebSocket upgrades (nginx: other requests send no `Connection` upstream, so `keepalive 16` reuses connections, idle for at most 60 s, below the app's 72 s), unbuffered SSE (the app sends `X-Accel-Buffering: no`) and a long read timeout when the app keeps streams (SSE, WebSocket, MCP), only the listed names (nginx answers another `Host` with 421; Caddy serves only its site names), `/health/live` and `/health/ready` passed through with one `Cache-Control: no-store` (the app's own replaced), the app's own `Cache-Control` and compression left as they are. Warnings `TRUST_PROXY_MISSING` (the sample's `dokebi-web.trustProxy` lacks 127.0.0.1 or ::1) and `DOMAIN_NOT_MAPPED` (a domain not in `dokebi-app.domains`). Errors `WEB_NOT_INSTALLED`, `INSTANCE_UNKNOWN` (deploy init first) |
|
|
81
81
|
| `dokebi dev-infra [up\|start\|stop\|down\|status] [--file <path>] [--db-port <n>] [--dry-run]` | Without an action: prepare compose.yaml and the database URL in dokebi.yaml; no .env is generated. With an action: run Docker Compose using the YAML password in the child environment only. Repeat --file for additional Compose files. down retains data volumes. --db-port and --dry-run apply only to preparation. On a kept compose.yaml (`COMPOSE_KEPT`, its published port is the URL's) `--db-port <n>` changes only the published host port of `services.db` in it (every other byte of the file stays) and the URL in dokebi.yaml, with the warning `COMPOSE_PORT_CHANGED` (`hint`: `dev-infra up` recreates a running container on the new port and keeps its data volume); a taken port is `PORT_IN_USE`. A port entry the CLI cannot read (a variable, a range) refuses `--db-port` with `COMPOSE_PORT_UNKNOWN` (`details.file`, `details.fix`: set the entry yourself) and nothing is written; without the flag the run keeps the URL's port and warns `COMPOSE_PORT_UNKNOWN`. A MongoDB is a single-node replica set (`rs0`, D-0103): the generated mongod gets `--replSet rs0` and a key file made inside the container at each start (mongod needs one for a replica set with authentication), the healthcheck initiates the set once and passes when the member is the writable primary (so `up` returns when transactions work), and the URL ends with `replicaSet=rs0&directConnection=true`; `service.replicaSet` says so. A kept compose.yaml whose server is standalone (written before) keeps a standalone URL and gives the warning `DEV_INFRA_STANDALONE`, whose `hint` is the switch: `dev-infra down`, move compose.yaml away, `dev-infra --db-port <its port>`, `dev-infra up` (password and data volume kept). `DEV_INFRA_CONFIG_INVALID` means the main database URL is invalid/unset; `DEV_INFRA_FAILED` means the Compose action failed. |
|
|
82
|
-
| `dokebi verify [--wait-ms <n>] [--test-timeout-ms <n>]` · `verify --remote <https-url> [--timeout-ms <ms>]` | With `--remote` (D-0184) only that site is checked, nothing local runs: `{ ok, url, checks[{name, ok, warning?, status?, detail, ms}], certificate? }` with the checks `tls` (the certificate is valid for the host; under 14 days left is a warning), `redirect` (http answers a redirect to https; a warning otherwise), `live` and `ready` (the health routes of the settings when run in a project, else `/health/live` and `/health/ready`, must answer 200), `headers` (HSTS and `X-Content-Type-Options: nosniff`; on an HTML answer also `X-Frame-Options` or CSP `frame-ancestors`, and `Referrer-Policy` (a warning); `X-Powered-By` fails; HSTS under 180 days is a warning); exit 1 when a check fails. Without it: `{ ok, checks[{name, ok, skipped?, ms, code?, message?, details?}], urls[], listen[], tests?, tellUser?, relay?, finalReport?, warnings? }` (`warnings`: `ENV_DOKEBI_CONFIG_IGNORED` when `.env` sets `DOKEBI_CONFIG`, §2.2): doctor → check (`dokebi check` below, reusing the doctor result) → typecheck (skipped without the script) → build (Vite) → test (the package.json `test` script, skipped without one: `no test script`; see **Tests in verify** below) → preflight (`ALREADY_RUNNING`, `PORT_IN_USE`, `DB_URL_MISSING`; a taken web port is the user's call as in the recipe preflight: the problem has `alternative` (the first free port after it), `fix` (`npx dokebi config set dokebi-web.port=<alternative>`), `waitForUser`, `question` and `next`, and the result repeats `waitForUser`, `question` and `next`; `waitForUser` is false when the last recipe ran with `--defaults`) → start (`--wait-ms`, default 30000) → HTTP (connects to the listening address: `/health/ready`, and `GET /` with the Host header of every app domain; with neither a readiness route (`healthRoutes: false`) nor an app domain, one identity probe `GET /` that passes with any status below 500 carrying this run's header, so HTTP never passes without a request: `details.requests[].identity: true`; each request must complete within 5 s, a response cut off or never finished is `HTTP_FAILED`) → stop. `urls` are the addresses the app answers (see `start`), `listen` the bound addresses. `ok` only when everything passes (otherwise exit 1). A doctor or preflight failure skips the start; a check failure does not. It never stops an app that already runs. **HTTP counts only answers from the app verify started**: it passes a random token in `DOKEBI_VERIFY_TOKEN` and @dokebi/web echoes it in the response header `x-dokebi-verify` (only while that variable is set, no cost in production). An answer without the token comes from another server on the port: `FOREIGN_SERVER` (`details.requests[].instance: other`). When the app did not start, HTTP is skipped and fails (`NOT_STARTED`). stop ends the processes verify started by the pid start returned (no `ps` needed, works in a sandbox); `APP_EXITED` when the app ended by itself first, `STOP_FAILED` when a signal cannot be sent; a SIGINT, SIGTERM or SIGHUP to verify while its app runs stops that app first (forced after 5 s), then verify ends as the signal says (also while the start step still waits for the app: nothing it started is left running). With `ok: true` and an applied recipe (`.dokebi/recipe.json`), `tellUser: string[]` holds the lines your final message must include (each choice with who made it: `<id> = <value>: your answer`, `: chosen by the AI (you left the choice to it)` followed by `: <aiReason>` when you gave one, `: chosen by default (<reason>)`; then the notices); a notice that names the app address (the admin login) is filled in with the address the app has now (`urls`, else `dokebi-web.port`), so a later port change shows the new one; with them comes `relay: { tellUser: 'verbatim', instruction }` (AI-M05 F6): copy the lines unchanged into your final message, never translated, reworded or summarized, and add your own summary only after them; when verify also has `finalReport`, the instruction adds that the table or list a heading announces (Database practice, Silenced check rules) is written right under it in the same message — a results file or a link does not replace it; the human output ends with them under `Tell the user exactly these lines.` and the same instruction. An EJS blog without @dokebi/session gets a notice that offers it to the user (AI-M05 F3: with `--defaults` the next step says not to add it, since the defaults are the plan; with `--answers-from user` the next step says to ask first). Without a recipe record there is no `tellUser`. With `ok: true` and @dokebi/db installed, `finalReport: string[]` (D-0105 §4) says what your final message must also contain, written by you rather than copied: the table of section 6 of `node_modules/@dokebi/db/AI.md`, one row per rule with the queries or jobs it applies to, the measurement and the verdict (pass, or the fix you made) (a results file does not replace it); the human output lists it under `Your final message must also contain:`, and when there are `tellUser` lines they end with a heading for each (`Database practice (@dokebi/db AI.md section 6): the table below, here in this message, has one row per rule of that section (6.1 Cost follows the page, not the table; …), …`, naming the rules of the installed AI.md, `Silenced check rules (dokebi-check allow markers), each followed below, here in this message, by why the rule does not apply there: …`): relay them as they are and write the table or the reasons under them |
|
|
82
|
+
| `dokebi verify [--wait-ms <n>] [--test-timeout-ms <n>]` · `verify --remote <https-url> [--timeout-ms <ms>]` | With `--remote` (D-0184) only that site is checked, nothing local runs: `{ ok, url, checks[{name, ok, warning?, status?, detail, ms}], certificate? }` with the checks `tls` (the certificate is valid for the host; under 14 days left is a warning), `redirect` (http answers a redirect to https; a warning otherwise), `live` and `ready` (the health routes of the settings when run in a project, else `/health/live` and `/health/ready`, must answer 200), `headers` (HSTS and `X-Content-Type-Options: nosniff`; on an HTML answer also `X-Frame-Options` or CSP `frame-ancestors`, and `Referrer-Policy` (a warning); `X-Powered-By` fails; HSTS under 180 days is a warning); exit 1 when a check fails. Without it: `{ ok, checks[{name, ok, skipped?, ms, code?, message?, details?}], urls[], listen[], tests?, tellUser?, relay?, finalReport?, warnings? }` (`warnings`: `ENV_DOKEBI_CONFIG_IGNORED` when `.env` sets `DOKEBI_CONFIG`, §2.2): doctor → check (`dokebi check` below, reusing the doctor result) → typecheck (skipped without the script) → build (Vite) → test (the package.json `test` script, skipped without one: `no test script`; see **Tests in verify** below) → preflight (`ALREADY_RUNNING`, `PORT_IN_USE`, `DB_URL_MISSING`; a taken web port is the user's call as in the recipe preflight: the problem has `alternative` (the first free port after it), `fix` (`npx dokebi config set dokebi-web.port=<alternative>`), `waitForUser`, `question` and `next`, and the result repeats `waitForUser`, `question` and `next`; `waitForUser` is false when the last recipe ran with `--defaults`) → start (`--wait-ms`, default 30000) → HTTP (connects to the listening address: `/health/ready`, and `GET /` with the Host header of every app domain; with neither a readiness route (`healthRoutes: false`) nor an app domain, one identity probe `GET /` that passes with any status below 500 carrying this run's header, so HTTP never passes without a request: `details.requests[].identity: true`; each request must complete within 5 s, a response cut off or never finished is `HTTP_FAILED`) → stop. `urls` are the addresses the app answers (see `start`), `listen` the bound addresses. `ok` only when everything passes (otherwise exit 1). A doctor or preflight failure skips the start; a check failure does not. It never stops an app that already runs. **HTTP counts only answers from the app verify started**: it passes a random token in `DOKEBI_VERIFY_TOKEN` and @dokebi/web echoes it in the response header `x-dokebi-verify` (only while that variable is set, no cost in production). An answer without the token comes from another server on the port: `FOREIGN_SERVER` (`details.requests[].instance: other`). When the app did not start, HTTP is skipped and fails (`NOT_STARTED`). A settings file with `dokebi-web.listen: false` (a worker process of the same code picked with `DOKEBI_CONFIG`, D-0221) skips HTTP as passed (`skipped: 'listen: false (dokebi-web): this process opens no port'`) and the preflight's port check; start still proves the app started (0.4.45). stop ends the processes verify started by the pid start returned (no `ps` needed, works in a sandbox); `APP_EXITED` when the app ended by itself first, `STOP_FAILED` when a signal cannot be sent; a SIGINT, SIGTERM or SIGHUP to verify while its app runs stops that app first (forced after 5 s), then verify ends as the signal says (also while the start step still waits for the app: nothing it started is left running). With `ok: true` and an applied recipe (`.dokebi/recipe.json`), `tellUser: string[]` holds the lines your final message must include (each choice with who made it: `<id> = <value>: your answer`, `: chosen by the AI (you left the choice to it)` followed by `: <aiReason>` when you gave one, `: chosen by default (<reason>)`; then the notices); a notice that names the app address (the admin login) is filled in with the address the app has now (`urls`, else `dokebi-web.port`), so a later port change shows the new one; with them comes `relay: { tellUser: 'verbatim', instruction }` (AI-M05 F6): copy the lines unchanged into your final message, never translated, reworded or summarized, and add your own summary only after them; when verify also has `finalReport`, the instruction adds that the table or list a heading announces (Database practice, Silenced check rules) is written right under it in the same message — a results file or a link does not replace it; the human output ends with them under `Tell the user exactly these lines.` and the same instruction. An EJS blog without @dokebi/session gets a notice that offers it to the user (AI-M05 F3: with `--defaults` the next step says not to add it, since the defaults are the plan; with `--answers-from user` the next step says to ask first). Without a recipe record there is no `tellUser`. With `ok: true` and @dokebi/db installed, `finalReport: string[]` (D-0105 §4) says what your final message must also contain, written by you rather than copied: the table of section 6 of `node_modules/@dokebi/db/AI.md`, one row per rule with the queries or jobs it applies to, the measurement and the verdict (pass, or the fix you made) (a results file does not replace it); the human output lists it under `Your final message must also contain:`, and when there are `tellUser` lines they end with a heading for each (`Database practice (@dokebi/db AI.md section 6): the table below, here in this message, has one row per rule of that section (6.1 Cost follows the page, not the table; …), …`, naming the rules of the installed AI.md, `Silenced check rules (dokebi-check allow markers), each followed below, here in this message, by why the rule does not apply there: …`): relay them as they are and write the table or the reasons under them |
|
|
83
83
|
| `dokebi mail preview <name> [--locale <locale>]` | Render preview.json without network connections or data hooks; JSON includes subject, html, text and locale |
|
|
84
84
|
| `dokebi describe [--with-db] [--timeout-ms <ms>]` | What the app has, without serving (D-0077): it loads the project like `start` (the settings file — `DOKEBI_CONFIG`, else dokebi.yaml —, `src/dokebi.generated.ts`, the project's `.env` under the environment, the doctor check first: `START_CHECK_FAILED`) in core's describe mode: every plugin's setup runs, no start or ready hook, so nothing listens, no database, Redis or NATS connection is opened and no job is bound. `--json` is `{ schemaVersion: 1, app: { name, core, plugins[{name, version, described}], apps[], domains[], unknownDomain, web, session, csrf, auth, … }, routes[{method, url, id?, app?, host?, constraints?, schema?{body, querystring, params, headers, response}, config?{auth, can, roles, csrf, …}, auth?{mode, realm, via, can?}, seal?, health?}], pages[{app, engine: ejs\|inertia, template, name, file}], jobs[], schedules[], errors[{code, status, message, hint?}], config: { keys[], env[{name, plugin, purpose}] }, db: { connections[{name, adapter, startup?, dialect?, schemas?, tables?, collections?, unavailable?}], unavailable? }, unavailable[{plugin, section?, code, reason}], warnings?, ms }`, checked by the JSON Schema `describe.schema.json` of this package. `route.auth` is the login rule @dokebi/auth applies (its `default` included); `config.keys` are option paths and `config.env` variable names, **never a value**; `errors` are the codes of `src/shared/errors.ts`. A plugin whose setup fails is listed in `unavailable` (with the plugins that need it, `DEPENDENCY_UNAVAILABLE`) and the rest is still described; a database, Redis, NATS, SMTP or S3 that is not running is never the reason (D-0133: plugins on never-connected clients still set up; a nats event bus refuses only `publish`, with `DESCRIBING`), while a real configuration error (an unknown connection name, a connection of the wrong kind) still is. Without `--with-db` the tables are not read (`db.unavailable` says so; describe mode never connects). **`--with-db`** adds a separate step that connects: for each dokebi-db connection it runs the project's `dokebi-migrate schema --connection <name> --json` (@dokebi/migrate 0.4.2) and puts its `dialect` and `tables` (columns with type, nullable, default, identity, generated; primary key, unique, indexes, foreign keys, checks; `isMigrationHistory` on `dokebi_migrations`) or MongoDB `collections` into `db.connections[]`; a connection it cannot read (not listed in `options.dokebi-migrate.connections`, @dokebi/migrate missing, the database refused, `--timeout-ms` passed) gets its own `unavailable` reason and describe still answers. `startup: 'optional'` marks a connection dokebi.yaml lets the app run without ([D-0127](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0127-optional-db-startup.md); the default `required` is left out); `dokebi-migrate schema` opens it as required, so while it is down it is `unavailable` with the open or check error, and `drift` lists it in `unavailable`. No URL or password is printed. Run it before writing a migration so you change what the database really has. Errors: `DESCRIBE_TIMEOUT` (default 30000 ms), `DESCRIBE_FAILED` (the app exited first; `details.output` holds its last lines), `DESCRIBE_UNSUPPORTED` (@dokebi/core older than 0.4.2), or the app's own code (`INVALID_PLUGIN_OPTIONS`, …). Read it before you change an app you did not write |
|
|
85
85
|
| `dokebi describe --openapi [--app <name>]` | OpenAPI 3.1 of the same description (D-0077 C), **one document per app** (route ids are unique per app): `info.title` the app, `servers` its domains (`http://<host>:<port>` for local hosts, `https://<host>` otherwise), `operationId` the route `config.id` (`<id>_<method>` on every operation when the id names several: a route of several methods, or the routes of one plugin route key such as `oauth.authorize_get` and `oauth.authorize_post`, D-0142), else `<method>_<path>` (`get_posts_id`), numbered `_2` on a collision. Request parameters and bodies (JSON, and form bodies with `formBody`) and responses come from the route schemas (draft-07 `items` tuples, `dependencies`, `nullable` and local `#/definitions` refs rewritten for JSON Schema 2020-12; a ref to an `addSchema` schema becomes an open schema with `x-dokebi-ref`). `components.schemas.DokebiError` is the D-0074 body; operations list 422 `VALIDATION_FAILED` (body or query schema), 400 `INVALID_REQUEST` (params or headers schema), 401 `UNAUTHENTICATED` (a login needed), 403 `FORBIDDEN` (`roles` or `can`) and 403 `CSRF_FAILED` (POST, PUT, PATCH, DELETE under @dokebi/csrf unless `config.csrf: false` or `exclude`, with the token header). Security: `cookieAuth` (the session cookie) and `bearerAuth` (`via: token` or `any`), `{}` added for `optional`; `x-dokebi-auth` keeps `{ mode, realm, via, roles?, can? }` (also `routes[].auth.roles` in `--json`). Health and Vite dev routes are left out; routes outside apps are in every app's document. The app's `defineErrors` codes are `x-dokebi-errors`. Without `--app` and with several apps: `{ apps: { <name>: document } }`; an unknown name is `UNKNOWN_APP`. Without `--json` the document is printed as JSON |
|
package/catalog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "Generated by scripts/catalog/build.ts from package.json dokebiCatalog fields and packages/cli/catalog-src (D-0065). Do not edit; run node scripts/catalog/build.ts.",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"cli": "0.4.
|
|
4
|
+
"cli": "0.4.45",
|
|
5
5
|
"core": {
|
|
6
6
|
"package": "@dokebi/core",
|
|
7
7
|
"version": "0.4.7"
|
|
@@ -446,7 +446,7 @@
|
|
|
446
446
|
{
|
|
447
447
|
"id": "dokebi-app",
|
|
448
448
|
"package": "@dokebi/app",
|
|
449
|
-
"version": "0.4.
|
|
449
|
+
"version": "0.4.10",
|
|
450
450
|
"kind": "plugin",
|
|
451
451
|
"summary": "Several apps chosen by request domain (src/apps/<app>) with a template each; installs web, controller and template-ejs with it",
|
|
452
452
|
"description": "Multiple apps per project for Dokebi: pick the app and template by request domain, with EJS and Inertia skeletons.",
|
|
@@ -820,7 +820,7 @@
|
|
|
820
820
|
{
|
|
821
821
|
"id": null,
|
|
822
822
|
"package": "@dokebi/cli",
|
|
823
|
-
"version": "0.4.
|
|
823
|
+
"version": "0.4.45",
|
|
824
824
|
"kind": "cli",
|
|
825
825
|
"summary": "Commands to create a project, browse the plugin catalog, run recipes, install plugins and verify (dokebi)",
|
|
826
826
|
"description": "Project scaffolding, plugin catalog, recipes, install and verification CLI for Dokebi.",
|
|
@@ -1692,7 +1692,7 @@
|
|
|
1692
1692
|
{
|
|
1693
1693
|
"id": "dokebi-job",
|
|
1694
1694
|
"package": "@dokebi/job",
|
|
1695
|
-
"version": "0.4.
|
|
1695
|
+
"version": "0.4.6",
|
|
1696
1696
|
"kind": "plugin",
|
|
1697
1697
|
"summary": "NATS JetStream job queue (at least once, retries, DLQ)",
|
|
1698
1698
|
"description": "Bounded durable jobs over the Dokebi NATS provider: retries, delayed redelivery and a dead-letter stream.",
|
|
@@ -2138,7 +2138,7 @@
|
|
|
2138
2138
|
{
|
|
2139
2139
|
"id": "dokebi-module",
|
|
2140
2140
|
"package": "@dokebi/module",
|
|
2141
|
-
"version": "0.4.
|
|
2141
|
+
"version": "0.4.7",
|
|
2142
2142
|
"kind": "plugin",
|
|
2143
2143
|
"summary": "Modules that hold one feature each (src/shared/modules/<module>); an app attaches them under a prefix",
|
|
2144
2144
|
"description": "Feature modules for Dokebi apps: controllers, models, views and routes in one folder mounted under a prefix.",
|
|
@@ -3005,7 +3005,7 @@
|
|
|
3005
3005
|
{
|
|
3006
3006
|
"id": "dokebi-scheduler",
|
|
3007
3007
|
"package": "@dokebi/scheduler",
|
|
3008
|
-
"version": "0.4.
|
|
3008
|
+
"version": "0.4.4",
|
|
3009
3009
|
"kind": "plugin",
|
|
3010
3010
|
"summary": "Submits fixed-interval and cron schedules as @dokebi/job jobs (one leader through Redis)",
|
|
3011
3011
|
"description": "Interval and cron schedules (with time zones) for Dokebi that submit jobs, with one leader over Redis.",
|
|
@@ -3041,6 +3041,7 @@
|
|
|
3041
3041
|
"optionKeys": [
|
|
3042
3042
|
"allowInCluster",
|
|
3043
3043
|
"coordination",
|
|
3044
|
+
"enabled",
|
|
3044
3045
|
"logRepeatWindowMs",
|
|
3045
3046
|
"retryAfterMs",
|
|
3046
3047
|
"schedules",
|
|
@@ -3665,7 +3666,7 @@
|
|
|
3665
3666
|
{
|
|
3666
3667
|
"id": "dokebi-web",
|
|
3667
3668
|
"package": "@dokebi/web",
|
|
3668
|
-
"version": "0.4.
|
|
3669
|
+
"version": "0.4.9",
|
|
3669
3670
|
"kind": "plugin",
|
|
3670
3671
|
"summary": "Fastify 5 HTTP server (503 before ready, health paths, drain, zero-downtime cluster replacement, security headers and overload protection on by default)",
|
|
3671
3672
|
"description": "Fastify 5 HTTP server owned by a Dokebi app: 503 before ready, health routes, drain and cluster handover.",
|
|
@@ -3717,6 +3718,7 @@
|
|
|
3717
3718
|
"healthRoutes",
|
|
3718
3719
|
"host",
|
|
3719
3720
|
"linger",
|
|
3721
|
+
"listen",
|
|
3720
3722
|
"logRepeatWindowMs",
|
|
3721
3723
|
"maxBodyBytes",
|
|
3722
3724
|
"maxRouteBodyBytes",
|
package/dist/output.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.4.
|
|
1
|
+
export declare const CLI_VERSION = "0.4.45";
|
|
2
2
|
export declare function envelope(command: string, result: unknown, ok?: boolean): object;
|
|
3
3
|
export declare function failure(command: string, error: unknown, mutationStarted: boolean): object;
|
package/dist/output.js
CHANGED
package/dist/server.js
CHANGED
|
@@ -468,7 +468,8 @@ async function configuredUrl(root) {
|
|
|
468
468
|
});
|
|
469
469
|
return undefined;
|
|
470
470
|
}
|
|
471
|
-
|
|
471
|
+
// D-0221: `listen: false` opens no port, whatever port is configured.
|
|
472
|
+
if (web.listen === false || typeof web.port !== 'number' || web.port <= 0)
|
|
472
473
|
return undefined;
|
|
473
474
|
const host = typeof web.host !== 'string' || ['0.0.0.0', '::', '[::]'].includes(web.host)
|
|
474
475
|
? '127.0.0.1'
|
package/dist/verify.js
CHANGED
|
@@ -277,6 +277,7 @@ async function settings(root) {
|
|
|
277
277
|
vite,
|
|
278
278
|
web: {
|
|
279
279
|
installed: ids.has('dokebi-web'),
|
|
280
|
+
listen: web.listen !== false,
|
|
280
281
|
port: typeof web.port === 'number' ? web.port : 0,
|
|
281
282
|
host: typeof web.host === 'string' ? web.host : '127.0.0.1',
|
|
282
283
|
ready: web.healthRoutes === false ? null : (web.healthRoutes?.ready ?? '/health/ready'),
|
|
@@ -524,7 +525,10 @@ export async function verify(root, options = {}) {
|
|
|
524
525
|
message: `The app already runs (pid ${running.pid}); verify does not stop it`,
|
|
525
526
|
fix: 'npx dokebi stop',
|
|
526
527
|
});
|
|
527
|
-
else if (project.web.installed &&
|
|
528
|
+
else if (project.web.installed &&
|
|
529
|
+
project.web.listen &&
|
|
530
|
+
project.web.port > 0 &&
|
|
531
|
+
(await portInUse(project.web.port)))
|
|
528
532
|
problems.push(await webPortProblem(project.web.port, (await readAppliedRecipes(root)).at(-1)?.answersFrom === 'defaults'));
|
|
529
533
|
for (const db of project.dbUrls)
|
|
530
534
|
if (db.missing)
|
|
@@ -571,32 +575,36 @@ export async function verify(root, options = {}) {
|
|
|
571
575
|
: project.web.host;
|
|
572
576
|
const listen = started?.listen.length
|
|
573
577
|
? started.listen
|
|
574
|
-
: project.web.installed && project.web.port > 0
|
|
578
|
+
: project.web.installed && project.web.listen && project.web.port > 0
|
|
575
579
|
? [`http://${host.includes(':') ? `[${host}]` : host}:${project.web.port}`]
|
|
576
580
|
: [];
|
|
577
581
|
try {
|
|
578
582
|
await run('http', !project.web.installed
|
|
579
583
|
? skip('no web plugin')
|
|
580
|
-
: !
|
|
581
|
-
? //
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
})
|
|
588
|
-
: async () => {
|
|
589
|
-
// Connect to the listening address; the Host header of each app domain picks the
|
|
590
|
-
// app (the readiness route answers every host).
|
|
591
|
-
const base = listen.find((url) => url.includes('127.0.0.1')) ?? listen[0];
|
|
592
|
-
if (!base)
|
|
593
|
-
return {
|
|
584
|
+
: !project.web.listen
|
|
585
|
+
? // D-0221: a worker process (`dokebi-web.listen: false`) has no address to check; the
|
|
586
|
+
// start check proved it started.
|
|
587
|
+
skip('listen: false (dokebi-web): this process opens no port')
|
|
588
|
+
: !started?.ready
|
|
589
|
+
? // Nothing of ours answers: whatever is on the port proves nothing (AI-M02).
|
|
590
|
+
async () => ({
|
|
594
591
|
ok: false,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
592
|
+
skipped: 'the app did not start',
|
|
593
|
+
code: 'NOT_STARTED',
|
|
594
|
+
message: 'No HTTP check ran: the app verify starts did not start (see the start check)',
|
|
595
|
+
})
|
|
596
|
+
: async () => {
|
|
597
|
+
// Connect to the listening address; the Host header of each app domain picks the
|
|
598
|
+
// app (the readiness route answers every host).
|
|
599
|
+
const base = listen.find((url) => url.includes('127.0.0.1')) ?? listen[0];
|
|
600
|
+
if (!base)
|
|
601
|
+
return {
|
|
602
|
+
ok: false,
|
|
603
|
+
code: 'URL_UNKNOWN',
|
|
604
|
+
message: 'No address: the web listening line is missing and options.dokebi-web.port is 0',
|
|
605
|
+
};
|
|
606
|
+
return httpChecks(base, { ready: project.web.ready, domains: project.domains }, token);
|
|
607
|
+
});
|
|
600
608
|
}
|
|
601
609
|
finally {
|
|
602
610
|
await run('stop', started
|