create-wordjs 2.9.0 → 2.11.0

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.
Files changed (3) hide show
  1. package/README.md +39 -12
  2. package/index.js +3 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -53,7 +53,7 @@ in CI — plus a pure-JS *SQLite (legacy / WASM)* fallback for hosts where the n
53
53
  | --- | --- |
54
54
  | `--zip <path-or-url>` | Use a local release ZIP (or a direct **`https://`** ZIP URL — plain `http://` is refused) instead of querying the GitHub API. Handy offline or when rate-limited. |
55
55
  | `--sha256 <hex>` | Refuse the ZIP unless its SHA-256 is exactly this (the value in the release's `.sha256` asset). Use it to pin a `--zip` file or URL; with a GitHub download it is checked on top of the release checksum. |
56
- | `--version <tag>` | Install a specific release (e.g. `--version v2.1.0`) instead of the latest. |
56
+ | `--version <tag>` | Install a specific release (e.g. `--version vX.Y.Z`) instead of the latest. |
57
57
  | `--http` | Serve plain HTTP instead of self-signed HTTPS (sets `WORDJS_HTTP=1`). |
58
58
  | `--no-start` | Scaffold and install dependencies only — start the server yourself later. |
59
59
  | `--yes`, `-y` | Skip the confirmation prompt (required when `upgrade` runs non-interactively). |
@@ -78,15 +78,39 @@ Separate-mode options:
78
78
 
79
79
  ## Upgrade an existing site
80
80
 
81
+ **From the admin panel first.** On a standard install (the monolith started by its service, with its
82
+ own files — the `--systemd` layout) **Admin → Updates** lists the newer releases with their notes and
83
+ installs one with your password and a two-factor code: it takes a backup, runs this same command with
84
+ `--version <tag>`, restarts WordJS by itself and puts the previous version back if the new one fails to
85
+ install or to start. In a container, a git checkout, split or separate mode, or when the code belongs
86
+ to another account, the screen says so and gives you the command instead.
87
+
88
+ **From the command line:**
89
+
81
90
  ```bash
82
91
  cd .. && npx create-wordjs@latest upgrade my-site # or run it from inside: npx create-wordjs@latest upgrade .
83
92
  ```
84
93
 
85
94
  Downloads the newest release and replaces the app code while **preserving your data**: the database
86
- directory (`backend/data`), `backend/uploads/`, `wordjs-config.json`, `.env`, gateway secrets
87
- (`gateway/gateway-config.json`) and any user-installed plugins survive. It asks for confirmation
88
- before touching an existing install — on a non-interactive shell it refuses unless you pass `--yes`.
89
- Restart the server afterwards (schema migrations run automatically on the next start).
95
+ directory (`backend/data`), `backend/uploads/`, `backend/backups/`, `wordjs-config.json`, `.env`,
96
+ gateway secrets (`gateway/gateway-config.json`) and any user-installed plugins survive; the small config
97
+ files are also copied to a `.upgrade-backup-<time>/` folder first. It asks for confirmation before
98
+ touching an existing install — on a non-interactive shell it refuses unless you pass `--yes`. On a
99
+ site that is already on the target version it does nothing unless you pass `--force`. Restart the
100
+ server afterwards (`sudo systemctl restart wordjs` for a service); schema migrations run automatically
101
+ on the next start.
102
+
103
+ ```bash
104
+ npx create-wordjs@latest upgrade /srv/wordjs --yes # unattended
105
+ npx create-wordjs@latest upgrade /srv/wordjs --version vX.Y.Z --yes # a given release
106
+ npx create-wordjs@latest upgrade /srv/wordjs --zip ./wordjs-vX.Y.Z.zip --sha256 <hex> --yes --force # offline, re-apply
107
+ ```
108
+
109
+ `--zip` takes a release ZIP you downloaded (or an `https://` URL) instead of asking GitHub, and
110
+ `--sha256` pins it to the value in `wordjs-<tag>.zip.sha256`. To go back, run `upgrade` with
111
+ `--version <old-tag>` (add `--force` if the site already reports that version); your data stays
112
+ intact. Run it as root (`sudo npx …`) when the site's files belong to the service account: the upgraded
113
+ files are given back to the site's owner.
90
114
 
91
115
  ## Run it as a service (Linux)
92
116
 
@@ -148,8 +172,11 @@ npx create-wordjs@latest join frontend --gateway 10.0.0.1 --token <t> --ca-hash
148
172
  `--ca-hash` is required: `join` refuses to enroll without it, and there is no trust-on-first-use
149
173
  opt-out. Each `join` downloads the release, enrolls against the gateway (the token authorizes exactly one
150
174
  certificate signing; it is burned afterwards, and the ones `gateway` printed also expire after 120
151
- minutes — mint more on the gateway with `node scripts/cluster.js token <backend|frontend>`, which
152
- defaults to a 60-minute TTL and takes `--ttl <minutes>`), then starts the service, which registers
175
+ minutes — once the first backend has joined, mint more from **Admin → Servers → Add a server**, which
176
+ also prints the `node-join` command for the new machine
177
+ ([managing the cluster from the admin panel](https://github.com/jaimemartinez/wordjs/blob/main/documentation/separate-mode.md#managing-the-cluster-from-the-admin-panel));
178
+ the second way is `node scripts/cluster.js token <backend|frontend>` on the gateway, which defaults to
179
+ a 60-minute TTL and takes `--ttl <minutes>`), then starts the service, which registers
153
180
  with the gateway over mTLS. Browse `https://<gateway>:3000` when all three are up. `join` machines
154
181
  need `openssl` on the PATH. Full details, port matrix and the manual (source-checkout) procedure:
155
182
  [documentation/separate-mode.md](https://github.com/jaimemartinez/wordjs/blob/main/documentation/separate-mode.md).
@@ -169,8 +196,8 @@ need `openssl` on the PATH. Full details, port matrix and the manual (source-che
169
196
  - **GitHub rate limit / offline**: the release lookup uses the unauthenticated GitHub API. If it
170
197
  is rate-limited or you're offline, download `wordjs-v*.zip` from the
171
198
  [releases page](https://github.com/jaimemartinez/wordjs/releases) and run
172
- `npx create-wordjs@latest my-site --zip ./wordjs-v2.1.0.zip` — add
173
- `--sha256 <hex>` with the value from `wordjs-v2.1.0.zip.sha256` to have it verified.
199
+ `npx create-wordjs@latest my-site --zip ./wordjs-vX.Y.Z.zip` — add
200
+ `--sha256 <hex>` with the value from `wordjs-vX.Y.Z.zip.sha256` to have it verified.
174
201
  - **Existing directories**: the target directory must not exist (or must be empty) — the tool
175
202
  refuses to overwrite anything.
176
203
 
@@ -193,9 +220,9 @@ need `openssl` on the PATH. Full details, port matrix and the manual (source-che
193
220
  ## What gets created
194
221
 
195
222
  A ready-to-run WordJS bundle: backend (pre-compiled to `dist/`), frontend (pre-built `.next`),
196
- gateway, the bundled plugins and the four bundled themes (`circuito`, `default`, `gaceta`,
197
- `vergel`). Marketplace plugins are **not** in the bundle — they ship as separate release assets and
198
- are installed from the admin. Secrets (JWT, DB password, install token) are generated
223
+ gateway and the four bundled themes (`circuito`, `default`, `gaceta`,
224
+ `vergel`). No plugin ships in the bundle: plugins come from the marketplace (separate release assets),
225
+ installed from **Admin → Plugins**. Secrets (JWT, DB password, install token) are generated
199
226
  locally during install — nothing sensitive ships in the bundle. See `INSTALL.md` inside the
200
227
  scaffolded directory for the manual steps and `documentation/deployment.md` for production
201
228
  deployment.
package/index.js CHANGED
@@ -64,7 +64,7 @@ Options:
64
64
  --zip <path-or-url> Use a local release ZIP (or a direct https:// ZIP URL) instead of asking GitHub.
65
65
  --sha256 <hex> Require the ZIP to have this SHA-256 (pin a checksum for --zip; also checked
66
66
  on top of the release's own .sha256 asset).
67
- --version <tag> Install/upgrade to a specific release tag (e.g. v2.1.0) instead of the latest.
67
+ --version <tag> Install/upgrade to a specific release tag (e.g. vX.Y.Z) instead of the latest.
68
68
  --http Serve plain HTTP instead of self-signed HTTPS (sets WORDJS_HTTP=1). (create)
69
69
  --no-start Scaffold + install dependencies only; don't start the server.
70
70
  --yes, -y Skip the confirmation prompt (required when upgrading non-interactively).
@@ -95,7 +95,7 @@ Options:
95
95
 
96
96
  Examples:
97
97
  npx create-wordjs@latest my-site
98
- npx create-wordjs@latest my-site --version v2.1.0
98
+ npx create-wordjs@latest my-site --version vX.Y.Z
99
99
  npx create-wordjs@latest upgrade # from inside your site directory
100
100
  npx create-wordjs@latest upgrade ./my-site --yes
101
101
  npx create-wordjs@latest /srv/wordjs --systemd --port 443
@@ -148,7 +148,7 @@ function parseArgs(argv) {
148
148
  if (!hex) fail(`--sha256 must be a 64-character hex SHA-256, got "${v}".`);
149
149
  opts.sha256 = hex;
150
150
  }
151
- else if (a === '--version') { opts.version = argv[++i] || fail('--version needs a value (a release tag, e.g. v2.1.0).'); }
151
+ else if (a === '--version') { opts.version = argv[++i] || fail('--version needs a value (a release tag, e.g. vX.Y.Z).'); }
152
152
  else if (a === '--http') opts.http = true;
153
153
  else if (a === '--no-start') opts.start = false;
154
154
  else if (a === '--yes' || a === '-y') opts.yes = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-wordjs",
3
- "version": "2.9.0",
3
+ "version": "2.11.0",
4
4
  "description": "Create a WordJS site with one command — the self-hosted CMS where third-party plugins run in an OS-isolated process with per-capability permission grants. SSR/SEO out of the box, SQLite by default, no PHP.",
5
5
  "license": "MIT",
6
6
  "author": "Jaime Martinez (https://github.com/jaimemartinez)",