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>
45 lines
1.3 KiB
Nix
45 lines
1.3 KiB
Nix
{
|
|
description = "BigBiggerBiggestBot — Telegram fitness tracker with Mini App";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
python = pkgs.python3;
|
|
|
|
pythonEnv = python.withPackages (ps: with ps; [
|
|
# python-telegram-bot was used by the now-deleted bot.py polling
|
|
# loop; the Mini App backend doesn't need it. Kept off this list.
|
|
python-dotenv
|
|
aiohttp
|
|
pytest
|
|
pytest-asyncio
|
|
]);
|
|
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
packages = [ pythonEnv pkgs.cloudflared ];
|
|
shellHook = ''
|
|
echo "💪 BigBiggerBiggestBot dev shell"
|
|
echo " Run: python start.py (server + tunnel)"
|
|
'';
|
|
};
|
|
|
|
# `nix run` — start everything via start.py
|
|
apps.default = {
|
|
type = "app";
|
|
program = toString (pkgs.writeShellScript "run-fitness-bot" ''
|
|
export PATH="${pkgs.lib.makeBinPath [ pythonEnv pkgs.cloudflared ]}:$PATH"
|
|
exec ${pythonEnv}/bin/python "$PWD/start.py"
|
|
'');
|
|
};
|
|
}
|
|
);
|
|
}
|