farazsms-webhook-gateway
v1.0.0
Published
FarazSMS · IranPayamak (فراز اس ام اس) webhook→SMS gateway — turn webhooks from Grafana, MikroTik, FortiGate, Cisco, Ubiquiti, Juniper, VMware, Hyper-V, Proxmox, TrueNAS, Synology, pfSense & OPNsense into SMS, without changing the FarazSMS backend.
Maintainers
Readme
farazsms-webhook-gateway
FarazSMS · IranPayamak (فراز اس ام اس · ایران پیامک) — a tiny self-hosted middleware that turns webhooks into SMS. 🌐 farazsms.com · 📚 docs.farazsms.com/webhook
Add SMS alerting to tools that only speak webhooks — Grafana, MikroTik, FortiGate, Cisco, Ubiquiti, Juniper, VMware, Hyper-V, Proxmox, TrueNAS, Synology, pfSense, OPNsense (and anything else). It calls the existing FarazSMS REST API, so nothing on the FarazSMS backend changes.
- Zero dependencies (Node ≥ 14, built-in
http/https) - One endpoint per source:
POST /hook/{id}(JSON) andGET /hook/{id}(query/placeholder) - Per-product presets normalize each payload →
{title, message, severity} {{mustache}}templates with dot-paths and defaults:{{ payload.alerts.0.labels.severity | "info" }}- Recipients: static admin numbers per route and/or taken from the payload
- Per-route token auth, length cap, auto-retry on 429/5xx
Run
cp config.example.json config.json # edit apiKey + routes + tokens
node server.js # or: npx farazsms-gateway config.jsonDocker:
docker run -d --name faraz-gw -p 8787:8787 \
-e FARAZ_API_KEY=YOUR_KEY \
-v $PWD/config.json:/app/config.json \
farazsms-webhook-gatewayConfigure (config.json)
{
"apiKey": "YOUR_FARAZSMS_API_KEY",
"defaultLine": "90008361",
"port": 8787,
"routes": [
{ "id": "grafana", "preset": "grafana", "token": "secret1",
"recipients": ["09120000000"],
"template": "[Grafana] {{severity|}} {{title}} — {{message}}" }
]
}apiKey can also come from FARAZ_API_KEY. Each route: id, preset, token, recipients (default list), optional recipientField (default to), mode (simple|pattern), template, line.
Point your tools at it
| Product | How | Endpoint |
|---|---|---|
| Grafana | Contact point → Webhook → URL | POST /hook/grafana?token=… |
| Proxmox VE | Datacenter → Notifications → Webhook target | POST /hook/proxmox?token=… |
| FortiGate | Automation → Action → Webhook (custom body) | POST /hook/fortigate?token=… |
| VMware (vROps) | Alerts → Outbound → Webhook | POST /hook/vmware?token=… |
| Ubiquiti UniFi | System → Webhook notifications | POST /hook/unifi?token=… |
| Cisco Meraki | Network-wide → Alerts → Webhooks | POST /hook/cisco?token=… |
| TrueNAS | Alert service → Webhook (Slack-style) | POST /hook/truenas?token=… |
| Synology DSM | Notification → SMS → custom SMS provider URL | GET /hook/synology?token=…&to=09…&message=… |
| MikroTik | /tool fetch url="…/hook/mikrotik?token=…&message=…" | GET /hook/mikrotik?token=… |
| pfSense / OPNsense | cron / monit curl | GET|POST /hook/pfsense?token=… |
| Hyper-V / Juniper | PowerShell / script curl | POST /hook/hyperv?token=… |
Full step-by-step per product (with copyable bodies): docs.farazsms.com/webhook.
Response
200 {ok:true, recipients, text, result} on success; 401 bad token, 404 unknown route, 422 empty/no-recipient, 502 upstream send error (with body).
License
MIT © FarazSMS · IranPayamak
