feat: import nodejs/release-keys GitHub pgp keyring #1388
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Situation
The Cypress Docker images repo currently manages a list of Node.js release signer keys in the
cypress/factory
install script factory/installScripts/node/default.sh. Node.js releases are signed by individuals, and additional keys or changes to the status of existing keys can causecypress/factory
builds to fail because the integrity of the downloaded Node.js package cannot be verified. To remedy the situation requires a manual update to the table of keys, delaying the ability to use a particular impacted Node.js version until the update is merged, a newcypress/factory
version is published and users pick up this version.An alternate supported source of Node.js release signer keys is available from the nodejs/release-keys repo.
Background
Until now, the Node.js project provided instructions in their README > Release keys document section to import individual "Primary GPG keys for Node.js Releasers" using the
hkps://keys.openpgp.org
keyserver. For keys in the category "Other keys used to sign some previous releases" no instructions were provided. Some of these keys are needed for versions of Node.js that Cypress lists as supported under Install Cypress > Node.js.The
cypress/factory
install script factory/installScripts/node/default.sh did not specifically use the information in the Node.js README and instead notes in the install script that code was borrowed from https://github.com/nodejs/docker-node/blob/main/20/bookworm-slim/Dockerfile. This code took the approach of attempting to import keys first fromhkps://keys.openpgp.org
and then falling back to(hkp://)keyserver.ubuntu.com
if that failed.A recent change to the status of the key
C0D6248439F1D5604AAFFB4021D900FFDB233756
inhkps://keys.openpgp.org
caused a breaking change and meant that the script failed for what was at the time the Node.js Active LTS version 22.17.0. The problem was reported in issue #1375 and a workaround was implemented through PR #1377 incypress/factory:5.11.2
. Subsequently the nodejs/docker-node repo implemented a fix which added checks to each import step. This fix was mirrored into thecypress/factory
script through PR #1380 and released incypress/factory:5.11.3
. Stricter checking in this fix became an unintentional breaking change that then led to 2 users reporting build failures in an environment / situation where they had no connectivity to thekeyserver.ubuntu.com
, described in issue #1386. One theory, yet to be confirmed, is that there was a firewall rule in place that blocked access to TCP port11371
, the port used by the default keyserver protocolhkp
. A workaround for this side-effect was implemented through PR #1385 and released ascypress/factory:5.11.5
. (See also the CHANGELOG for an overview.)The key problem for Node.js 22.17.0 impacted also other Node.js users unrelated to Cypress and this has led to a new recommendation for verifying Node.js binaries involving importing a GPG keyring directly from the GitHub repo https://github.com/nodejs/release-keys instead of importing individual keys from
hkps://keys.openpgp.org
.Change
hkps://keys.openpgp.org
andkeyserver.ubuntu.com
.Advantages
https
connectivity (TCP port443
). This can be assumed to be available forcypress/factory
build environments, as it is required to retrieve the base Docker image, npm packages from the registry, browser packages, etc.Verification
Confirm that a
cypress/base
image for an example version signed by each of the "primary release signers" can be built without error. Additionally, test Node.js22.17.0
, which was signed with a key that has moved to the "previous keys" section: