mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 12:27:28 +01:00
The in-app updater has been failing silently on this box: it checked,
found 0.8.12, downloaded it, posted "Fleet Runner v0.8.12 ready" — and
stayed on 0.8.11 for twelve days. A notification is not an update.
Four independent causes, each sufficient on its own:
1. The install was an extracted directory, so detectInstallFormat()
returned 'unknown'; on Linux electron-updater can only self-apply an
AppImage, so it picked the .deb asset...
2. ...which needs `sudo dpkg -i`. Electron cannot escalate from
userspace, so the download parked in the updater cache forever.
3. The systemd unit hardcoded the version in the path
(ExecStart=.../FleetRunner-0.8.11/fleet-runner). Even a perfect
self-update would have been reverted on the next boot.
4. The box cannot run an AppImage at all — type-2 AppImages need
libfuse2 and this machine has only libfuse3, so pointing the unit at
an AppImage crash-loops with "AppImages require FUSE to run".
Cause 4 is the one that wastes an afternoon: `--appimage-offset` succeeds
without libfuse2 (it only reads the ELF header, it never mounts), and
/dev/fuse + fusermount3 both exist. The honest check is
`ldconfig -p | grep libfuse.so.2`.
So: download, verify sha512 against latest-linux.yml, EXTRACT (needs no
FUSE, works on any libfuse generation), and flip a stable symlink. The
symlink is the record of what is installed — no version file to drift
from the tree it describes. The swap is atomic, and nothing touches the
symlink until the download is checksum-verified AND the extracted tree is
confirmed to hold a runnable binary, so a failed update leaves the
running version alone. One previous build is kept for rollback.
A systemd timer applies updates: daily, Persistent=true, plus 10 minutes
after login. It does not depend on the app being healthy, on a quit hook
winning a race against SIGTERM, or on sudo. Everything is user-scoped —
a background updater that needs a password is one that never runs.
Verified on real hardware, not just enabled: rolled the symlink back to
0.8.11, ran fleet-runner-update.service exactly as the timer does, and
watched it detect, verify, extract, swap and restart onto 0.8.12 in 53s.
Control now reports `app v0.8.12`; a second run says "already current".
Co-authored-by: t <t@t.t>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>