From ce59662e88ab24c13fd2ced1239295b2163c97b7 Mon Sep 17 00:00:00 2001 From: Marco Walz Date: Tue, 28 Apr 2026 17:50:13 +0200 Subject: [PATCH 1/2] infra(build): serve install.sh from site root via postbuild download Mirrors the portal's download-redirected-files.sh pattern: a postbuild script fetches the ICP SDK installer from the sdk public-manifest branch and places it at dist/install.sh so it is served at /install.sh. Required because internetcomputer.org/install.sh now redirects to docs.internetcomputer.org/install.sh and we were returning 404. --- package.json | 1 + scripts/download-install-sh.sh | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100755 scripts/download-install-sh.sh diff --git a/package.json b/package.json index 22284dde..c42132eb 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dev": "astro dev", "start": "astro dev", "build": "astro build", + "postbuild": "sh scripts/download-install-sh.sh", "preview": "astro preview", "astro": "astro", "validate": "node scripts/validate.js --all", diff --git a/scripts/download-install-sh.sh b/scripts/download-install-sh.sh new file mode 100755 index 00000000..165b7e77 --- /dev/null +++ b/scripts/download-install-sh.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Downloads the ICP SDK installer into the build output so it is served +# at /install.sh — mirroring the portal's download-redirected-files.sh pattern. +curl -sf https://raw.githubusercontent.com/dfinity/sdk/public-manifest/install.sh \ + -o dist/install.sh \ + || echo "Warning: could not download install.sh — file will not be served" From cfca82992951576836ba3a528e4ffd7bbeb7a3ef Mon Sep 17 00:00:00 2001 From: Marco Walz Date: Tue, 28 Apr 2026 17:51:22 +0200 Subject: [PATCH 2/2] infra(assets): set content-type for .sh files in asset canister config --- public/.ic-assets.json5 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/.ic-assets.json5 b/public/.ic-assets.json5 index a146ecbe..4c4e9285 100644 --- a/public/.ic-assets.json5 +++ b/public/.ic-assets.json5 @@ -35,6 +35,15 @@ "Content-Type": "text/plain; charset=utf-8" } }, + { + // Shell scripts served as plain text so curl | sh works correctly. + // install.sh is fetched fresh on every build so no long-lived cache. + "match": "**/*.sh", + "headers": { + "Content-Type": "text/plain; charset=utf-8", + "Cache-Control": "public, max-age=0, must-revalidate" + } + }, { // Markdown endpoints and llms.txt — short cache so updates are visible quickly "match": "**/*.{md,txt}",