v2.4.8: preflight port-conflict check

Добавлена предустановочная проверка свободы портов перед установкой
telemt. На вход приходит режим (lite/pro) и выбранный порт, проверяются
443 (lite: выбранный), 80 и 8443 (pro). Известный proxy/VPN/веб-софт
(xray, sing-box, v2ray, trojan, hysteria, mtg, shadowsocks, x-ui,
marzban, amneziawg, caddy, apache, haproxy, wireguard, openvpn)
распознаётся по имени процесса и показывается отдельным блоком.

При конфликте пользователь видит список занятых портов, получает
рекомендацию удалить конфликтующий софт или взять чистый VPS, и
может либо форсировать установку, либо отказаться — тогда показывается
15-секундный промо-блок с QR для донатов и возврат в меню.

Override для автоматизированных сценариев: GOTELEGRAM_SKIP_PREFLIGHT=1.

Files:
  lib/common.sh      — get_port_process, match_known_conflict, preflight_check
  lib/lang/ru.sh     — preflight_* i18n keys (ru)
  lib/lang/en.sh     — preflight_* i18n keys (en)
  install.sh         — preflight_check вызов в install_lite_mode / install_pro_mode;
                        show_promo_with_qr теперь принимает countdown arg
  gotelegram-bot/bot.py — version bump 2.4.7 → 2.4.8
This commit is contained in:
anten-ka
2026-04-11 23:48:53 +03:00
parent 8f249c35e5
commit 9d9d12e150
5 changed files with 207 additions and 4 deletions

14
lib/lang/en.sh Executable file → Normal file
View File

@@ -347,6 +347,20 @@ I18N[backup_pass_short]="Password too short (minimum 6 characters)"
I18N[backup_pick_prompt]="Backup number (or path to file)"
I18N[backup_not_found]="Backup not found"
# ── Preflight (v2.4.8) ──────────────────────────────────────────────────
I18N[preflight_title]="Preflight: port conflicts detected"
I18N[preflight_known]="Known proxy/VPN/web software is using required ports:"
I18N[preflight_unknown]="Required ports are held by unknown processes:"
I18N[preflight_needed]="GoTelegram requires ports:"
I18N[preflight_hint_header]="Recommended actions:"
I18N[preflight_hint1]="Stop and remove the conflicting services (systemctl stop ...)"
I18N[preflight_hint2]="Or use a clean VPS without other proxies"
I18N[preflight_hint3]="Installing on top will most likely fail"
I18N[preflight_skip_hint]="Bypass: GOTELEGRAM_SKIP_PREFLIGHT=1 gotelegram"
I18N[preflight_proceed]="Continue installation anyway (likely to fail)?"
I18N[preflight_forced]="Installation continued despite conflicts — errors likely"
I18N[preflight_aborted]="Installation aborted due to port conflicts"
# ── Errors / misc ───────────────────────────────────────────────────────
I18N[err_need_root]="Run the script with sudo / as root"
I18N[err_os_unknown]="Failed to detect OS. Linux is required."