barberousse/README.md

44 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2026-10-13 12:07:21 +00:00
# barberousse
Telegram bot that answers questions about the homelab's **Uptime Kuma**.
Kuma itself still sends the alerts (same bot token); this bot only adds commands.
| Command | Reply |
|---|---|
| `/status` | Every status-page group at a glance (✅ or what's down) |
| `/down` | Only what is down or pending, since when, last error |
| `/monitor <name>` | One monitor: state, response time, 24 h uptime, last 10 checks |
| `/uptime` | 24 h uptime, worst first |
Optional: a daily digest (`DIGEST_TIME`) and a heartbeat to a Kuma Push monitor (`KUMA_PUSH_URL`).
It reads Kuma's **public status page API** (`/api/status-page/<slug>` and
`/api/status-page/heartbeat/<slug>`): read-only, no Kuma login. It only answers the chat
IDs in `ALLOWED_CHAT_IDS`.
## Run locally
```bash
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
cp .env.example .env # fill in the token
.venv/bin/python app.py
```
## Deploy on Pterodactyl (python generic egg)
Server `barberousse` on node `wings`.
| Variable | Value |
|---|---|
| `GIT_ADDRESS` | `https://forgejo.un-oeil.fr/un-oeil/barberousse.git` |
| `USERNAME` / `ACCESS_TOKEN` | Forgejo user + token with **read:repository** only |
| `AUTO_UPDATE` | `1` (git pull on every restart) |
| `PY_FILE` | `app.py` |
| `REQUIREMENTS_FILE` | `requirements.txt` |
1. Set the variables, then **Reinstall** (the install clones the repo into an empty folder).
2. Files → create `.env` from `.env.example`. It is git-ignored, so `git pull` never touches it.
3. Start. The console shows `Barberousse starting (...)`.
To update: push to Forgejo, then Restart the server.