Repository navigation
feat(update): sign release checksums and install updates automatically - #402
Merged
Merged
Conversation
fcoury
force-pushed
the
feat/auto-update
branch
from
October 17, 2026 15:16
2d7483c to
0569d66
Compare
Red now installs newer stable releases in the background by default. Since that removes the human from the loop, unattended installs need a stronger trust anchor than a checksum list published next to the archives it describes. The release workflow signs SHA256SUMS.txt with minisign, using a trusted comment that binds the signature to the release tag. The updater refuses any release whose checksum list isn't signed by an embedded release key for that exact tag, for both manual and automatic installs. [updates] mode gains "auto" (the new default) next to "notify" and "off". Builds the standalone updater doesn't own fall back to notifying; a held installation lock or detached session defers to the next daily check; a failed install warns once and keeps the current version.
fcoury
force-pushed
the
feat/auto-update
branch
from
October 17, 2026 16:00
0569d66 to
95ca248
Compare
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.
Why
Red's updater only notified: users had to run
red updateor:updatethemselves, so many sessions stayed on old releases. Installing unattended removes the person who would notice something odd. Today the only integrity check isSHA256SUMS.txt, which is published in the same GitHub release as the archives it describes. Anyone able to change that release could replace both.What
Signed checksums
release.ymlsignsSHA256SUMS.txtwith minisign. The secret key comes from theRED_MINISIGN_SECRET_KEYrepository secret. The trusted comment isred <tag> SHA256SUMS.txt, which ties the signature to one release, so an older signed list can't be reused under a newer tag. Before uploading, the step checks the signature againstinstall/release-signing.pub. The release notes explain how to verify releases manually.SHA256SUMS.txt.minisigand checks it againstRELEASE_PUBLIC_KEYSwithminisign-verify, which has no dependencies. It requires prehashed signatures and an exact trusted comment. This applies to manual and automatic installs alike. Keeping a list of keys allows key rotation.Automatic installs
[updates] modegainsautoand makes it the default.notifyandoffstill work. The starter config only has the defaults commented out, so existing users getautounless they set a mode themselves.red update --auto. It installs when the standalone updater owns the executable. Homebrew and source builds fall back to a check only.Deferrederror: logged quietly, retried the next day. A real failure (bad signature, bad checksum, failed self-check) shows one warning, and the binary stays as it was.How to Test
cargo test --lib update. The fixture tests sign releases with a throwaway ed25519 key and cover:official_release_keys_are_well_formedtiesinstall/release-signing.pubto the key embedded in Red.Cargo.tomlset toversion = "0.9.0".bin/with.red-install.toml(schema_version = 1,source = "standalone",target = "aarch64-apple-darwin") and an empty.red-update.lock.red update --auto. It fails withlatest Red release is missing SHA256SUMS.txt.minisig, because v0.9.1 is unsigned, andred --versionstill prints 0.9.0.XDG_CONFIG_HOME. After about a second it shows "Red could not install an update automatically".red update --checkandred update --autoon an unmanaged build print "Red 0.9.1 is up to date."mode = "notify"brings back the old notice-only behaviour.mode = "off"disables the daily check.Release note
The repository secret
RED_MINISIGN_SECRET_KEYmust exist before the next tag. Without it, the Sign checksums step fails the release on purpose. Releases before this one are unsigned. Users of this release will only ever be offered later, signed releases, so the transition never offers an unsigned candidate.