- Python 97.5%
- Shell 2.1%
- Dockerfile 0.4%
| .github/workflows | ||
| tests | ||
| .dockerignore | ||
| .gitignore | ||
| bot.py | ||
| CHANGELOG.md | ||
| database.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| icon.jpg | ||
| icon.png | ||
| README.md | ||
| requirements.txt | ||
| set_admin.py | ||
| update.sh | ||
Delta Chat Uptime Bot
Delta Chat Uptime Bot is a self-hosted uptime monitoring bot (similar to Uptime Kuma) integrated directly with Delta Chat. It monitors resources (websites, APIs, TCP ports, or ping targets) and alerts you inside Delta Chat if they go offline.
Additionally, it automatically generates a secure, beautiful web status dashboard for each chat.
Features
- 🛡️ Secure Administration: Claim ownership with
/initadminvia private chat. Cryptographic fingerprint-based authentication protects administrative actions. - 💬 Per-Chat Isolation: Each chat (private or group) maintains its own separate list of monitored resources.
- ⚙️ Three Check Modes:
- HTTP/HTTPS: Checks status code and latency (e.g.
https://example.com). - TCP Port: Checks port availability (e.g.
example.com:22). - Ping (ICMP): Sends standard ICMP echo requests (e.g.
example.com).
- HTTP/HTTPS: Checks status code and latency (e.g.
- 🔄 Failure Resiliency & Retry Logic:
- Checks resources once a minute.
- If a resource check fails, the bot does not alert immediately. It retries 2 more times at 30-second intervals.
- Alerts are only triggered if all 3 checks fail, avoiding false positives.
- Once a DOWN resource recovers, it is marked UP on the first successful check.
- 📊 Uptime Dashboards: Generates a secure, 12-character unguessable base62 URL (e.g.
https://up.example.com/k8D2x9mPqL1a) hosting a modern dark-themed web status dashboard for each chat. - ✉️ Multi-Transport Failover: Supports multiple SMTP servers and automatically falls back to backups if message delivery fails.
Commands
User Commands (Public per-chat)
These commands are available to any member of a chat. They support suffixes (e.g. /add@up, /status@uptime) to route commands correctly if multiple bots exist in the same chat.
/add <target> [name]— Add a monitor. Target formats:https://google.com(HTTP/HTTPS check)google.com:443(TCP port check)google.com(ICMP Ping check)
/remove <id>— Stop monitoring a resource by ID./list— List monitored resources and their status in this chat./status— View monthly uptime statistics and get the link to the chat's secure Web Status Page./help— View available commands and system information.
Admin-Only Commands
These commands are only executable by the configured administrator.
/url— View current base external status URL./url <url>— Update the base external status URL (e.g.,/url https://up.gluek.info) to generate correct status links./accounts— List active bot accounts./rmaccount <id>— Delete a bot account./transports— Show configured mail relays, status, and stats./addtransport— Add backup mail relays (either chatmail URIs or address/password)./rmtransport <addr>— Remove backup mail relay./setprimary <addr>— Switch primary SMTP transport./resilient— Toggle resilient sending (attempts sending on backups if primary fails).
Deployment
Prerequisites
- Docker and Docker Compose installed.
- A dedicated email address for the bot (e.g.
uptimebot@yourdomain.com). - A domain name pointing to your host for the status pages (e.g.
up.gluek.info).
1. Build and Prepare
Clone the repository, enter the directory, and build the Docker container:
cd deltachat_uptime
docker compose build
2. Configure Email and Admin
Initialize the bot account with your email and password:
docker compose run --rm uptime_bot python bot.py init uptimebot@yourdomain.com "your_email_password"
Configure your admin email address and optionally your cryptographic fingerprint on the server:
docker compose run --rm uptime_bot python set_admin.py --email admin@yourdomain.com
docker compose run --rm uptime_bot python set_admin.py --fingerprint 1234ABCD1234ABCD1234ABCD1234ABCD1234ABCD
3. Run the Bot
Start the bot daemon in background:
docker compose up -d
4. Claim Ownership inside Delta Chat
- Scan the bot's secure join QR code printed in the logs (
docker compose logs uptime_bot) or add the bot's email address in Delta Chat. - Send
/initadminto the bot in a private message. - The bot will automatically verify your identity and associate your cryptographic fingerprint. You are now the administrator!
5. Set up Base URL
Tell the bot your public status domain so that it generates correct dashboard links:
/url https://up.gluek.info
Reverse Proxy with Caddy
If you use Caddy on your host (like for your ntfy bot), you can expose the status pages by adding the following config to your /etc/caddy/Caddyfile:
up.gluek.info {
reverse_proxy 127.0.0.1:8080
}
Reload Caddy to apply changes:
sudo systemctl reload caddy