From 67a836dfa8665a2fc4b74a3510cb86ae6ad96990 Mon Sep 17 00:00:00 2001 From: jonathan Date: Wed, 4 Mar 2026 19:54:03 +0100 Subject: [PATCH] Webhook support --- public/index.html | 54 ++++++++++++----------------- public/js/app.js | 56 ++++++++++++------------------ src/db.js | 60 +++++++++++++++++++------------- src/poller.js | 6 ---- src/routes/api.js | 35 ++++++++++++++----- src/webhookDispatcher.js | 74 --------------------------------------- src/webhookReceiver.js | 66 +++++++++++++++++++++++++++++++++++ test/db.test.js | 75 ++++++++++++++++++---------------------- 8 files changed, 207 insertions(+), 219 deletions(-) delete mode 100644 src/webhookDispatcher.js create mode 100644 src/webhookReceiver.js diff --git a/public/index.html b/public/index.html index eb51e33..0624bd3 100644 --- a/public/index.html +++ b/public/index.html @@ -211,25 +211,35 @@ +
+ How it works +

+ Each webhook has a unique URL. Configure your external app to POST JSON to that URL and this gateway will send an SMS. +

+ POST /api/hooks/<token> — no auth required, the token is the secret +

+ The message template supports {{key}} placeholders resolved from the JSON body. + For uptime-kuma the top-level msg field contains the full alert text. +

+
- - - + + - +
NamePhone filterURLEventsSend SMS toWebhook URL Status Actions
@@ -381,37 +391,19 @@