Skip to content

feat: add greywall update command#46

Open
Joyce-O wants to merge 3 commits intoGreyhavenHQ:mainfrom
Joyce-O:feat/update-cmd
Open

feat: add greywall update command#46
Joyce-O wants to merge 3 commits intoGreyhavenHQ:mainfrom
Joyce-O:feat/update-cmd

Conversation

@Joyce-O
Copy link
Copy Markdown
Contributor

@Joyce-O Joyce-O commented Mar 20, 2026

Adds greywall update, a new command that updates both greywall and greyproxy to the latest release. The behavior depends on how greywall was installed:

  • Installed via install.sh → downloads and replaces the binaries automatically
  • Installed via Homebrew → prints the brew upgrade command to run
  • Installed from source → prints manual instructions and exits cleanly

--beta flag targets the latest pre-release for both tools. If no beta exists for either tool, a clear error is shown instead of a raw API message.

Both tools are skipped if already on the latest version.

Changes

cmd/greywall/main.go

  • greywall update command with install-method detection
  • copyFileTo handles atomic binary replacement across filesystems
  • Up-to-date check before downloading — skips if already on latest version
  • Clear error messages when --beta has no available pre-release

internal/proxy/install.go

  • DownloadGreywallBinary fetches asset URL via GitHub API instead of constructing it directly
  • resolveGreywallAssetURL resolves the correct greywall release asset for the current platform
  • fetchReleaseFor — generic GitHub release fetcher shared across both tools
  • CheckLatestTag(beta) / CheckLatestTagFor(owner, repo, beta) — public API for version checking
  • Fixed 404 on tagged release fetches — tags/ prefix now applied correctly

README.md

  • Added note that go install and source builds don't include greyproxy — run greywall setup separately

Tests

  • copyFileTo — atomic replacement across filesystems
  • TestCheckLatestTagFor — stable, beta, and error cases via httptest server

@Joyce-O Joyce-O marked this pull request as draft March 20, 2026 18:00
@Joyce-O Joyce-O force-pushed the feat/update-cmd branch 3 times, most recently from b992a0b to 79d52c8 Compare March 27, 2026 09:04
@Joyce-O Joyce-O marked this pull request as ready for review March 27, 2026 09:05
@Joyce-O Joyce-O force-pushed the feat/update-cmd branch 2 times, most recently from a6172da to 960ffba Compare March 31, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant