Expand description
The desktop app’s signed updates from next.brep.io (offered, never silent). The desktop app’s updates: master’s Linux and Windows builds, offered from next.brep.io and installed only with the user’s say-so.
In the background the app hashes its own executable and asks the server’s
update channel (/api/public/app-update/<os>) for the current build’s
manifest. The manifest is signed with an ed25519 key whose public half is
PUBLIC_KEY_HEX; one that does not verify is ignored. When the signed
sha256 differs from this executable’s, a notice offers Update and
restart. The download must match the signed length and sha256 before it
touches the executable, so a server or connection that hands over
anything else can only make an update fail.
The executable is replaced by rename beside itself, which a running
program allows on both systems: on Linux the new file is renamed over the
old one; on Windows the running file is renamed to <exe>.old (deleted at
the next start) and the new one takes its name. The app then closes
through its normal close path, which writes unsaved work for recovery, and
starts the new executable with the same arguments.
The check never runs for a build out of a cargo target/ directory or
~/.cargo/bin (a developer’s or a crates.io build, which is not the
channel’s), with BREP_NO_UPDATE_CHECK set, or after Don’t check again
(update.json in the app’s config directory). BREP_UPDATE_URL points the
check at another server.
Structs§
- Manifest
- A build the channel offers, as its manifest describes it.
- Updater
- The background check and the notice it raises.
Constants§
- DEFAULT_
SERVER - The server the channel is on, unless
BREP_UPDATE_URLsays otherwise. - FORMAT
- The first line of every signed message; the server’s
FORMAT. - PUBLIC_
KEY_ HEX - The update signing key’s public half.
Functions§
- clean_
leftovers - What an earlier update left beside the executable: the Windows
.old(no longer running) and a.newan interrupted install wrote. - disabled_
reason - Why this run does not check, or
Nonewhen it does. - install
- Put
bytesin place ofexe, once they are whatmanifestsigned. - is_
dev_ build - A build cargo put where it builds (
…/target/release/brep-app,…/target/<triple>/debug/…, a test binary underdeps/) or installed (~/.cargo/bin): a developer’s or a crates.io build, not the channel’s. - platform_
os - The channel’s name for this system, or
Nonewhere it serves no build. - relaunch_
if_ installed - After the event loop returns: start the installed build with this run’s arguments, if an update was installed.
- sha256_
file - signed_
message - What the manifest’s signature covers. Byte-for-byte the server’s
desktop_update::signed_message; both sides’ tests pin one vector. - turn_
off - turned_
off - Whether the user said Don’t check again.