@nocobase/app-installer 0.1.0-beta.3 → 0.1.0-beta.5

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/README.md CHANGED
@@ -1,22 +1,34 @@
1
1
  # @nocobase/app-installer
2
2
 
3
- Installs, upgrades and rolls back a NocoBase 3 application on a server, and runs it under pm2. It takes one of two sources, fixed when the application is installed:
3
+ Installs, upgrades and rolls back a NocoBase 3 application on a server, and runs it under pm2. Use `--app studio` to download and build the published `@nocobase/studio` application on the server, or `--archive` to unpack a deployment archive built elsewhere with `pnpm build --tar`. Only npm application installs need pnpm (11 or later); neither route needs a repository checkout.
4
4
 
5
- - **A deployment archive** you build in the application project with `pnpm build --tar`. The server unpacks it and runs it; it needs neither the sources nor pnpm. This is how an application of your own is deployed without a Hub.
6
- - **The published Hub template**, `--template hub`, for a Hub whose source you do not change. The installer generates the Hub from `@nocobase/app-template-hub`, builds it on the server and keeps only the deployment archive. A Hub you customise is an application project: create it with `pnpm create @nocobase/app hub --template=hub` and deploy its archive like any other.
5
+ Each installation lives in a directory of its own, with its own port and pm2 process, so one server can run several. Docker remains the other way to run an application.
7
6
 
8
- Each installation lives in a directory of its own, with its own port and pm2 process, so one server can run several. A Hub deployed from an archive — a Hub project of your own — is recognised as a Hub by its manifest and treated like one built from the template: its hosted applications stop with it, and pm2 leaves its App Host child to it. Docker remains the other way to run an application without a Hub.
7
+ Earlier versions could also build the published Hub template on the server (`--template hub`). That source is gone: an installation recorded as built from a template is refused with `STATE_UNSUPPORTED`, and stays manageable with the app-installer version that installed it.
8
+
9
+ ## Published applications
10
+
11
+ ```bash
12
+ npx --yes --registry=https://registry.npmjs.org @nocobase/app-installer install /srv/nocobase/studio --app studio --origin https://studio.example.com
13
+ # Equivalent application name: --app @nocobase/studio
14
+ # Select a version or tag: --app studio@beta or --app @nocobase/studio@<version>
15
+ npx --yes --registry=https://registry.npmjs.org @nocobase/app-installer upgrade --dir /srv/nocobase/studio --yes
16
+ ```
17
+
18
+ Bare application names expand to `@nocobase/<name>`. Other publishers use the full scoped name, such as `--app @acme/crm`. Choose exactly one of `--app` and `--archive`; `--template` is not supported. A published application includes its buildable sources, development dependencies, `build` script and `nocobase.templateKind: app`. The installer preserves its package name and version, installs dependencies and builds its deployment archive in a temporary directory, then removes the sources and build dependencies. The application package and dependencies execute their normal install/build scripts, so choose a publisher you trust. A requested database driver must be declared by the application package.
19
+
20
+ `--registry` (or `NOCOBASE_REGISTRY`) selects the registry used for the application and its dependencies and is saved in `installer.json`. npm and pnpm use the service user's registry credentials. Installing an npm application requires npm and pnpm 11+ on PATH, in addition to Node and pm2. The build needs more memory, disk space and time than unpacking an archive.
21
+
22
+ An npm installation records `source.kind: app` and the full package name. `upgrade` resolves that package's `latest` tag; `--to <version or tag>` selects another release for that operation, and `--rebuild` rebuilds the installed version for the current server. An install with `@beta` or an exact version does not pin future upgrades: use `--to beta` or `--to <version>` when needed. The installed version is a no-op unless rebuilding or adapting to a changed Node major. Downgrades require rollback. The new build completes while the previous release keeps serving; configuration, SQLite backup, migration, health checks and rollback use the same path as archive upgrades. Archive installations still require `upgrade --archive` and cannot switch source kinds in place.
9
23
 
10
24
  ## Requirements
11
25
 
12
26
  - Linux or macOS. On Windows, use WSL: switching releases relies on symbolic links and atomic renames.
13
- - Node.js 24 or later. `--template` also needs pnpm 11 or later.
27
+ - Node.js 24 or later.
14
28
  - pm2 4.3 or later, installed globally (`npm install -g pm2`), to start the application. A copy fetched through `npx` does not work, because `pm2 startup` writes a boot service that names pm2's own path.
15
29
 
16
30
  NocoBase 3 packages are published to the public npm registry. The commands below use `--yes` to skip npx's own install prompt. `--registry` or `NOCOBASE_REGISTRY` selects a private registry when needed; the installer records that registry in `installer.json`, so later commands for an existing installation keep using its original source.
17
31
 
18
- `--template` builds the Hub on the machine it runs on, which takes several minutes; give `install` and `upgrade` a timeout to match when a script or an agent runs them.
19
-
20
32
  ## Building an archive
21
33
 
22
34
  In the application project, build for the server rather than for the machine you build on, and copy the archive over:
@@ -32,77 +44,70 @@ scp storage/exports/dist.tar.gz user@server:/tmp/crm.tar.gz
32
44
 
33
45
  ```bash
34
46
  npx --yes @nocobase/app-installer install /srv/nocobase/crm --archive /tmp/crm.tar.gz --origin https://apps.example.com
35
- npx --yes @nocobase/app-installer install /srv/nocobase/hub --template hub --origin https://apps.example.com
36
47
  ```
37
48
 
38
- The target must be new or empty. Before writing anything, the command also checks that the port is free — naming a free one when it is not — that no pm2 process already uses the name (`pm2 start` on a taken name would restart that process with this installation's configuration rather than start a new one), and that every variable named by `--set-from-env` is set. It then unpacks the archive, or resolves the template version and builds it in a temporary build directory, into a release directory; writes the configuration; applies the database migrations; and starts the application with pm2, waiting until its health check answers or pm2 reports the process as crashed. Anything it wrote is removed again if it fails before the application is switched on, so running it again starts clean — with `--keep-source`, the build directory is kept for inspection and has to be removed before retrying.
49
+ The target must be new or empty. Before writing anything, the command also checks that the port is free — naming a free one when it is not — that no pm2 process already uses the name (`pm2 start` on a taken name would restart that process with this installation's configuration rather than start a new one), and that every variable named by `--set-from-env` is set. It then unpacks the archive into a release directory; writes the configuration; applies the database migrations; and starts the application with pm2, waiting until its health check answers or pm2 reports the process as crashed. Anything it wrote is removed again if it fails before the application is switched on, so running it again starts clean.
39
50
 
40
51
  Ctrl-C (or SIGTERM) stops the step that is running and lets that cleanup happen; a second one exits at once.
41
52
 
42
- | Flag | Default | Purpose |
43
- | ------------------ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
44
- | `--dir` | | The target, as the other commands name it; the same as the directory argument. |
45
- | `--archive` | | The deployment archive to install, by local path. Give this or `--template`. |
46
- | `--template` | | `hub`, or `hub@<version or dist-tag>` (`latest` by default), to build the published Hub here. Give this or `--archive`. |
47
- | `--origin` | `http://HOST:PORT` | Public origin without the base path. Set it before exposing the application. |
48
- | `--base-path` | the server's, `/main` | Where the application is mounted, such as `/crm`, or `/` for the origin root; `/hub` for a Hub, from the template or an archive. Written to `app.env`. |
49
- | `--host`, `--port` | `127.0.0.1`, `13000` | Where the application listens. Keep the loopback default behind a reverse proxy; give each installation its own port. |
50
- | `--dialect` | `sqlite` | Database. Anything else needs `--set`; an archive must carry `@nocobase/db-<dialect>`, a template build adds it. |
51
- | `--set` | | `key=value` passed to `nocobase config set`, repeatable. Values are YAML scalars. |
52
- | `--set-from-env` | | `key=VARIABLE` read from the environment, repeatable. Use it for passwords. |
53
- | `--registry` | `https://registry.npmjs.org` | Registry for the template, NocoBase packages and suggested commands; `NOCOBASE_REGISTRY` also sets it. |
54
- | `--name` | `nocobase-<directory name>` | pm2 process name. |
55
- | `--no-start` | | Install without starting; the result names the command that starts it. |
56
- | `--health-timeout` | `180` | Seconds to wait for the health check. |
57
- | `--keep-source` | | With `--template`, keep the build directory, with the sources and development dependencies, even on failure. |
58
- | `--json` | | Print one JSON result on stdout. Progress always goes to stderr. |
59
-
60
- A PostgreSQL Hub, with the password taken from the environment:
53
+ | Flag | Default | Purpose |
54
+ | ------------------ | ---------------------------- | --------------------------------------------------------------------------------------------------------------------- |
55
+ | `--dir` | | The target, as the other commands name it; the same as the directory argument. |
56
+ | `--archive` | | The deployment archive to install, by local path. Required. |
57
+ | `--origin` | `http://HOST:PORT` | Public origin without the base path. Set it before exposing the application. |
58
+ | `--base-path` | the server's, `/main` | Where the application is mounted, such as `/crm`, or `/` for the origin root. Written to `app.env`. |
59
+ | `--host`, `--port` | `127.0.0.1`, `13000` | Where the application listens. Keep the loopback default behind a reverse proxy; give each installation its own port. |
60
+ | `--dialect` | `sqlite` | Database. Anything else needs `--set`; the archive must carry `@nocobase/db-<dialect>`. |
61
+ | `--set` | | `key=value` passed to `nocobase config set`, repeatable. Values are YAML scalars. |
62
+ | `--set-from-env` | | `key=VARIABLE` read from the environment, repeatable. Use it for passwords. |
63
+ | `--registry` | `https://registry.npmjs.org` | Registry the suggested installer commands use; `NOCOBASE_REGISTRY` also sets it. |
64
+ | `--name` | `nocobase-<directory name>` | pm2 process name. |
65
+ | `--no-start` | | Install without starting; the result names the command that starts it. |
66
+ | `--health-timeout` | `180` | Seconds to wait for the health check. |
67
+ | `--json` | | Print one JSON result on stdout. Progress always goes to stderr. |
68
+
69
+ A PostgreSQL installation, with the password taken from the environment:
61
70
 
62
71
  ```bash
63
- HUB_DB_PASSWORD=... npx --yes @nocobase/app-installer install /srv/nocobase/hub \
64
- --template hub --origin https://apps.example.com --dialect postgres \
72
+ CRM_DB_PASSWORD=... npx --yes @nocobase/app-installer install /srv/nocobase/crm \
73
+ --archive /tmp/crm.tar.gz --origin https://apps.example.com --dialect postgres \
65
74
  --set database.connections.main.host=db.internal \
66
- --set database.connections.main.username=hub \
67
- --set-from-env database.connections.main.password=HUB_DB_PASSWORD
75
+ --set database.connections.main.username=crm \
76
+ --set-from-env database.connections.main.password=CRM_DB_PASSWORD
68
77
  ```
69
78
 
70
79
  `--set` values are read as YAML scalars by `nocobase config set`: `0123` becomes the number `123` and `no` becomes `false`, so quote text that looks like either, as in `--set 'key="0123"'`. Values are masked in the installer's own output, but a secret passed with `--set` is still visible to other users in the process list while the command runs; pass secrets with `--set-from-env`.
71
80
 
72
- Afterwards, run `pm2 startup` once and execute the command it prints so pm2 restarts the application after a reboot, and proxy the origin to the application's port with `location /` (a Hub also needs `client_max_body_size 260m`). Several installations behind one origin are told apart by their base paths. The first sign-in comes from `users.initialAdmin` in `config.yml`. The result's `initialAdmin` names that account's username and email, and `defaultPassword` says whether its password is still the template's (`admin123`), to be changed after signing in; the password itself is never printed.
81
+ Afterwards, run `pm2 startup` once and execute the command it prints so pm2 restarts the application after a reboot, and proxy the origin to the application's port with `location /`. Several installations behind one origin are told apart by their base paths. The first sign-in comes from `users.initialAdmin` in `config.yml`. The result's `initialAdmin` names that account's username and email, and `defaultPassword` says whether its password is still the one `config.example.yml` ships (`admin123`), to be changed after signing in; the password itself is never printed.
73
82
 
74
83
  ## Upgrade
75
84
 
76
85
  ```bash
77
86
  npx --yes @nocobase/app-installer upgrade --dir /srv/nocobase/crm --archive /tmp/crm.tar.gz
78
- npx --yes @nocobase/app-installer upgrade --dir /srv/nocobase/hub
79
87
  ```
80
88
 
81
- An upgrade takes the kind of source the install did. An archive installation moves to the archive given with `--archive`, which must hold the same application (its package name owns the migration history) and not an older version; an archive from before relocatable builds must also have been built for the path `app.env` mounts. A template installation moves to `latest`, or to the version or dist-tag given with `--to`.
89
+ An upgrade moves to the archive given with `--archive`, which must hold the same application (its package name owns the migration history) and not an older version; an archive from before relocatable builds must also have been built for the path `app.env` mounts.
82
90
 
83
91
  Every build is a release of its own, named by its version and UTC build time, as in `0.3.0_20260927T005500Z`, so deploying a project without bumping its version is still an upgrade. An archive already on disk is reused, and the one already running changes nothing.
84
92
 
85
- Everything that takes time happens while the current release keeps serving: the new release is unpacked or built beside it, then checked with its own CLI — `config check`, and `db apply --dry-run` to count the pending migrations. Only then does the downtime start: the application is stopped, its SQLite databases, `config.yml` and `app.env` are copied to `backups/<time>_<from>_to_<to>/`, `current` is switched, the migrations are applied, and the new release is started and must pass its health check. Stopping a Hub stops every application it hosts, and deployments in progress are marked failed.
93
+ Everything that takes time happens while the current release keeps serving: the new release is unpacked beside it, then checked with its own CLI — `config check`, and `db apply --dry-run` to count the pending migrations. Only then does the downtime start: the application is stopped, its SQLite databases, `config.yml` and `app.env` are copied to `backups/<time>_<from>_to_<to>/`, `current` is switched, the migrations are applied, and the new release is started and must pass its health check.
86
94
 
87
95
  If migrating or starting the new release fails, the upgrade rolls itself back: `current` returns to the previous release, the databases are restored from the backup when the new release may have migrated them, and the previous release is started again. The command then exits with code `3`. If the previous release does not come back either, it exits with `4`, keeps the new release on disk, and leaves the operation pending, so `rollback` finishes the job once the cause is fixed.
88
96
 
89
97
  A version older than the running one is refused: the older release knows nothing of the newer migrations. Going back is what `rollback` is for. The pm2 process named in `installer.json` must belong to this installation, and once the application is stopped its port must be free, so the health check cannot be answered by anything but the new release.
90
98
 
91
- | Flag | Default | Purpose |
92
- | ------------------ | -------- | -------------------------------------------------------------------------------------------------------------------- |
93
- | `--archive` | | Archive installation: the new archive, by local path. Required there, refused for a template installation. |
94
- | `--to` | `latest` | Template installation: version or dist-tag, not older than the running one. A build of it already on disk is reused. |
95
- | `--rebuild` | | Template installation: build the target again even when a build of it is on disk; alone, the installed version. |
96
- | `--keep-source` | | Template installation: keep the build directory. |
97
- | `--backup-done` | | Required when `config.yml` names a database the installer cannot back up — any but SQLite: back it up yourself. |
98
- | `--keep` | `3` | Releases to keep on disk (at least 2). The new release and the one upgraded from are always kept. |
99
- | `--health-timeout` | `180` | Seconds to wait for the new release's health check. |
100
- | `--yes` | | Proceed without the confirmation prompt; required with `--json` or without a terminal. |
101
- | `--json` | | Print one JSON result on stdout. |
99
+ | Flag | Default | Purpose |
100
+ | ------------------ | ------- | --------------------------------------------------------------------------------------------------------------- |
101
+ | `--archive` | | The new archive, by local path. Required. |
102
+ | `--backup-done` | | Required when `config.yml` names a database the installer cannot back up — any but SQLite: back it up yourself. |
103
+ | `--keep` | `3` | Releases to keep on disk (at least 2). The new release and the one upgraded from are always kept. |
104
+ | `--health-timeout` | `180` | Seconds to wait for the new release's health check. |
105
+ | `--yes` | | Proceed without the confirmation prompt; required with `--json` or without a terminal. |
106
+ | `--json` | | Print one JSON result on stdout. |
102
107
 
103
- The backup covers what rolling back needs: every SQLite database `config.yml` declares, with its journals, and the configuration. It is not a replacement for regular backups of `storage/`, whose uploaded files it leaves out, and backups are not pruned: remove old ones from `backups/` yourself. Upgrading a Hub migrates only the Hub's own database, not those of the applications it hosts.
108
+ The backup covers what rolling back needs: every SQLite database `config.yml` declares, with its journals, and the configuration. It is not a replacement for regular backups of `storage/`, whose uploaded files it leaves out, and backups are not pruned: remove old ones from `backups/` yourself.
104
109
 
105
- When the machine's Node major changes, a release's native modules no longer load, and `status` says so. For an archive installation, build the archive again with the new `--node-version` and upgrade to it. For a template installation, an upgrade to a newer version builds for the new Node by itself; when the Hub is already on the latest version, `upgrade --rebuild` builds the installed version again for this machine, as a release of its own, switched to through the same steps and the same backup as any upgrade. The release it replaces stays on disk but cannot be rolled back to, since it was built for another Node. A rebuild interrupted while the Hub is down is finished by running it again.
110
+ When the machine's Node major changes, a release's native modules no longer load, and `status` says so. Build the archive again with the new `--node-version` and upgrade to it: the new build is a release of its own, switched to through the same steps and the same backup as any upgrade. The release it replaces stays on disk but cannot be rolled back to, since it was built for another Node.
106
111
 
107
112
  ## Rollback
108
113
 
@@ -122,7 +127,7 @@ If an upgrade or rollback is interrupted while the application is down, `install
122
127
  npx --yes @nocobase/app-installer status --dir /srv/nocobase/crm
123
128
  ```
124
129
 
125
- Reports the application, its source, the running release with its version and build time, its `endpoints` — the public URL and origin, and the host and port it listens on — whether it answers its health check, the pm2 process, the releases on disk and their size, and whether the machine's Node major still matches the one the release was built for. For a template installation it also asks the registry whether a newer version is published (`--offline` skips that). It changes nothing, and does not start the pm2 daemon when it is not running.
130
+ Reports the application, its source, the running release with its version and build time, its `endpoints` — the public URL and origin, and the host and port it listens on — whether it answers its health check, the pm2 process, the releases on disk and their size, and whether the machine's Node major still matches the one the release was built for. It changes nothing, and does not start the pm2 daemon when it is not running.
126
131
 
127
132
  ## Changing the origin or port
128
133
 
@@ -147,7 +152,7 @@ pm2 restart nocobase-crm
147
152
  ├── releases/<version>_<time>/app/ dist/ and config.example.yml from the deployment archive
148
153
  ├── current -> releases/<version>_<time>/app
149
154
  ├── backups/ databases and configuration copied before each upgrade
150
- └── installer.json what the installer knows: application, base path, kind, source, releases, history
155
+ └── installer.json what the installer knows: application, base path, source, releases, history
151
156
  ```
152
157
 
153
158
  `APP_CONFIG_FILE` and `APP_STORAGE_DIR` in `app.env` are absolute. A built server treats the directory above `dist/` as its deployment root and would otherwise keep its configuration and data inside the release directory; a release too old to read `APP_STORAGE_DIR` does exactly that, and the installer refuses it.
@@ -168,51 +173,43 @@ pm2 runs `node launcher.mjs` (`interpreter: 'none'`), and on every start `launch
168
173
 
169
174
  Under `--json`, a failure prints `ok: false` and `status: "failure"` with `error.code`, a message, `error.suggestions` and, where there is any, `error.details`: the same envelope as the application CLI's `pnpm nocobase … --json`. A suggestion's `run`, where it has one, is `{ command, args }`, an executable and its arguments to run as given, without a shell; a step that takes two commands is two suggestions. Codes are stable; branch on them rather than on the message.
170
175
 
171
- | Code | Exit | Meaning and what to do |
172
- | ----------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
173
- | `INVALID_USAGE` | `2` | An unknown command or flag, a malformed `--set`, an `--origin` with a path, no install directory, neither or both of `--archive` and `--template`, a template other than `hub`, an `--archive` URL, or an upgrade flag for the other kind of source. Fix the command line. |
174
- | `NODE_UNSUPPORTED` | `2` | Node.js is older than 24. Install Node.js 24 or later. |
175
- | `PLATFORM_UNSUPPORTED` | `2` | Windows. Run the installer inside WSL. |
176
- | `PNPM_MISSING` | `2` | `--template` needs pnpm, which is not on PATH. Install pnpm 11 with corepack, as the suggestion shows. |
177
- | `PNPM_UNSUPPORTED` | `2` | pnpm is older than 11. |
178
- | `PM2_MISSING` | `2` | pm2 is not on PATH. Install it globally, or install with `--no-start`. |
179
- | `PM2_UNSUPPORTED` | `2` | pm2 is older than 4.3, which does not read `ecosystem.config.cjs`, or `pm2 --version` printed no version. Update it globally, then run `pm2 update`. |
180
- | `PM2_NAME_IN_USE` | `2` | Another process owns the pm2 name. Choose another with `--name` when installing; for an installation, stop or rename that process. |
181
- | `PORT_IN_USE` | `2` | Something already listens on the host and port. When installing, `details.freePort` and the suggestion name a free port; otherwise stop what holds it. |
182
- | `ENV_MISSING` | `2` | A variable named by `--set-from-env` is not set. |
183
- | `TARGET_NOT_EMPTY` | `2` | The install target holds files, or is a file. Install into a new or empty directory; an installation is managed with the other commands. |
184
- | `NOT_INSTALLED` | `2` | The directory holds no `installer.json`. Run from the installation root, or name it with `--dir`. |
185
- | `STATE_UNSUPPORTED` | `2` | `installer.json` was written by a newer app-installer. Run the latest one. |
186
- | `LOCKED` | `2` | Another app-installer is working on this installation. Wait for it to finish. |
187
- | `REGISTRY_UNREACHABLE` | `2` | The registry could not be read. Check the network or `--registry`. |
188
- | `VERSION_NOT_FOUND` | `2` | No such template version or dist-tag; `details` lists the tags and recent versions. |
189
- | `ARCHIVE_NOT_FOUND` | `2` | `--archive` names no file. |
190
- | `ARCHIVE_INVALID` | `2` | The archive holds no `dist/package.json`: it is not one `pnpm build --tar` wrote. |
191
- | `CONFIG_UNREADABLE` | `2` | `config.yml` could not be read as YAML, so the databases an upgrade would have to back up are unknown. Fix the file; nothing was changed. |
192
- | `ARCHIVE_TOO_OLD` | `2` | The archive records neither that it is relocatable nor its base path, or not its build time. Upgrade `@nocobase/app-cli` in the project and build it again. |
193
- | `DRIVER_MISSING` | `2` | The archive lacks `@nocobase/db-<dialect>` for the chosen dialect. Add it to the project and build again. |
194
- | `APP_MISMATCH` | `2` | The archive holds another application than the one installed. Install it into a directory of its own. |
195
- | `BASE_PATH_MISMATCH` | `2` | A release from before relocatable builds was built for another path than `--base-path` or `app.env` names. Build it again with a current `@nocobase/app-cli`, which runs at any path. |
196
- | `CONFIRMATION_REQUIRED` | `2` | `upgrade` or `rollback` needs consent, and `--json` or the lack of a terminal leaves no prompt to ask on. `details.notes` says what the operation does; pass `--yes` once that is accepted. |
197
- | `CANCELLED` | `2` | The confirmation prompt was declined. Nothing changed. |
198
- | `OPERATION_INTERRUPTED` | `2` | An earlier upgrade or rollback stopped while the application was down. Run `rollback` to recover before anything else, or run an interrupted `--rebuild` again. |
199
- | `DOWNGRADE` | `2` | The target is an older version than the running one. Use `rollback --to`. |
200
- | `BACKUP_REQUIRED` | `2` | `config.yml` names a database the installer cannot back up. Back it up, then pass `--backup-done`. |
201
- | `DISK_LOW` | `2` | Less than about 2 GB free for a template build. Free space, or lower `--keep`. |
202
- | `NOTHING_TO_ROLL_BACK` | `2` | No upgrade led to the current release. Name a release on disk with `--to`. |
203
- | `RELEASE_MISSING` | `2` | The release to return to is not on disk; `status` lists those that are. |
204
- | `NODE_MISMATCH` | `2` | The release was built for another Node major, so its native modules would not load; the suggestions say how to get one that does. |
205
- | `BUILD_TARGET_MISMATCH` | `2` or `1` | The release was built for another platform or Node major than this machine: an archive (exit `2`, with the build command that fits) or, unexpectedly, a template build (exit `1`). |
206
- | `CREATE_FAILED` | `1` | Generating the Hub project with `create-app` failed; `details.output` holds its output. |
207
- | `DRIVER_INSTALL_FAILED` | `1` | Adding the database driver to a template build failed; `details.output` holds pnpm's output. |
208
- | `BUILD_FAILED` | `1` | `pnpm build` failed; `details.output` holds its output. |
209
- | `UNPACK_FAILED` | `1` | Unpacking the deployment archive failed. |
210
- | `STORAGE_IN_RELEASE` | `1` | The release wrote its data inside its own directory: its `@nocobase/app-server` predates `APP_STORAGE_DIR`. Upgrade it in the project and build again; an upgrade rolls back on it. |
211
- | `APP_CLI_FAILED` | `1` | The release's own CLI printed no result. A failure it does report keeps its own code instead, such as `CONFIG_INVALID` from `config check`. |
212
- | `START_FAILED` | `1` | The application is installed but did not pass its health check; `details.log` holds the end of its error log. Fix the cause and start it with the suggested command. |
213
- | `UPGRADE_ABORTED` | `1` | The upgrade stopped before switching releases and the previous release is running again; exit `4` when it did not come back. |
214
- | `ROLLBACK_ABORTED` | `1` | Stopping the application failed; nothing was restored or switched. |
215
- | `INTERRUPTED` | `1` | Ctrl-C or SIGTERM stopped the running step before the application was touched. An install removes what it wrote unless the application was already switched on; an upgrade removes the release it was building. Once an upgrade or rollback has stopped the application, it reports its own code instead. |
216
- | `UNEXPECTED` | `1` | An error the installer does not recognise. The message is all there is; report it. |
217
- | `UPGRADE_ROLLED_BACK` | `3` | The new release failed after the switch; the previous one runs again, on the restored databases when the new one may have migrated them. |
218
- | `ROLLBACK_FAILED` | `4` | The application is down. Follow the suggestions: read the log, fix the cause, and run `rollback` again, which retries the restore. |
176
+ | Code | Exit | Meaning and what to do |
177
+ | ----------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
178
+ | `INVALID_USAGE` | `2` | An unknown command or flag, a malformed `--set`, an `--origin` with a path, no install directory, no `--archive`, or an `--archive` URL. Fix the command line. |
179
+ | `NODE_UNSUPPORTED` | `2` | Node.js is older than 24. Install Node.js 24 or later. |
180
+ | `PLATFORM_UNSUPPORTED` | `2` | Windows. Run the installer inside WSL. |
181
+ | `PM2_MISSING` | `2` | pm2 is not on PATH. Install it globally, or install with `--no-start`. |
182
+ | `PM2_UNSUPPORTED` | `2` | pm2 is older than 4.3, which does not read `ecosystem.config.cjs`, or `pm2 --version` printed no version. Update it globally, then run `pm2 update`. |
183
+ | `PM2_NAME_IN_USE` | `2` | Another process owns the pm2 name. Choose another with `--name` when installing; for an installation, stop or rename that process. |
184
+ | `PORT_IN_USE` | `2` | Something already listens on the host and port. When installing, `details.freePort` and the suggestion name a free port; otherwise stop what holds it. |
185
+ | `ENV_MISSING` | `2` | A variable named by `--set-from-env` is not set. |
186
+ | `TARGET_NOT_EMPTY` | `2` | The install target holds files, or is a file. Install into a new or empty directory; an installation is managed with the other commands. |
187
+ | `NOT_INSTALLED` | `2` | The directory holds no `installer.json`. Run from the installation root, or name it with `--dir`. |
188
+ | `STATE_UNSUPPORTED` | `2` | `installer.json` was written by a newer app-installer, or records an installation built from a published template, which only the app-installer that installed it manages. |
189
+ | `LOCKED` | `2` | Another app-installer is working on this installation. Wait for it to finish. |
190
+ | `ARCHIVE_NOT_FOUND` | `2` | `--archive` names no file. |
191
+ | `ARCHIVE_INVALID` | `2` | The archive holds no `dist/package.json`: it is not one `pnpm build --tar` wrote. |
192
+ | `CONFIG_UNREADABLE` | `2` | `config.yml` could not be read as YAML, so the databases an upgrade would have to back up are unknown. Fix the file; nothing was changed. |
193
+ | `ARCHIVE_TOO_OLD` | `2` | The archive records neither that it is relocatable nor its base path, or not its build time. Upgrade `@nocobase/app-cli` in the project and build it again. |
194
+ | `DRIVER_MISSING` | `2` | The archive lacks `@nocobase/db-<dialect>` for the chosen dialect. Add it to the project and build again. |
195
+ | `APP_MISMATCH` | `2` | The archive holds another application than the one installed. Install it into a directory of its own. |
196
+ | `BASE_PATH_MISMATCH` | `2` | A release from before relocatable builds was built for another path than `--base-path` or `app.env` names. Build it again with a current `@nocobase/app-cli`, which runs at any path. |
197
+ | `CONFIRMATION_REQUIRED` | `2` | `upgrade` or `rollback` needs consent, and `--json` or the lack of a terminal leaves no prompt to ask on. `details.notes` says what the operation does; pass `--yes` once that is accepted. |
198
+ | `CANCELLED` | `2` | The confirmation prompt was declined. Nothing changed. |
199
+ | `OPERATION_INTERRUPTED` | `2` | An earlier upgrade or rollback stopped while the application was down. Run `rollback` to recover before anything else. |
200
+ | `DOWNGRADE` | `2` | The target is an older version than the running one. Use `rollback --to`. |
201
+ | `BACKUP_REQUIRED` | `2` | `config.yml` names a database the installer cannot back up. Back it up, then pass `--backup-done`. |
202
+ | `NOTHING_TO_ROLL_BACK` | `2` | No upgrade led to the current release. Name a release on disk with `--to`. |
203
+ | `RELEASE_MISSING` | `2` | The release to return to is not on disk; `status` lists those that are. |
204
+ | `NODE_MISMATCH` | `2` | The release was built for another Node major, so its native modules would not load; the suggestions say how to get one that does. |
205
+ | `BUILD_TARGET_MISMATCH` | `2` | The archive was built for another platform or Node major than this machine; the suggestion names the build command that fits. |
206
+ | `UNPACK_FAILED` | `1` | Unpacking the deployment archive failed. |
207
+ | `STORAGE_IN_RELEASE` | `1` | The release wrote its data inside its own directory: its `@nocobase/app-server` predates `APP_STORAGE_DIR`. Upgrade it in the project and build again; an upgrade rolls back on it. |
208
+ | `APP_CLI_FAILED` | `1` | The release's own CLI printed no result. A failure it does report keeps its own code instead, such as `CONFIG_INVALID` from `config check`. |
209
+ | `START_FAILED` | `1` | The application is installed but did not pass its health check; `details.log` holds the end of its error log. Fix the cause and start it with the suggested command. |
210
+ | `UPGRADE_ABORTED` | `1` | The upgrade stopped before switching releases and the previous release is running again; exit `4` when it did not come back. |
211
+ | `ROLLBACK_ABORTED` | `1` | Stopping the application failed; nothing was restored or switched. |
212
+ | `INTERRUPTED` | `1` | Ctrl-C or SIGTERM stopped the running step before the application was touched. An install removes what it wrote unless the application was already switched on; an upgrade removes the release it was unpacking. Once an upgrade or rollback has stopped the application, it reports its own code instead. |
213
+ | `UNEXPECTED` | `1` | An error the installer does not recognise. The message is all there is; report it. |
214
+ | `UPGRADE_ROLLED_BACK` | `3` | The new release failed after the switch; the previous one runs again, on the restored databases when the new one may have migrated them. |
215
+ | `ROLLBACK_FAILED` | `4` | The application is down. Follow the suggestions: read the log, fix the cause, and run `rollback` again, which retries the restore. |
package/dist/cli.js CHANGED
@@ -22,14 +22,14 @@ function describeFlags(flags) {
22
22
  /** Every usage line and example is a command that runs as-is, the same way error suggestions are. */
23
23
  export function formatHelp() {
24
24
  return [
25
- 'Install and manage a NocoBase 3 application on a server, from a deployment archive or the published Hub template.',
25
+ 'Install and manage a NocoBase 3 application on a server, from an npm application package or deployment archive.',
26
26
  '',
27
27
  'USAGE',
28
28
  ` $ ${installerCommand('COMMAND [FLAGS]')}`,
29
29
  '',
30
30
  'COMMANDS',
31
- ' install DIRECTORY Install into DIRECTORY (or --dir DIRECTORY) from --archive or --template hub, and start it with pm2.',
32
- ' upgrade Upgrade the installation in --dir, the current directory by default: to a new --archive, or for a template installation to --to (latest) or a --rebuild.',
31
+ ' install DIRECTORY Install into DIRECTORY (or --dir DIRECTORY) from --app or --archive, and start it with pm2.',
32
+ ' upgrade Upgrade the installation in --dir, the current directory by default, to the latest npm application or a new --archive.',
33
33
  ' rollback Return to the release the last upgrade came from, or to --to.',
34
34
  ' status Report the release, endpoints, health, pm2 process and releases on disk.',
35
35
  '',
@@ -46,19 +46,18 @@ export function formatHelp() {
46
46
  ...describeFlags(STATUS_FLAGS),
47
47
  '',
48
48
  'EXAMPLES',
49
+ ` $ ${installerCommand('install /srv/nocobase/studio --app studio --origin https://studio.example.com')}`,
50
+ ` $ ${installerCommand('upgrade --dir /srv/nocobase/studio --yes')}`,
49
51
  ` $ ${installerCommand('install /srv/nocobase/crm --archive /tmp/crm.tar.gz --origin https://apps.example.com')}`,
50
52
  ` $ ${installerCommand('upgrade --dir /srv/nocobase/crm --archive /tmp/crm.tar.gz --yes')}`,
51
- ` $ ${installerCommand('install /srv/nocobase/hub --template hub --origin https://apps.example.com')}`,
52
- ` $ ${installerCommand('install /srv/nocobase/hub --template hub --dialect postgres --set database.connections.main.host=db.internal --set-from-env database.connections.main.password=HUB_DB_PASSWORD')}`,
53
- ` $ ${installerCommand('upgrade --dir /srv/nocobase/hub --yes')}`,
53
+ ` $ ${installerCommand('install /srv/nocobase/crm --archive /tmp/crm.tar.gz --dialect postgres --set database.connections.main.host=db.internal --set-from-env database.connections.main.password=CRM_DB_PASSWORD')}`,
54
54
  ` $ ${installerCommand('rollback --dir /srv/nocobase/crm')}`,
55
55
  ` $ ${installerCommand('status --dir /srv/nocobase/crm --json')}`,
56
56
  '',
57
57
  'NOTES',
58
- ` Requires Node.js 24+ and, to start the application, pm2 ${MINIMUM_PM2_VERSION}+ installed globally; --template also needs pnpm 11+.`,
58
+ ` Requires Node.js 24+ and, to start the application, pm2 ${MINIMUM_PM2_VERSION}+ installed globally.`,
59
59
  ' Build an archive in the application project with pnpm build --target <platform> --node-version <major> --tar, matching this machine.',
60
- ' Packages come from https://registry.npmjs.org by default; override with --registry or NOCOBASE_REGISTRY.',
61
- ' --template builds the Hub on this machine and takes several minutes.',
60
+ ' Suggested installer commands use https://registry.npmjs.org by default; override with --registry or NOCOBASE_REGISTRY.',
62
61
  ' To change the origin or port, edit app.env in the installation root, then run pm2 restart with the process name.',
63
62
  ].join('\n');
64
63
  }
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,OAAO,GAIR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,Q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