Skip to content

Commit f538add

Browse files
authored
fix(ci): bound non-root NodeSource setup download (#108911)
1 parent 0ca1d23 commit f538add

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

scripts/docker/install-sh-nonroot/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ RUN --mount=type=cache,id=openclaw-install-sh-nonroot-apt-cache,target=/var/cach
2828
RUN --mount=type=cache,id=openclaw-install-sh-nonroot-apt-cache,target=/var/cache/apt,sharing=locked \
2929
--mount=type=cache,id=openclaw-install-sh-nonroot-apt-lists,target=/var/lib/apt,sharing=locked \
3030
set -eux; \
31-
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -; \
31+
installer="$(mktemp)"; \
32+
curl -fsSL --connect-timeout 10 --max-time 120 -o "$installer" https://deb.nodesource.com/setup_24.x; \
33+
bash "$installer"; \
34+
rm -f "$installer"; \
3235
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nodejs
3336

3437
RUN useradd -m -s /bin/bash app \

test/scripts/test-install-sh-docker.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,13 @@ describe("test-install-sh-docker", () => {
463463
expect(nonrootDockerfile).toContain("USER app");
464464
expect(nonrootDockerfile).toContain("WORKDIR /home/app");
465465
expect(nonrootDockerfile).toContain("NPM_CONFIG_UPDATE_NOTIFIER=false");
466+
expect(nonrootDockerfile).toContain('installer="$(mktemp)"');
467+
expect(nonrootDockerfile).toContain(
468+
'curl -fsSL --connect-timeout 10 --max-time 120 -o "$installer" https://deb.nodesource.com/setup_24.x',
469+
);
470+
expect(nonrootDockerfile).toContain('bash "$installer"');
471+
expect(nonrootDockerfile).toContain('rm -f "$installer"');
472+
expect(nonrootDockerfile).not.toMatch(/curl[^\n]+\|\s*bash/u);
466473
});
467474

468475
it("keeps shared install helpers parsing and verifying installed CLI versions", () => {

0 commit comments

Comments
 (0)