简体中文 | English
A generic notification relay for devices without public network access — receive alerts via Telegram, DingTalk, Feishu, Bark, ServerChan, PushPlus. Powered by Cloudflare Workers, zero cost, zero server.
- 🚀 One-click deploy — Fork → fill Secrets → auto-deploy, 5 minutes and you're done
- 🔒 Secure verification — Secret embedded in URL prevents forged requests
- 📡 Multi-channel push — Supports the following platforms; configure only what you need
| Channel | Environment Variables | Notes |
|---|---|---|
| Telegram | TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID |
HTML formatting supported |
| DingTalk | DINGTALK_WEBHOOK |
Optional signing secret: DINGTALK_SECRET |
| Feishu (Lark) | FEISHU_WEBHOOK |
Webhook URL |
| Bark | BARK_KEY |
iOS push. Optional custom server: BARK_URL |
| ServerChan | SERVERCHAN_KEY |
WeChat push |
| PushPlus | PUSHPLUS_TOKEN |
WeChat push |
- 💸 Completely free — Cloudflare Workers free tier offers 100K requests/day, plenty for personal use
- 🌍 Global edge network — Low latency via Cloudflare CDN
- 🔌 Generic input — Works with any device or script that can make an HTTP request (GET, POST, JSON, FormData)
- 📝 Flexible message — Pass a
messageorcontentfield for custom text, or let the worker auto-format all fields askey: valuepairs - 🏷️ Custom title — Set a
titlefield (defaults to "Webhook 通知")
From scratch, step by step. All you need:
- A GitHub account
- A Cloudflare account (free)
- A device or script that can send HTTP requests
- Click the Fork button at the top right of this repository
- Confirm the fork is created under your account
- Log into Cloudflare Dashboard
- Click your avatar → My Profile → API Tokens
- Click Create Token
- Select the Edit Cloudflare Workers template
- Under Account Resources, select your account
- Click Continue to summary → Create Token
⚠️ Copy the token immediately — it's only shown once!
- On the Cloudflare Dashboard homepage
- Find Account ID in the right sidebar and copy it
- Go to your forked repository
- Settings → Secrets and variables → Actions
- Click New repository secret and add each one:
Required:
| Name | Value | Where to get it |
|---|---|---|
CLOUDFLARE_API_TOKEN |
The token from Step 2 | Cloudflare API Tokens |
CLOUDFLARE_ACCOUNT_ID |
The ID from Step 3 | Cloudflare Dashboard |
WEBHOOK_SECRET |
A custom secret, e.g. mySecret123 |
Make one up and remember it |
Notification channels (configure at least one):
Using Telegram as an example:
| Name | Value | Where to get it |
|---|---|---|
TELEGRAM_BOT_TOKEN |
e.g. 123456:ABC-DEF... |
Create a Bot via @BotFather on Telegram |
TELEGRAM_CHAT_ID |
e.g. -1001234567890 |
Get it from @userinfobot on Telegram |
Other channels:
| Name | Description |
|---|---|
DINGTALK_WEBHOOK |
DingTalk group robot webhook URL |
DINGTALK_SECRET |
DingTalk robot signing secret (optional) |
FEISHU_WEBHOOK |
Feishu (Lark) group robot webhook URL |
BARK_KEY |
Bark app push key |
BARK_URL |
Custom Bark server URL (optional, default https://api.day.app) |
SERVERCHAN_KEY |
ServerChan SendKey |
PUSHPLUS_TOKEN |
PushPlus Token |
💡 Tip: Only configure the channels you want to use. For example, if you only use Telegram, just fill in
TELEGRAM_BOT_TOKENandTELEGRAM_CHAT_ID.
Once your Secrets are set, any push to main triggers automatic deployment. You can:
- Option 1: Make a small change (e.g., add a space) and push to
main - Option 2: Go to Actions → Deploy to Cloudflare Workers → Run workflow
Wait for the Action to complete (usually 1-2 minutes).
- Log into Cloudflare Dashboard
- Click Workers & Pages on the left
- Click
webhook-worker— you'll see the domain, e.g.webhook-worker.<your-subdomain>.workers.dev - Note this domain
Make a POST or GET request to:
https://webhook-worker.<your-subdomain>.workers.dev/<YOUR_WEBHOOK_SECRET>/notify
Example — POST JSON (recommended):
curl -X POST 'https://webhook-worker.<your-subdomain>.workers.dev/mySecret123/notify' \
-H 'Content-Type: application/json' \
-d '{
"title": "Server Alert",
"message": "CPU temperature too high!"
}'Example — GET (for simple scripts):
curl 'https://webhook-worker.<your-subdomain>.workers.dev/mySecret123/notify?title=Disk+Warning&message=/dev/sda1+is+95%25+full'Example — auto-format (no message field, just pass data):
curl -X POST 'https://webhook-worker.<your-subdomain>.workers.dev/mySecret123/notify' \
-H 'Content-Type: application/json' \
-d '{
"device": "raspberry-pi-4",
"event": "high_temperature",
"temperature": 82,
"threshold": 75
}'This will produce a notification with fields formatted as:
device: raspberry-pi-4
event: high_temperature
temperature: 82
threshold: 75
curl 'https://webhook-worker.<your-subdomain>.workers.dev/mySecret123/notify?title=Test&message=Hello+from+webhook-worker'If you received a message on your configured channels, congratulations — you're all set! 🎉
| Field | Type | Required | Description |
|---|---|---|---|
title |
string | No | Notification title (default: "Webhook 通知") |
message |
string | No | Custom message body, used as-is |
content |
string | No | Alias for message |
| Any other fields | varies | No | Auto-formatted as key: value pairs |
Supported request methods:
POSTwithContent-Type: application/jsonPOSTwithContent-Type: application/x-www-form-urlencoded(FormData)GETwith query parameters
在 mikufans 录播姬中建议使用 Webhook v2,不建议使用 v1。Webhook v2 会发送包含 EventType 和 EventData 的 JSON,当前 Worker 会自动识别这种格式。
Webhook v2 地址填写:
https://你的-worker域名/你的WEBHOOK_SECRET/notify
当前 Worker 默认只推送 StreamStarted 开播事件,并格式化为适合 Telegram 阅读的直播通知。
StreamEnded、RecordingStarted、RecordingFinished、FileOpening、FileClosed 等其他事件会被忽略并返回 HTTP 200,避免录播姬因为未收到成功响应而重试。
如果想推送下播事件,可以在代码里把 StreamEnded 加入 BILILIVE_RECORDER_ALLOWED_EVENT_TYPES 允许列表,并补充对应的格式化逻辑。
Telegram (Recommended)
- Search for @BotFather on Telegram, send
/newbot - Give your bot a name, and you'll receive a Bot Token (format:
123456:ABC-DEF...) - Create a group or find your private chat, add the bot
- Send a message to the bot (otherwise it can't initiate messages)
- Visit
https://api.telegram.org/bot<TOKEN>/getUpdatesto get thechat_id - Add
TELEGRAM_BOT_TOKENandTELEGRAM_CHAT_IDto GitHub Secrets
DingTalk
- DingTalk desktop → Group settings → Smart group assistant → Add robot → Custom
- Select Sign for security, copy the signing secret
- Copy the Webhook URL
- Add
DINGTALK_WEBHOOKandDINGTALK_SECRETto GitHub Secrets
Feishu (Lark)
- Feishu desktop → Group settings → Add robot → Custom robot
- Select Custom keywords for security, enter a keyword (or leave empty for webhook-only mode)
- Copy the Webhook URL
- Add
FEISHU_WEBHOOKto GitHub Secrets
Bark (iOS)
- Download Bark from App Store
- Open the app, copy the push key (the string after the registration code)
- Add
BARK_KEYto GitHub Secrets - If using a self-hosted server, also add
BARK_URL
ServerChan (WeChat Push)
- Visit ServerChan, log in with WeChat
- Copy your SendKey
- Add
SERVERCHAN_KEYto GitHub Secrets
PushPlus (WeChat Push)
- Visit PushPlus, log in with WeChat
- Copy your Token
- Add
PUSHPLUS_TOKENto GitHub Secrets
┌──────────────┐ POST/GET https://worker/<secret>/notify ┌──────────────────┐
│ Your device │ ──────────────────────────────────────────► │ Cloudflare Worker │
│ (no public │ └────────┬─────────┘
│ IP / sensor │ │
│ / script) │ ┌─────┼─────┐
└──────────────┘ │ │ │
┌────▼────┐┌────▼────┐ │
│Telegram ││DingTalk │ │
└─────────┘└─────────┘ │
│ │ │
┌──▼────▼──┐ ┌──────▼───┐
│Bark/etc │ │ PushPlus │
└──────────┘ └──────────┘
- Your device or script sends an HTTP request to the Worker with your custom data
- Worker verifies the secret in the URL
- Worker formats the notification (or uses your
messagefield directly) - Worker pushes to all configured notification channels in parallel
- Returns the aggregated result from all channels
# Clone the repository
git clone https://github.com/chius-me/webhook-worker.git
cd webhook-worker
# Install dependencies
npm install
# Local development (requires .dev.vars for environment variables)
npm run dev
# Manual deploy
npm run deployCreate a .dev.vars file in the project root:
WEBHOOK_SECRET=mysecret123
TELEGRAM_BOT_TOKEN=123456:ABC-DEF
TELEGRAM_CHAT_ID=-1001234567890
If you're not using GitHub Actions, set secrets directly with wrangler:
npx wrangler secret put WEBHOOK_SECRET
npx wrangler secret put TELEGRAM_BOT_TOKEN
npx wrangler secret put TELEGRAM_CHAT_ID
# Add other channels as neededWorker responds "webhook-worker is running" but no notifications?
Check the following:
- Are your notification channel tokens/keys correct?
- Does your request URL contain the correct
WEBHOOK_SECRET? - Check the response body for details on each channel's result
How to view Worker logs?
Cloudflare Dashboard → Workers & Pages → webhook-worker → Logs (real-time)
Is the Cloudflare Workers free tier enough?
The free tier offers 100K requests/day. Even with frequent notifications, it's more than enough for personal use.
Can I push to multiple channels at the same time?
Yes! As long as you configure the environment variables for each channel, the Worker will push to all configured channels in parallel.
Backwards compatible with ddns-go?
Yes! ddns-go's original IP change data (ipv4Addr, ipv4Result, etc.) will still work — they're just auto-formatted as key-value pairs instead of having a custom template. The notification will still contain all the information.