Commit Graph
11 Commits
Author SHA1 Message Date
valknarandClaude Sonnet 5 8e783f894d fix(stacks): widen pull retry window and jitter the nightly update timer
Nightly update pulls for coolify/immich kept hitting transient ghcr.io
toomanyrequests errors and getting skipped, because the timer fired at
exactly 02:00:00 Europe/Amsterdam (the same instant countless other
hosts' cron/timer jobs also hit registries) and the retry loop only
spanned ~15s (3 attempts, 5/10/15s backoff) — not enough to ride out
the burst.

- Widen pull retries to 5 attempts with 20/40/60/80s backoff (~3+ min).
- Add RandomizedDelaySec=1800 to the update timer (and its install
  template) so this host's pulls no longer land on the exact
  top-of-hour thundering herd.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmtksEEYSBZqUacw3qF1A9
2026-09-12 15:45:12 +00:00
valknarandClaude Sonnet 5 030e27b13b fix(stacks): make nightly update check resilient to transient errors
Two opposite failure modes in `update run`:

- pulsenode was reported "updated" every night though its image never
  changed: the pre-pull image-ID snapshot came back empty (the awk
  fallback used \s, which mawk silently ignores), and empty != populated
  was read as "changed".
- coolify was never recreated despite a new image: its nightly pull kept
  hitting a transient `toomanyrequests`, and a failed pull only warned
  before falling through to the comparison, which then saw no change.

Changes:
- _stack_image_ids: POSIX [[:space:]] instead of \s; return non-zero when
  images can't be resolved so callers can tell "unknown" from "unchanged".
- Retry `docker compose pull` 3x with backoff; if it still fails, add the
  stack to a new `skipped` list and skip the recreate instead of treating
  it as up to date.
- Detect changes by comparing running containers' image IDs against the
  post-pull resolved config, so a transient empty read can't be mistaken
  for "everything changed".
- Notify with an amber "finished with warnings" summary listing skipped
  stacks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-30 17:11:00 +00:00
valknar db4fc948d8 fix(stacks): surface pull failures and log before/after image IDs on mismatch
update run silently swallowed pull errors and never logged what actually
differed, making a recurring false "updates found" for pulsenode (no
registry-side change since Aug 19) impossible to diagnose.
2026-08-22 09:22:13 +02:00
valknarandClaude Sonnet 4.6 af6beaff1e revert: remove SYSTEMD_COLORS/SYSTEMD_PAGER from logs — no effect without TTY
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 19:25:56 +02:00
valknarandClaude Sonnet 4.6 5a6e209b6d fix: use SYSTEMD_PAGER=cat instead of --no-pager for colored journal logs
--no-pager causes journalctl to disable ANSI colors. Setting SYSTEMD_PAGER=cat
achieves the same effect (no interactive pager) while preserving color output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 19:21:14 +02:00
valknarandClaude Sonnet 4.6 4276a5b94e fix: pass SYSTEMD_COLORS=1 to systemctl/journalctl for colored output
systemctl and journalctl use their own color detection (SYSTEMD_COLORS env
var) independently of the terminal — child processes don't always inherit
it. Force colors for status and logs subcommands of update and backup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 19:18:17 +02:00
valknarandClaude Sonnet 4.6 65acede0a5 fix: combine Environment= into single line in systemd units
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 19:15:45 +02:00
valknarandClaude Sonnet 4.6 bf396972b0 fix: bake STACKS_DIR into systemd service units at install time
The update and backup services ran without STACKS_DIR since systemd
doesn't source ~/.env or ~/.zshrc. Capture the value at install time
and write it as Environment= in the generated unit files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 19:12:31 +02:00
valknarandClaude Sonnet 4.6 3ef96ff8ab fix: stacks STACKS_DIR defaults to PWD instead of ~/stacks
Makes stacks work like arty — discovers stacks in the current directory.
Explicit STACKS_DIR env var still takes precedence.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 18:11:58 +02:00
valknarandClaude Sonnet 4.6 cfee542f35 chore: update bin scripts — rename references from .sh to plain names
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 15:39:21 +02:00
valknarandClaude Sonnet 4.6 f38b15f550 feat: move scripts from ~/scripts to ~/bin and track in git
Drop .sh extension — scripts are now invocable directly as arty and stacks.
Remove redundant aliases from .zshrc since ~/bin is already in PATH.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 15:36:45 +02:00