-
Notifications
You must be signed in to change notification settings - Fork 1
version checkin
Summary: sloth can support low-interruption version awareness, but the safe design is a split system: an in-process checker that only discovers newer releases, and a separate update path that downloads, builds, installs, and restarts outside the capture loop.
Sources: include/sloth.h, src/main.c, src/event_wake.c, src/data_socket.c, README.md, RELEASE_v1.4.0.md, SECURITY.md.
Last updated: 2026-07-02.
Issue #18 asks for an automated version check-in that regularly checks for new releases and updates sloth with minimal interruption by downloading the latest source and building it.
- The running version is compile-time state only:
#define SLOTH_VERSIONininclude/sloth.h. (This section describes the state when #18 was designed; the literal was 1.4.0 then.) - The current upgrade story is manual.
RELEASE_v1.4.0.mddocuments:git pullthenmake. -
src/main.cruns a tight poll/render/key loop. Blocking network I/O in that loop would stall the TUI. -
src/event_wake.calready provides the right wake-up pattern for async work that needs to refresh the screen early. -
src/data_socket.cshows the style sloth already uses for bounded, non-blocking, mutex-protected side channels.
- Low interruption: version checks must not freeze the interface.
- Safe install boundary: building and replacing the binary must not happen inside the render loop.
- Explicit trust model: the updater must verify what it downloads.
- Graceful offline behaviour: no network reachability must degrade into "do nothing" rather than break capture.
- Minimal blast radius: the new logic should sit behind a narrow module boundary instead of spreading through protocol or view code.
The first component should only answer one question: "is a newer version available?"
- Run on a timer in a background thread or helper process.
- Fetch release metadata only (latest tag, release URL, checksum manifest).
- Compare it against
SLOTH_VERSION. - Store a small immutable snapshot: current version, latest version, last checked time, release URL, error state.
- Signal completion through the existing wake pattern so the UI can redraw without waiting for the full poll interval.
This keeps the main loop's contract intact: poll state, draw, wait for input, wake early if a side event happened.
The second component should do the disruptive work:
- download a release tarball or source archive
- verify integrity/authenticity
- unpack into a staging directory
- build with the project's existing
maketargets - replace the installed binary atomically
- restart sloth or defer activation until next launch
That step should not overwrite the currently running executable from inside the main UI path. A separate helper keeps failure handling clear and avoids mixing package-management concerns with passive packet observation.
The least noisy default UX is:
- periodic background check (for example every 6-24 hours)
- passive "update available" indicator in the UI
- optional manual trigger to check now
- optional explicit "apply update on next clean exit" action
That matches the issue's "minimal interruptions" requirement better than an immediate forced rebuild while the user is monitoring traffic.
-
No blocking network calls in
src/main.c. - No self-overwrite in-place while the binary is still running.
- No unauthenticated download/build path.
- No silent privilege expansion: if install needs elevated rights, keep that step explicit.
- No hard dependency on the check service: GitHub down, DNS down, or no network should leave sloth usable.
- ✅ Policy + docs (landed)
- Supported-version policy in
SECURITY.md. - Check cadence:
updater_tickre-reads at most once every 60 s. - Release source: locally-populated manifest file (see manifest-format), because the safest first landing is one where sloth itself never touches the network — a helper process (systemd timer, cron) produces the file. That satisfies the "background thread OR helper process" wording of the original recommendation.
- Supported-version policy in
- ✅ Version model (landed)
-
src/version.{c,h}— semver parse + compare, RFC-ish, with the1.10.0>1.9.0trap covered by unit tests.
-
- ✅ Notify-only checker (landed, phase 3.1)
-
src/updater.{c,h}reads the manifest, compares toSLOTH_VERSION, exposes status through the existing poll-and-snapshot pattern. -
--check-manifest FILECLI flag; omitted → checker disabled. - Status surfaces in the help view — no dashboard clutter until the operator explicitly enables checks.
- Reference producer:
examples/updater/check-latest.sh.
-
- ⏳ Manual apply path (deferred — separate landing)
- Implement a separate updater helper or exec path that stages a source build outside the render loop.
- ⏳ Optional unattended mode (deferred — after phase 4)
- Only after the manual path is stable.
- Keep it opt-in and policy-controlled.
The updater should prefer a release tarball plus an authenticated manifest
or checksum file over a raw git pull. The current manual upgrade text in
RELEASE_v1.4.0.md is fine for a human, but an automated path needs an
artifact-oriented trust decision, not "whatever the current branch tip is".
- unit tests for version parsing/comparison
- tests for "newer version available" vs "already current"
- tests that failed network checks only update error state
- tests that the UI loop remains responsive while a check is in flight
- tests for staged build/install failure paths
- tests for restart/defer semantics
- What is the trusted release source: GitHub API, signed manifest, or both?
- Should default behaviour be "notify only" or "download and stage"?
- When an update is ready, should sloth restart itself or prompt for restart?
- Where should staged source/build artifacts live?
- Should auto-apply be allowed when sloth is running as root for capture?
For sloth specifically, the safest plan is check in-process, apply out-of-process. That delivers regular version awareness with minimal user interruption, while keeping network fetch, source build, install, and restart concerns outside the passive-monitoring hot path.
Mirrored from docs/wiki/ on main by .github/scripts/wiki_sync.sh. Edit there, not here — hand edits to this wiki are overwritten on the next push.
Read this first — the complete reference
- what-sloth-does
- how-wifi-works
- monitor-mode
- where-exploits-happen
- wifi-sigint-techniques
- cli-reference
- wifi-state-of-the-art
Start here
Engines
WiFi SIGINT
- wifi-sigint
- non-ip-sensors
- mac-randomisation
- evil-twin-reproducer
- btm-abuse
- action-frames
- research-corpus
- captive-portal
- fragattacks
- tool-fingerprints
- enterprise-rogue
- ipv6-ndp
- smb-snoop
- kerberos-snoop
- ldap-snoop
- bgp-snoop
- ssh-snoop
- rdp-snoop
- snmp-snoop
- mqtt-snoop
UI and infrastructure
- ip-palette
- platform-vtable
- version-checkin
- manifest-format
- pcap-export
- jsonl-schema
- data-socket-exposure
- sqlite-schema
- ring-buffers
Factory infrastructure
Reference
Source material
Maintenance