Receive Uptime Kuma webhook notifications #40

Merged
Gilles merged 3 commits from feat/38-kuma-webhook into master 2026-10-29 10:52:32 +00:00
Owner

Closes #38

Monitoring plan, phase 4.3. Stacked on #39 (uses apps.reports.ingest.store_custom_report): merge #39 first.

Changes

  • POST /api/projects/<owner>/<repo>/ingest/uptime-kuma/ (apps/reports/kuma.py), authenticated by an upload token (Authorization: Bearer …, set in Kuma's "Additional Headers"). Body = Kuma's default JSON webhook {heartbeat, monitor, msg} (checked against server/notification-providers/webhook.js).
  • One "format maison" report per notification: ref_kind=source, ref_value=kuma (or ?source=), custom_type_name=uptime:<monitor name> (64 chars max). Heartbeat status 0 → fail, 2 → warn, 1 / 3 → ok; metrics state, message, target (URL / host / container), time. No expect_every: Kuma only notifies on changes.
  • Kuma's "test" notification (no heartbeat) → 200, no report.
  • Token check extracted to upload_target(), shared with the regular upload (behaviour unchanged).
  • README, feature catalog; tests in apps/reports/test_kuma.py.

Checks

pytest (235 passed), pylint 10/10, autopep8, bandit clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA

Closes #38 Monitoring plan, phase 4.3. **Stacked on #39** (uses `apps.reports.ingest.store_custom_report`): merge #39 first. ## Changes - `POST /api/projects/<owner>/<repo>/ingest/uptime-kuma/` (`apps/reports/kuma.py`), authenticated by an upload token (`Authorization: Bearer …`, set in Kuma's "Additional Headers"). Body = Kuma's default JSON webhook `{heartbeat, monitor, msg}` (checked against `server/notification-providers/webhook.js`). - One "format maison" report per notification: `ref_kind=source`, `ref_value=kuma` (or `?source=`), `custom_type_name=uptime:<monitor name>` (64 chars max). Heartbeat status 0 → fail, 2 → warn, 1 / 3 → ok; metrics state, message, target (URL / host / container), time. No `expect_every`: Kuma only notifies on changes. - Kuma's "test" notification (no heartbeat) → 200, no report. - Token check extracted to `upload_target()`, shared with the regular upload (behaviour unchanged). - README, feature catalog; tests in `apps/reports/test_kuma.py`. ## Checks pytest (235 passed), pylint 10/10, autopep8, bandit clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA
feature: receive Uptime Kuma webhook notifications
All checks were successful
ci / test (pull_request) Successful in 3m56s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
73e5af6010
POST /api/projects/<owner>/<repo>/ingest/uptime-kuma/ (upload token as
Bearer): Kuma's "Webhook" notification ({heartbeat, monitor, msg})
becomes a format maison report, ref source=kuma (or ?source=), custom
type uptime:<monitor>; down -> fail, pending -> warn, up/maintenance ->
ok. Kuma's test notification is acknowledged without a report. The
upload token check is shared with the regular upload (upload_target).

Closes #38

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA
Author
Owner
<!-- argus-link-bot:argus/backend --> 📊 [Rapports Argus pour cette PR](https://reports.stationmyr.net/argus/backend/pr/40)
Gilles changed target branch from feat/37-connectors to master 2026-10-29 10:39:11 +00:00
Merge remote-tracking branch 'origin/master' into feat/38-kuma-webhook
All checks were successful
ci / test (pull_request) Successful in 3m28s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
795e01c8b4
# Conflicts:
#	README.md
#	e2e/features.catalog.yaml
Gilles scheduled this pull request to auto merge when all checks succeed 2026-10-29 10:40:37 +00:00
Gilles scheduled this pull request to auto merge when all checks succeed 2026-10-29 10:40:46 +00:00
Gilles merged commit 17719ae04c into master 2026-10-29 10:52:32 +00:00
Gilles deleted branch feat/38-kuma-webhook 2026-10-29 10:52:33 +00:00
Sign in to join this conversation.
No description provided.