Skip to content

pito-renew

The demo example: an app at 1.0.0 finds 1.1.0 in a signed local manifest, installs it once its sha256 matches, then refuses a tampered download and keeps the old binary

pito-renew is self-update for a Rust app, in one small crate, renew, part of PITO MD. It takes three calls:

  • check fetches a signed release manifest and says whether a newer release is out;
  • install downloads this platform’s binary and swaps it in place of the running executable;
  • restart relaunches it.

Nothing runs or stays on disk unless the manifest’s minisign signature verifies against the key the app carries and the binary’s size and sha256 match what was signed.

Check for an update 0.47 ms on loopback, signature verified
Download, verify and swap 64 MiB 193 ms on loopback, 1.2× faster than curl then sha256sum
Library code 378 lines of Rust, no unsafe
Dependencies 7 direct, 44 in all, no system TLS library
Added to a stripped release binary 1.86 MiB, HTTPS included

Measure speed and size shows how each number was taken. Works on Linux and macOS (Windows through WSL), CI-tested on both.

The code is MIT licensed, © Catalin Ilinca. The PITO MD name and its logos are © Catalin Ilinca, all rights reserved, and are not covered by the MIT grant.