v2.3.1: fix QR top margin, use domain instead of IP for pro-mode links

This commit is contained in:
anten-ka
2026-04-09 00:59:42 +03:00
parent 96cbd243d9
commit a21d2ebea2
3 changed files with 57 additions and 14 deletions

View File

@@ -257,11 +257,21 @@ show_proxy_info() {
port=$(get_config_value port "$config")
mask_host=$(get_config_value mask_host "$config")
ip=$(get_server_ip)
link=$(generate_proxy_link "$ip" "$port" "$secret")
status=$(telemt_status)
local mode
local mode domain
mode=$(config_get mode 2>/dev/null || echo "lite")
domain=$(config_get domain 2>/dev/null || echo "")
# Pro-режим: ссылка с доменом и fake-TLS секретом
if [ "$mode" = "pro" ] && [ -n "$domain" ]; then
local domain_hex faketls_secret
domain_hex=$(printf '%s' "$domain" | xxd -p | tr -d '\n')
faketls_secret="ee${secret}${domain_hex}"
link="tg://proxy?server=${domain}&port=${port}&secret=${faketls_secret}"
else
link=$(generate_proxy_link "$ip" "$port" "$secret")
fi
local status_icon status_text
case "$status" in
@@ -274,7 +284,11 @@ show_proxy_info() {
echo -e " ${BOLD}${WHITE}${status_icon} Статус прокси: ${status_text}${NC}"
echo -e " ${DIM}$(printf '─%.0s' {1..50})${NC}"
echo -e " ${WHITE}Ядро:${NC} telemt (Rust)"
echo -e " ${WHITE}IP:${NC} ${CYAN}${ip}${NC}"
if [ "$mode" = "pro" ] && [ -n "$domain" ]; then
echo -e " ${WHITE}Домен:${NC} ${CYAN}${domain}${NC}"
else
echo -e " ${WHITE}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}"