Phase 8: widgets and polish

- Live job card widget (progress bar, in-widget cancel via widget_query)
  and live invoice widget (QR drawn from a bitmap, countdown, paid state),
  Bot API 10.4 sendWidget, private chats only
- Automatic fallback to the ordinary message when sendWidget fails, with
  a breaker that pauses widgets after repeated failures or on servers
  without the method; TELEGRAM_WIDGETS
- Prometheus metrics on the core (/metrics) and on every worker: queue
  depth and wait, slots, heartbeats, job outcomes, errors per site,
  deliveries, cache, invoices, Lightning, ledger check, widgets
- Example Prometheus config and alert rules, Caddyfile, dashboard notes
- Load test: cmd/loadtest and deploy/loadtest (make loadtest)
- Browser check of the widgets' HTML, including decoding a drawn QR
- docs/DEPLOY.md (production in under an hour) and docs/MONITORING.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Michilis
2026-11-18 18:24:36 +00:00
co-authored by Claude Opus 5.5
parent f1f9c6156c
commit 3c153af97f
45 changed files with 3158 additions and 20 deletions
+10
View File
@@ -9,6 +9,10 @@ BOT_TOKEN=
TELEGRAM_API_URL=https://api.telegram.org
# polling (default) or webhook.
TELEGRAM_MODE=polling
# Prometheus metrics at /metrics on HTTP_LISTEN. Keep the path off the
# public internet; see docs/MONITORING.md.
METRICS_ENABLED=true
# Public HTTPS base URL of this server. Only for webhook mode. Telegram will
# call <WEBHOOK_URL>/telegram/webhook.
WEBHOOK_URL=
@@ -37,6 +41,12 @@ MINIAPP_ENABLED=false
# set in @BotFather.
TELEGRAM_SET_PROFILE=true
# Show the download status and invoices as live HTML widgets in private
# chats (Bot API 10.4 sendWidget): a progress bar with a cancel button, and
# an invoice with a QR code, a countdown and its paid state. If Telegram
# refuses a widget the bot sends the ordinary message instead, by itself.
TELEGRAM_WIDGETS=true
# Add the pseudo-locale en-XA (accented, bracketed English) for checking
# that every text comes from the catalog. Only owners can pick it.
I18N_PSEUDO=false