app: check Gitea releases and install update capsules
The app asks the project's Gitea release list about five seconds after startup and every six hours. A stable release beats a newer prerelease, and a release is offered only when its tag is newer than the running build and it carries a .capsule asset for this target. A capsule is a ZIP with capsule.json and a payload. Every payload file carries its size and BLAKE3 digest in the manifest, and staging rejects absolute paths, parent segments, undeclared entries, digest mismatches, and versions that are not newer. The verified payload is stored under the app data directory, so a download survives a restart. The manifest and archive format live in crates/capsule-format, shared by the app's verifier and the release tool. Settings > Advanced shows the state, the notes, and the download and install buttons. The status bar shows an accent chip while an update is waiting. Install copies the app to a temp helper, asks the daemon to stop, and quits. The helper waits for the process, swaps the files with a rollback copy of each old file, removes stale files, and starts the new app. A failed swap puts the old files back and logs the reason. --check-updates runs the release check from a shell. The release tool in tools/capsule builds a capsule from the same files the installer puts down, using packager.toml, so a release does not need an installed copy. docs/updates.md covers the format and the release steps.
This commit is contained in:
1 parent
9d1fb40434
commit
e3a62aa6ae
17 files changed
+3535
-6
No files matched your search
@@ -74,6 +74,7 @@ reading (`history::tests`), highlight clipping (`highlight::tests`) and formatti
|
||||
| `src/export.rs` | ffmpeg clip export, the clips folder it fills and its miniatures |
|
||||
| `src/os.rs` | Run key, toasts, tray icon and menu |
|
||||
| `src/ui.rs` | Colours, cards, switches, sliders, buttons |
|
||||
| `src/update.rs` | Release checks, the capsule format, staging, and the apply helper |
|
||||
| `src/screens/` | Settings, match history, clips, game review, the recording in progress |
|
||||
|
||||
## Where this stands against TODO.txt
|
||||
@@ -118,6 +119,9 @@ reading (`history::tests`), highlight clipping (`highlight::tests`) and formatti
|
||||
runtime beside the exe. `cargo install cargo-packager --locked && cargo packager --release`.
|
||||
On the first run the app downloads ffmpeg (`--fetch-ffmpeg` does it from a shell), so clip
|
||||
export is ready before the first clip. The installer has not been run on a clean VM yet.
|
||||
10. Updates: the app checks Gitea releases, downloads a capsule, verifies it, and restarts into
|
||||
a helper that swaps the files. The apply path has been exercised on a scratch folder; it has
|
||||
not run against a capsule published on Gitea yet.
|
||||
|
||||
### The recording screen
|
||||
|
||||
@@ -136,6 +140,24 @@ in Match history as a game that never happened, next to one with no champion. Th
|
||||
the open timeline into the one holding the video (`history::close_stopped`), and "Stop and
|
||||
delete" removes the clip and both.
|
||||
|
||||
## Updates
|
||||
|
||||
The app checks the project's Gitea releases about five seconds after startup, then every six
|
||||
hours. Settings > Advanced has the running version, the result, and the buttons that download a
|
||||
release and restart to install it. A release carries a `.capsule` asset: a ZIP with
|
||||
`capsule.json` at the root and every install file under `payload/`. The manifest names each
|
||||
file with a size and BLAKE3 digest, and the app checks every one before it stages the update.
|
||||
|
||||
`../tools/capsule` builds a capsule from the release tree and `packager.toml`, without an
|
||||
installed copy. `--check-updates` runs the same check from a shell. The restart starts a copy
|
||||
of the app from the temp folder; that copy waits for the app and daemon to exit, replaces the
|
||||
files, and starts the new app. A failed replace puts the old files back and writes
|
||||
`update.log` under the app data directory. `../docs/updates.md` has the format, the release
|
||||
steps, and the limits.
|
||||
|
||||
The capsule is not signed. HTTPS and the per-file digests detect a broken or truncated
|
||||
download, not a server that serves a matching capsule.
|
||||
|
||||
### Known gaps
|
||||
|
||||
- Item images are not drawn. Champion portraits download from Data Dragon on first sight and are
|
||||
|
||||
Reference in new issue
Block a user