create-wordjs 2.1.0 → 2.2.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 +6 -2
  2. package/index.js +14 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -114,8 +114,12 @@ need `openssl` on the PATH. Full details, port matrix and the manual (source-che
114
114
  self-signed certificate. Your browser will warn once ("Your connection is not private") —
115
115
  click *Advanced → Proceed*. That is expected for localhost. Prefer plain HTTP? Use `--http`.
116
116
  - **Stop / restart**: press `Ctrl+C` to stop. Start again any time with
117
- `cd my-site && npm run start:mono`. Until setup is finished, every start prints a fresh
118
- one-time install URL, so you never need to keep the original token around.
117
+ `cd my-site && npm run start:mono`. Until setup is finished, every start mints a fresh one-time
118
+ install token, so you never need to keep the original around. The server prints it in its boot
119
+ banner — as a clickable `/install#token=…` URL — only when its stdout is a terminal, which it is
120
+ when you run that command yourself; off a TTY (systemd, Docker, a pipe) the banner shows the URL
121
+ without the token. Either way the token is written to `my-site/backend/data/install-token`
122
+ (mode `0600`), and `WORDJS_PRINT_INSTALL_TOKEN=1` prints it in the banner regardless.
119
123
  - **GitHub rate limit / offline**: the release lookup uses the unauthenticated GitHub API. If it
120
124
  is rate-limited or you're offline, download `wordjs-v*.zip` from the
121
125
  [releases page](https://github.com/jaimemartinez/wordjs/releases) and run
package/index.js CHANGED
@@ -11,7 +11,11 @@
11
11
  * 2. Extracts it into <dir> and installs the runtime dependencies (npm run release:install).
12
12
  * 3. Generates a one-time install token and starts the server (npm run start:mono) with it,
13
13
  * printing a clickable https://localhost:3000/install#token=… URL — the browser install
14
- * wizard takes it from there (pick SQLite/PostgreSQL, create your admin, done).
14
+ * wizard takes it from there (pick SQLite/PostgreSQL, create your admin, done). That URL is
15
+ * printed by THIS process, which owns the token, so it is unconditional.
16
+ * With --no-start there is no token from here: the server mints its own on its first boot and
17
+ * prints it in its banner only when ITS stdout is a TTY (or WORDJS_PRINT_INSTALL_TOKEN=1);
18
+ * otherwise it writes it to <dir>/backend/data/install-token (mode 0600) and prints the path.
15
19
  *
16
20
  * Plain Node, no TypeScript. Only runtime dependency: adm-zip (ZIP extraction).
17
21
  */
@@ -729,7 +733,12 @@ async function main() {
729
733
  console.log(` cd ${opts.dir}`);
730
734
  console.log(` npm run start:mono${opts.http ? ' (with WORDJS_HTTP=1 in the environment for plain HTTP)' : ''}`);
731
735
  console.log('');
732
- console.log(` The console will print your one-time install URL (${proto}://localhost:3000/install#token=…).`);
736
+ console.log(' That first boot mints a one-time install token. The server prints it in its');
737
+ console.log(` banner as a clickable URL (${proto}://localhost:3000/install#token=…) only when its`);
738
+ console.log(' stdout is a terminal — which it is if you run the command above yourself. Off a');
739
+ console.log(' TTY (systemd, Docker, a pipe) the banner shows the URL WITHOUT the token; read it');
740
+ console.log(` from ${path.join(opts.dir, 'backend', 'data', 'install-token')} (mode 0600) instead,`);
741
+ console.log(' or set WORDJS_PRINT_INSTALL_TOKEN=1 to have it printed either way.');
733
742
  console.log(line + '\n');
734
743
  return;
735
744
  }
@@ -758,7 +767,9 @@ async function main() {
758
767
  }
759
768
  console.log(' • Stop the server: press Ctrl+C in this window.');
760
769
  console.log(` • Start it later: cd ${opts.dir} && npm run start:mono`);
761
- console.log(' (a fresh install URL is printed on every start until setup is finished)');
770
+ console.log(' (a fresh token is minted on every start until setup is finished; the server prints');
771
+ console.log(' it in its banner when stdout is a terminal, and always writes it to');
772
+ console.log(' backend/data/install-token, mode 0600)');
762
773
  if (process.platform === 'linux') {
763
774
  console.log('');
764
775
  console.log(' • RECEIVING email from the internet? WordJS listens on port 25 (the MX port).');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-wordjs",
3
- "version": "2.1.0",
3
+ "version": "2.2.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)",