v2.4.10: stats auto-install + i18n for show_proxy_info, traffic stats (SSH+bot)

This commit is contained in:
anten-ka
2026-04-12 07:54:40 +03:00
parent 0e38c2b5b6
commit 7075ff8696
9 changed files with 177 additions and 61 deletions

View File

@@ -3,7 +3,7 @@
# Colors, logging, spinner, system helpers, v1 compat, i18n-aware
# ── Version ───────────────────────────────────────────────────────────────────
GOTELEGRAM_VERSION="2.4.9"
GOTELEGRAM_VERSION="2.4.10"
GOTELEGRAM_NAME="GoTelegram"
# ── Пути ──────────────────────────────────────────────────────────────────────

View File

@@ -44,6 +44,33 @@ I18N[net_mode]="Mode:"
I18N[net_domain]="Domain:"
I18N[connection_link]="Telegram connection link:"
I18N[proxy_not_configured]="Proxy is not configured. Select option 1."
# ── show_proxy_info labels ─────────────────────────────────────────────
I18N[info_status_running]="Running"
I18N[info_status_stopped]="Stopped"
I18N[info_status_not_installed]="Not installed"
I18N[info_proxy_status]="Proxy status"
I18N[info_engine]="Engine"
I18N[info_ip]="IP"
I18N[info_domain]="Domain"
I18N[info_port]="Port"
I18N[info_mode]="Mode"
I18N[info_mask]="Mask host"
I18N[info_secret]="Secret"
I18N[info_link]="Link"
# ── show_traffic_stats labels ──────────────────────────────────────────
I18N[stats_sh_proxy]="Proxy (telemt, port 443)"
I18N[stats_sh_site]="Site (nginx, port 8443)"
I18N[stats_sh_hdr_period]="Period"
I18N[stats_sh_hdr_inbound]="Inbound"
I18N[stats_sh_hdr_rate]="Rate"
I18N[stats_sh_packets]="Packets"
I18N[stats_sh_1min]="1 min"
I18N[stats_sh_5min]="5 min"
I18N[stats_sh_60min]="60 min"
I18N[stats_sh_1day]="1 day"
I18N[stats_sh_7days]="7 days"
I18N[stats_sh_30days]="30 days"
I18N[stats_sh_365days]="365 days"
I18N[menu_proxy]="Proxy ▸"
I18N[menu_stats]="Statistics ▸"
I18N[menu_manage]="Management ▸"

View File

@@ -44,6 +44,33 @@ I18N[net_mode]="Режим:"
I18N[net_domain]="Домен:"
I18N[connection_link]="Ссылка для Telegram:"
I18N[proxy_not_configured]="Прокси не настроен. Выберите пункт 1."
# ── show_proxy_info labels ─────────────────────────────────────────────
I18N[info_status_running]="Работает"
I18N[info_status_stopped]="Остановлен"
I18N[info_status_not_installed]="Не установлен"
I18N[info_proxy_status]="Статус прокси"
I18N[info_engine]="Ядро"
I18N[info_ip]="IP"
I18N[info_domain]="Домен"
I18N[info_port]="Порт"
I18N[info_mode]="Режим"
I18N[info_mask]="Маскировка"
I18N[info_secret]="Secret"
I18N[info_link]="Ссылка"
# ── show_traffic_stats labels ──────────────────────────────────────────
I18N[stats_sh_proxy]="Proxy (telemt, порт 443)"
I18N[stats_sh_site]="Сайт (nginx, порт 8443)"
I18N[stats_sh_hdr_period]="Период"
I18N[stats_sh_hdr_inbound]="Входящий"
I18N[stats_sh_hdr_rate]="Скорость"
I18N[stats_sh_packets]="Пакетов"
I18N[stats_sh_1min]="1 мин"
I18N[stats_sh_5min]="5 мин"
I18N[stats_sh_60min]="60 мин"
I18N[stats_sh_1day]="1 день"
I18N[stats_sh_7days]="7 дней"
I18N[stats_sh_30days]="30 дней"
I18N[stats_sh_365days]="365 дней"
I18N[menu_proxy]="Прокси ▸"
I18N[menu_stats]="Статистика ▸"
I18N[menu_manage]="Управление ▸"

View File

@@ -243,36 +243,49 @@ show_traffic_stats() {
local site_rates=$(stats_calculate_rates "site")
IFS='|' read -r s1m s1mr s5m s5mr s60m s60mr s1d s1dr s7d s7dr s30d s30dr s365d s365dr <<< "$site_rates"
# i18n labels (fall back to English if t() not loaded)
local lbl_proxy; lbl_proxy="$(_t_or stats_sh_proxy 'Proxy (telemt, port 443)')"
local lbl_site; lbl_site="$(_t_or stats_sh_site 'Site (nginx, port 8443)')"
local lbl_hdr; lbl_hdr="$(_t_or stats_sh_hdr_period 'Period')$(_t_or stats_sh_hdr_inbound 'Inbound')$(_t_or stats_sh_hdr_rate 'Rate')"
local lbl_pkts; lbl_pkts="$(_t_or stats_sh_packets 'Packets')"
local l1m; l1m="$(_t_or stats_sh_1min '1 min')"
local l5m; l5m="$(_t_or stats_sh_5min '5 min')"
local l60m; l60m="$(_t_or stats_sh_60min '60 min')"
local l1d; l1d="$(_t_or stats_sh_1day '1 day')"
local l7d; l7d="$(_t_or stats_sh_7days '7 days')"
local l30d; l30d="$(_t_or stats_sh_30days '30 days')"
local l365d; l365d="$(_t_or stats_sh_365days '365 days')"
# Display proxy stats
{
echo ""
echo -e "${BLUE} Proxy (telemt, порт 443):${NC}"
echo -e "${BLUE} ${lbl_proxy}:${NC}"
echo -e "${BLUE} ─────────────────────────────────────────${NC}"
echo -e "${BLUE} Период │ Входящий │ Скорость${NC}"
echo -e "${BLUE} ${lbl_hdr}${NC}"
echo -e "${BLUE} ─────────────────────────────────────────${NC}"
printf " %-9s │ %14s │ %s\n" "1 мин" "$p1m" "$p1mr"
printf " %-9s │ %14s │ %s\n" "5 мин" "$p5m" "$p5mr"
printf " %-9s │ %14s │ %s\n" "60 мин" "$p60m" "$p60mr"
printf " %-9s │ %14s │ %s\n" "1 день" "$p1d" "$p1dr"
printf " %-9s │ %14s │ %s\n" "7 дней" "$p7d" "$p7dr"
printf " %-9s │ %14s │ %s\n" "30 дней" "$p30d" "$p30dr"
printf " %-9s │ %14s │ %s\n" "365 дней" "$p365d" "$p365dr"
printf " %-9s │ %14s │ %s\n" "$l1m" "$p1m" "$p1mr"
printf " %-9s │ %14s │ %s\n" "$l5m" "$p5m" "$p5mr"
printf " %-9s │ %14s │ %s\n" "$l60m" "$p60m" "$p60mr"
printf " %-9s │ %14s │ %s\n" "$l1d" "$p1d" "$p1dr"
printf " %-9s │ %14s │ %s\n" "$l7d" "$p7d" "$p7dr"
printf " %-9s │ %14s │ %s\n" "$l30d" "$p30d" "$p30dr"
printf " %-9s │ %14s │ %s\n" "$l365d" "$p365d" "$p365dr"
echo -e "${BLUE} ─────────────────────────────────────────${NC}"
printf " Пакетов: %d\n\n" "$proxy_pkts"
printf " %s: %d\n\n" "$lbl_pkts" "$proxy_pkts"
echo -e "${BLUE} Сайт (nginx, порт 8443):${NC}"
echo -e "${BLUE} ${lbl_site}:${NC}"
echo -e "${BLUE} ─────────────────────────────────────────${NC}"
echo -e "${BLUE} Период │ Входящий │ Скорость${NC}"
echo -e "${BLUE} ${lbl_hdr}${NC}"
echo -e "${BLUE} ─────────────────────────────────────────${NC}"
printf " %-9s │ %14s │ %s\n" "1 мин" "$s1m" "$s1mr"
printf " %-9s │ %14s │ %s\n" "5 мин" "$s5m" "$s5mr"
printf " %-9s │ %14s │ %s\n" "60 мин" "$s60m" "$s60mr"
printf " %-9s │ %14s │ %s\n" "1 день" "$s1d" "$s1dr"
printf " %-9s │ %14s │ %s\n" "7 дней" "$s7d" "$s7dr"
printf " %-9s │ %14s │ %s\n" "30 дней" "$s30d" "$s30dr"
printf " %-9s │ %14s │ %s\n" "365 дней" "$s365d" "$s365dr"
printf " %-9s │ %14s │ %s\n" "$l1m" "$s1m" "$s1mr"
printf " %-9s │ %14s │ %s\n" "$l5m" "$s5m" "$s5mr"
printf " %-9s │ %14s │ %s\n" "$l60m" "$s60m" "$s60mr"
printf " %-9s │ %14s │ %s\n" "$l1d" "$s1d" "$s1dr"
printf " %-9s │ %14s │ %s\n" "$l7d" "$s7d" "$s7dr"
printf " %-9s │ %14s │ %s\n" "$l30d" "$s30d" "$s30dr"
printf " %-9s │ %14s │ %s\n" "$l365d" "$s365d" "$s365dr"
echo -e "${BLUE} ─────────────────────────────────────────${NC}"
printf " Пакетов: %d\n" "$site_pkts"
printf " %s: %d\n" "$lbl_pkts" "$site_pkts"
echo ""
} >&2
}

44
lib/telemt_config.sh Executable file → Normal file
View File

@@ -285,26 +285,26 @@ show_proxy_info() {
local status_icon status_text
case "$status" in
running) status_icon="✅"; status_text="Работает" ;;
stopped) status_icon="⏸️"; status_text="Остановлен" ;;
*) status_icon="❌"; status_text="Не установлен" ;;
running) status_icon="✅"; status_text="$(t info_status_running)" ;;
stopped) status_icon="⏸️"; status_text="$(t info_status_stopped)" ;;
*) status_icon="❌"; status_text="$(t info_status_not_installed)" ;;
esac
echo ""
echo -e " ${BOLD}${WHITE}${status_icon} Статус прокси: ${status_text}${NC}"
echo -e " ${BOLD}${WHITE}${status_icon} $(t info_proxy_status): ${status_text}${NC}"
echo -e " ${DIM}$(printf '─%.0s' {1..50})${NC}"
echo -e " ${WHITE}Ядро:${NC} telemt (Rust)"
echo -e " ${WHITE}$(t info_engine):${NC} telemt (Rust)"
if [ "$mode" = "pro" ] && [ -n "$domain" ]; then
echo -e " ${WHITE}Домен:${NC} ${CYAN}${domain}${NC}"
echo -e " ${WHITE}$(t info_domain):${NC} ${CYAN}${domain}${NC}"
else
echo -e " ${WHITE}IP:${NC} ${CYAN}${ip}${NC}"
echo -e " ${WHITE}$(t info_ip):${NC} ${CYAN}${ip}${NC}"
fi
echo -e " ${WHITE}Порт:${NC} ${CYAN}${port}${NC}"
echo -e " ${WHITE}Режим:${NC} ${CYAN}${mode}${NC}"
echo -e " ${WHITE}Маскировка:${NC} ${CYAN}${mask_host}${NC}"
echo -e " ${WHITE}Secret:${NC} ${CYAN}${secret:0:16}...${NC}"
echo -e " ${WHITE}$(t info_port):${NC} ${CYAN}${port}${NC}"
echo -e " ${WHITE}$(t info_mode):${NC} ${CYAN}${mode}${NC}"
echo -e " ${WHITE}$(t info_mask):${NC} ${CYAN}${mask_host}${NC}"
echo -e " ${WHITE}$(t info_secret):${NC} ${CYAN}${secret:0:16}...${NC}"
echo -e " ${DIM}$(printf '─%.0s' {1..50})${NC}"
echo -e " ${WHITE}Ссылка:${NC}"
echo -e " ${WHITE}$(t info_link):${NC}"
echo -e " ${GREEN}${link}${NC}"
echo ""
@@ -323,20 +323,20 @@ show_proxy_info_pro() {
local link="tg://proxy?server=${domain}&port=443&secret=${faketls_secret}"
echo ""
echo -e " ${BOLD}${WHITE}Pro-прокси настроен${NC}"
echo -e " ${BOLD}${WHITE}$(t info_proxy_status): $(t info_status_running) (Pro)${NC}"
echo -e " ${DIM}$(printf '─%.0s' {1..55})${NC}"
echo -e " ${WHITE}Ядро:${NC} telemt (Rust)"
echo -e " ${WHITE}Домен:${NC} ${CYAN}${domain}${NC}"
echo -e " ${WHITE}Порт:${NC} ${CYAN}443${NC} (внешний, telemt)"
echo -e " ${WHITE}Режим:${NC} ${MAGENTA}Pro (fake-TLS)${NC}"
echo -e " ${WHITE}nginx:${NC} ${CYAN}127.0.0.1:8443${NC} (внутренний)"
echo -e " ${WHITE}Secret:${NC} ${CYAN}${faketls_secret:0:20}...${NC}"
echo -e " ${WHITE}$(t info_engine):${NC} telemt (Rust)"
echo -e " ${WHITE}$(t info_domain):${NC} ${CYAN}${domain}${NC}"
echo -e " ${WHITE}$(t info_port):${NC} ${CYAN}443${NC} (telemt)"
echo -e " ${WHITE}$(t info_mode):${NC} ${MAGENTA}Pro (fake-TLS)${NC}"
echo -e " ${WHITE}nginx:${NC} ${CYAN}127.0.0.1:8443${NC}"
echo -e " ${WHITE}$(t info_secret):${NC} ${CYAN}${faketls_secret:0:20}...${NC}"
echo -e " ${DIM}$(printf '─%.0s' {1..55})${NC}"
echo -e " ${WHITE}Ссылка для Telegram:${NC}"
echo -e " ${WHITE}$(t info_link):${NC}"
echo -e " ${GREEN}${link}${NC}"
echo ""
echo -e " ${DIM}Провайдер видит: HTTPS-трафик к ${domain}:443${NC}"
echo -e " ${DIM}Telegram-клиент маскирует соединение под TLS${NC}"
echo -e " ${DIM}ISP sees: HTTPS → ${domain}:443${NC}"
echo -e " ${DIM}Telegram client masquerades as TLS${NC}"
echo ""
# QR если доступен