diff --git a/.craft.yml b/.craft.yml index e5b7f01ef0..09615fdfef 100644 --- a/.craft.yml +++ b/.craft.yml @@ -40,6 +40,7 @@ workspaces: - "npm-package" - "mcp-server-npm-package" - "vercel" + - "install-scripts" targets: - name: npm includeNames: '/^sentry-\d.*\.tgz$/' diff --git a/.github/workflows/cli-build.yml b/.github/workflows/cli-build.yml index b6fad80ad9..d86c8f21b0 100644 --- a/.github/workflows/cli-build.yml +++ b/.github/workflows/cli-build.yml @@ -394,3 +394,15 @@ jobs: with: name: vercel path: vercel.zip + # The website serves these at cli.sentry.dev/install and /install.ps1. + # Releasing the same files as assets puts their checksums on GitHub and + # the release registry, so the served scripts can be checked against a + # source other than the website. + - name: Upload install scripts artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: install-scripts + path: | + apps/cli-docs/dist/install + apps/cli-docs/dist/install.ps1 + if-no-files-found: error diff --git a/apps/cli-docs/src/content/docs/getting-started.mdx b/apps/cli-docs/src/content/docs/getting-started.mdx index 02efb7ae4b..0b59c0df51 100644 --- a/apps/cli-docs/src/content/docs/getting-started.mdx +++ b/apps/cli-docs/src/content/docs/getting-started.mdx @@ -64,6 +64,24 @@ curl https://cli.sentry.dev/install -fsS | SENTRY_INIT=1 bash The installer reports its own errors to Sentry. Set `SENTRY_CLI_NO_TELEMETRY=1` to turn this off; the CLI honors the same variable. +### Verify the Install Script + +Each stable release attaches `install` and `install.ps1` to its +[GitHub release](https://github.com/getsentry/toolkit/releases), and Sentry's +release registry lists their SHA-256 checksums. To check the script against the +registry before you run it: + +```bash +curl -fsSL https://cli.sentry.dev/install -o install +curl -fsSL https://release-registry.services.sentry.io/apps/sentry/latest -o release.json +expected=$(jq -er '.files.install.checksums["sha256-hex"]' release.json) +echo "$expected install" | sha256sum -c - && bash install +``` + +On macOS, use `shasum -a 256 -c -` instead of `sha256sum -c -`. During a release the +website can update before the registry does, so retry if the checksums differ +right after a new version ships. + ### Windows (PowerShell) On Windows, install the latest stable release from PowerShell: diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md index 3ef279f0bf..d4f2ec9d11 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md @@ -375,6 +375,10 @@ curl https://cli.sentry.dev/install -fsS | bash -s -- --no-completions curl https://cli.sentry.dev/install -fsS | bash -s -- --no-agent-skills curl https://cli.sentry.dev/install -fsS | SENTRY_INSTALL_DIR="$HOME/.local/bin" bash curl https://cli.sentry.dev/install -fsS | SENTRY_INIT=1 bash +curl -fsSL https://cli.sentry.dev/install -o install +curl -fsSL https://release-registry.services.sentry.io/apps/sentry/latest -o release.json +expected=$(jq -er '.files.install.checksums["sha256-hex"]' release.json) +echo "$expected install" | sha256sum -c - && bash install # Or install via npm/pnpm/bun npm install -g sentry