Repository navigation
Conversation
…ed request; step startup not init #1681 Signed-off-by: Nik Cubrilovic <[email protected]>
…ignores proxies, a fragment ends the host; tests and docs for the state file and probe #1681 Signed-off-by: Nik Cubrilovic <[email protected]>
This was referenced Nov 11, 2026
Merged
Contributor
Author
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 free
to 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.
Part of #1681 (the install.sh side; the worker rate limit and a stable Sentry user key are a later private slice).
What
A failure report from
install.sh(report version 4) now names where a failed network request was going and on which IP family, alongside the fields it always had (step,exit_code,error_line,error_output, ...):host:install.squirrelscan.com,github.com,api.github.comor a*.githubusercontent.comhost; anything else (aSQUIRREL_RELEASES_ENDPOINTorSQUIRREL_DOWNLOAD_ENDPOINToverride, an internal mirror) iscustom. No path, query or credentials, and no name from the user's own network.ip_family:v4,v6orunknown. curl does not expose the family of a failed connection (%{remote_ip}is empty when it fails), so a detached probe of OUR host reads the address from curl's ownTrying <address>line (an IPv4 address with its port has one colon, an IPv6 one has more; the bracketed form of curl 8 too). It runs inside the same detached reporter as the POST, with the transport hardening and a 3 s connect and 5 s total bound, so the install never waits for it.customhosts are never probed (unknown).error()exits 1 after a failed request: each request site now records curl's exit code (note_fetch_failed), so the report keeps the installer's ownexit_codeand still carries host and family. A later request clears it, so a checksum failure after a recovered fetch does not inherit a stale host.A bug found on the way
note_fetch_hostset a shell variable, andget_latest_versionruns asversion=$(...), a subshell: the exit trap never saw the host, which is how a report read "an unknown host (before the first request)" for a request that had been made. The host and code now also go to a small state file (the same pattern asERROR_MSG_FILE), read once by the exit trap and removed on every exit path including signals.stepis neverinitThe default step is
startup;report_erroralso maps an empty step orinittostartup. A report that predates the named steps can no longer be mistaken for one from the current script. The stepstartupis unknown to the worker'sKNOWN_STEPStoday (buckets toother), and so are the new fields (its allowlist drops them): both are the private slice, and neither breaks anything meanwhile.Verified
install.squirrelscan.commapped to127.0.0.1reportshost: install.squirrelscan.com, ip_family: v4, mapped to::1reportsv6, withexit_code: 1and the sameerror_lineas before. Alpine 3 (musl, curl 8.23, bracketed trace):v6,libc: musl.bash -n, and the report path (a failure in a command substitution, then the exit trap) sendshostandip_family.shellcheck: no new finding (4 existing notes unchanged);bash -n install.sh(the CI "Installer script syntax" step).scripts/install-contract.test.ts(new cases: every network code, five trace shapes, custom host, GitHub hosts, command-substitution persistence, non-network and early failures, the error()-exit-1 case, stale-failure clearing, the step cases) andinstall-hardening-168.test.ts(signals leak no temp file) andinstall-path-setup.test.ts: 227 pass. The curl-hardening scan now counts six invocations (the probe is hardened).Acceptance criteria (#1681)
install.shincludes the failing host (hostname only, ours orcustom) and whether the attempt was IPv4 or IPv6, for every curl network failure codestep=initfrom the current script/errorrate limit per source: private sliceinstall-contract.test.ts)Agent skill and docs
quickstart.mdx(a custom endpoint's address never appears in the report;custominstead) andfaq.mdx(the report's fields now include host and IP family) are updated; CHANGELOG bullet included.install.ps1is unchanged (report version 3).