Skip to content

feat(update): allow disabling the update check (#110) - #122

Merged
lance0 merged 2 commits into
masterfrom
feat/disable-update-check
Jul 7, 2026
Merged

lance0 merged 2 commits into
masterfrom
feat/disable-update-check

Conversation

@lance0

@lance0 lance0 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Adds a full opt-out for the background "newer release available" check (update-informer → GitHub API). Requested in #110 for the standard package-manager/CI/privacy courtesy. Mirrors the xfr implementation (lance0/xfr#137) for cross-project consistency.

How to turn it off

Precedence (first that applies wins): compiled-out → env → CLI → config/pref.

Surface How
env DO_NOT_TRACK=1 (cross-tool standard) or TTL_NO_UPDATE_CHECK=1
CLI --no-update-check
config.toml no_update_check = true in ~/.config/ttl/config.toml (see examples/config.toml)
TUI toggle Settings (s) → Update Check: on/off; persisted to config, sticks across runs
compile-out update-check cargo feature (default-on); --no-default-features drops update-informer from the tree entirely — no phone-home code shipped

Notes

  • ttl unifies config and TUI-saved prefs in one config.toml, so there is a single preference layer (xfr splits config vs. prefs). Resolution is the pure update::check_disabled(env, cli, pref).
  • The gate sits at the single spawn site in main, before mode dispatch, so it covers TUI, streaming, JSON/CSV/report, and daemon modes.
  • Toggling off mid-run doesn't retract an already-displayed banner — it applies to the next run.

Validation

  • Builds and clippy -D warnings clean with and without default features; fmt clean.
  • cargo tree --no-default-features -i update-informer → absent.
  • 292 lib tests pass on both feature configs (added check_disabled_precedence, flag_is_truthy, no_update_check prefs roundtrip, settings section/nav).
  • Behavioral check (strace, enrichment disabled so the check is the only :443 traffic): default = 1 connect; each of --no-update-check, DO_NOT_TRACK=1, TTL_NO_UPDATE_CHECK=1, and no_update_check = true = 0; no_update_check = false = 1.

lance0 added 2 commits July 7, 2026 09:44
The startup GitHub release check ran unconditionally on every non-replay
run, with no way to opt out — unexpected for package-repo, air-gapped, and
privacy-conscious installs.

Add five opt-outs. Precedence (higher wins): compiled-out > env > CLI flag
> saved preference, resolved by the pure `update::check_disabled`:

- `--no-update-check` CLI flag
- `DO_NOT_TRACK=1` (cross-tool standard) or `TTL_NO_UPDATE_CHECK=1` env vars
- `no_update_check = true` in ~/.config/ttl/config.toml
- an Update Check toggle in the TUI Settings modal (persisted to config)
- an `update-check` cargo feature (default on); `--no-default-features`
  compiles the check out and drops the update-informer dependency entirely

Adds examples/config.toml documenting the preferences. Surfaces, key names,
and env vars mirror the xfr implementation for cross-project consistency.
The --no-update-check help text and update.rs module doc referenced the
old positive key (`update_check = false`); the actual preference is
`no_update_check = true`. Comment-only.
@lance0
lance0 merged commit 71384e7 into master Jul 7, 2026
5 checks passed
@lance0
lance0 deleted the feat/disable-update-check branch July 7, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant