Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 Mar 2026 16:13:30 +0000
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: bccac3973c7d - main - Tools/scripts: Use CA certificates in Tools/scripts/npmjs-fetch-with-dependencies.sh
Message-ID:  <69aef1aa.41481.721f7f7c@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bccac3973c7d7603884a1b538095f7c45ccca2a3

commit bccac3973c7d7603884a1b538095f7c45ccca2a3
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-03-09 15:49:08 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-03-09 16:13:25 +0000

    Tools/scripts: Use CA certificates in Tools/scripts/npmjs-fetch-with-dependencies.sh
---
 Tools/scripts/npmjs-fetch-with-dependencies.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Tools/scripts/npmjs-fetch-with-dependencies.sh b/Tools/scripts/npmjs-fetch-with-dependencies.sh
index 4884de6724fe..d2c95ccb095e 100755
--- a/Tools/scripts/npmjs-fetch-with-dependencies.sh
+++ b/Tools/scripts/npmjs-fetch-with-dependencies.sh
@@ -27,12 +27,20 @@ PACKAGE_VERSION="$2"
 PACKAGE_LOCK_JSON="$3"
 PACKAGE_TARBALL_OUTPUT="$4"
 
+LOCALBASE=${LOCALBASE}
+
 if [ -z "$PACKAGE_NAME" ] || [ -z "$PACKAGE_VERSION" ] || [ -z "$PACKAGE_LOCK_JSON" ] || [ -z "$PACKAGE_TARBALL_OUTPUT" ]; then
 	echo "Usage: $0 <package name> <package version> <package-lock.json> <package tarball output>"
 	echo "Example: $0 sharp 0.34.4 outdir/sharp-package-lock.json outdir/sharp-0.34.4.tar.gz"
 	exit 1
 fi
 
+if ! [ -f ${LOCALBASE}/share/certs/ca-root-nss.crt ]; then
+	echo "error: the CA certificate file ${LOCALBASE}/share/certs/ca-root-nss.crt is missing"
+	echo "       please install the 'ca_root_nss' package to provide it"
+	exit 1
+fi
+
 PACKAGE_NAME_PURE="$(echo $PACKAGE_NAME | sed 's|.*/||')"
 
 if [ -z "$TMPDIR" ]; then
@@ -92,7 +100,7 @@ if [ -f $PACKAGE_LOCK_JSON ]; then
 	# fetch dependencies
 	echo "{\"name\":\"${PACKAGE_NAME}-installer\",\"version\":\"1.0.0\",\"dependencies\":{\"${PACKAGE_NAME}\":\"${PACKAGE_VERSION}\"}}" > package.json
 	cp $PACKAGE_LOCK_JSON package-lock.json
-	HOME=${TMPDIR} npm ci --ignore-scripts --global-style --legacy-peer-deps --omit=dev
+	HOME=${TMPDIR} NODE_EXTRA_CA_CERTS=${LOCALBASE}/share/certs/ca-root-nss.crt npm ci --ignore-scripts --global-style --legacy-peer-deps --omit=dev
 else
 	# info
 	echo "INFO: the file $PACKAGE_LOCK_JSON does not exist, we will attempt to generate it"


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69aef1aa.41481.721f7f7c>