Repository navigation
Open
Labels
enhancementNew feature or requestNew feature or requestpriority: lowDo when nothing else waitsDo when nothing else waits
Description
After #7 there is an install.sh that installs a checked release. Let the owner also update pullgate on a host from the bot: /update checks GitHub for a newer release, and when there is one the bot asks the usual question with Apply and Skip. On Apply, root installs that exact release with the checks of install.sh.
How it must fit the design
- Same gate as a commit. The question names the exact version and the SHA-256 of the tarball for this host's CPU, and links the release notes. Apply installs only that tarball (rule 2, "one exact commit", for a release). A newer release that arrives in between closes the old question and asks again.
- The listener only writes requests and approvals, as today: a check request for the built-in
pullgatetarget, and the approval code. Root checks GitHub, records the question in its own state, and installs. Root takes the version and SHA-256 from its own state, never from the approval. - Root runs the install with every check of feat: install.sh that installs or updates pullgate from a checked release #7: SHA-256 from
SHA256SUMS,gh attestation verifywith the release bundle and the release workflow identity, the new binary'spullgate version. Best as a built-in copy ofinstall.sh(pullgate update, as nodkey does), so the code that checks is the code that was installed and checked before. - Forward only by default: never install an older version from Telegram.
- Fail closed and keep a way back: keep the old binary until the new one runs; if the new binary does not start (
pullgate version, then the listener service is active), put the old one back and report. Report the new version when done. - Restart the listener and units after the install (the listener restarts itself last, after it has reported).
- Optional, off by default: a timer that checks for a new release once a day and asks without
/update.
Threats to cover in THREAT-MODEL.md
- This replaces the program that is the gate. A wrong or bad binary removes the gate. So the attestation check is required, never optional, and there is no setting to skip it.
- A stolen bot token: cannot tap as the owner (rule 4); a forged request only checks and asks.
- A release that is published but bad: forward-only plus the owner's tap; the owner can pin
--versionwithinstall.shby hand.
Done when
-
/updatechecks, asks with version + SHA-256 + release link, and installs on Apply as above; DESIGN.md and README describe it. - Tests (fake release server, as in feat: install.sh that installs or updates pullgate from a checked release #7): wrong SHA-256, failed attestation, wrong version, older version, a newer release that arrives while a question is open, a new binary that does not start (rollback to the old one), Skip.
- THREAT-MODEL.md has the entries above.
- A real run on a test machine updates from one real release to the next, and the output is in a comment.
- Security review subagent run on the PR, findings fixed.
More from review (2026-11-11)
- Name space.
pullgateis also a valid instance name. Use a name that no instance can have (for example a separate inbox and state directory, or a name outside[a-z0-9][a-z0-9-]{0,31}), and test that an instance calledpullgatedoes not touch the self-update. - Root now downloads and unpacks. THREAT-MODEL T13 covers only git over ssh. Add: HTTPS only, no redirect outside GitHub's release hosts, a size limit per download, a time limit, tar entries with no
.., absolute paths, symlinks or other types, only the expected files.ghruns as root: say whichgh(pinned, checked, as in feat: install.sh that installs or updates pullgate from a checked release #7). - Check before asking. Run the SHA-256 and attestation checks before the question is sent, and again on Apply (the files are fetched again or kept in a root-only place). The question never offers a release that failed a check.
- The design says the opposite today: DESIGN section 15 and THREAT-MODEL T5 say self-update is not in 0.1 and pullgate does not repair itself. Rewrite both for this feature.
- A crash in the middle of the swap (T10): after a reboot the host has either the old or the new binary, never none or a half file (rename in the same directory,
fsync); test it. - Done when, more exactly: DESIGN.md gets a section for self-update (the flow, the files, the states); README "Install" gets the
/updatesteps. The real run needs two real releases; the comment shows only versions and check lines, no host names or IDs (the repo is public).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpriority: lowDo when nothing else waitsDo when nothing else waits
Activity