Part of the Ping-Tower uptime monitoring system. 📖 Full project description and architecture →
Telegram notification channel. Serves the /start bot flow (webhook or
polling) and delivers server up/down alerts pushed from the API through
RabbitMQ.
Python / FastAPI, aiogram (Telegram Bot API), faststream[rabbit]
(RabbitMQ consumer), pydantic-settings, uv
telegramQueue ──▶ [ Telegram Bot ] ──Bot API──▶ Telegram user
- Consumes notification messages from
telegramQueueviafaststreamand delivers them throughaiogram, with inline keyboards (Web app / GitHub buttons on/start). - Runs in either
webhookmode (FastAPI endpoint atTG_BOT_WEBHOOK_PATH, verified withTG_BOT_WEBHOOK_SECRET) orpollingmode, selected viaTG_BOT_MODE. - Account linking: users connect their Telegram account to a PingTower user
via the API's
telegram-accountsendpoints.
cp .env.example .env
# fill in TG_BOT_BOT_TOKEN
uv sync
uv run tg-botOr via Docker:
cp .env.example .env
docker compose up --buildKey environment variables (.env.example): TG_BOT_BOT_TOKEN, TG_BOT_MODE
(polling/webhook), TG_BOT_WEBHOOK_*, TG_BOT_RABBITMQ_URL,
TG_BOT_RABBITMQ_QUEUE, TG_BOT_PROXY_URL (optional outbound proxy for the
Bot API).
uv run pytest tests/unit
uv run pytest tests/integration.gitlab-ci.yml: test (pytest) → build (Docker image, push,
main/stage only) → deploy (SSH, docker compose pull && up -d).