Commit Graph

115 Commits

Author SHA1 Message Date
Виталий Литвинов
4dc286908e Document Telegram bot auto-update flow rollback-alfa-20260426 rollback-codex-20260426 2026-04-26 11:04:11 +03:00
Виталий Литвинов
7bb88f2c24 Auto-update existing Telegram bot during upgrade 2026-04-26 10:51:30 +03:00
Виталий Литвинов
ffea9f5d77 Default bootstrap installs from alfa 2026-04-25 23:20:45 +03:00
Виталий Литвинов
5714714d3c Add repository hygiene ignore rules v2.5.0-alfa 2026-04-25 22:59:41 +03:00
Виталий Литвинов
6840d309af Fix Telegram bot template callbacks and telemt version checks 2026-04-25 19:18:54 +03:00
Виталий Литвинов
2f3607e1e6 v2.5.0: harden telemt user reloads 2026-04-25 17:50:06 +03:00
Виталий Литвинов
5a6bc9f614 v2.5.0: read quoted main proxy secret 2026-04-25 16:45:57 +03:00
Виталий Литвинов
cae552ec87 v2.5.0: add admin auto refresh toggle 2026-04-25 16:38:19 +03:00
Виталий Литвинов
98e4be8831 v2.5.0: use live IP counts in key cards 2026-04-25 16:22:17 +03:00
Виталий Литвинов
d62991857f v2.5.0: replace keys table with responsive cards 2026-04-25 15:52:17 +03:00
Виталий Литвинов
7b1a79bba9 v2.5.0: align key table buttons 2026-04-25 15:44:36 +03:00
Виталий Литвинов
b58bc9e1ba v2.5.0: make key stats selection explicit 2026-04-25 15:35:13 +03:00
Виталий Литвинов
1e27d6ba71 v2.5.0: make key table responsive 2026-04-25 15:27:58 +03:00
Виталий Литвинов
a143c01a9a v2.5.0: keep admin scroll clear 2026-04-25 15:24:34 +03:00
Виталий Литвинов
507a2979e5 v2.5.0: align key controls and add IP limits 2026-04-25 15:19:28 +03:00
Виталий Литвинов
bd3fc1af18 v2.5.0: select key traffic by row click 2026-04-25 14:56:52 +03:00
Виталий Литвинов
817ea9ab9f v2.5.0: clarify encrypted restore in admin 2026-04-25 14:51:10 +03:00
Виталий Литвинов
d492e5eb69 v2.5.0: make backup names collision safe 2026-04-25 14:47:34 +03:00
Виталий Литвинов
b2ab0dca57 v2.5.0: add QR import and backup scheduling 2026-04-25 14:39:56 +03:00
Виталий Литвинов
c7540a97f7 v2.5.0: compact traffic history retention 2026-04-25 14:15:28 +03:00
Виталий Литвинов
63b564f70f v2.5.0: add shared 443 and per-user traffic 2026-04-25 14:07:47 +03:00
Виталий Литвинов
c1b5ffc5a7 v2.5.0: clarify 443 route map assets 2026-04-25 13:29:05 +03:00
Виталий Литвинов
7eaeef8b49 v2.5.0: show routed services behind port 443 2026-04-25 13:25:32 +03:00
Виталий Литвинов
5225811b3c v2.5.0: harden admin key and traffic flows 2026-04-25 12:28:33 +03:00
Виталий Литвинов
d74b05ccf8 v2.5.0: refine admin traffic and port status 2026-04-25 12:01:31 +03:00
Виталий Литвинов
d8ec62eb07 v2.5.0: update service branding 2026-04-25 09:58:23 +03:00
Виталий Литвинов
e54778c08c v2.5.0: add key disable switches and pro UI polish 2026-04-25 09:44:53 +03:00
Виталий Литвинов
6b89c3ea81 v2.5.0: redact admin overview secret 2026-04-24 23:08:02 +03:00
Виталий Литвинов
a393bd79ff v2.5.0: limit language api response 2026-04-24 23:03:06 +03:00
Виталий Литвинов
3b075a7ed7 v2.5.0: improve admin domain language logs 2026-04-24 22:59:21 +03:00
Виталий Литвинов
9c74a0d00f v2.5.0: guard web admin log loading race 2026-04-24 22:44:47 +03:00
Виталий Литвинов
3ab0f9d5c7 v2.5.0: bust web admin asset cache 2026-04-24 22:40:31 +03:00
Виталий Литвинов
dc7452930a v2.5.0: disable web admin static cache 2026-04-24 22:37:52 +03:00
Виталий Литвинов
d9e4831e44 v2.5.0: redesign local admin and repair stats 2026-04-24 22:30:09 +03:00
Виталий Литвинов
008143a617 v2.5.0: remove local web admin token gate 2026-04-24 22:00:08 +03:00
Виталий Литвинов
8804319e19 v2.5.0: wait for telemt readiness in web admin 2026-04-24 21:41:21 +03:00
Виталий Литвинов
fe6d91c3a5 v2.5.0: wait for telemt listener readiness 2026-04-24 21:39:02 +03:00
Виталий Литвинов
20103ccac8 v2.5.0: add local web admin dashboard 2026-04-24 19:19:12 +03:00
Виталий Литвинов
ed9073f28f v2.5.0: add legacy state migration 2026-04-24 18:58:52 +03:00
Codex
7afeb59261 v2.5.0: maintenance and bot user management 2026-04-24 18:50:43 +03:00
anten-ka
b10ea54ce9 install.sh: show promo QR only for tips, remove hoster QR codes release-main-20260426 rollback-test-20260426 2026-04-10 20:48:35 +03:00
anten-ka
2f3045bcc0 bootstrap.sh: rotate PAT + support GOTELEGRAM_PAT env override 2026-04-10 20:44:20 +03:00
anten-ka
eb5175ccab v2.4.6: universal apt_lock_wait helper (fix nginx install on fresh VPS)
- lib/common.sh: add apt_lock_wait + apt_install + apt_update helpers
  * waits up to 300s for dpkg lock held by unattended-upgrades
  * uses DPkg::Lock::Timeout=120 native flag
  * captures stderr to show real error if install fails
- lib/website.sh: install_nginx/install_certbot use apt_install
  (fixes "Could not get lock /var/lib/dpkg/lock-frontend" during Pro setup)
- install.sh: bot_install uses apt_install (removes duplicated lock logic)
- lib/common.sh: ensure_deps uses apt_update + apt_install
v2.4.6
2026-04-10 20:01:20 +03:00
anten-ka
3403975636 fix(v2.4.5): wait for apt lock + versioned python3.X-venv fallback
- bot_install: wait up to 300s for dpkg/apt lock (unattended-upgrades)
- use apt-get -o DPkg::Lock::Timeout=120 as extra safety
- detect python3 minor version and include python3.X-venv in package list
- stop silencing apt errors with 2>/dev/null — surface them to user
- python3-full is optional; fall back to core packages if unavailable
- venv fallback path also installs versioned package and retries
- templates_catalog.json: skip cp when source==dest (symlink install)
2026-04-10 15:59:46 +03:00
anten-ka
3919f201f5 fix(v2.4.4): robust venv creation + UTF-8 safe install frame
- install.sh bot_install: always ensure python3-venv+pip, verify pip exists, check pip install exit code, sanity-check imports
- install.sh: replace box-frame with simple bullet lines (printf %-Ns was byte-counting, breaking Cyrillic UTF-8)
- common.sh: 2.4.4
- bot.py: 2.4.4
v2.4.4
2026-04-10 14:03:28 +03:00
anten-ka
4b63b79184 docs(v2.4.3): changelog + bot action bridge + flock race fix
- Header version bumped 2.4.1 -> 2.4.3 in both docs
- DOCS_HUMAN.md changelog: 2.4.2 (bot can change template/domain) + 2.4.3 (flock race fix)
- DOCS_AI.md section 11.1 (new): non-interactive action bridge contract - action list, JSON format, error codes, flock serialization semantics
- DOCS_AI.md section 10: bugs #24-28 (safe_edit_message TypeError, template_id field name, jq 1.5 compat, validation, flock race)
- DOCS_AI.md changelog: 2.4.2 + 2.4.3 entries
v2.4.3
2026-04-10 13:39:10 +03:00
anten-ka
e9af6e969f fix(v2.4.3): flock serialization for bot_action_dispatch
Iteration 3 discovered a race condition: parallel CLI invocations of
change-lite-domain occasionally produced 'no secret in config' because
one process read config.json while another was mid-rewrite (jq -> tmp -> mv).
asyncio.Lock in bot.py only protects bot->bot races; CLI-level races and
bot+CLI mixed races were still possible.

- install.sh: bot_action_dispatch wraps dispatch in flock(1) on
  /var/lock/gotelegram-bot-action.lock, 30s timeout, EX_TEMPFAIL on timeout
- common.sh: flock added to critical deps; apt_pkg_for_cmd/dnf_pkg_for_cmd
  map flock -> util-linux
- common.sh: check_deps_present includes flock
- version bumped to 2.4.3 (common.sh + bot.py)
2026-04-10 13:35:22 +03:00
anten-ka
724eeb92d9 fix(v2.4.2): iter2 audit fixes
- bot.py: safe_edit_message now accepts disable_web_page_preview (CRIT: was TypeError in cb_pro_confirm success path)
- bot.py: status display uses template_id field (was 'template' — mismatch with save_gotelegram_config, template never showed)
- bot.py: cb_pro_confirm validates tpl_id against [A-Za-z0-9_-]{1,64} before subprocess (defense-in-depth)
- bot.py: cb_lite_domain validates domain shape
- bot.py: asyncio.Lock _BOT_ACTION_LOCK serializes concurrent change-template/change-lite-domain calls
- install.sh: bot_update_config_field uses shell `date -Iseconds` instead of jq's `now|todate` (jq 1.5 compat for Debian 10)
2026-04-10 13:30:47 +03:00
anten-ka
fc28a1a099 feat(v2.4.2): bot non-interactive install.sh actions
- install.sh: new bot_action_dispatch entry point for --action=X --json CLI invocation from the bot/scripts
- install.sh: bot_action_change_template — reuses download_template + deploy_template_to_nginx, updates config.json template_id
- install.sh: bot_action_change_lite_domain — regenerates telemt TOML with new fake-TLS mask domain, restarts telemt
- bot.py: run_bot_action() subprocess wrapper parses JSON result
- bot.py: cb_pro_confirm now performs real change-template when already in pro mode (fresh install still routes to CLI)
- bot.py: cb_lite_domain now performs real change-lite-domain when already in lite mode
- version -> 2.4.2
2026-04-10 13:19:26 +03:00
anten-ka
7b53566dad fix(bot): promo auto-delete + neutralize fake install/change stubs
Two user-reported bugs:

1. Promo spam: daily promo message from /start and the Promo menu
   button stayed in chat forever. Now they auto-delete after 30s.
   - new helper _delete_message_after()
   - cmd_start schedules deletion of the daily promo
   - cb_menu_promo sends promo as a SEPARATE ephemeral message
     (instead of editing the main menu in place), so the menu stays
     intact and only the promo self-destructs in 30s.

2. CRITICAL: 'install/change template from bot' was a stub that
   silently corrupted /opt/gotelegram/config.json. cb_lite_domain
   and cb_pro_confirm wrote a fake minimal config ({mode,template,
   port,installed_at}) without secret/domain/mask_host, and showed
   '[OK] installed!' — while never invoking install.sh, never
   downloading the template, never touching nginx. Proxy link
   generation then broke because secret was gone.
   User symptom: 'устанавливал другой шаблон через бота и всё
   повисло'.

   Fix: both callbacks now refuse cleanly and route the user to the
   CLI ('gotelegram' command → menu 1 → 1 or 7). Configuration is
   NOT touched. Full non-interactive install/change from the bot is
   left as future work.

Tested live on VPS:
- bot.py syntax OK (ast.parse on VPS)
- gotelegram-bot restarted, active
- corrupted config.json on VPS rebuilt from telemt TOML ground
  truth (mode=lite, secret, port, mask_host=google.com)
2026-04-10 13:00:04 +03:00