fix(monitoring): route Umami events to the endpoint the tracker was built with

The tracker posts to `${data-host-url}${collect path}`, and the collect
path is compiled into the operator's Umami build: /api/send by default,
anything else when the instance sets COLLECT_API_ENDPOINT. The tag
pointed data-host-url at the app origin and the proxy listened only on
/api/send, so a renamed endpoint sent every page view and event to an
app path that does not exist and got a full 404 page back each time.

Point data-host-url at /api/monitoring/umami and answer every path under
it with one proxy route. The route reads the collect path from the
configured tracker (cached for an hour), forwards only that path to the
Umami host, and answers anything else, or an unreadable tracker, with an
empty response. The admin test event posts to the same learnt path. The
send-URL resolver lives in one module instead of two copies.
This commit is contained in:
Marc-André Bombeck committed 2026-10-04 15:13:52 +02:00
1 parent 2e150e97cf
commit 1b1da652d3
12 files changed
+494 -275

No files matched your search

-1
View File
@@ -41,7 +41,6 @@ export const PUBLIC_PATHS = [
"/api/version",
"/api/notifications/vapid",
"/api/monitoring/",
"/api/send",
"/api/withings/webhook",
// v1.11.0 — WHOOP webhook (`recovery.updated` / `sleep.updated` /
// `workout.updated`, + `*.deleted`). Authenticated by the path-segment