Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Move PortOS to pm2 7.1.0 and retire the get-uri and braces patches

Claude8e84a1579932
diff --git a/docs/DEPS.md b/docs/DEPS.md
index 28143a5a32..8c01f5ee54 100644
--- a/docs/DEPS.md
+++ b/docs/DEPS.md
@@ -22,7 +22,7 @@ Before removing a Tier 3 candidate, run a transitive-dep check (`npm ls <pkg>`).
| Package | Tier | Verdict | Where Used | Notes |
|---------|------|---------|------------|-------|
| **Root deps** | | | | |
-| `pm2` | 1 | KEEP | top-level scripts | Process manager, foundational. Declared in root `dependencies` (the root manifest has no devDependencies). Pinned `7.0.4` (aligned with server pin) |
+| `pm2` | 1 | KEEP | top-level scripts | Process manager, foundational. Declared in root `dependencies` (the root manifest has no devDependencies). Pinned `7.1.0` (aligned with server pin) |
| **Server deps** | | | | |
| `@cantoo/pdf-lib` | 2 | KEEP | PDF generation for the volume / comic / prose / legacy-archive exports | Maintained MIT fork of `pdf-lib`, which has had no publish since 2022-05. Same public API (`PDFDocument`/`rgb`/`StandardFonts`); the swap was 4 import lines. On maintenance watch — see the detailed finding |
| `pdf-lib` | — | REPLACED | PDF generation | 2026-09-02 → `@cantoo/pdf-lib` (issue #5672). Abandoned upstream: `1.17.1` is simultaneously the pinned and the latest published version, unchanged since 2022-05-12. Not deprecated and never flagged by `npm audit` — replaced ahead of an advisory, not in response to one |
@@ -38,7 +38,7 @@ Before removing a Tier 3 candidate, run a transitive-dep check (`npm ls <pkg>`).
| `node-pty` | 1 | KEEP | shell/terminal services | Native PTY binding (N-API) |
| `pg` | 1 | KEEP | Postgres access | Official `pg` driver |
| `playwright-core` | 1 | KEEP | `server/services/fableLoom/falVideoAutomation.js` — fal.ai scene video automation | Drives the PortOS-managed browser over CDP (`chromium.connectOverCDP`). `-core` rather than the full `playwright` package deliberately: the browser is provisioned separately by `npm run setup:browser`, so the bundled browser download would be dead weight |
-| `pm2` | 1 | KEEP | app lifecycle | Process manager. Pinned `7.0.4` (aligned with root pin) |
+| `pm2` | 1 | KEEP | app lifecycle | Process manager. Pinned `7.1.0` (aligned with root pin) |
| `sharp` | 1 | KEEP | image processing | Native, widely-audited |
| `socket.io` | 1 | KEEP | realtime | Foundational |
| `socket.io-client` | 1 | KEEP | server-to-client | Paired with socket.io |
@@ -173,7 +173,7 @@ An extreme run re-tests every `SKIPPED_INFEASIBLE` row here rather than honoring
Defined in `package.json` (root + server + client + autofixer) — kept current to dodge known upstream advisories:
- `[email protected]` (root + server + client)
- `[email protected]`, `[email protected]` (server + client)
- `[email protected]`, `[email protected]`, `[email protected]` (server + autofixer — the express-reachable subset; `autofixer/` mirrors only these three because a pin for a package absent from the tree reads as protection that does not exist)
- `[email protected]` (server only)
@@ -201,25 +201,9 @@ These exist purely to force-bump transitive deps; revisit if `npm audit` flags n
Packages that legitimately need an install script are named explicitly in the allowlist in `scripts/trusted-rebuilds.js`, the single source consumed by `npm run setup`, `scripts/ensure-deps.js`, `setup.ps1`, `update.sh` / `update.ps1`, and CI. `scripts/trusted-rebuilds.test.js` fails if a workspace `.npmrc` loses the setting, or if a dependency appears with an install hook that nobody has explicitly decided about. Because CI caches `server/node_modules` between jobs, `scripts/trusted-rebuild-stamp.js` writes a mark into the tree in the same step that rebuilds it and checks that mark after a cache restore — a tree cached before the rebuild is otherwise indistinguishable from a good one, since the allowlisted packages all ship prebuilt bindings and import fine either way.
-### Install-time dependency patches
+### Retired install-time dependency patches
-`scripts/lib/getUriFtpPatch.js` carries one narrowly scoped patch for a defect upstream has not fixed (get-uri through 8.0.1): its FTP adapter reads only `entry.modifiedAt`, which basic-ftp fills from MLSD alone, so a server with neither MDTM nor MLSD made an existing file report `ENOTFOUND` (#9462). The patch falls back to the Unix `LIST` date (`rawModifiedAt`). It runs from `scripts/trusted-rebuilds.js` (`rebuildTrusted` for every workspace, and `runCli server` for the root tree that holds pm2) because `ignore-scripts=true` rules out a postinstall hook; `scripts/trusted-rebuild-stamp.js` folds the patch fingerprint into the mark so a CI-cached tree from before a patch change is rebuilt. The patch edits by exact anchor, is idempotent, and leaves an unrecognized get-uri untouched with a warning — `server/dependency-overrides.test.js` pins the lockfile to the targeted release so a bump re-verifies the anchor.
-
-Date semantics: LIST carries no timezone, so values are read as UTC (the zone MDTM and MLSD use). `Mon d yyyy`, `d Mon yyyy` → midnight UTC (day resolution); `Mon d hh:mm`, `d Mon hh:mm` → the latest year not more than a day ahead of now; `yyyy-mm-dd hh:mm` (`-` or `/`) → as written. Anything else (non-English months, Japanese forms, impossible dates, ambiguous numeric forms) throws `EFTPLISTDATE` rather than inventing a timestamp. Cache validation compares exact instants, so a listing that switches from the time form to the year form simply redownloads. The security-patched `basic-ftp` override is unchanged.
-
-### PM2 brace recursion mitigation (#9906)
-
-As of 2026-10-03, the upstream [braces advisory GHSA-vfj7-8cjw-p6xm](https://github.com/advisories/GHSA-vfj7-8cjw-p6xm) has no first patched release, and npm still publishes braces 3.0.3 / PM2 7.0.4. Both root and server lockfiles resolve PM2 → chokidar 3.6.0 → the hoisted braces 3.0.3. They intentionally keep those supported versions; changing the server's separate chokidar 5 dependency does not change PM2's watcher.
-
-`scripts/lib/bracesDepthPatch.js` applies a local mitigation during the existing trusted-rebuild step. It verifies the installed version and complete upstream file hashes before editing, then bounds parser nesting and recursive compile, expand, stringify, append and flatten calls to 64 levels. Excessive patterns or externally supplied ASTs throw `EBRACESDEPTH` instead of exhausting the process stack. Quoted, escaped and bracketed literals preserve their parser semantics. A missing braces install is a no-op; unfamiliar releases, modified walkers and failed writes stop startup/install so an unguarded tree cannot be marked repaired. The patch is idempotent and repairs a partly written patch on the next attempt. Re-verify the patch when bumping braces; the dependency parity test pins both its version and hoisted location.
-
-All managed setup/update paths already run trusted rebuilds. `scripts/ensure-deps.js` additionally reapplies patches to existing workspace trees before `npm start` launches PM2, covering code-only upgrades with unchanged manifests and lockfiles. The trusted-rebuild cache stamp includes this patch's fingerprint.
-
-Input authority: PortOS's own ecosystem processes disable watching, and command-launched apps set `watch: false`; the spawn helper strips inherited `watch`. Managed-app lifecycle requests can also load that app's existing ecosystem file (`server/routes/apps/lifecycle.js` → `server/services/pm2.js`). PM2's `Watcher.js` passes ecosystem `watch`, `ignore_watch`, and `watch_options` to chokidar. Those patterns therefore come from locally admitted app configuration or an operator's PM2 CLI use, rather than an anonymous API watch-pattern field. Host-control route gates remain required; this tracing is not a claim that every reachable peer is trusted or that arbitrary app configuration is safe. The mitigation guards the dependency regardless of pattern origin.
-
-Regression tests copy the actual PM2 braces consumer into disposable trees, exercise deeply nested patterns below the existing character limit and externally supplied ASTs, verify normal globs/literals, and reject unfamiliar walkers before writing. Validation also used a disposable PM2 daemon with its own `PM2_HOME` and synthetic app: start, explicit restart, brace-glob file-watch restart, stop, and daemon cleanup all passed. No live managed processes were used.
-
-Dependabot alerts 58 (`package-lock.json`) and 59 (`server/package-lock.json`) are version-based and cannot detect this install-time patch. Reconcile each only after the mitigation PR is merged, recording the merged commit, this patch and regression evidence in the dismissal comment. The `tolerable_risk` reason records the local mitigation while the upstream version remains flagged; it is not an upstream fix or a claim of non-reachability. Future upstream fixes should replace the patch and restore version-based resolution.
+PortOS used to patch two PM2 transitive dependencies during the trusted-rebuild step: get-uri's FTP adapter (#9462, with a `basic-ftp` override, #9444) and a recursion-depth guard for braces (#9906, GHSA-vfj7-8cjw-p6xm). PM2 7.1.0 dropped its `proxy-agent` dependency (and with it the get-uri → basic-ftp chain and `ip-address`) and its chokidar 3 watcher dependency, so neither package is installed any more. The patches, the `get-uri` and `ip-address` overrides, and the `patches` field of the trusted-rebuild stamp were removed with that bump. `server/dependency-overrides.test.js` fails if braces reappears in the root or server lockfile, because it would then run without the old guard.
## Inline Audit Policy
diff --git a/package-lock.json b/package-lock.json
index 1603c541c9..254dd9e666 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,25 +9,13 @@
"version": "2.100.0",
"license": "MIT",
"dependencies": {
- "pm2": "7.0.4"
+ "pm2": "7.1.0"
},
"engines": {
"node": "^22.22.2 || ^24.15.0 || >=26.0.0",
"npm": ">=11.11.0"
}
},
- "node_modules/@pm2/blessed": {
- "version": "0.1.81",
- "resolved": "https://registry.npmjs.org/@pm2/blessed/-/blessed-0.1.81.tgz",
- "integrity": "sha512-ZcNHqQjMuNRcQ7Z1zJbFIQZO/BDKV3KbiTckWdfbUaYhj7uNmUwb+FbdDWSCkvxNr9dBJQwvV17o6QBkAvgO0g==",
- "license": "MIT",
- "bin": {
- "blessed": "bin/tput.js"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
"node_modules/@pm2/js-api": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@pm2/js-api/-/js-api-0.8.1.tgz",
@@ -79,21 +67,6 @@
"debug": "^4.3.1"
}
},
- "node_modules/@tootallnate/quickjs-emscripten": {
- "version": "0.23.0",
- "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz",
- "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==",
- "license": "MIT"
- },
- "node_modules/agent-base": {
- "version": "7.1.4",
- "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
- "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
- "license": "MIT",
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/amp": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/amp/-/amp-0.3.1.tgz",
@@ -146,51 +119,18 @@
"node": ">= 8"
}
},
- "node_modules/anymatch/node_modules/picomatch": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
- "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
- "license": "MIT",
- "engines": {
- "node": ">=8.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/jonschlinkert"
- }
- },
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"license": "Python-2.0"
},
- "node_modules/ast-types": {
- "version": "0.13.4",
- "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz",
- "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==",
- "license": "MIT",
- "dependencies": {
- "tslib": "^2.0.1"
- },
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/async": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",
"integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==",
"license": "MIT"
},
- "node_modules/basic-ftp": {
- "version": "6.2.1",
- "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-6.2.1.tgz",
- "integrity": "sha512-bK67isD+lKq46AU8vNtjvMaT2ZqAOAmNCbxUHlFBRD4k15NWxyEjmaKtZPlgce58So4BNTjITGQOVTjL9y0ECA==",
- "license": "MIT",
- "engines": {
- "node": ">=10.0.0"
- }
- },
"node_modules/binary-extensions": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
@@ -203,18 +143,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/braces": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
- "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
- "license": "MIT",
- "dependencies": {
- "fill-range": "^7.1.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/chalk": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
@@ -228,30 +156,6 @@
"node": ">=8"
}
},
- "node_modules/chokidar": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
- "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
- "license": "MIT",
- "dependencies": {
- "anymatch": "~3.1.2",
- "braces": "~3.0.2",
- "glob-parent": "~5.1.2",
- "is-binary-path": "~2.1.0",
- "is-glob": "~4.0.1",
- "normalize-path": "~3.0.0",
- "readdirp": "~3.6.0"
- },
- "engines": {
- "node": ">= 8.10.0"
- },
- "funding": {
- "url": "https://paulmillr.com/funding/"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.2"
- }
- },
"node_modules/cli-tableau": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/cli-tableau/-/cli-tableau-2.0.1.tgz",
@@ -293,15 +197,6 @@
"integrity": "sha512-/f6gpQuxDaqXu+1kwQYSckUglPaOrHdbIlBAu0YuW8/Cdb45XwXYNUBXg3r/9Mo6n540Kn/smKcZWko5x99KrQ==",
"license": "MIT"
},
- "node_modules/data-uri-to-buffer": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz",
- "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==",
- "license": "MIT",
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/dayjs": {
"version": "1.11.15",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.15.tgz",
@@ -325,72 +220,6 @@
}
}
},
- "node_modules/degenerator": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz",
- "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==",
- "license": "MIT",
- "dependencies": {
- "ast-types": "^0.13.4",
- "escodegen": "^2.1.0",
- "esprima": "^4.0.1"
- },
- "engines": {
- "node": ">= 14"
- }
- },
- "node_modules/escodegen": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz",
- "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",
- "license": "BSD-2-Clause",
- "dependencies": {
- "esprima": "^4.0.1",
- "estraverse": "^5.2.0",
- "esutils": "^2.0.2"
- },
- "bin": {
- "escodegen": "bin/escodegen.js",
- "esgenerate": "bin/esgenerate.js"
- },
- "engines": {
- "node": ">=6.0"
- },
- "optionalDependencies": {
- "source-map": "~0.6.1"
- }
- },
- "node_modules/esprima": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
- "license": "BSD-2-Clause",
- "bin": {
- "esparse": "bin/esparse.js",
- "esvalidate": "bin/esvalidate.js"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/estraverse": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
- "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
- "license": "BSD-2-Clause",
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
- "license": "BSD-2-Clause",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/eventemitter2": {
"version": "6.4.9",
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.9.tgz",
@@ -412,18 +241,6 @@
"integrity": "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==",
"license": "MIT"
},
- "node_modules/fill-range": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
- "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
- "license": "MIT",
- "dependencies": {
- "to-regex-range": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/follow-redirects": {
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
@@ -458,20 +275,6 @@
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
- "node_modules/get-uri": {
- "version": "6.0.5",
- "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz",
- "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==",
- "license": "MIT",
- "dependencies": {
- "basic-ftp": "^5.0.2",
- "data-uri-to-buffer": "^6.0.2",
- "debug": "^4.3.4"
- },
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
@@ -493,41 +296,6 @@
"node": ">=8"
}
},
- "node_modules/http-proxy-agent": {
- "version": "7.0.2",
- "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
- "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
- "license": "MIT",
- "dependencies": {
- "agent-base": "^7.1.0",
- "debug": "^4.3.4"
- },
- "engines": {
- "node": ">= 14"
- }
- },
- "node_modules/https-proxy-agent": {
- "version": "7.0.6",
- "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
- "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
- "license": "MIT",
- "dependencies": {
- "agent-base": "^7.1.2",
- "debug": "4"
- },
- "engines": {
- "node": ">= 14"
- }
- },
- "node_modules/ip-address": {
- "version": "10.7.2",
- "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.2.tgz",
- "integrity": "sha512-7H/2gFSIitxc0hG3nOI1glS8QLo/EHBFFLk8vEUjXY/xu0AdL8jZ9U1IzO2PUm0d2D/ofQcAifb0g6OBkt8U7w==",
- "license": "MIT",
- "engines": {
- "node": ">= 12"
- }
- },
"node_modules/is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
@@ -561,15 +329,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "license": "MIT",
- "engines": {
- "node": ">=0.12.0"
- }
- },
"node_modules/js-yaml": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
@@ -604,30 +363,12 @@
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
"license": "MIT"
},
- "node_modules/lru-cache": {
- "version": "7.18.3",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
- "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"license": "MIT"
},
- "node_modules/netmask": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.1.1.tgz",
- "integrity": "sha512-eonl3sLUha+S1GzTPxychyhnUzKyeQkZ7jLjKrBagJgPla13F+uQ71HgpFefyHgqrjEbCPkDArxYsjY8/+gLKA==",
- "license": "MIT",
- "engines": {
- "node": ">= 0.4.0"
- }
- },
"node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
@@ -637,36 +378,16 @@
"node": ">=0.10.0"
}
},
- "node_modules/pac-proxy-agent": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz",
- "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==",
+ "node_modules/picomatch": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
+ "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
"license": "MIT",
- "dependencies": {
- "@tootallnate/quickjs-emscripten": "^0.23.0",
- "agent-base": "^7.1.2",
- "debug": "^4.3.4",
- "get-uri": "^6.0.1",
- "http-proxy-agent": "^7.0.0",
- "https-proxy-agent": "^7.0.6",
- "pac-resolver": "^7.0.1",
- "socks-proxy-agent": "^8.0.5"
- },
"engines": {
- "node": ">= 14"
- }
- },
- "node_modules/pac-resolver": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz",
- "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==",
- "license": "MIT",
- "dependencies": {
- "degenerator": "^5.0.0",
- "netmask": "^2.0.2"
+ "node": ">=8.6"
},
- "engines": {
- "node": ">= 14"
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/pidusage": {
@@ -682,19 +403,18 @@
}
},
"node_modules/pm2": {
- "version": "7.0.4",
- "resolved": "https://registry.npmjs.org/pm2/-/pm2-7.0.4.tgz",
- "integrity": "sha512-rMzoZmZlmJw7hoTbO9cOqcwj407TzUVc84JRaIjmnK8+808zldQT2Sd4rVcqVvXUcI2LoXEf1irMevWfOx5SEQ==",
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/pm2/-/pm2-7.1.0.tgz",
+ "integrity": "sha512-ZqyWxM94iTvOaPYCa4ccAP4yaLZiIcGbzNn+SKlnakc+6joQ3wiKj1ZrYIZJwLTF9RI4vhRPL3YkOXXZksVYAw==",
"license": "AGPL-3.0",
"dependencies": {
- "@pm2/blessed": "0.1.81",
"@pm2/js-api": "0.8.1",
"@pm2/pm2-version-check": "1.0.4",
"amp": "0.3.1",
"amp-message": "0.1.2",
"ansis": "4.0.0-node10",
+ "anymatch": "3.1.3",
"async": "3.2.6",
- "chokidar": "3.6.0",
"cli-tableau": "2.0.1",
"commander": "2.15.1",
"croner": "4.1.97",
@@ -702,10 +422,14 @@
"debug": "4.4.3",
"eventemitter2": "6.4.9",
"fast-json-patch": "3.1.1",
- "js-yaml": "4.3.1",
+ "glob-parent": "5.1.2",
+ "is-binary-path": "2.1.0",
+ "is-glob": "4.0.3",
+ "js-yaml": "4.3.2",
+ "normalize-path": "3.0.0",
"pidusage": "4.0.1",
"pm2-deploy": "1.0.2",
- "proxy-agent": "6.5.0",
+ "readdirp": "3.6.0",
"semver": "7.7.2",
"tx2": "1.0.5",
"ws": "8.21.0"
@@ -718,6 +442,9 @@
},
"engines": {
"node": ">=18.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "2.3.3"
}
},
"node_modules/pm2-deploy": {
@@ -745,31 +472,6 @@
"node": ">=10"
}
},
- "node_modules/proxy-agent": {
- "version": "6.5.0",
- "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz",
- "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==",
- "license": "MIT",
- "dependencies": {
- "agent-base": "^7.1.2",
- "debug": "^4.3.4",
- "http-proxy-agent": "^7.0.1",
- "https-proxy-agent": "^7.0.6",
- "lru-cache": "^7.14.1",
- "pac-proxy-agent": "^7.1.0",
- "proxy-from-env": "^1.1.0",
- "socks-proxy-agent": "^8.0.5"
- },
- "engines": {
- "node": ">= 14"
- }
- },
- "node_modules/proxy-agent/node_modules/proxy-from-env": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
- "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
- "license": "MIT"
- },
"node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
@@ -782,18 +484,6 @@
"node": ">=8.10.0"
}
},
- "node_modules/readdirp/node_modules/picomatch": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
- "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
- "license": "MIT",
- "engines": {
- "node": ">=8.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/jonschlinkert"
- }
- },
"node_modules/run-series": {
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/run-series/-/run-series-1.1.9.tgz",
@@ -834,54 +524,6 @@
],
"license": "MIT"
},
- "node_modules/smart-buffer": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
- "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",
- "license": "MIT",
- "engines": {
- "node": ">= 6.0.0",
- "npm": ">= 3.0.0"
- }
- },
- "node_modules/socks": {
- "version": "2.8.8",
- "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.8.tgz",
- "integrity": "sha512-NlGELfPrgX2f1TAAcz0WawlLn+0r3FyhhCRpFFK2CemXenPYvzMWWZINv3eDNo9ucdwme7oCHRY0Jnbs4aIkog==",
- "license": "MIT",
- "dependencies": {
- "ip-address": "^10.1.1",
- "smart-buffer": "^4.2.0"
- },
- "engines": {
- "node": ">= 10.0.0",
- "npm": ">= 3.0.0"
- }
- },
- "node_modules/socks-proxy-agent": {
- "version": "8.0.5",
- "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz",
- "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==",
- "license": "MIT",
- "dependencies": {
- "agent-base": "^7.1.2",
- "debug": "^4.3.4",
- "socks": "^2.8.3"
- },
- "engines": {
- "node": ">= 14"
- }
- },
- "node_modules/source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "license": "BSD-3-Clause",
- "optional": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -894,24 +536,6 @@
"node": ">=8"
}
},
- "node_modules/to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "license": "MIT",
- "dependencies": {
- "is-number": "^7.0.0"
- },
- "engines": {
- "node": ">=8.0"
- }
- },
- "node_modules/tslib": {
- "version": "2.8.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
- "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
- "license": "0BSD"
- },
"node_modules/tv4": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/tv4/-/tv4-1.3.0.tgz",
diff --git a/package.json b/package.json
index 9b096f3037..15c17a3f88 100644
--- a/package.json
+++ b/package.json
@@ -56,16 +56,12 @@
"smoke": "node scripts/smoke-boot.js"
},
"dependencies": {
- "pm2": "7.0.4"
+ "pm2": "7.1.0"
},
"overrides": {
"lodash": "4.18.1",
"follow-redirects": "1.16.0",
"js-yaml": "4.3.2",
- "ws": "8.22.0",
- "ip-address": "10.7.2",
- "get-uri": {
- "basic-ftp": "6.2.1"
- }
+ "ws": "8.22.0"
}
}
diff --git a/scripts/ensure-deps.js b/scripts/ensure-deps.js
index 11c7a6304d..aa50433291 100644
--- a/scripts/ensure-deps.js
+++ b/scripts/ensure-deps.js
@@ -8,7 +8,7 @@ import { execFileSync } from 'child_process';
import { createHash } from 'crypto';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
-import { rebuildTrusted, patchInstalledDependencies } from './trusted-rebuilds.js';
+import { rebuildTrusted } from './trusted-rebuilds.js';
import { isDirectlyInvoked } from './lib/directInvocation.js';
import { dependencyWorkspaces, hasLinkedDependencies } from './lib/workspaceDependencies.js';
// Node refuses to spawn npm's `.cmd` shim under `shell:false` (CVE-2024-27980),
@@ -135,7 +135,7 @@ function install(dir, label) {
// and only performs installs when run as `node scripts/ensure-deps.js`.
function main() {
// Ordinary CoS worktrees borrow the source checkout's dependencies. Refuse
- // the entire repair before any install, cleanup, patch or receipt write;
+ // the entire repair before any install, cleanup or receipt write;
// checking inside the repair loop could already mutate an earlier workspace.
// lstat also catches dangling links and Windows directory junctions.
for (const { dir, label } of WORKSPACES) {
@@ -213,10 +213,6 @@ function main() {
}
}
- // A code-only upgrade can change an install-time patch without changing any
- // manifest or lockfile. Repair warm trees too, before PM2 is ever started.
- for (const { dir } of WORKSPACES) patchInstalledDependencies(dir);
-
if (hashesDirty) saveHashes(storedHashes);
if (needed) console.log('✅ Dependencies verified');
diff --git a/scripts/ensure-deps.test.js b/scripts/ensure-deps.test.js
index 5ce590f412..8698fdb214 100644
--- a/scripts/ensure-deps.test.js
+++ b/scripts/ensure-deps.test.js
@@ -98,12 +98,7 @@ describe('startup dependency reconciliation', () => {
copyFileSync(join(REPO_ROOT, 'scripts', 'ensure-deps.js'), join(root, 'scripts', 'ensure-deps.js'));
copyFileSync(join(REPO_ROOT, 'scripts', 'lib', 'directInvocation.js'), join(root, 'scripts', 'lib', 'directInvocation.js'));
copyFileSync(join(REPO_ROOT, 'scripts', 'lib', 'workspaceDependencies.js'), join(root, 'scripts', 'lib', 'workspaceDependencies.js'));
- writeFileSync(join(root, 'scripts', 'trusted-rebuilds.js'), `
- import { writeFileSync } from 'fs';
- import { join } from 'path';
- export const rebuildTrusted = () => true;
- export const patchInstalledDependencies = dir => writeFileSync(join(dir, 'node_modules', 'patch-applied'), 'patched');
- `);
+ writeFileSync(join(root, 'scripts', 'trusted-rebuilds.js'), 'export const rebuildTrusted = () => true;\n');
writeFileSync(join(root, 'server', 'lib', 'bufferedSpawn.js'), `
import { fileURLToPath } from 'url';
export const prepareCliSpawn = (command, args) => ({
@@ -136,7 +131,7 @@ describe('startup dependency reconciliation', () => {
};
}
- // A worktree must never repair or patch dependencies owned by its source
+ // A worktree must never repair dependencies owned by its source
// checkout. Check all workspaces before touching even an earlier local tree.
it.each(['warm', 'changed', 'missing-package', 'dangling'])('refuses %s shared dependencies before any startup mutation', (state) => {
const f = fixture();
@@ -147,7 +142,6 @@ describe('startup dependency reconciliation', () => {
renameSync(modules, shared);
if (state === 'changed') writeFileSync(join(f.root, 'server', 'package-lock.json'), '{"version":"new"}');
if (state === 'missing-package') rmSync(join(shared, 'pg'), { recursive: true });
- rmSync(join(shared, 'patch-applied'));
const target = state === 'dangling' ? join(f.root, 'absent-deps') : shared;
symlinkSync(target, modules, process.platform === 'win32' ? 'junction' : 'dir');
@@ -162,7 +156,6 @@ describe('startup dependency reconciliation', () => {
expect(readFileSync(join(f.root, 'node_modules', 'keep'), 'utf8')).toBe('original');
expect(readFileSync(f.receipt, 'utf8')).toBe(receipt);
expect(readFileSync(join(shared, 'installed-lock.json'), 'utf8')).toBe('{"version":"old"}');
- expect(existsSync(join(shared, 'patch-applied'))).toBe(false);
if (state === 'missing-package') expect(existsSync(join(shared, 'pg'))).toBe(false);
if (state === 'dangling') expect(existsSync(target)).toBe(false);
} finally {
@@ -183,10 +176,8 @@ describe('startup dependency reconciliation', () => {
expect(readFileSync(join(f.client, 'package-lock.json'), 'utf8')).toBe(updated);
expect(readFileSync(join(f.client, 'package.json'), 'utf8')).toBe('{}');
writeFileSync(join(f.client, 'node_modules', 'keep'), 'unchanged tree');
- rmSync(join(f.client, 'node_modules', 'patch-applied'));
expect(f.run()).not.toContain('reinstall');
expect(existsSync(join(f.client, 'node_modules', 'keep'))).toBe(true);
- expect(readFileSync(join(f.client, 'node_modules', 'patch-applied'), 'utf8')).toBe('patched');
} finally {
rmSync(f.root, { recursive: true, force: true });
}
diff --git a/scripts/lib/bracesDepthPatch.js b/scripts/lib/bracesDepthPatch.js
deleted file mode 100644
index 142aaa8b2b..0000000000
--- a/scripts/lib/bracesDepthPatch.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/** Install-time mitigation for GHSA-vfj7-8cjw-p6xm (#9906).
- * PM2 still requires chokidar 3.6.0 / braces 3.0.3. Keep that API and refuse
- * excessive parser/AST recursion instead. Never edit an unfamiliar release.
- */
-import { createHash } from 'crypto';
-import { existsSync, readFileSync, writeFileSync } from 'fs';
-import { join } from 'path';
-
-export const BRACES_PATCH_TARGET_VERSION = '3.0.3';
-export const BRACES_MAX_DEPTH = 64;
-const MARKER = '// portos #9906 depth guard';
-const guard = `${MARKER}\n if (depth > ${BRACES_MAX_DEPTH}) throw Object.assign(new RangeError('Brace nesting exceeds safe depth'), { code: 'EBRACESDEPTH' });`;
-const digest = source => createHash('sha256').update(source).digest('hex');
-
-// Verify complete upstream files, not merely an anchor that another release
-// could retain while changing the recursion around it.
-const FILES = {
- 'parse.js': {
- hash: 'e572166565f15fa6ad9865ae49d678218e32aabfd1b3720f6d0d43d39800d310',
- changes: [[' stack.push(block);', ` ${MARKER}\n if (stack.length > ${BRACES_MAX_DEPTH}) throw Object.assign(new RangeError('Brace nesting exceeds safe depth'), { code: 'EBRACESDEPTH' });\n stack.push(block);`]],
- },
- 'compile.js': {
- hash: 'dc98f22eee3d511785d92a00758d5f0d48efed5f5813bdecc2de430c529b5c9f',
- changes: [
- ['const walk = (node, parent = {}) => {', `const walk = (node, parent = {}, depth = 0) => {\n ${guard}`],
- ['walk(child, node)', 'walk(child, node, depth + 1)'],
- ],
- },
- 'expand.js': {
- hash: '41ccc196ebfa7b7781a634e721eb744e4e7bcb54cba427a7e3d6806a1b9e58f7',
- changes: [
- ['const walk = (node, parent = {}) => {', `const walk = (node, parent = {}, depth = 0) => {\n ${guard}`],
- ['walk(child, node)', 'walk(child, node, depth + 1)'],
- ["const append = (queue = '', stash = '', enclose = false) => {", `const append = (queue = '', stash = '', enclose = false, depth = 0) => {\n ${guard}`],
- ['append(value, stash, enclose)', 'append(value, stash, enclose, depth + 1)'],
- ['append(item, ele, enclose)', 'append(item, ele, enclose, depth + 1)'],
- ],
- },
- 'stringify.js': {
- hash: '379f22d77bfa1478341ccd49c5e4267464aabcbba03558bab332aac23fc6f23a',
- changes: [
- ['const stringify = (node, parent = {}) => {', `const stringify = (node, parent = {}, depth = 0) => {\n ${guard}`],
- ['stringify(child)', 'stringify(child, {}, depth + 1)'],
- ],
- },
- 'utils.js': {
- hash: 'b5a7596aa67730412b3c029ef09e84e6b67b8e445cffd35d1d295549c89066c7',
- changes: [
- ['const flat = arr => {', `const flat = (arr, depth = 0) => {\n ${guard}`],
- ['flat(ele)', 'flat(ele, depth + 1)'],
- ],
- },
-};
-
-export const bracesPatchFingerprint = () => digest(JSON.stringify({
- version: BRACES_PATCH_TARGET_VERSION, files: FILES,
-})).slice(0, 16);
-
-/** Patch the lockfile's hoisted braces install. Throws on unexpected code or
- * I/O failure: unlike the FTP compatibility patch, this is a security guard.
- * Both shipped PM2 lockfiles pin this location and version in the parity test.
- * All files are validated before any write. A partial write is repairable on
- * the next attempt because each file accepts pristine OR exact patched bytes.
- */
-export function applyBracesDepthPatch(nodeModulesDir) {
- const dir = join(nodeModulesDir, 'braces');
- if (!existsSync(dir)) return 'absent';
- const manifest = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'));
- if (manifest.version !== BRACES_PATCH_TARGET_VERSION) {
- throw new Error(`Unrecognized braces release for depth patch: ${manifest.version}`);
- }
- const files = Object.entries(FILES).map(([name, { hash, changes }]) => {
- const path = join(dir, 'lib', name);
- const installed = readFileSync(path, 'utf8');
- const original = changes.reduce((source, [before, after]) => source.replaceAll(after, before), installed);
- if (digest(original) !== hash) throw new Error(`Unrecognized braces ${name} for depth patch`);
- const patched = changes.reduce((source, [before, after]) => source.replaceAll(before, after), original);
- return { path, installed, patched };
- });
- let changed = false;
- for (const { path, installed, patched } of files) {
- if (installed === patched) continue;
- writeFileSync(path, patched);
- changed = true;
- }
- return changed ? 'patched' : 'already-patched';
-}
diff --git a/scripts/lib/bracesDepthPatch.test.js b/scripts/lib/bracesDepthPatch.test.js
deleted file mode 100644
index f0b818e553..0000000000
--- a/scripts/lib/bracesDepthPatch.test.js
+++ /dev/null
@@ -1,89 +0,0 @@
-import { afterEach, describe, expect, it } from 'vitest';
-import { cpSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'fs';
-import { createRequire } from 'module';
-import { tmpdir } from 'os';
-import { dirname, join } from 'path';
-import { fileURLToPath } from 'url';
-import { applyBracesDepthPatch, BRACES_MAX_DEPTH } from './bracesDepthPatch.js';
-import { patchInstalledDependencies, rebuildTrusted, runCli } from '../trusted-rebuilds.js';
-
-const require = createRequire(import.meta.url);
-// CI installs the server tree only. Follow PM2's actual chokidar consumer,
-// rather than assuming a root install or the server's unrelated chokidar 5.
-const pm2Require = createRequire(require.resolve('pm2/package.json', { paths: [fileURLToPath(new URL('../../server/', import.meta.url))] }));
-const watcherRequire = createRequire(pm2Require.resolve('chokidar'));
-const bracesRequire = createRequire(watcherRequire.resolve('braces/package.json'));
-const dirs = [];
-afterEach(() => dirs.splice(0).forEach(dir => rmSync(dir, { recursive: true, force: true })));
-
-const install = () => {
- const dir = mkdtempSync(join(tmpdir(), 'braces-depth-patch-'));
- dirs.push(dir);
- const modules = join(dir, 'node_modules');
- mkdirSync(modules);
- for (const name of ['braces', 'fill-range', 'to-regex-range', 'is-number']) {
- cpSync(dirname(bracesRequire.resolve(`${name}/package.json`)), join(modules, name), { recursive: true });
- }
- return { dir, modules, braces: () => require(join(modules, 'braces')) };
-};
-
-describe('PM2 braces depth mitigation (#9906)', () => {
- it('refuses deep brace, parenthesis and malformed patterns with a bounded error, then remains usable', () => {
- const f = install();
- patchInstalledDependencies(f.dir);
- const braces = f.braces();
- const deep = '{'.repeat(4000) + 'a,b' + '}'.repeat(4000);
- for (const input of [deep, '('.repeat(4000) + 'x' + ')'.repeat(4000), '{'.repeat(4000)]) {
- for (const method of ['parse', 'compile', 'expand', 'stringify']) {
- expect(() => braces[method](input)).toThrowError(expect.objectContaining({ code: 'EBRACESDEPTH' }));
- }
- }
- expect(braces.expand('src/{client,server}/{a..c}.js')).toEqual([
- 'src/client/a.js', 'src/client/b.js', 'src/client/c.js',
- 'src/server/a.js', 'src/server/b.js', 'src/server/c.js',
- ]);
- expect(braces.compile('src/{client,server}/*.js')).toBe('src/(client|server)/*.js');
- // Quoted, escaped and bracketed literals must not spend nesting depth.
- const literal = '{'.repeat(100);
- expect(braces.stringify(`"${literal}"`)).toBe(literal);
- expect(braces.stringify('\\{'.repeat(100))).toBe(literal);
- expect(braces.stringify(`[${literal}]`)).toBe(`[${literal}]`);
- expect(braces.stringify('{a')).toBe('{a');
- });
-
- it('guards externally supplied ASTs as well as parser input', () => {
- const f = install();
- applyBracesDepthPatch(f.modules);
- const braces = f.braces();
- const ast = () => {
- let node = { type: 'text', value: 'x' };
- for (let i = 0; i < BRACES_MAX_DEPTH + 2; i++) node = { type: 'root', nodes: [node] };
- return node;
- };
- for (const method of ['compile', 'expand', 'stringify']) {
- expect(() => braces[method](ast())).toThrowError(expect.objectContaining({ code: 'EBRACESDEPTH' }));
- }
- });
-
- it('patches idempotently through both managed rebuild and rebuild-free CLI paths', () => {
- const f = install();
- expect(rebuildTrusted(f.dir, 'client')).toBe(true);
- const file = join(f.modules, 'braces', 'lib', 'compile.js');
- const once = readFileSync(file, 'utf8');
- expect(runCli(['browser', f.dir])).toBe(0);
- expect(applyBracesDepthPatch(f.modules)).toBe('already-patched');
- expect(readFileSync(file, 'utf8')).toBe(once);
- });
-
- it('fails the install before writing when any upstream walker is unfamiliar', () => {
- const f = install();
- const compile = join(f.modules, 'braces', 'lib', 'compile.js');
- const parse = join(f.modules, 'braces', 'lib', 'parse.js');
- const original = readFileSync(parse, 'utf8');
- writeFileSync(compile, 'module.exports = () => "foreign";');
- expect(() => runCli(['browser', f.dir])).toThrow('Unrecognized braces compile.js');
- expect(readFileSync(parse, 'utf8')).toBe(original);
- writeFileSync(join(f.modules, 'braces', 'package.json'), '{"version":"4.0.0"}');
- expect(() => applyBracesDepthPatch(f.modules)).toThrow('Unrecognized braces release');
- });
-});
diff --git a/scripts/lib/getUriFtpPatch.js b/scripts/lib/getUriFtpPatch.js
deleted file mode 100644
index 66edf01c1e..0000000000
--- a/scripts/lib/getUriFtpPatch.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Install-time patch for get-uri's FTP adapter (#9462).
- *
- * get-uri decides "does this file exist, and when did it change" from
- * `client.lastMod()` (MDTM), then falls back to `client.list()` and reads
- * `entry.modifiedAt`. basic-ftp only fills `modifiedAt` from MLSD; its Unix
- * `LIST` parser sets `rawModifiedAt` and nothing else. A server without MDTM
- * *and* without MLSD therefore makes an existing file look missing (ENOTFOUND).
- * Upstream get-uri (through 8.0.1) still reads only `modifiedAt`, so we carry
- * the fallback ourselves. `ignore-scripts=true` blocks a postinstall hook, so
- * this runs from scripts/trusted-rebuilds.js — the same place every managed
- * install path already calls — against each workspace's installed tree.
- *
- * Raw date contract (basic-ftp `parseListUnix.js`): `rawModifiedAt` is
- * `"<date> <year-or-time>"`, one of
- * `Mon d yyyy` / `Mon d hh:mm` (ls -l: year for old files, time for recent)
- * `d Mon yyyy` / `d Mon hh:mm`
- * `yyyy-mm-dd hh:mm` (also with `/`)
- * LIST carries no timezone. We read every value as UTC, the same zone MDTM and
- * MLSD use, so the result is deterministic and never depends on the host's
- * locale. A year-less value (`Mon d hh:mm`) takes the most recent year that
- * does not put the date more than a day in the future. The year form has day
- * resolution only, so it is midnight UTC. Anything else (non-English month
- * names, Japanese forms, an out-of-range day) throws `EFTPLISTDATE` rather
- * than inventing a timestamp. Cache validation compares exact instants, so a
- * listing that later flips from the time form to the year form just redownloads.
- */
-import { createHash } from 'crypto';
-import { existsSync, readFileSync, writeFileSync } from 'fs';
-import { join } from 'path';
-
-export const GET_URI_PATCH_TARGET_VERSION = '6.0.5';
-const MARKER_BEGIN = '/* portos-patch #9462 begin';
-const MARKER_END = '/* portos-patch #9462 end */\n';
-
-const ANCHOR = 'lastModified = entry.modifiedAt;';
-const HELPER_ANCHOR = 'const ftp = ';
-const PATCHED = 'lastModified = entry.modifiedAt ?? parseUnixListDate(entry.rawModifiedAt);';
-
-/**
- * Self-contained on purpose: `applyGetUriFtpPatch` injects this function's own
- * source into get-uri's CommonJS file, so it may reference nothing outside its body.
- * Returns a Date, or throws an Error with code `EFTPLISTDATE`.
- */
-export function parseUnixListDate(raw, now = Date.now()) {
- const MONTHS = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
- const fail = () => Object.assign(
- new Error(`Unsupported FTP LIST modified date ${JSON.stringify(String(raw))}`),
- { code: 'EFTPLISTDATE' }
- );
- const build = (year, month, day, hour, minute) => {
- const date = new Date(Date.UTC(year, month, day, hour, minute));
- // Date.UTC rolls Feb 30 into March; a round-trip mismatch means the input was invalid.
- const valid = hour < 24 && minute < 60 && date.getUTCFullYear() === year
- && date.getUTCMonth() === month && date.getUTCDate() === day;
- return valid ? date : null;
- };
- const text = String(raw ?? '').trim();
- let month;
- let day;
- let tail;
- let match = text.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})\s+(\d{1,2}):(\d{2})$/);
- if (match) {
- const date = build(+match[1], +match[2] - 1, +match[3], +match[4], +match[5]);
- if (!date) throw fail();
- return date;
- }
- if ((match = text.match(/^([A-Za-z]{3})\s+(\d{1,2})\s+(\d{4}|\d{1,2}:\d{2})$/))) {
- [, month, day, tail] = match;
- } else if ((match = text.match(/^(\d{1,2})\s+([A-Za-z]{3})\s+(\d{4}|\d{1,2}:\d{2})$/))) {
- [, day, month, tail] = match;
- } else {
- throw fail();
- }
- const monthIndex = MONTHS.indexOf(month.toLowerCase());
- if (monthIndex === -1) throw fail();
- if (!tail.includes(':')) {
- const date = build(+tail, monthIndex, +day, 0, 0);
- if (!date) throw fail();
- return date;
- }
- const [hour, minute] = tail.split(':').map(Number);
- const limit = now + 24 * 60 * 60 * 1000;
- // Walk back a few years so Feb 29 resolves to the latest leap year instead of failing.
- for (let year = new Date(limit).getUTCFullYear(), i = 0; i < 5; i += 1, year -= 1) {
- const date = build(year, monthIndex, +day, hour, minute);
- if (date && +date <= limit) return date;
- }
- throw fail();
-}
-
-/** Changes whenever the injected code or its target does — see trusted-rebuild-stamp.js. */
-export const patchFingerprint = () => createHash('sha256')
- .update([GET_URI_PATCH_TARGET_VERSION, ANCHOR, PATCHED, parseUnixListDate.toString()].join('\0'))
- .digest('hex')
- .slice(0, 16);
-
-// Reverts a previously injected patch so a changed patch replaces it instead of
-// stacking on (or being skipped behind) the old one.
-const stripPatch = (source) => {
- const start = source.indexOf(MARKER_BEGIN);
- const end = source.indexOf(MARKER_END);
- const base = start !== -1 && end > start
- ? source.slice(0, start) + source.slice(end + MARKER_END.length)
- : source;
- return base.replace(/lastModified = entry\.modifiedAt \?\? parseUnixListDate\([^;]*\);/, ANCHOR);
-};
-
-/**
- * Patch `<nodeModulesDir>/get-uri/dist/ftp.js` in place. Idempotent, and a
- * changed patch replaces the one an earlier install injected. Returns `absent`
- * (get-uri not installed here), `patched`, `already-patched`, or
- * `unrecognized` (a get-uri this patch was not written for — never edited blind).
- */
-export function applyGetUriFtpPatch(nodeModulesDir) {
- const file = join(nodeModulesDir, 'get-uri', 'dist', 'ftp.js');
- if (!existsSync(file)) return 'absent';
- const installed = readFileSync(file, 'utf8');
- const fingerprint = patchFingerprint();
- if (installed.includes(`${MARKER_BEGIN} ${fingerprint} */`)) return 'already-patched';
- const source = stripPatch(installed);
- if (!source.includes(ANCHOR) || !source.includes(HELPER_ANCHOR)) return 'unrecognized';
- const helper = `${MARKER_BEGIN} ${fingerprint} */\n${parseUnixListDate.toString()}\n${MARKER_END}`;
- const patched = source.replace(ANCHOR, PATCHED).replace(HELPER_ANCHOR, `${helper}${HELPER_ANCHOR}`);
- writeFileSync(file, patched);
- return 'patched';
-}
diff --git a/scripts/lib/getUriFtpPatch.test.js b/scripts/lib/getUriFtpPatch.test.js
deleted file mode 100644
index f8a1453808..0000000000
--- a/scripts/lib/getUriFtpPatch.test.js
+++ /dev/null
@@ -1,122 +0,0 @@
-import { afterEach, describe, expect, it } from 'vitest';
-import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'fs';
-import { createRequire } from 'module';
-import { tmpdir } from 'os';
-import { join } from 'path';
-
-import {
- applyGetUriFtpPatch,
- parseUnixListDate,
- patchFingerprint
-} from './getUriFtpPatch.js';
-
-const NOW = Date.UTC(2026, 9, 1, 12, 0); // 2026-10-01T12:00Z
-const iso = raw => parseUnixListDate(raw, NOW).toISOString();
-
-describe('parseUnixListDate (basic-ftp rawModifiedAt contract, read as UTC)', () => {
- it.each([
- ['Jan 1 2020', '2020-01-01T00:00:00.000Z'],
- ['1 Jan 2020', '2020-01-01T00:00:00.000Z'],
- ['sep 09 2019', '2019-09-09T00:00:00.000Z'],
- ['2020-01-02 03:04', '2020-01-02T03:04:00.000Z'],
- ['2020/1/2 3:04', '2020-01-02T03:04:00.000Z'],
- ['Aug 15 08:30', '2026-08-15T08:30:00.000Z'],
- ['15 Aug 08:30', '2026-08-15T08:30:00.000Z']
- ])('parses %s', (raw, expected) => {
- expect(iso(raw)).toBe(expected);
- });
-
- it('resolves a year-less date to the latest year not beyond one day ahead', () => {
- expect(iso('Oct 1 11:59')).toBe('2026-10-01T11:59:00.000Z'); // earlier today
- expect(iso('Oct 2 11:00')).toBe('2026-10-02T11:00:00.000Z'); // within the skew tolerance
- expect(iso('Oct 3 00:00')).toBe('2025-10-03T00:00:00.000Z'); // beyond it: last year
- expect(iso('Dec 25 10:00')).toBe('2025-12-25T10:00:00.000Z');
- });
-
- it('finds the latest leap year for a year-less Feb 29', () => {
- expect(iso('Feb 29 10:00')).toBe('2024-02-29T10:00:00.000Z');
- });
-
- it.each([
- ['empty', ''],
- ['non-English month', 'Okt 1 2020'],
- ['Japanese form', '10月01日 2020年'],
- ['impossible day', 'Feb 30 2020'],
- ['impossible time', 'Jan 1 24:00'],
- ['ambiguous day-first numeric date', '01-02-2020 10:00'],
- ['trailing text', 'Jan 1 2020 extra']
- ])('refuses %s instead of inventing a timestamp', (_name, raw) => {
- expect(() => parseUnixListDate(raw, NOW)).toThrowError(expect.objectContaining({ code: 'EFTPLISTDATE' }));
- });
-});
-
-describe('applyGetUriFtpPatch', () => {
- const dirs = [];
- afterEach(() => dirs.splice(0).forEach(dir => rmSync(dir, { recursive: true, force: true })));
-
- // Reduced to the line the patch edits, plus the declaration it anchors on.
- const UPSTREAM = [
- '"use strict";',
- 'const ftp = (entry) => {',
- ' let lastModified;',
- ' if (entry) {',
- ' lastModified = entry.modifiedAt;',
- ' }',
- ' return lastModified;',
- '};',
- 'exports.ftp = ftp;',
- ''
- ].join('\n');
-
- const install = (source = UPSTREAM) => {
- const nodeModules = mkdtempSync(join(tmpdir(), 'get-uri-patch-'));
- dirs.push(nodeModules);
- mkdirSync(join(nodeModules, 'get-uri', 'dist'), { recursive: true });
- writeFileSync(join(nodeModules, 'get-uri', 'dist', 'ftp.js'), source);
- return nodeModules;
- };
-
- it('prefers MLSD/MDTM metadata and falls back to the parsed LIST date', () => {
- const nodeModules = install();
- expect(applyGetUriFtpPatch(nodeModules)).toBe('patched');
- const { ftp } = createRequire(import.meta.url)(join(nodeModules, 'get-uri', 'dist', 'ftp.js'));
- expect(ftp({ modifiedAt: new Date(0), rawModifiedAt: 'Jan 1 2020' })).toEqual(new Date(0));
- expect(ftp({ rawModifiedAt: 'Jan 1 2020' })).toEqual(new Date('2020-01-01T00:00:00Z'));
- expect(() => ftp({ rawModifiedAt: '' })).toThrowError(expect.objectContaining({ code: 'EFTPLISTDATE' }));
- });
-
- it('is idempotent', () => {
- const nodeModules = install();
- applyGetUriFtpPatch(nodeModules);
- const once = readFileSync(join(nodeModules, 'get-uri', 'dist', 'ftp.js'), 'utf8');
- expect(applyGetUriFtpPatch(nodeModules)).toBe('already-patched');
- expect(readFileSync(join(nodeModules, 'get-uri', 'dist', 'ftp.js'), 'utf8')).toBe(once);
- expect(once.match(/portos-patch #9462 begin/g)).toHaveLength(1);
- });
-
- it('replaces an older injected patch instead of keeping or stacking it', () => {
- const nodeModules = install();
- applyGetUriFtpPatch(nodeModules);
- const file = join(nodeModules, 'get-uri', 'dist', 'ftp.js');
- const current = readFileSync(file, 'utf8');
- // Simulate a tree patched by an earlier release of this patch.
- writeFileSync(file, current
- .replace(/begin [0-9a-f]{16}/, 'begin 0000000000000000')
- .replace(/function parseUnixListDate[\s\S]*?\n}\n/, 'function parseUnixListDate() { return new Date(0); }\n'));
- expect(applyGetUriFtpPatch(nodeModules)).toBe('patched');
- expect(readFileSync(file, 'utf8')).toBe(current);
- });
-
- it('reports a missing install and never edits a get-uri it does not recognize', () => {
- expect(applyGetUriFtpPatch(mkdtempSync(join(tmpdir(), 'get-uri-empty-')))).toBe('absent');
- const foreign = 'module.exports = { ftp() { return entry.lastModified; } };\n';
- const nodeModules = install(foreign);
- expect(applyGetUriFtpPatch(nodeModules)).toBe('unrecognized');
- expect(readFileSync(join(nodeModules, 'get-uri', 'dist', 'ftp.js'), 'utf8')).toBe(foreign);
- });
-
- it('exposes a stable fingerprint so a cached node_modules tree can be invalidated', () => {
- expect(patchFingerprint()).toMatch(/^[0-9a-f]{16}$/);
- expect(patchFingerprint()).toBe(patchFingerprint());
- });
-});
diff --git a/scripts/trusted-rebuild-stamp.js b/scripts/trusted-rebuild-stamp.js
index b222896de8..9c73090075 100644
--- a/scripts/trusted-rebuild-stamp.js
+++ b/scripts/trusted-rebuild-stamp.js
@@ -34,8 +34,6 @@ import { existsSync, readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
import { isDirectlyInvoked } from './lib/directInvocation.js';
-import { bracesPatchFingerprint } from './lib/bracesDepthPatch.js';
-import { patchFingerprint } from './lib/getUriFtpPatch.js';
import { TRUSTED_REBUILDS, discoverWorkspaces, workspaceDir } from './trusted-rebuilds.js';
export const STAMP_FILE = '.portos-trusted-rebuild.json';
@@ -52,9 +50,6 @@ export function expectedStamp(label, { platform = process.platform, arch = proce
return {
label,
allowlist: createHash('sha256').update(JSON.stringify(TRUSTED_REBUILDS[label] ?? null)).digest('hex').slice(0, 16),
- // Install-time dependency patches are applied by the same step that writes
- // this mark, so a cached tree from before a patch changed must read as stale.
- patches: `${patchFingerprint()}:${bracesPatchFingerprint()}`,
platform,
arch,
modules: String(modules),
diff --git a/scripts/trusted-rebuilds.js b/scripts/trusted-rebuilds.js
index 9d75a39346..97eb8d53fa 100644
--- a/scripts/trusted-rebuilds.js
+++ b/scripts/trusted-rebuilds.js
@@ -23,8 +23,6 @@ import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
import { prepareCliSpawn } from '../server/lib/bufferedSpawn.js';
import { isDirectlyInvoked } from './lib/directInvocation.js';
-import { applyGetUriFtpPatch } from './lib/getUriFtpPatch.js';
-import { applyBracesDepthPatch } from './lib/bracesDepthPatch.js';
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
@@ -81,28 +79,6 @@ export const TRUSTED_REBUILDS = {
]
};
-/**
- * Apply PortOS's install-time dependency patches to one workspace's installed
- * tree (get-uri's FTP adapter, #9462 — see scripts/lib/getUriFtpPatch.js). Rides
- * on this module because every managed install path already calls it after
- * `npm install` and `ignore-scripts=true` rules out a postinstall hook. Never
- * fatal for the FTP compatibility fallback. The braces recursion guard is
- * mandatory: unrecognized code or failed patch writes must stop the install.
- */
-export function patchInstalledDependencies(dir) {
- const bracesStatus = applyBracesDepthPatch(join(dir, 'node_modules'));
- if (bracesStatus === 'patched') console.log(`🩹 Patched braces recursion depth in ${dir}`);
- try {
- const status = applyGetUriFtpPatch(join(dir, 'node_modules'));
- if (status === 'patched') console.log(`🩹 Patched get-uri FTP LIST date fallback in ${dir}`);
- if (status === 'unrecognized') {
- console.warn(`⚠️ get-uri in ${dir} is not the release the FTP LIST date patch targets — left unpatched (#9462)`);
- }
- } catch (err) {
- console.warn(`⚠️ get-uri FTP LIST date patch failed in ${dir}: ${err.message ?? err}`);
- }
-}
-
/**
* Rebuild the trusted packages for one workspace.
* Returns true when every fatal group succeeded.
@@ -114,7 +90,6 @@ export function patchInstalledDependencies(dir) {
* than only a shape assertion on TRUSTED_REBUILDS.
*/
export function rebuildTrusted(dir, label, { spawn = execFileSync } = {}) {
- patchInstalledDependencies(dir);
const groups = TRUSTED_REBUILDS[label];
if (!groups) return true;
let ok = true;
@@ -164,11 +139,7 @@ export function runCli(argv, { spawn = execFileSync } = {}) {
console.error(`❌ unknown workspace '${label}'. Known workspaces: ${workspaces.join(', ')}`);
return 1;
}
- // pm2 (and with it get-uri) installs in the repo root, which no setup/update
- // path rebuilds directly — the server step is the one hook all of them share.
- if (label === 'server' && !dirOverride) patchInstalledDependencies(ROOT);
if (!TRUSTED_REBUILDS[label]) {
- patchInstalledDependencies(dirOverride ?? workspaceDir(label));
console.log(`✅ no trusted rebuilds needed for ${label}`);
return 0;
}
diff --git a/scripts/trusted-rebuilds.test.js b/scripts/trusted-rebuilds.test.js
index 7dbd069214..9ff00167ab 100644
--- a/scripts/trusted-rebuilds.test.js
+++ b/scripts/trusted-rebuilds.test.js
@@ -326,40 +326,6 @@ describe('npm spawn shape', () => {
});
});
-describe('install-time dependency patch wiring (#9462)', () => {
- // The patch itself is covered in scripts/lib/getUriFtpPatch.test.js; this pins
- // that every managed install path (rebuildTrusted for any workspace, and the
- // rebuild-free CLI branch) actually reaches it.
- const upstream = 'const ftp = async () => {\n lastModified = entry.modifiedAt;\n};\n';
- const tree = () => {
- const dir = mkdtempSync(join(tmpdir(), 'trusted-patch-'));
- mkdirSync(join(dir, 'node_modules', 'get-uri', 'dist'), { recursive: true });
- writeFileSync(join(dir, 'node_modules', 'get-uri', 'dist', 'ftp.js'), upstream);
- return dir;
- };
- const patched = (dir) => readFileSync(join(dir, 'node_modules', 'get-uri', 'dist', 'ftp.js'), 'utf8').includes('parseUnixListDate');
-
- it('patches a workspace tree from rebuildTrusted even when it has no rebuilds', () => {
- const dir = tree();
- try {
- expect(rebuildTrusted(dir, 'client', { spawn: () => {} })).toBe(true);
- expect(patched(dir)).toBe(true);
- } finally {
- rmSync(dir, { recursive: true, force: true });
- }
- });
-
- it('patches from the rebuild-free CLI branch too', () => {
- const dir = tree();
- try {
- expect(runCli(['browser', dir], { spawn: () => {} })).toBe(0);
- expect(patched(dir)).toBe(true);
- } finally {
- rmSync(dir, { recursive: true, force: true });
- }
- });
-});
-
describe('runCli exit codes', () => {
const noop = () => {};
diff --git a/server/dependency-overrides.test.js b/server/dependency-overrides.test.js
index 1419759712..0391d94be2 100644
--- a/server/dependency-overrides.test.js
+++ b/server/dependency-overrides.test.js
@@ -4,8 +4,6 @@ import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import { discoverWorkspaces } from '../scripts/trusted-rebuilds.js';
-import { BRACES_PATCH_TARGET_VERSION } from '../scripts/lib/bracesDepthPatch.js';
-import { GET_URI_PATCH_TARGET_VERSION } from '../scripts/lib/getUriFtpPatch.js';
const __dirname = dirname(fileURLToPath(import.meta.url));
const REPO_ROOT = join(__dirname, '..');
@@ -169,6 +167,15 @@ describe('dependency override parity across manifests (#2848)', () => {
expect(stale).toEqual([]);
});
+ // PortOS dropped its local braces depth guard (#9906) once pm2 7.1.0 stopped
+ // pulling braces in. A dependency that brings it back would run unguarded, so
+ // the guard has to return with it.
+ it.each(['package.json', 'server/package.json'])('%s resolves no braces install', rel => {
+ const resolved = Object.keys(readLockPackages(lockfileFor(rel)))
+ .filter((path) => packageNameFromLockPath(path) === 'braces');
+ expect(resolved).toEqual([]);
+ });
+
// The three mechanisms that govern a dependency tree — the manifest `overrides`
// block, a Dependabot entry, and the assertions above — were all hardcoded to
// root/server/client, so `autofixer/` (a fourth npm install prefix with its own
@@ -177,36 +184,6 @@ describe('dependency override parity across manifests (#2848)', () => {
// (issue #5658). MANIFESTS is a hand-written list; this derives the roster from
// the same `discoverWorkspaces()` the install-script allowlist uses, so a fifth
// workspace added later fails here instead of silently inheriting no governance.
- it.each(['package.json', 'server/package.json'])('%s patches the get-uri FTP consumer (#9444)', rel => {
- expect(readOverrides(rel)['get-uri']).toEqual({ 'basic-ftp': '6.2.1' });
- const resolved = Object.entries(readLockPackages(lockfileFor(rel)))
- .filter(([path]) => packageNameFromLockPath(path) === 'basic-ftp');
- expect(resolved.length).toBeGreaterThan(0);
- expect(resolved.map(([, metadata]) => metadata.version)).toEqual(
- resolved.map(() => '6.2.1')
- );
- });
-
- // scripts/lib/getUriFtpPatch.js edits get-uri's dist/ftp.js by exact anchor. A
- // lockfile move to another get-uri would leave installs unpatched (the patcher
- // skips a release it does not recognize), so the bump must re-verify the anchor.
- it.each(['package.json', 'server/package.json'])('%s resolves the get-uri release the FTP LIST date patch targets (#9462)', rel => {
- const resolved = Object.entries(readLockPackages(lockfileFor(rel)))
- .filter(([path]) => packageNameFromLockPath(path) === 'get-uri');
- expect(resolved.length).toBeGreaterThan(0);
- expect(resolved.map(([, metadata]) => metadata.version)).toEqual(
- resolved.map(() => GET_URI_PATCH_TARGET_VERSION)
- );
- });
-
- it.each(['package.json', 'server/package.json'])('%s pins the braces install the depth patch guards (#9906)', rel => {
- const resolved = Object.entries(readLockPackages(lockfileFor(rel)))
- .filter(([path]) => packageNameFromLockPath(path) === 'braces');
- expect(resolved.map(([path, metadata]) => [path, metadata.version])).toEqual([
- ['node_modules/braces', BRACES_PATCH_TARGET_VERSION],
- ]);
- });
-
it('governs every workspace manifest that ships its own lockfile', () => {
const tracked = trackedLockfiles();
const ungoverned = discoverWorkspaces()
diff --git a/server/getUriFtp.test.js b/server/getUriFtp.test.js
deleted file mode 100644
index 1b2a538b96..0000000000
--- a/server/getUriFtp.test.js
+++ /dev/null
@@ -1,150 +0,0 @@
-import { afterEach, describe, expect, it } from 'vitest';
-import { createServer } from 'node:net';
-import { once } from 'node:events';
-import { getUri } from 'get-uri';
-
-// Exercises get-uri's actual basic-ftp consumer, including its legacy-server
-// LIST fallback. The fixture binds only loopback and uses no production data.
-const fixtures = [];
-afterEach(async () => {
- await Promise.all(fixtures.splice(0).map(async ({ servers, sockets }) => {
- for (const socket of sockets) socket.destroy();
- await Promise.all(servers.map(server => new Promise(resolve => server.close(resolve))));
- }));
-});
-
-// `unixLine` swaps MLSD for a Unix `ls -l` LIST (no MLST in FEAT), the shape a
-// legacy server without MDTM/MLSD returns. Its date is the only metadata offered.
-const startFtp = async (mdtmResponse, { unixLine } = {}) => {
- const commands = [];
- const servers = [];
- const sockets = new Set();
- const sessions = [];
- fixtures.push({ servers, sockets });
- const track = socket => {
- sockets.add(socket);
- socket.on('close', () => sockets.delete(socket));
- socket.on('error', () => {}); // A client may reset its completed control connection.
- return socket;
- };
- const server = createServer(control => {
- track(control);
- const closed = new Promise(resolve => control.once('close', resolve));
- sessions.push(closed);
- control.setEncoding('utf8');
- control.write('220 Synthetic FTP ready\r\n');
- let buffer = '';
- let dataConnection;
- let passiveServer;
- control.on('data', chunk => {
- buffer += chunk;
- let end;
- while ((end = buffer.indexOf('\r\n')) !== -1) {
- const line = buffer.slice(0, end);
- buffer = buffer.slice(end + 2);
- commands.push(line);
- const verb = line.split(' ')[0];
- if (verb === 'USER') control.write('331 Password required\r\n');
- else if (verb === 'PASS') control.write('230 Logged in\r\n');
- else if (verb === 'FEAT') control.write(`211-Features\r\n UTF8\r\n${unixLine ? '' : ' MLST type*;size*;modify*;\r\n'}211 End\r\n`);
- else if (verb === 'MDTM') control.write(`${mdtmResponse}\r\n`);
- else if (verb === 'EPSV') {
- passiveServer = createServer();
- servers.push(passiveServer);
- dataConnection = once(passiveServer, 'connection').then(([socket]) => track(socket));
- passiveServer.listen(0, '127.0.0.1', () => {
- control.write(`229 Entering Extended Passive Mode (|||${passiveServer.address().port}|)\r\n`);
- });
- } else if (verb === 'MLSD' || verb === 'LIST' || verb === 'RETR') {
- control.write('150 Opening data connection\r\n');
- const listing = unixLine ?? 'type=file;size=19;modify=20200101000000; example.txt';
- const payload = verb !== 'RETR' ? `${listing}\r\n` : 'synthetic download\n';
- dataConnection.then(socket => {
- socket.end(payload, () => {
- control.write('226 Transfer complete\r\n');
- passiveServer.close();
- });
- }).catch(error => control.destroy(error));
- } else if (verb === 'QUIT') control.end('221 Goodbye\r\n');
- else control.write('200 Command accepted\r\n');
- }
- });
- });
- servers.push(server);
- server.listen(0, '127.0.0.1');
- await once(server, 'listening');
- return {
- url: `ftp://example:[email protected]:${server.address().port}/example.txt`,
- commands,
- sessions
- };
-};
-
-const readStream = async stream => {
- const chunks = [];
- for await (const chunk of stream) chunks.push(chunk);
- return Buffer.concat(chunks).toString('utf8');
-};
-
-describe('get-uri FTP compatibility with the security override (#9444)', () => {
- it.each([
- ['MDTM', '213 20200101000000', false],
- ['directory listing fallback', '502 MDTM unsupported', true]
- ])('downloads, reads metadata, caches, and closes connections via %s', async (_name, response, listing) => {
- const ftp = await startFtp(response);
- const stream = await getUri(ftp.url);
- expect(await readStream(stream)).toBe('synthetic download\n');
- expect(stream.lastModified.toISOString()).toBe('2020-01-01T00:00:00.000Z');
- await ftp.sessions[0];
- expect(ftp.commands.some(command => command.startsWith('MLSD'))).toBe(listing);
- expect(ftp.commands).toContain('RETR /example.txt');
- ftp.commands.length = 0;
- await expect(getUri(ftp.url, { cache: stream })).rejects.toMatchObject({ code: 'ENOTMODIFIED' });
- await ftp.sessions[1];
- expect(ftp.commands.some(command => command.startsWith('RETR'))).toBe(false);
- });
-
- const unixLine = date => `-rw-r--r-- 1 owner group 19 ${date} example.txt`;
- const utcMonthDayTime = date => `${date.toLocaleString('en-US', { month: 'short', timeZone: 'UTC' })} ${date.getUTCDate()} `
- + `${String(date.getUTCHours()).padStart(2, '0')}:${String(date.getUTCMinutes()).padStart(2, '0')}`;
- const recent = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000);
- recent.setUTCSeconds(0, 0);
-
- it.each([
- ['year form (day resolution, UTC midnight)', unixLine('Jan 1 2020'), new Date('2020-01-01T00:00:00Z')],
- ['recent time form (year inferred)', unixLine(utcMonthDayTime(recent)), recent]
- ])('downloads an existing file when MDTM is unsupported and only a Unix LIST date exists: %s (#9462)', async (_name, line, expected) => {
- const ftp = await startFtp('502 MDTM unsupported', { unixLine: line });
- const stream = await getUri(ftp.url);
- expect(await readStream(stream)).toBe('synthetic download\n');
- expect(stream.lastModified).toEqual(expected);
- await ftp.sessions[0];
- expect(ftp.commands.some(command => command.startsWith('MLSD'))).toBe(false);
- expect(ftp.commands.some(command => command.startsWith('LIST'))).toBe(true);
- ftp.commands.length = 0;
- await expect(getUri(ftp.url, { cache: stream })).rejects.toMatchObject({ code: 'ENOTMODIFIED' });
- await ftp.sessions[1];
- expect(ftp.commands.some(command => command.startsWith('RETR'))).toBe(false);
- });
-
- it('fails clearly, without downloading, when the Unix LIST date is not a supported format (#9462)', async () => {
- const ftp = await startFtp('502 MDTM unsupported', { unixLine: unixLine('Okt 1 2020') });
- await expect(getUri(ftp.url)).rejects.toMatchObject({ code: 'EFTPLISTDATE' });
- await ftp.sessions[0];
- expect(ftp.commands.some(command => command.startsWith('RETR'))).toBe(false);
- });
-
- it('reports a file absent from a Unix LIST as missing without downloading (#9462)', async () => {
- const ftp = await startFtp('502 MDTM unsupported', { unixLine: unixLine('Jan 1 2020').replace('example.txt', 'other.txt') });
- await expect(getUri(ftp.url)).rejects.toMatchObject({ code: 'ENOTFOUND' });
- await ftp.sessions[0];
- expect(ftp.commands.some(command => command.startsWith('RETR'))).toBe(false);
- });
-
- it('reports missing files without listing or downloading and closes the connection', async () => {
- const ftp = await startFtp('550 File missing');
- await expect(getUri(ftp.url)).rejects.toMatchObject({ code: 'ENOTFOUND' });
- await ftp.sessions[0];
- expect(ftp.commands.some(command => /^(LIST|MLSD|RETR)/.test(command))).toBe(false);
- });
-});
diff --git a/server/package-lock.json b/server/package-lock.json
index e52e01a04d..42b7a16607 100644
--- a/server/package-lock.json
+++ b/server/package-lock.json
@@ -19,7 +19,7 @@
"node-pty": "1.2.0-beta.15",
"pg": "8.23.1",
"playwright-core": "1.64.1",
- "pm2": "7.0.4",
+ "pm2": "7.1.0",
"sharp": "0.35.5",
"socket.io": "4.8.4",
"socket.io-client": "4.8.4",
@@ -933,18 +933,6 @@
"url": "https://github.com/sponsors/oxc-project"
}
},
- "node_modules/@pm2/blessed": {
- "version": "0.1.81",
- "resolved": "https://registry.npmjs.org/@pm2/blessed/-/blessed-0.1.81.tgz",
- "integrity": "sha512-ZcNHqQjMuNRcQ7Z1zJbFIQZO/BDKV3KbiTckWdfbUaYhj7uNmUwb+FbdDWSCkvxNr9dBJQwvV17o6QBkAvgO0g==",
- "license": "MIT",
- "bin": {
- "blessed": "bin/tput.js"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
"node_modules/@pm2/js-api": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@pm2/js-api/-/js-api-0.8.1.tgz",
@@ -1298,12 +1286,6 @@
"integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==",
"license": "MIT"
},
- "node_modules/@tootallnate/quickjs-emscripten": {
- "version": "0.23.0",
- "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz",
- "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==",
- "license": "MIT"
- },
"node_modules/@types/chai": {
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",
@@ -1548,18 +1530,6 @@
"node": ">=12"
}
},
- "node_modules/ast-types": {
- "version": "0.13.4",
- "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz",
- "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==",
- "license": "MIT",
- "dependencies": {
- "tslib": "^2.0.1"
- },
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/ast-v8-to-istanbul": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.7.tgz",
@@ -1598,15 +1568,6 @@
],
"license": "MIT"
},
- "node_modules/basic-ftp": {
- "version": "6.2.1",
- "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-6.2.1.tgz",
- "integrity": "sha512-bK67isD+lKq46AU8vNtjvMaT2ZqAOAmNCbxUHlFBRD4k15NWxyEjmaKtZPlgce58So4BNTjITGQOVTjL9y0ECA==",
- "license": "MIT",
- "engines": {
- "node": ">=10.0.0"
- }
- },
"node_modules/better-sqlite3-multiple-ciphers": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/better-sqlite3-multiple-ciphers/-/better-sqlite3-multiple-ciphers-13.0.3.tgz",
@@ -1673,18 +1634,6 @@
"url": "https://opencollective.com/express"
}
},
- "node_modules/braces": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
- "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
- "license": "MIT",
- "dependencies": {
- "fill-range": "^7.1.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/buffer-equal-constant-time": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
@@ -1937,15 +1886,6 @@
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
}
},
- "node_modules/data-uri-to-buffer": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz",
- "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==",
- "license": "MIT",
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/dayjs": {
"version": "1.11.15",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.15.tgz",
@@ -1969,20 +1909,6 @@
}
}
},
- "node_modules/degenerator": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz",
- "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==",
- "license": "MIT",
- "dependencies": {
- "ast-types": "^0.13.4",
- "escodegen": "^2.1.0",
- "esprima": "^4.0.1"
- },
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
@@ -2177,49 +2103,6 @@
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
"license": "MIT"
},
- "node_modules/escodegen": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz",
- "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",
- "license": "BSD-2-Clause",
- "dependencies": {
- "esprima": "^4.0.1",
- "estraverse": "^5.2.0",
- "esutils": "^2.0.2"
- },
- "bin": {
- "escodegen": "bin/escodegen.js",
- "esgenerate": "bin/esgenerate.js"
- },
- "engines": {
- "node": ">=6.0"
- },
- "optionalDependencies": {
- "source-map": "~0.6.1"
- }
- },
- "node_modules/esprima": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
- "license": "BSD-2-Clause",
- "bin": {
- "esparse": "bin/esparse.js",
- "esvalidate": "bin/esvalidate.js"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/estraverse": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
- "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
- "license": "BSD-2-Clause",
- "engines": {
- "node": ">=4.0"
- }
- },
"node_modules/estree-walker": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
@@ -2230,15 +2113,6 @@
"@types/estree": "^1.0.0"
}
},
- "node_modules/esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
- "license": "BSD-2-Clause",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
@@ -2375,18 +2249,6 @@
"integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==",
"license": "MIT"
},
- "node_modules/fill-range": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
- "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
- "license": "MIT",
- "dependencies": {
- "to-regex-range": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/finalhandler": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
@@ -2546,20 +2408,6 @@
"node": ">= 0.4"
}
},
- "node_modules/get-uri": {
- "version": "6.0.5",
- "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz",
- "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==",
- "license": "MIT",
- "dependencies": {
- "basic-ftp": "^5.0.2",
- "data-uri-to-buffer": "^6.0.2",
- "debug": "^4.3.4"
- },
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
@@ -2696,19 +2544,6 @@
"url": "https://opencollective.com/express"
}
},
- "node_modules/http-proxy-agent": {
- "version": "7.0.2",
- "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
- "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
- "license": "MIT",
- "dependencies": {
- "agent-base": "^7.1.0",
- "debug": "^4.3.4"
- },
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/https-proxy-agent": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
@@ -2744,15 +2579,6 @@
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"license": "ISC"
},
- "node_modules/ip-address": {
- "version": "10.7.2",
- "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.2.tgz",
- "integrity": "sha512-7H/2gFSIitxc0hG3nOI1glS8QLo/EHBFFLk8vEUjXY/xu0AdL8jZ9U1IzO2PUm0d2D/ofQcAifb0g6OBkt8U7w==",
- "license": "MIT",
- "engines": {
- "node": ">= 12"
- }
- },
"node_modules/ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
@@ -2795,15 +2621,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "license": "MIT",
- "engines": {
- "node": ">=0.12.0"
- }
- },
"node_modules/is-promise": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
@@ -3166,15 +2983,6 @@
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
"license": "MIT"
},
- "node_modules/lru-cache": {
- "version": "7.18.3",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
- "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/magic-string": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.3.tgz",
@@ -3303,15 +3111,6 @@
"node": ">= 0.6"
}
},
- "node_modules/netmask": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.1.1.tgz",
- "integrity": "sha512-eonl3sLUha+S1GzTPxychyhnUzKyeQkZ7jLjKrBagJgPla13F+uQ71HgpFefyHgqrjEbCPkDArxYsjY8/+gLKA==",
- "license": "MIT",
- "engines": {
- "node": ">= 0.4.0"
- }
- },
"node_modules/node-addon-api": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz",
@@ -3458,38 +3257,6 @@
"wrappy": "1"
}
},
- "node_modules/pac-proxy-agent": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz",
- "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==",
- "license": "MIT",
- "dependencies": {
- "@tootallnate/quickjs-emscripten": "^0.23.0",
- "agent-base": "^7.1.2",
- "debug": "^4.3.4",
- "get-uri": "^6.0.1",
- "http-proxy-agent": "^7.0.0",
- "https-proxy-agent": "^7.0.6",
- "pac-resolver": "^7.0.1",
- "socks-proxy-agent": "^8.0.5"
- },
- "engines": {
- "node": ">= 14"
- }
- },
- "node_modules/pac-resolver": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz",
- "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==",
- "license": "MIT",
- "dependencies": {
- "degenerator": "^5.0.0",
- "netmask": "^2.0.2"
- },
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
@@ -3644,19 +3411,18 @@
}
},
"node_modules/pm2": {
- "version": "7.0.4",
- "resolved": "https://registry.npmjs.org/pm2/-/pm2-7.0.4.tgz",
- "integrity": "sha512-rMzoZmZlmJw7hoTbO9cOqcwj407TzUVc84JRaIjmnK8+808zldQT2Sd4rVcqVvXUcI2LoXEf1irMevWfOx5SEQ==",
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/pm2/-/pm2-7.1.0.tgz",
+ "integrity": "sha512-ZqyWxM94iTvOaPYCa4ccAP4yaLZiIcGbzNn+SKlnakc+6joQ3wiKj1ZrYIZJwLTF9RI4vhRPL3YkOXXZksVYAw==",
"license": "AGPL-3.0",
"dependencies": {
- "@pm2/blessed": "0.1.81",
"@pm2/js-api": "0.8.1",
"@pm2/pm2-version-check": "1.0.4",
"amp": "0.3.1",
"amp-message": "0.1.2",
"ansis": "4.0.0-node10",
+ "anymatch": "3.1.3",
"async": "3.2.6",
- "chokidar": "3.6.0",
"cli-tableau": "2.0.1",
"commander": "2.15.1",
"croner": "4.1.97",
@@ -3664,10 +3430,14 @@
"debug": "4.4.3",
"eventemitter2": "6.4.9",
"fast-json-patch": "3.1.1",
- "js-yaml": "4.3.1",
+ "glob-parent": "5.1.2",
+ "is-binary-path": "2.1.0",
+ "is-glob": "4.0.3",
+ "js-yaml": "4.3.2",
+ "normalize-path": "3.0.0",
"pidusage": "4.0.1",
"pm2-deploy": "1.0.2",
- "proxy-agent": "6.5.0",
+ "readdirp": "3.6.0",
"semver": "7.7.2",
"tx2": "1.0.5",
"ws": "8.21.0"
@@ -3680,6 +3450,9 @@
},
"engines": {
"node": ">=18.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "2.3.3"
}
},
"node_modules/pm2-deploy": {
@@ -3695,30 +3468,6 @@
"node": ">=4.0.0"
}
},
- "node_modules/pm2/node_modules/chokidar": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
- "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
- "license": "MIT",
- "dependencies": {
- "anymatch": "~3.1.2",
- "braces": "~3.0.2",
- "glob-parent": "~5.1.2",
- "is-binary-path": "~2.1.0",
- "is-glob": "~4.0.1",
- "normalize-path": "~3.0.0",
- "readdirp": "~3.6.0"
- },
- "engines": {
- "node": ">= 8.10.0"
- },
- "funding": {
- "url": "https://paulmillr.com/funding/"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.2"
- }
- },
"node_modules/pm2/node_modules/picomatch": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
@@ -3841,31 +3590,6 @@
"url": "https://opencollective.com/express"
}
},
- "node_modules/proxy-agent": {
- "version": "6.5.0",
- "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz",
- "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==",
- "license": "MIT",
- "dependencies": {
- "agent-base": "^7.1.2",
- "debug": "^4.3.4",
- "http-proxy-agent": "^7.0.1",
- "https-proxy-agent": "^7.0.6",
- "lru-cache": "^7.14.1",
- "pac-proxy-agent": "^7.1.0",
- "proxy-from-env": "^1.1.0",
- "socks-proxy-agent": "^8.0.5"
- },
- "engines": {
- "node": ">= 14"
- }
- },
- "node_modules/proxy-from-env": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
- "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
- "license": "MIT"
- },
"node_modules/qs": {
"version": "6.16.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz",
@@ -4200,16 +3924,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/smart-buffer": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
- "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",
- "license": "MIT",
- "engines": {
- "node": ">= 6.0.0",
- "npm": ">= 3.0.0"
- }
- },
"node_modules/socket.io": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.4.tgz",
@@ -4308,44 +4022,6 @@
"node": ">= 0.6"
}
},
- "node_modules/socks": {
- "version": "2.8.9",
- "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.9.tgz",
- "integrity": "sha512-LJhUYUvItdQ0LkJTmPeaEObWXAqFyfmP85x0tch/ez9cahmhlBBLbIqDFnvBnUJGagb0JbIQrkBs1wJ+yRYpEw==",
- "license": "MIT",
- "dependencies": {
- "ip-address": "^10.1.1",
- "smart-buffer": "^4.2.0"
- },
- "engines": {
- "node": ">= 10.0.0",
- "npm": ">= 3.0.0"
- }
- },
- "node_modules/socks-proxy-agent": {
- "version": "8.0.5",
- "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz",
- "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==",
- "license": "MIT",
- "dependencies": {
- "agent-base": "^7.1.2",
- "debug": "^4.3.4",
- "socks": "^2.8.3"
- },
- "engines": {
- "node": ">= 14"
- }
- },
- "node_modules/source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "license": "BSD-3-Clause",
- "optional": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/source-map-js": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
@@ -4446,18 +4122,6 @@
"node": ">=14.0.0"
}
},
- "node_modules/to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "license": "MIT",
- "dependencies": {
- "is-number": "^7.0.0"
- },
- "engines": {
- "node": ">=8.0"
- }
- },
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
diff --git a/server/package.json b/server/package.json
index 448ea0e989..973b5771b7 100644
--- a/server/package.json
+++ b/server/package.json
@@ -32,7 +32,7 @@
"node-pty": "1.2.0-beta.15",
"pg": "8.23.1",
"playwright-core": "1.64.1",
- "pm2": "7.0.4",
+ "pm2": "7.1.0",
"sharp": "0.35.5",
"socket.io": "4.8.4",
"socket.io-client": "4.8.4",
@@ -57,11 +57,7 @@
"sharp": "0.35.5",
"socket.io-parser": "4.2.7",
"ws": "8.22.0",
- "ip-address": "10.7.2",
"postcss": "8.5.28",
- "nanoid": "3.3.18",
- "get-uri": {
- "basic-ftp": "6.2.1"
- }
+ "nanoid": "3.3.18"
}
}