Repository navigation
feat(deploy): Telegram bot runs from the VPS + /check?text= deep link (E-063) - #3
Merged
Merged
Conversation
…nk (E-063) - deploy/vps/docker-compose.prod.yml: telegram-bot env_file -> /etc/basira/telegram-bot.env (!override), BASIRA_API_URL=http://basira:8000, BASIRA_WEB_URL=https://basirapp.site; basira env_file /etc/basira/basira.env (BASIRA_EVAL_KEY, optional); json-file log rotation 10m x 3 on all services - deploy/vps/autodeploy.sh: export COMPOSE_PROFILES from autodeploy.conf; after a deploy log 'bot: healthy|unhealthy|missing' from docker inspect; autodeploy.conf.example documents the profile - frontend: /check reads ?text= (pre-fill only, cap MAX_CHARS, never checks on load, param dropped); initialTextFrom exported; 2 vitest cases - bot: rich.check_link(site, text) builds /check?text= when the URL is <= 2000 chars, else /check; used by the rich footer and the classic-HTML fallback button; text handler passes the user's text and deletes it after rendering; 5 new tests (110 total), ruff + mypy strict clean - docs: DEPLOYMENT 3.1 (secrets, shared eval key, verification), deploy/vps/README bot section, STATE 3, README line, bot README; DECISIONS E-063; duplicate E-057/E-058 from PR #1 renumbered E-061/E-062 with all references (CHANGELOG, anchor.py, tests, smoke, index.css, README)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Bot always-on from the server (profile
bot, no laptop needed):deploy/vps/docker-compose.prod.yml:telegram-botreads/etc/basira/telegram-bot.env(!override, 600 root),BASIRA_API_URL=http://basira:8000,BASIRA_WEB_URL=https://basirapp.site;basirareads/etc/basira/basira.env(optional, carriesBASIRA_EVAL_KEY); json-file log rotation10m x 3on all services.BASIRA_EVAL_KEY(openssl rand -hex 24) in both env files makes the API skip the per-IP limiter for the bot; the bot's 10 msg/min per user remains the guard.autodeploy.shexportsCOMPOSE_PROFILESfromautodeploy.confand logsbot: healthy|unhealthy|missingafter each deploy.docker compose upwithout the profile is unchanged for judges./check?text=deep link (Check.tsx): pre-fills the composer, cap 5000, never checks on load, param removed from the URL. The bot's «open in Basira» button carries the user's text when the full URL is <= 2000 chars (rich.check_link), else plain/check; also on the classic-HTML fallback.Hygiene: duplicate decision IDs E-057/E-058 (introduced by PR #1) renumbered to E-061/E-062 with every reference; E-063 added; DEPLOYMENT 3.1, deploy/vps/README, STATE 3, README, bot README.
Measured
mypy --strictclean, 110 passed (+5)config --serviceswith and without profile validated on the server; token resolves from/etc/basira(redacted)git grep -nE "[0-9]{8,}:[A-Za-z0-9_-]{30,}"-> emptyServer (already applied, backup in
/root/backup/2026-10-06_0415, imagebasira:rollback-ca8401a)/etc/basira/basira.env+ key appended to/etc/basira/telegram-bot.env(600 root)BASIRA_EVAL_KEYpresent, len 48);/health200 buildca8401aCOMPOSE_PROFILES=botonce the owner stops it.No religious text, no judgment vocabulary, no storage,
state.py/thresholds untouched, no DNS/Caddy changes.