Skip to content

Show running version on the dashboard footer#46

Merged
LarsLaskowski merged 1 commit into
mainfrom
claude/release-version-website-lu637u
Jul 14, 2026
Merged

Show running version on the dashboard footer#46
LarsLaskowski merged 1 commit into
mainfrom
claude/release-version-website-lu637u

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

The dashboard now shows which PiMonitor version is running, so you can tell from the web UI what's deployed (useful after an upgrade or when triaging a report). The build-time main.version (already set via -ldflags, previously only reachable through the --version CLI flag) is threaded into the HTTP server and surfaced in the footer.

  • API: added a version field to GET /api/v1/config (additive — no change to existing response shapes). cmd/pimonitor/main.go passes main.version through to httpapi.ClientConfig.
  • Dashboard: the version is rendered in the footer, between the PiMonitor label and the /api/v1/metrics link. Releases are tagged vX.Y.Z; the frontend strips the leading v for display (e.g. v1.2.31.2.3), while an unversioned local build shows dev unchanged.
  • install.sh: the local-build fallback now embeds the version via git describe --tags --always --dirty and -ldflags, mirroring the Makefile and GoReleaser, so binaries built directly on the Pi report a real version too (falling back to dev outside a git checkout).
  • Docs: docs/API.md documents the new version field.

Verified end-to-end: built with -X main.version=v1.2.3, GET /api/v1/config returns "version":"v1.2.3", and the served footer fills in 1.2.3.

Related Issue

Closes #45

Checklist

  • Tests added/updated for the change (go test ./... passes locally)
  • go vet ./... and golangci-lint run are clean
  • Documentation updated if this changes the REST API (docs/API.md),
    configuration (README.md, packaging/pimonitor.example.yaml), or
    installation/packaging (packaging/install.sh, systemd units)
  • No breaking change to /api/v1/... response shapes, or a new API
    version was introduced instead

Surface the build-time version (main.version, set via -ldflags) so it is
visible from the web UI instead of only via the --version CLI flag.

- Thread the version from main into the HTTP server and expose it
  additively as a version field on GET /api/v1/config (no change to
  existing response shapes).
- Render it in the dashboard footer, between the PiMonitor label and the
  API link. A release is tagged vX.Y.Z, so a leading v is stripped for
  display; unversioned local builds show dev.
- Embed the version in install.sh's local-build fallback via git describe,
  mirroring the Makefile and GoReleaser, so on-Pi builds report a real
  version too.
- Document the new config field in docs/API.md and cover it in the config
  handler test.

Closes #45
@LarsLaskowski
LarsLaskowski merged commit da9374b into main Jul 14, 2026
3 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/release-version-website-lu637u branch July 14, 2026 17:35
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.

Show the current release version on the dashboard

2 participants