bot.py is gone. /start, /history, /stats, /delete, /export,
/feedback, and the text-message workout parser are no longer
exposed. Everything those commands did is already available in
the Mini App (history listing, stats, edit/delete, JSON export
via /api/export/json, etc.).
Why: prod runs behind a Mini App URL, and shipyard staging is a
tenant under the existing shipyard_poc_bot which polls Telegram
itself. A second polling process on the same token would 409. By
removing polling entirely, prod and staging share one
architecture: a pure HTTP server validated against whatever
BOT_TOKEN is provided.
Changes:
- delete bot.py
- start.py: stop spawning the bot subprocess; load token, start
server, optionally start cloudflared. WEBAPP_URL still skips
the tunnel.
- flake.nix / requirements.txt: drop python-telegram-bot.
- README: rewrite to reflect Mini-App-only architecture.
The prod systemd unit doesn't need to change — its ExecStart is
`python start.py`, which now boots only the server (+ no tunnel
since WEBAPP_URL is set in the unit env).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Backward-compatible reorder: env var wins, then file. This lets
multiple instances on the same host (prod + shipyard staging)
each load a distinct token via systemd EnvironmentFile, instead
of fighting over the single ~/.secrets/bigbiggerbiggestbot file.
Also documents the new two-environment workflow in README.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Allows the bot to run behind an external reverse proxy (e.g. a VPS
running Caddy on a public TLS-terminated domain forwarding to
localhost:$API_PORT over a private overlay network) instead of
spinning up an ephemeral trycloudflare.com quick tunnel. Set
WEBAPP_URL=https://your.domain/... in the service environment and
start.py will use it verbatim and skip spawning cloudflared.
Behavior unchanged when WEBAPP_URL is unset: still launches cloudflared
and picks up the auto-generated trycloudflare.com URL as before.
QUIC tunnels consistently returned 1033 errors. Forcing http2 fixes it.
Added a daemon thread to drain cloudflared's stdout pipe to prevent
buffer-full blocking that would kill the tunnel.
- Replace localtunnel with cloudflared (no interstitial password page)
- Wait for "Registered tunnel connection" before starting bot
- Serve index.html at / instead of directory listing
- Remove localtunnel npm package build from flake.nix
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- server.py: aiohttp API serving webapp/ and REST endpoints using existing db.py
- start.py: orchestrator that loads token, starts server + localtunnel + bot
- webapp/: Mini App frontend (Log, History, Stats) with Telegram-native theming
- bot.py: added Mini App menu button and inline button on /start
- flake.nix: added aiohttp + localtunnel, nix run now uses start.py