Telegram bot that tracks Monobank balance changes and sends daily budget reports.
Create ./data/monobank.json:
{
"tokenList": ["your_monobank_token"]
}Create ./data/telegram.json:
{
"login": "your_bot_username",
"token": "your_bot_token"
}cp .env.example .env
# Edit .env: set TUNNEL_TOKEN, MONOBANK_WEBHOOK_PUBLIC_URL, MONOBANK_WEBHOOK_SECRETMONOBANK_WEBHOOK_SECRET should be a long random string (e.g. openssl rand -hex 32).
In Cloudflare Zero Trust → Networks → Tunnels:
- Create a named tunnel, copy the token →
TUNNEL_TOKENin.env - Add public hostname:
budgetbot.yourdomain.com→ service typeHTTP, URLbot:7070 - Set
MONOBANK_WEBHOOK_PUBLIC_URL=https://budgetbot.yourdomain.comin.env
docker compose up -d --buildVerify:
# Health check
docker compose exec bot curl -fsS http://localhost:7070/health
# Webhook handshake (should return 200)
curl https://budgetbot.yourdomain.com/personal/balance/webhook/<your-secret>
# Logs
docker compose logs -fThe app registers the webhook with Monobank automatically on startup. A 6-hourly cron re-registers it if Monobank disables it after failed deliveries.
# Java 21 required
mvn clean test # run tests
mvn package -DskipTests # build jar → target/budgetbot-1.0.0.jar