infra/stacks/uptime-kuma
Viktor Barzin 99688bbb02 [uptime-kuma] Omit trailing slash when path annotation not set
## Context

After commit f6812fe6 every external-monitor-sync run updated all ~107
monitors without any real change — because the new code always appended
`/` to the host (default path), while historical monitors had been
created with bare `https://host` URLs. Sync saw `https://host` !=
`https://host/` and re-wrote every monitor on each cycle: noisy logs,
wasted Uptime Kuma writes.

## This change

When the `uptime.viktorbarzin.me/external-monitor-path` annotation is
absent, build the URL WITHOUT a trailing slash so it matches the shape
of pre-existing monitors. When the annotation is set, append it as
before (e.g. `https://forgejo.viktorbarzin.me/api/healthz`).

Also flip the lenient/strict codes branch to trigger off the same
"annotation set?" signal instead of comparing against DEFAULT_PATH.

## Verification

Verified via two consecutive manual triggers of the CronJob against the
live stack:

    Pass 1 (migration): 0 created, 107 updated, 0 deleted, 1 unchanged
    Pass 2 (stable):    0 created,   0 updated, 0 deleted, 108 unchanged

`[External] forgejo` still probes `https://forgejo.viktorbarzin.me/api/healthz`
with strict `200-299`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 22:41:02 +00:00
..
modules/uptime-kuma [uptime-kuma] Omit trailing slash when path annotation not set 2026-04-17 22:41:02 +00:00
main.tf feat: add external monitoring for all Cloudflare-proxied services 2026-04-14 19:04:45 +00:00
secrets extract remaining 19 modules from platform, complete stack split [ci skip] 2026-03-17 21:42:16 +00:00
terragrunt.hcl extract remaining 19 modules from platform, complete stack split [ci skip] 2026-03-17 21:42:16 +00:00