Skip to content

Version + "Update available" under the sidebar - #208

Merged
Randomname653 merged 1 commit into
mainfrom
version-badge
Oct 23, 2026
Merged

Randomname653 merged 1 commit into
mainfrom
version-badge

Conversation

@Randomname653

Copy link
Copy Markdown
Owner

What

  • Sidebar footer: version and running commit (v1.1.0-beta · abc1234, full SHA and build date in the tooltip).
  • Admins: an amber "Update available" button when upstream has published a newer build; it opens how to update plus a link to the changelog.
  • GET /api/system/version: every signed-in user gets the build. Admins also get the update status. The answer comes from app_state, and a stale one (6 h, 1 h after an error) kicks one background refresh, so the request never waits on GitHub.

How "newer" is decided (services/update_check.py)

  • Container: the last successful docker.yml push run on main, i.e. what :latest is. Compared with CURATARR_BUILD_SHA, which the workflow now bakes into the image as a build arg (late in the Dockerfile, so the pip layer stays cached; OCI revision label too).
  • Git checkout: the newest main commit, compared with HEAD. HEAD is read from .git directly (worktrees and packed-refs handled), with no git binary.
  • Then compare/{ours}...{latest}: only ahead / diverged count, so a dev branch running ahead of main is never told to update. An unknown build or a rate limit gives no answer, and the check retries after 1 h.
  • Anonymous GitHub API, at most every 6 h. UPDATE_CHECK=false turns it off.

Updating on TrueNAS

TrueNAS's own update badge is unreliable for custom YAML apps. deploy/docker-compose.yml carries pull_policy: always as an option (commented out): with it, Edit → Save pulls :latest. Without it: docker pull and then Edit → Save. Documented in docs/NAS_MOVE.md ("Updating later").

Tests

tests/test_update_check.py (30 checks): build detection (env, loose ref, packed-refs, detached HEAD, worktree), refresh against a fake GitHub (same / ahead / behind / diverged / unknown / rate limited / no sha), staleness, single background refresh, member vs admin endpoint, Dockerfile/workflow/compose/frontend wiring. Full battery 229/229 green.

🤖 Generated with Claude Code

The footer shows the version and the running commit (the image carries
CURATARR_BUILD_SHA from the docker workflow; a checkout reads HEAD from
.git). For admins, services/update_check asks GitHub anonymously every
6 h whether a newer build is published: the last successful docker run on
main for a container, the newest main commit for a checkout. Only a
published commit ahead of ours counts (compare status ahead/diverged), so
a dev branch is never told to update. GET /api/system/version answers from
the stored result and kicks the refresh in the background.

deploy/docker-compose.yml offers pull_policy: always as an option
(commented out): with it, TrueNAS's edit + save pulls :latest.
UPDATE_CHECK=false turns the check off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Randomname653
Randomname653 merged commit 3bb6e35 into main Oct 23, 2026
9 of 10 checks passed
@Randomname653
Randomname653 deleted the version-badge branch October 23, 2026 15:17
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