Skip to content

v0.7.0 — version ticker and update check

Choose a tag to compare

@izzipizzy izzipizzy released this 24 Aug 18:18
· 2 commits to main since this release
870fd22

The admin footer used to print getenv('APP_VERSION') ?: 'v0.5.5'. APP_VERSION was set nowhere in the repository, so the fallback always won and every deployment claimed a version that existed only in a template. This release makes the footer tell the truth.

Build identity

Baked at image build time, in two distinct kinds:

  • release — stamped by CI from the tag it built. The release workflow now fails the build if the tag or revision cannot be resolved.
  • source — from git describe in a local build, shown as a source build with an src marker.

They are never mixed behind one variable. The nearest reachable tag is not the newest tag in a repository, so a source checkout comparing itself to upstream can confidently report "behind" for a build that has actually diverged. A source build therefore never claims to be current or behind.

Update check

version:check runs twice daily and reads GitHub's releases/latest into a typed single-row core.update_status.

  • Redirects disabled — PHP streams follow them by default and would forward the Authorization header to the target host.
  • Every response field validated; tag_name must parse as semver; html_url is ignored. All URLs are built locally from a validated owner/repo slug against constant hosts, so the operator picks the repository but never the host that receives the token.
  • last_attempt_at and last_success_at are separate, because one timestamp cannot mean both "when did we last try" and "how old is this answer".
  • A failed attempt keeps the last good answer but exits non-zero, so core.cron_runs records it. Freshness ages out into a stale state rather than letting an old verdict stand forever.

Footer

Five states with a strict precedence order. Only behind carries links — to the release page, plus a "how to update" link pinned to that release so the instructions match the version being offered. Status resolution never throws: the footer is decorative and must not be able to 500 an admin page.

Upgrading

See Updating an existing install. This release adds one migration (core.update_status) and three optional settings: UPDATE_CHECK_ENABLED, UPDATE_CHECK_REPO, UPDATE_CHECK_TOKEN. Checking is on by default and needs no token.