fix: upgrade/uninstall hardening and security dependency bumps - #188
fix: upgrade/uninstall hardening and security dependency bumps#188nullun wants to merge 10 commits into
Conversation
A failed algod upgrade was only logged, then the command slept, attempted to start algod anyway and exited 0, hiding the failure from scripts.
Homebrew-based upgrade and uninstall now check whether the algorand formula is actually installed with brew before running brew commands, returning a clear message for updater/manual installs instead of "No available formula with the name algorand".
Mirrors the macOS Homebrew guard: upgrade and uninstall now verify the algorand package is installed with dpkg/rpm before running apt or dnf, returning a clear message for updater/manual installs.
…tall The paths were joined with spaces into a single rm argument, so the known data directories were never actually removed.
…/upgrade-uninstall-hardening
govulncheck reports five reachable stdlib vulnerabilities in go1.26.5 (GO-2026-6218, GO-2026-6090, GO-2026-6088, GO-2026-5972, GO-2026-5026), all fixed in go1.26.6.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #188 +/- ##
==========================================
+ Coverage 36.15% 45.42% +9.27%
==========================================
Files 96 96
Lines 6005 6025 +20
==========================================
+ Hits 2171 2737 +566
+ Misses 3681 3006 -675
- Partials 153 282 +129 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR hardens nodekit upgrade/uninstall behavior to better handle nodes not installed via the package manager NodeKit expects (Homebrew on macOS, apt/dnf on Linux), while also rolling in dependency/security upgrades (including a Go version bump).
Changes:
- Add “package-manager managed?” guards for macOS (Homebrew) and Linux (dpkg/rpm) upgrade/uninstall flows, with clearer user-facing errors for non-managed installs.
- Make
nodekit upgradefail fast with a non-zero exit when the algod upgrade step fails. - Bump Go and multiple Go module dependencies (per the merged dependency update work).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/system/upgrade.go | Fixes self-upgrade debug log to reference the actual backup path. |
| internal/algod/mac/mac.go | Adds Homebrew-managed checks and fixes forced uninstall data-dir deletion argument handling. |
| internal/algod/linux/linux.go | Adds dpkg/rpm “managed install” checks before running apt/dnf operations. |
| cmd/upgrade.go | Ensures algod upgrade failures exit non-zero. |
| go.mod | Updates Go version and dependency versions. |
| go.sum | Updates module checksums to match dependency bumps. |
Suppressed comments (1)
internal/algod/mac/mac.go:158
trustTap()runs before the Homebrew-managed guard. On systems with Homebrew installed but algod not installed via the managed formula,nodekit upgradewill still executebrew trust ...before returningNotBrewInstalledMsg. Consider movingtrustTap()to after theisBrewManaged()check to avoid unnecessary Homebrew side effects for non-brew installs.
trustTap()
if !isBrewManaged() {
return errors.New(NotBrewInstalledMsg)
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Homebrew 6 refuses to load formulae from untrusted taps, so running isBrewManaged first would misreport a brew-managed install with an untrusted tap as not managed.
The workflows pinned Go 1.22 while go.mod requires 1.26.6; builds only worked via toolchain auto-download. Using go-version-file keeps CI in step with the module directive.
|
LGTM but leaving review to @PhearZero I added a related UI task btw in case you want to add this too @nullun: #189 |
ℹ Overview
Fixes prompted by a user report of
nodekit upgradefailing on macOS with"No available formula with the name algorand" for a node that was installed
with update.sh rather than Homebrew. Also includes the dependency bumps from
#187 so both changes ship in a single release.
Upgrade/uninstall fixes
upgrade/uninstallnow check whether algod is actually managed byHomebrew before running brew commands, and return a clear message pointing
non-brew installs back to their original install method
dpkg -s/rpm -qbefore running apt/dnfnodekit upgradenow exits non-zero when the algod upgrade fails, insteadof logging the error and exiting 0
uninstall --forceon macOS now passes each data directory tormas aseparate argument; previously they were space-joined into a single path and
never deleted
path
Dependencies
vulnerabilities in 1.26.5 (GO-2026-6218, -6090, -6088, -5972, -5026), all
fixed in 1.26.6. The scan is clean after the bump.
Testing
go build ./...,go vet, and the full test suite pass on the merged treego mod verifyandgo mod tidyare cleangovulncheck ./...reports zero reachable vulnerabilitiesCI
go-version-fileinstead of pinning 1.22; builds previously relied on toolchain auto-download