Skip to content

feat: add --version, a health check that tracks DockTail, and an update notice - #93

Merged
marvinvr merged 1 commit into
mainfrom
issue-81
Sep 30, 2026
Merged

marvinvr merged 1 commit into
mainfrom
issue-81

Conversation

@marvinvr

Copy link
Copy Markdown
Owner

Makes DockTail easier to operate and support.

Version

  • New version package; release builds inject the version there via -ldflags (the cloud module reads the same value).
  • The startup log carries it: Starting DockTail version=….
  • docktail --version prints it (docker exec docktail /app/docktail --version).

Health check that tracks DockTail

  • The running process rewrites a small JSON status file (HEALTH_FILE, default /tmp/docktail-health.json) every 10 s and after every reconcile. docktail health reads it, prints a one-line verdict, and exits 0 or 1. It is now the image's HEALTHCHECK, replacing tailscale serve status. Nothing listens on a port.
  • Unhealthy when:
    • the file is stale for 60 s (DockTail is hung or stopped);
    • the tailscaled socket does not accept connections;
    • two reconciles in a row could not read the containers from Docker;
    • no reconcile has finished for three intervals (at least 3 min).
  • Per-service reconcile errors (label conflicts, refused services) are reported as healthy, with errors.
  • The DockTail Cloud link state (connecting, connected, disconnected, rejected, failed) is reported but never fails the check. A restart triggered by the check (Swarm, autoheal) would drain every service and fix nothing on the cloud side.

Update notice

  • About 30 s after startup and then daily, release builds look up the repository's tags on the GitHub API. When a newer stable release exists, they log it once. UPDATE_CHECK=false disables this, and dev builds skip it.

Cloud module

  • Records its link state for the health status.
  • Reads hello_ack.server_time and warns (at most hourly) when the host clock is more than 60 s off.

Also adds unit tests for semver and the health verdict, e2e assertions for docktail health and --version, and docs in docs/07-reference.md (Version And Updates, Health Check, the new env vars) and docs/06-cloud.md. ENTRYPOINT and packaging are unchanged.

Refs marvinvr/docktail-cloud#81

…te notice

- A shared version package: release builds inject the version there, the
  startup log carries it, and `docktail --version` prints it.
- `docktail health` reads a status file the running process rewrites every
  10 s and becomes the image's HEALTHCHECK: unhealthy when DockTail is hung,
  the reconcile loop stalls, Docker stays unreachable, or the tailscaled
  socket is gone. Per-service reconcile errors and the DockTail Cloud link are
  reported without failing the check. Nothing listens on a port.
- A daily update check (UPDATE_CHECK=false to disable) logs a newer stable
  release once.
- The cloud module records its link state for the health status and warns
  when the host clock is more than 60 s off the cloud's.
@marvinvr
marvinvr added this pull request to stack #99 September 24, 2026 04:12
@marvinvr
marvinvr merged commit a47b55c into main Sep 30, 2026
7 checks passed
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