etherpad-lite/src/node/hooks/express
John McLear b19ad89eb0
Fix offline/air-gapped Docker boot: stop pnpm self-provisioning the pinned version (#7911) (#7918)
* fix(docker): don't let pnpm self-provision a pinned version on offline boot (#7911)

The official Docker image installs pnpm directly via npm (corepack was dropped
for Node 25+). Standalone pnpm still honours the "packageManager" pin in
package.json: the image's pnpm intentionally lags that pin (pnpm 11.1.x enforces
a minimum-release-age policy the frozen-lockfile build can't satisfy), so pnpm
treats every invocation — including the informational `pnpm --version` probe
Etherpad runs at startup — as a request to download and run the pinned build.
Behind a corporate firewall / in an air-gapped install that download fails:

  [WARN] plugins - Failed to get pnpm version: Error: Command exited with
  code 1: pnpm --version

which is what #7911 reported.

Fix — neutralise the gap instead of closing it (closing it would break the
frozen-lockfile build on 11.1.x):

  - Dockerfile build stage sets `pnpm_config_pm_on_fail=ignore` (the pnpm 11
    successor to managePackageManagerVersions), inherited by the development and
    production runtime stages. pnpm then uses the installed pnpm instead of
    fetching the pinned one. It does not change which pnpm runs the build-time
    install, so the frozen-lockfile build is unaffected.
  - plugins.ts startup probe and the updater's pnpm-on-PATH checks run with the
    same flag, so the fix also covers non-Docker offline installs and the probe
    can never fail-loud.

Add a backend spec that fails CI if the offline guard is dropped while the image
pnpm differs from the package.json pin.

Verified with a standalone (non-corepack) pnpm: a "packageManager" mismatch
makes `pnpm --version` exit 1 by default (tries to fetch the pinned build), and
exit 0 reading the local version with pm_on_fail=ignore.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test: scope pnpm offline-guard check to the runtime-inherited build stage

Address Qodo review: the regression spec matched ENV pnpm_config_pm_on_fail
anywhere in the Dockerfile, so it would still pass if the guard were removed
from the `build` stage (which the runtime stages inherit) but left in the
throwaway `adminbuild` stage — reintroducing the offline failure. Extract the
`build` stage block and assert the ENV is present there specifically.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 09:31:00 +01:00
..
admin.ts Hardening: API request handling, random IDs, and plugin loading (#7906) 2026-06-07 19:17:39 +02:00
adminplugins.ts Drop swagger-ui, document telemetry, add opt-outs (#7524) (#7757) 2026-05-16 18:34:22 +01:00
adminsettings.ts feat(admin): explain env-var substitution in /settings, surface auth errors (#7819) (#7826) 2026-05-25 13:23:10 +01:00
apicalls.ts chore: fixed objectAsString 2025-08-01 21:58:10 +02:00
errorhandling.ts Added typescript to etherpad 2024-02-05 21:13:02 +01:00
importexport.ts fix(export): surface checkValidRev error message on bad :rev (#7792) 2026-05-17 13:20:05 +01:00
openapi-admin.ts fix(pad): outdated notice — resolve author from token cookie (Qodo #7804) (#7805) 2026-05-18 12:45:03 +01:00
openapi.ts feat(api): clean up published OpenAPI spec for downstream codegens (#7714) 2026-05-10 13:02:05 +01:00
padurlsanitize.ts Added typescript to etherpad 2024-02-05 21:13:02 +01:00
pwa.ts feat: support X-Forwarded-Prefix and X-Ingress-Path (#7802) (#7806) 2026-05-18 13:27:59 +01:00
socketio.ts feat(updater): tier 2 — manual-click update from /admin/update (#7607) (#7704) 2026-05-10 09:00:07 +01:00
specialpages.ts feat: support X-Forwarded-Prefix and X-Ingress-Path (#7802) (#7806) 2026-05-18 13:27:59 +01:00
static.ts chore: migrated settings to esm6 (#7062) 2025-08-04 22:42:50 +02:00
tokenTransfer.ts harden: assorted server-side tightening for 3.0.2 (#7784) 2026-05-17 13:19:41 +01:00
updateActions.ts Fix offline/air-gapped Docker boot: stop pnpm self-provisioning the pinned version (#7911) (#7918) 2026-06-09 09:31:00 +01:00
updateStatus.ts fix(pad): outdated notice — resolve author from token cookie (Qodo #7804) (#7805) 2026-05-18 12:45:03 +01:00
webaccess.ts feat(gdpr): IP/privacy audit (PR2 of #6701) (#7547) 2026-05-01 13:47:40 +01:00