@ours.network/install 2.0.0 → 2.0.1

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
@@ -82,6 +82,14 @@ If something cannot be removed, the summary says exactly what and why, the comma
82
82
 
83
83
  Running it when nothing is left changes nothing and says so.
84
84
 
85
+ ## Security versions
86
+
87
+ Use stable Node.js 22.23.4+, 24.22.1+ or 26.12.1+ within those reviewed lines ([advisory](https://nodejs.org/en/blog/vulnerability/october-2026-security-releases)). Earlier patches, EOL, prerelease and unreviewed lines are refused before installation; new lines need an updated floor.
88
+
89
+ Workspace setup checks the PATH-selected `cloudflared --version` before grant redemption or setup writes. Requires 2026.10.2+ ([incident](https://blog.cloudflare.com/emudhra-certificate-compromise/), [update instructions](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/update-cloudflared/)); missing, failed, timed-out or unrecognized output refuses setup.
90
+
91
+ New images use Node.js 24.22.1. Existing images, retained Dockerfiles, running processes and native service-manager settings are not migrated or audited: update/rebuild and restart them separately. Native service-manager settings and future starts are outside these checks. Fleet tunnel guards require the separate Fleet release and installer manifest update.
92
+
85
93
  ## Install first, connect the App afterwards
86
94
 
87
95
  ```sh
@@ -113,7 +121,7 @@ See [one-connection setup, localhost:4050 and systemd migration](GATEWAY_SETUP.m
113
121
 
114
122
  # @ours.network/install — one installer for the whole stack
115
123
 
116
- Requires Node.js 22+ and npm. Install the selected release channel:
124
+ Requires a patched Node.js release (see Security versions) and npm. Install the selected release channel:
117
125
 
118
126
  ```sh
119
127
  npm install -g @ours.network/install@nightly
@@ -257,7 +265,7 @@ diagnostic artifact under the root's `runtime` directory; all installer calls us
257
265
  an explicit project directory, Compose file, project name and selected environment.
258
266
  Assets resolve from the installed package, independently of the working directory.
259
267
 
260
- Package mode requires Node.js 22+, npm and a working systemd user manager on
268
+ Package mode requires a patched Node.js release, npm and a working systemd user manager on
261
269
  Linux/WSL or a launchd GUI user domain on macOS. Source builds also require Git,
262
270
  Python 3, a C/C++ toolchain, make, and the selected repositories' own prerequisites.
263
271
  Docker mode requires a working Docker engine and Compose 2.35+; its build image
package/assets/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
1
  # syntax=docker/dockerfile:1
2
- FROM node:24 AS toolchain
2
+ FROM node:24.22.1 AS toolchain
3
3
  RUN apt-get update && apt-get install -y --no-install-recommends build-essential python3 ca-certificates git && rm -rf /var/lib/apt/lists/*
4
4
  FROM toolchain AS build
5
5
  WORKDIR /opt/ours
@@ -30,7 +30,7 @@ COPY --chmod=644 scripts/runtime/healthcheck.mjs /opt/ours/docker/healthcheck.mj
30
30
  COPY --chmod=644 scripts/runtime/start-telegram.sh scripts/runtime/health-telegram.sh scripts/runtime/start-cowork.sh scripts/runtime/health-cowork.sh scripts/runtime/start-messenger.sh scripts/runtime/health-messenger.mjs scripts/runtime/notifications-gateway.mjs scripts/runtime/supervise.mjs scripts/runtime/recover.mjs scripts/runtime/dependency-ready.mjs /opt/ours/docker/
31
31
  COPY --chmod=644 scripts/runtime/daemon-client-prefix.mjs /opt/ours/docker/daemon-client-prefix.mjs
32
32
  RUN chmod 755 /opt/ours/maintenance /opt/ours/docker
33
- FROM node:24 AS maintenance
33
+ FROM node:24.22.1 AS maintenance
34
34
  LABEL network.ours.build-context="1"
35
35
  WORKDIR /opt/ours
36
36
  COPY --from=build /opt/ours /opt/ours
@@ -39,7 +39,7 @@ COPY --chmod=644 scripts/maintenance/package.json /opt/ours/docker/package.json
39
39
  RUN --mount=type=cache,id=ours-dist-2-npm,target=/root/.npm,sharing=locked npm install --prefix /opt/ours/docker --omit=dev --ignore-scripts --no-audit --no-fund
40
40
  USER 1000:1000
41
41
  ENTRYPOINT ["node", "/opt/ours/docker/state-operation.mjs"]
42
- FROM node:24 AS runtime
42
+ FROM node:24.22.1 AS runtime
43
43
  LABEL network.ours.build-context="1"
44
44
  WORKDIR /opt/ours
45
45
  COPY --from=build /opt/ours /opt/ours
@@ -66,9 +66,9 @@
66
66
  }
67
67
  },
68
68
  "node_modules/@adapt-toolkit/sdk/node_modules/body-parser": {
69
- "version": "1.20.8",
70
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.8.tgz",
71
- "integrity": "sha512-JNcyFQ64OiijEkPzUBTCe+hyPXUD/3LEldGQ6iF5LR1w00mx9o7xtDWHXBY2iItjdCFGoilOLNQbH943ut7pHA==",
69
+ "version": "1.20.9",
70
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.9.tgz",
71
+ "integrity": "sha512-FISIQxV5u91Y9gvuFq3q/tA/qTqLJn3AhRcEvyozyhJTh5OBFFtv827AdHU7Rbyct4r+Ba1/99oFa1Y3yuFsdw==",
72
72
  "license": "MIT",
73
73
  "dependencies": {
74
74
  "bytes": "~3.1.2",
@@ -261,6 +261,22 @@
261
261
  "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==",
262
262
  "license": "MIT"
263
263
  },
264
+ "node_modules/@adapt-toolkit/sdk/node_modules/qs": {
265
+ "version": "6.16.2",
266
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.2.tgz",
267
+ "integrity": "sha512-VYdnB5S7/0IeXzBacUtwNAaM6d7Y/PgYnNC7bJCI6meqA/OgnsQbZMtVW8Dt2D1PHgbHGtYmhSoEIgvt7xZ2ZA==",
268
+ "license": "BSD-3-Clause",
269
+ "dependencies": {
270
+ "es-define-property": "^1.0.1",
271
+ "side-channel": "^1.1.1"
272
+ },
273
+ "engines": {
274
+ "node": ">=0.6"
275
+ },
276
+ "funding": {
277
+ "url": "https://github.com/sponsors/ljharb"
278
+ }
279
+ },
264
280
  "node_modules/@adapt-toolkit/sdk/node_modules/range-parser": {
265
281
  "version": "1.2.1",
266
282
  "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
@@ -542,9 +558,9 @@
542
558
  ]
543
559
  },
544
560
  "node_modules/@anthropic-ai/sdk": {
545
- "version": "1.0.0",
546
- "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-1.0.0.tgz",
547
- "integrity": "sha512-I1KiDtqRl1F9mZgRJxTYiLxeM/jgLve/8YBeNpNBkPRttOFgABJQcDm70RFFGmOruTujiBbaCA+Vhx2Q8l0qPA==",
561
+ "version": "1.3.0",
562
+ "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-1.3.0.tgz",
563
+ "integrity": "sha512-k7z9BlLLPxfZH+ov7dS6EnaN/wiZeV8YNT1LZfrpAHIy7oY7pHr4UzirF9f2OlHtFEnRBOX+AZQ91Y5fK+TPTw==",
548
564
  "license": "Apache-2.0",
549
565
  "optional": true,
550
566
  "peer": true,
@@ -623,9 +639,9 @@
623
639
  "license": "BSD-3-Clause"
624
640
  },
625
641
  "node_modules/@fastify/deepmerge": {
626
- "version": "3.2.2",
627
- "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-3.2.2.tgz",
628
- "integrity": "sha512-155eqA/WMQdN6gUD4RrhS2K0Pcz2Ou9pQ86L0sipOpP9ONbTA6oYw/hW4VdBjR4egcDHqmWUK9x80oUX7S1mDQ==",
642
+ "version": "3.2.4",
643
+ "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-3.2.4.tgz",
644
+ "integrity": "sha512-kc8GQq5gX9RRhw0rov3DMrN8wS8yRlxJRdDzsYwwdBV/wazuVgc/1K7CKL90tlvu3RlHan6Y0R0aE3nJtBz2eQ==",
629
645
  "funding": [
630
646
  {
631
647
  "type": "github",
@@ -762,9 +778,9 @@
762
778
  }
763
779
  },
764
780
  "node_modules/@modelcontextprotocol/sdk": {
765
- "version": "1.32.1",
766
- "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.32.1.tgz",
767
- "integrity": "sha512-2DdE+SJDtzLEEWzY1ZjY7Q+VcPhcV1KisD3zI4u0XZyktsjHum1mwbMI+JaulUBi2OZk+KJAi2uPXzxichPkdw==",
781
+ "version": "1.32.2",
782
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.32.2.tgz",
783
+ "integrity": "sha512-SWsVtH/0vULSQStoZ6xxH2K09Li8fXYTMC64ZeogCdpZ3XSi1eCPOByV1OpuJxuI3OcmHhosDWYyii07tpPsLw==",
768
784
  "license": "MIT",
769
785
  "dependencies": {
770
786
  "@hono/node-server": "^1.19.9 || ^2.0.5",
@@ -1320,18 +1336,18 @@
1320
1336
  "license": "MIT"
1321
1337
  },
1322
1338
  "node_modules/body-parser": {
1323
- "version": "2.3.0",
1324
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
1325
- "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
1339
+ "version": "2.4.0",
1340
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz",
1341
+ "integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==",
1326
1342
  "license": "MIT",
1327
1343
  "dependencies": {
1328
1344
  "bytes": "^3.1.2",
1329
- "content-type": "^2.0.0",
1345
+ "content-type": "^2.1.0",
1330
1346
  "debug": "^4.4.3",
1331
1347
  "http-errors": "^2.0.1",
1332
- "iconv-lite": "^0.7.2",
1348
+ "iconv-lite": "^0.7.3",
1333
1349
  "on-finished": "^2.4.1",
1334
- "qs": "^6.15.2",
1350
+ "qs": "^6.16.1",
1335
1351
  "raw-body": "^3.0.2",
1336
1352
  "type-is": "^2.1.0"
1337
1353
  },
@@ -1878,9 +1894,9 @@
1878
1894
  "license": "MIT"
1879
1895
  },
1880
1896
  "node_modules/fast-json-stringify": {
1881
- "version": "7.1.2",
1882
- "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-7.1.2.tgz",
1883
- "integrity": "sha512-qGXObwtgxbn4CZM64EpHj+w31DnQ1XYtwnJL6eaWwLB00O8huNReY40lF3YP72PIUPv9TBYwvOXYvQvMNm1ekw==",
1897
+ "version": "7.2.0",
1898
+ "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-7.2.0.tgz",
1899
+ "integrity": "sha512-q18imgm9fEdQVfvJbRJALE9VP/A5HGme0+NUnWcmFYM9rbQbLkZZk20FyIp1LQ8gDOauQKwqMc52YozqFaQyOw==",
1884
1900
  "funding": [
1885
1901
  {
1886
1902
  "type": "github",
@@ -2172,9 +2188,9 @@
2172
2188
  "license": "MIT"
2173
2189
  },
2174
2190
  "node_modules/hono": {
2175
- "version": "4.13.13",
2176
- "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.13.tgz",
2177
- "integrity": "sha512-CQ46U0ZkAGmbT/4UxdzzGJpacP2IeKgY4a5/tOI9AABbpOMfK739wfDXmv1usCk+3RkKj1hQy4/fjhiwa2xlrA==",
2191
+ "version": "4.13.14",
2192
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.14.tgz",
2193
+ "integrity": "sha512-yhRLQ21U6qa9Hsu2N7Qcbh8tE+WKEcoErjIo56LeSGiGXGp9sA7UpE86Ui9uexb61KakiGwuHMn2QdV7w6i6kQ==",
2178
2194
  "license": "MIT",
2179
2195
  "engines": {
2180
2196
  "node": ">=16.9.0"
@@ -2245,9 +2261,9 @@
2245
2261
  "license": "ISC"
2246
2262
  },
2247
2263
  "node_modules/ip-address": {
2248
- "version": "10.7.4",
2249
- "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.4.tgz",
2250
- "integrity": "sha512-DWBMKyeM25D70nrIiTkgQth59/G+naKOTep6huF9j+GmeK3DMD60Zvxg5d5qQnz+38AHgou6ean2LECX+lrKDg==",
2264
+ "version": "10.7.5",
2265
+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.5.tgz",
2266
+ "integrity": "sha512-t2v0rkILYv9WXmSL7TpAaU3HXgaFYOPUcH3QHgwQ++gpJuH3bqyMy4Fvt/DJCTKwzH3Cf+bAp5W/mFL39KPLzA==",
2251
2267
  "license": "MIT",
2252
2268
  "engines": {
2253
2269
  "node": ">= 12"
@@ -2667,15 +2683,19 @@
2667
2683
  }
2668
2684
  },
2669
2685
  "node_modules/on-finished": {
2670
- "version": "2.4.1",
2671
- "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
2672
- "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
2686
+ "version": "2.4.2",
2687
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.2.tgz",
2688
+ "integrity": "sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==",
2673
2689
  "license": "MIT",
2674
2690
  "dependencies": {
2675
2691
  "ee-first": "1.1.1"
2676
2692
  },
2677
2693
  "engines": {
2678
2694
  "node": ">= 0.8"
2695
+ },
2696
+ "funding": {
2697
+ "type": "opencollective",
2698
+ "url": "https://opencollective.com/express"
2679
2699
  }
2680
2700
  },
2681
2701
  "node_modules/once": {
@@ -3049,9 +3069,9 @@
3049
3069
  }
3050
3070
  },
3051
3071
  "node_modules/qs": {
3052
- "version": "6.16.1",
3053
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.1.tgz",
3054
- "integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==",
3072
+ "version": "6.17.0",
3073
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.17.0.tgz",
3074
+ "integrity": "sha512-5LK5BZ2XDHMvcUJaf0CQ5HL3aVgKbpklvByC7qLSxYkfE8COEEbJg5xCHWCTqzqi0Gs4Jn5Mv5v3R38W6edscA==",
3055
3075
  "license": "BSD-3-Clause",
3056
3076
  "dependencies": {
3057
3077
  "es-define-property": "^1.0.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "channel": "stable",
4
- "installerVersion": "2.0.0",
4
+ "installerVersion": "2.0.1",
5
5
  "packages": {
6
6
  "@ours.network/sdk": {
7
7
  "version": "5.0.0",
@@ -2,7 +2,7 @@
2
2
  "release": {
3
3
  "schema": 1,
4
4
  "channel": "stable",
5
- "installerVersion": "2.0.0",
5
+ "installerVersion": "2.0.1",
6
6
  "packages": {
7
7
  "@ours.network/sdk": {
8
8
  "version": "5.0.0",
package/install.mjs CHANGED
@@ -2,12 +2,17 @@
2
2
 
3
3
  import { readFileSync } from 'node:fs';
4
4
 
5
+ import { isSecureNodeVersion, nodeVersionError } from './lib/security-versions.mjs';
5
6
  import { realEffects } from './lib/effects.mjs';
6
7
  import { installerFailure } from './lib/diagnostics.mjs';
7
8
  import { runWorkspaceSetup } from './lib/workspace-setup.mjs';
8
9
  import { runSetup } from './lib/setup.mjs';
9
10
  import { closeSync, makeWriter, openTty } from './lib/ui.mjs';
10
11
 
12
+ if (!isSecureNodeVersion(process.versions.node)) {
13
+ process.stderr.write(`${nodeVersionError(process.versions.node)}\n`);
14
+ process.exit(1);
15
+ }
11
16
  const version = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')).version;
12
17
  const ttyFd = openTty();
13
18
 
package/install.sh CHANGED
@@ -41,13 +41,13 @@ PKG="${OURS_INSTALL_PKG:-@ours.network/install}"
41
41
  NPM_BIN="${OURS_NPM:-npm}"
42
42
 
43
43
  # --- 1) Node.js + npm check + friendly guidance ------------------------------------------------
44
- # The installer needs Node.js ≥ 22 (and npm to fetch the command). If missing, don't fail
44
+ # The installer needs a patched Node.js 22, 24 or 26 release (and npm to fetch the command). If missing, don't fail
45
45
  # cryptically: explain what Node is and how to get it for this OS, point at nodejs.org, and exit
46
46
  # cleanly (0) so a piped run ends gracefully rather than with a scary non-zero error.
47
47
  if ! command -v node >/dev/null 2>&1 || ! command -v "$NPM_BIN" >/dev/null 2>&1; then
48
48
  os="$(uname -s 2>/dev/null || echo unknown)"
49
49
  printf '\n'
50
- say "ours needs Node.js (version 22 or newer, which includes npm) — it isn't installed yet."
50
+ say "ours needs Node.js (a patched 22.23.4+, 24.22.1+ or 26.12.1+ release, which includes npm) — it isn't installed yet."
51
51
  say "Node.js is a common, free runtime; here's how to get it:"
52
52
  case "$os" in
53
53
  Darwin)
@@ -65,6 +65,9 @@ if ! command -v node >/dev/null 2>&1 || ! command -v "$NPM_BIN" >/dev/null 2>&1;
65
65
  exit 0
66
66
  fi
67
67
 
68
+ # Refuse unpatched Node.js before anything runs (floors: lib/security-versions.mjs).
69
+ node -e 'const f={22:[23,4],24:[22,1],26:[12,1]},m=/^(\d+)\.(\d+)\.(\d+)$/.exec(process.versions.node),v=m&&m.slice(1).map(Number),p=v&&f[v[0]];if(!p||v[1]<p[0]||(v[1]===p[0]&&v[2]<p[1])){console.error("Node.js "+process.versions.node+" is not permitted. Ours requires a patched supported Node.js release: 22.23.4+, 24.22.1+, 26.12.1+ within those release lines; prerelease, end-of-life and unreviewed release lines are refused. Earlier patch levels are affected by CVE-2026-111497 (Brotli decompression out-of-bounds write): https://nodejs.org/en/blog/vulnerability/october-2026-security-releases Update Node.js from https://nodejs.org/en/download or your package manager, then retry.");process.exit(1)}' || exit 1
70
+
68
71
  # --- 2) DEV / LOCAL path: run the sibling install.mjs directly ---------------------------------
69
72
  # From a clone (or an explicit OURS_INSTALLER_MJS), skip npm entirely and run the local installer.
70
73
  MJS=""
@@ -1,3 +1,4 @@
1
+ import { assertSecureNodeVersion } from './security-versions.mjs';
1
2
  import { validateGatewayClientProfile } from './target.mjs';
2
3
  import { enableGateway } from './gateway-transition.mjs';
3
4
  import { executeLegacyMigration } from './legacy-migration.mjs';
@@ -796,8 +797,8 @@ export function runPreflight(effects) {
796
797
  }
797
798
  effects.out(ok(`Platform: ${plat.label} (supported)`));
798
799
  const version = String(effects.nodeVersion ?? '0');
799
- if (Number.parseInt(version.split('.')[0], 10) < 22) {
800
- effects.out(warn(`Node.js ${version} — ours needs v22 or newer. Update Node and re-run.`));
800
+ try { assertSecureNodeVersion(version); } catch (error) {
801
+ effects.out(warn(error.message));
801
802
  return { ok: false, platform: plat, node: version };
802
803
  }
803
804
  effects.out(ok(`Node.js ${version}`));
@@ -0,0 +1,38 @@
1
+ // Reviewed stable branches only: do not admit vulnerable intermediate Node lines.
2
+ export const NODE_SECURITY_ADVISORY = 'https://nodejs.org/en/blog/vulnerability/october-2026-security-releases';
3
+ export const NODE_DOWNLOAD_URL = 'https://nodejs.org/en/download';
4
+ export function isSecureNodeVersion(version) {
5
+ const match = /^v?(\d{1,9})\.(\d{1,9})\.(\d{1,9})$/.exec(String(version));
6
+ const [major, minor, patch] = match ? match.slice(1).map(Number) : [];
7
+ const floor = { 22: [23, 4], 24: [22, 1], 26: [12, 1] }[major];
8
+ return Boolean(floor && (minor > floor[0] || (minor === floor[0] && patch >= floor[1])));
9
+ }
10
+ export function nodeVersionError(version) {
11
+ const found = /^v?[0-9A-Za-z.+-]{1,64}$/.test(String(version)) ? version : 'unrecognized';
12
+ return `Node.js ${found} is not permitted. Requires stable Node.js 22.23.4+, 24.22.1+ or 26.12.1+ within those supported lines (CVE-2026-111497): ${NODE_SECURITY_ADVISORY} Update Node.js from ${NODE_DOWNLOAD_URL}, then retry.`;
13
+ }
14
+ export function assertSecureNodeVersion(version = process.versions.node) {
15
+ if (!isSecureNodeVersion(version)) throw Error(nodeVersionError(version));
16
+ }
17
+
18
+ export const CLOUDFLARED_SECURITY_ADVISORY = 'https://blog.cloudflare.com/emudhra-certificate-compromise/';
19
+ export const CLOUDFLARED_UPDATE_URL = 'https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/update-cloudflared/';
20
+ export const CLOUDFLARED_VERSION_TIMEOUT_MS = 10_000;
21
+ function cloudflaredVersion(output) {
22
+ const match = /^cloudflared version (\d{4})\.(\d{1,2})\.(\d{1,6})(?: \(built [^\r\n()]*\))?\r?\n?$/.exec(String(output));
23
+ const version = match?.slice(1).map(Number);
24
+ return version && version[1] >= 1 && version[1] <= 12 ? version : null;
25
+ }
26
+ export function isSecureCloudflaredVersion(output) {
27
+ const v = cloudflaredVersion(output);
28
+ return Boolean(v && (v[0] > 2026 || (v[0] === 2026 && (v[1] > 10 || (v[1] === 10 && v[2] >= 2)))));
29
+ }
30
+ const cloudflaredGuidance = `A tunnel requires cloudflared 2026.10.2 or later due to compromised certificate trust: ${CLOUDFLARED_SECURITY_ADVISORY} Update the cloudflared executable on PATH (${CLOUDFLARED_UPDATE_URL}), check with "cloudflared --version", then retry.`;
31
+ export function cloudflaredUnavailableError(reason) {
32
+ return `cloudflared could not be verified (${reason}). ${cloudflaredGuidance}`;
33
+ }
34
+ export function assertSecureCloudflaredVersion(output) {
35
+ if (isSecureCloudflaredVersion(output)) return;
36
+ const version = cloudflaredVersion(output);
37
+ throw Error(`cloudflared ${version ? `version ${version.join('.')}` : 'with an unrecognized version'} is not permitted. ${cloudflaredGuidance}`);
38
+ }
@@ -1,3 +1,4 @@
1
+ import { assertSecureCloudflaredVersion, assertSecureNodeVersion, cloudflaredUnavailableError, CLOUDFLARED_VERSION_TIMEOUT_MS } from './security-versions.mjs';
1
2
  import { chmodSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
2
3
  import { join,resolve } from 'node:path';
3
4
  import {parseSetupArgs} from './setup-options.mjs';
@@ -65,7 +66,16 @@ export function extractWorkspaceArgs(args){
65
66
  if(values['--setup-workspace'] && values['--setup-workspace-file'])throw Error('Choose one private payload transport');
66
67
  return {values,rest};
67
68
  }
69
+ // The connector Fleet later runs is checked before any grant redemption or setup write.
70
+ export async function requireSecureCloudflared(effects,timeout=CLOUDFLARED_VERSION_TIMEOUT_MS){
71
+ let result;
72
+ try{result=await effects.run('cloudflared',['--version'],{sensitive:true,timeout});}
73
+ catch(error){throw Error(cloudflaredUnavailableError(error?.code==='ENOENT'?'not found':error?.code==='ETIMEDOUT'?'timed out':'version check failed'));}
74
+ if(!result?.ok)throw Error(cloudflaredUnavailableError('version check failed'));
75
+ assertSecureCloudflaredVersion(result.stdout);
76
+ }
68
77
  export async function runWorkspaceSetup(args,effects,runSetup,request=fetch){
78
+ assertSecureNodeVersion(effects.nodeVersion ?? process.versions.node);
69
79
  const migrateAppOrigin=args.includes('--workspace-migrate-app-origin');
70
80
  if(args.filter(arg=>arg==='--workspace-migrate-app-origin').length>1)throw Error('Duplicate workspace migration flag');
71
81
  const {values,rest}=extractWorkspaceArgs(args.filter(arg=>arg!=='--workspace-migrate-app-origin'));let encoded;
@@ -122,7 +132,7 @@ export async function runWorkspaceSetup(args,effects,runSetup,request=fetch){
122
132
  if(p)await requireOptionalProfile();
123
133
  if(preserveProfile && !await capable('workspace.enroll.preserve-profile-v1'))throw Error('Existing-host setup requires a profile-preserving Fleet release; nothing was changed');
124
134
  const help=await effects.run(fleetBin,['workspace-enroll','--help'],{sensitive:true});if(!help.ok)throw Error('Fleet workspace enrollment is unavailable');
125
- const tunnel=await effects.run('cloudflared',['--version'],{sensitive:true});if(!tunnel.ok)throw Error('Tunnel connector is unavailable');
135
+ await requireSecureCloudflared(effects);
126
136
  if(options.includes('--dry-run')){
127
137
  if(grant)effects.out('Preview only: the workspace setup grant was not redeemed; this command remains usable until it expires.');
128
138
  if(!existing)return runSetup(setupOptions(p?.rootName ?? standIn),effects);return 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/install",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "private": false,
5
5
  "description": "The all-in-one ours.network installer: one shared daemon, MCP, cowork, Telegram, Fleet initialization, harness plugins, Human identity, progress UI, and guided next steps.",
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  "directory": "packages/installer"
29
29
  },
30
30
  "engines": {
31
- "node": ">=22"
31
+ "node": ">=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1 <27"
32
32
  },
33
33
  "scripts": {
34
34
  "test": "node --test",