Uh oh!
There was an error while loading. Please reload this page.
feat(install): install without reaching github.com (SOCKET_PATCH_BASE_URL) - #148
Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Open
Conversation
New `SOCKET_PATCH_BASE_URL` points the archive downloads at any releases base that answers GitHub's two asset paths, `<base>/latest/download/<file>` and `<base>/download/v<ver>/<file>`: curl -fsSL https://install.socket.dev/patch \ | SOCKET_PATCH_BASE_URL=https://install.socket.dev/SocketDev/socket-patch/releases sh install.socket.dev relays exactly those paths from the GitHub release (SocketDev/depscan#23909), which is why one template covers both origins and the script needs no branching for it. Whichever origin is used, the archive is still verified against the SHA256SUMS fetched from that same origin — the change moves who serves the bytes, not how they are checked. A new socket-patch release needs no publish for any of this: the origin resolves "latest" per request against the upstream release. Also adds `SOCKET_PATCH_INSTALL_DIR`, which wins over both defaults. It is what unprivileged installs into a toolchain-managed prefix need, and it is what makes the script testable without writing to a system path — used by the two new CI steps below. The default origin stays GitHub in this commit. Flipping it is one line, held until the relay is verified in prod: a script that defaults to a host which does not answer yet is a broken installer for everyone running it from a git checkout or the raw GitHub URL. CI gains two steps. One installs through a non-default base (GitHub's own, the same URL shape the relay serves) so the template is covered unconditionally. The other installs through install.socket.dev and asserts the installed version matches what that host reports as latest — skipping itself with a notice until the host resolves, so it is inert until the relay ships rather than red from merge. Verified locally against the real relay logic: latest and pinned installs both succeeded through it, checksums verified, and `socket-patch --update` worked through the same host with no CLI changes via SOCKET_UPDATE_BASE_URL (--dry-run resolved latest; `--update 3.2.0` downloaded and swapped). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Mikola Lysenko (mikolalysenko)force-pushed
the
feat/installer-download-origin
branch
from
August 5, 2026 16:47
d68a062 to
fd28391Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #145 (base:
feat/hosted-installer) — review that one first.Companion: SocketDev/depscan#23909, which serves the relay this talks to.
What
Lets
install.shinstall without reaching github.com, via a newSOCKET_PATCH_BASE_URLpointing at any releases base that answers GitHub's two assetpaths:
curl -fsSL https://install.socket.dev/patch \ | SOCKET_PATCH_BASE_URL=https://install.socket.dev/SocketDev/socket-patch/releases shinstall.socket.devrelays exactly those paths from the GitHub release, which is why onetemplate covers both origins and the script needs no branching. Whichever origin is used,
the archive is still verified against the
SHA256SUMSfetched from that same origin — thechange moves who serves the bytes, not how they are checked.
Also adds
SOCKET_PATCH_INSTALL_DIR, which wins over both existing defaults. Unprivilegedinstalls into a toolchain-managed prefix need it, and it is what makes the script testable
without writing to a system path — both new CI steps use it.
On "a release should automatically update the hosted binary"
It already does, and this keeps it that way: nothing runs at release time. The origin
resolves "latest" per request against the upstream release, so cutting 3.4.0 makes it
installable from
install.socket.devimmediately — no publish, no submodule bump, nodeploy. That property is the reason the depscan side is a relay rather than a copy.
The default is still GitHub, on purpose
Flipping it is one line, held until the relay is verified in prod. A script that defaults
to a host which does not answer yet is a broken installer for everyone running it from a
git checkout or the raw GitHub URL — and CI's end-to-end install step would fail on
mainimmediately. Sequence: this merges → depscan#23909 deploys → flip the default.
CI
Two steps, matching the posture of the
installer-driftworkflow from #145:SOCKET_PATCH_BASE_URLset to GitHub's ownreleases base (the same URL shape the relay serves), so the template the script builds
is covered unconditionally, today.
install.socket.devand asserts the installedversion matches what that host reports as latest. Skips itself with a notice until the
host resolves, so it is inert until the relay ships rather than red from merge.
Verified locally
Against the real relay logic from depscan#23909 running on this machine:
install.shthrough the relay installed 3.3.0 (latest) and 3.2.0 (pinned), bothchecksum-verified by the script itself;
shellcheck --shell=shandsh -nclean; the workflow YAML parses;SOCKET_UPDATE_BASE_URLoverride it already has:One caveat documented in
docs/installer-hosting.mdrather than papered over: anon-default
SOCKET_UPDATE_BASE_URLintentionally downgrades the downloaded binary'sversion self-check from hard-fail to a warning, because that knob is meant for mirrors
that may repackage. Making Socket's host a first-class endpoint set that keeps the strict
check is a CLI change, not a hosting one — deliberately not in this PR.
Not in scope
patch.ps1for native Windows.Note
Medium Risk
Changes the shell installer’s download and install paths—security-sensitive because users pipe the script—but behavior is opt-in via env vars, checksum verification is unchanged, and the default origin stays GitHub.
Overview
install.shnow supports installing release archives from a configurable releases base viaSOCKET_PATCH_BASE_URL(GitHub-style/latest/downloadand/download/v<ver>/paths), withSHA256SUMSstill fetched from that same origin.SOCKET_PATCH_INSTALL_DIRoverrides/usr/local/binvs~/.local/bin. The default download base remains GitHub.CI adds an end-to-end install using GitHub’s releases URL as a non-default base (plus a custom install dir), and a second step that installs through
install.socket.devwhen/patch/latestresponds, asserting the installed version matches the host’s reported latest.Docs (README,
docs/installer-hosting.md, CHANGELOG) describe the github-free one-liner, relay endpoints, and that flipping the default origin to Socket is intentionally deferred until prod verification.Reviewed by Cursor Bugbot for commit d68a062. Configure here.