Repository navigation
Panel watcher
Use a Cloudflare Worker to check the panel once a minute and send Telegram alerts when it stops answering and recovers.
The panel watcher is a small Cloudflare Worker that probes the panel's public listener once a minute. After three consecutive failures it sends one Telegram message; when the panel answers again, it sends one recovery message with the downtime.
If either Telegram secret is missing, the Worker does nothing.
Any HTTP status below 500 counts as healthy, including the panel's decoy 404 page. A timeout, connection or TLS error, or any 5xx response counts as a failure. The Worker does not proxy traffic, change DNS, or add a route on the panel's domain. Its own public fetch handler returns 404, and workers_dev is disabled.
The schedule runs once a minute: 1,440 checks a day, each with one panel request and one KV read. KV is written only when the failure count changes or the down/up state changes; healthy checks and continued downtime after the alert threshold do not write KV.
From deploy/cloudflare-watcher:
-
Copy the example and create a KV namespace:
cp wrangler.toml.example wrangler.toml wrangler kv namespace create WATCH
-
Put the namespace ID returned by Wrangler into
wrangler.tomlunder[[kv_namespaces]]. -
Set
HEALTH_URLto the panel's public listener, for examplehttps://panel.example.com/. The panel's decoy page is enough; do not point the Worker at a private listener. -
Optionally set
HEALTH_TIMEOUT_MS(default8000),ALERT_AFTER(default3consecutive failures),ALERT_NAME(defaultMistgate panel) andALERT_LANG(enorru, defaulten) in[vars]. -
Add the Telegram bot token as a secret:
wrangler secret put TELEGRAM_BOT_TOKEN
Use the same bot as the panel's Telegram alerts. Get its token from BotFather; the panel does not show it again.
-
Add the chat ID from Integrations → Telegram alerts on your own linked card:
wrangler secret put TELEGRAM_CHAT_ID
-
Install the package dependencies and deploy:
pnpm install wrangler deploy
The Worker only calls Telegram's sendMessage method. It never polls the bot or configures a webhook, so the panel can continue polling for chat-linking messages.
Temporarily point HEALTH_URL at a closed port on the panel's public host for three minutes, or stop the panel. After three scheduled failures, the Worker should send a down alert. Restore the URL or start the panel again; the next healthy check should send the recovery message. Restore your original HEALTH_URL after the test.
Generated from docs/ in Mistgate/mistgate — edit the docs, not the wiki.
Сгенерировано из docs/ в Mistgate/mistgate — правьте документацию, а не вики.
由 Mistgate/mistgate 中的 docs/ 生成,请编辑文档,不要直接编辑 wiki。
English
Getting started
- Overview
- Requirements
- Install the panel
- Install the Cloudflare edition
- Add a node
- Install a node over SSH
- AI agent guide
- First users
Guide
- Nodes
- Profiles
- Hysteria2
- VLESS REALITY
- VLESS and Hysteria2 on one node
- AmneziaWG
- WARP
- Users and groups
- Subscriptions
- Client apps
- User page
- DNS
- Torrent protection
- Your own decoy site
Operations
- Health
- Reachability
- Telegram alerts
- Panel watcher
- Updates
- Releases and signing
- Encrypted panel backups
- Security
- Troubleshooting
Roadmap
Reference
Русский
Начало работы
- Обзор
- Требования
- Установка панели
- Установка Cloudflare-версии
- Добавление ноды
- Установка ноды по SSH
- Инструкция для AI-агента
- Первые пользователи
Руководство
- Ноды
- Профили
- Hysteria2
- VLESS REALITY
- VLESS и Hysteria2 на одной ноде
- AmneziaWG
- WARP
- Пользователи и группы
- Подписки
- Приложения-клиенты
- Страница пользователя
- DNS
- Защита от торрентов
- Свой сайт-ширма
Эксплуатация
- Здоровье
- Доступность
- Алерты в Telegram
- Наблюдатель панели
- Обновления
- Релизы и подпись
- Зашифрованные резервные копии панели
- Безопасность
- Решение проблем
План развития
Справочник