#!/bin/bash # Цвета для вывода GRN='\033[1;32m' RED='\033[1;31m' YEL='\033[1;33m' NC='\033[0m' # No Color [[ $EUID -eq 0 ]] || { echo -e "${RED}❌ скрипту нужны root права ${NC}"; exit 1; } DOMAIN=$1 if [ -z "$DOMAIN" ]; then echo -e "${RED}❌ Ошибка: домен не задан.${NC}" exit 1 fi echo -e "${YEL}Обновление и установка необходимых пакетов...${NC}" apt-get update && apt-get install curl jq dnsutils openssl nginx certbot wget tar -y systemctl enable --now nginx LOCAL_IP=$(hostname -I | awk '{print $1}') DNS_IP=$(dig +short "$DOMAIN" | grep '^[0-9]') if [ "$LOCAL_IP" != "$DNS_IP" ]; then echo -e "${RED}❌ Внимание: IP-адрес ($LOCAL_IP) не совпадает с A-записью $DOMAIN ($DNS_IP).${NC}" echo -e "${YEL}Правильно укажите одну A-запись для вашего домена в ДНС - $LOCAL_IP ${NC}" read -p "Продолжить на ваш страх и риск? (y/N):" choice if [[ ! "$choice" =~ ^[Yy]$ ]]; then echo -e "${RED}Выполнение скрипта прервано.${NC}" exit 1 fi echo -e "${YEL}Продолжение выполнения скрипта...${NC}" fi # === ВОПРОСЫ ПОЛЬЗОВАТЕЛЮ === read -p "$(echo -e "\n${YEL}Устанавливать WARP для обхода блокировок некоторых сайтов? (y/n, по умолчанию y): ${NC}")" choice_warp choice_warp=${choice_warp:-y} if [[ "$choice_warp" =~ ^[Yy]$ ]]; then TAG_WARP="warp" INSTALL_WARP=true else TAG_WARP="direct" INSTALL_WARP=false fi read -p "$(echo -e "\n${YEL}Устанавливать MTProxy для Telegram? (y/n, по умолчанию y): ${NC}")" choice_mtp choice_mtp=${choice_mtp:-y} if [[ "$choice_mtp" =~ ^[Yy]$ ]]; then TARGET_MTP="127.0.0.1:500" INSTALL_MTP=true else TARGET_MTP="/dev/shm/nginx.sock" INSTALL_MTP=false fi echo -e "\n${YEL}Выберите TLS fingerprint для маскировки трафика:${NC}" echo "1) chrome 3) safari 5) android 7) 360" echo "2) firefox 4) ios 6) edge 8) qq" read -p "Введите номер [1-8] (по умолчанию 2 - firefox): " fp_choice case $fp_choice in 1) fpBro="chrome" ;; 2) fpBro="firefox" ;; 3) fpBro="safari" ;; 4) fpBro="ios" ;; 5) fpBro="android" ;; 6) fpBro="edge" ;; 7) fpBro="360" ;; 8) fpBro="qq" ;; *) fpBro="firefox" ;; esac # ============================ # Включаем BBR bbr=$(sysctl -a | grep net.ipv4.tcp_congestion_control) if [ "$bbr" = "net.ipv4.tcp_congestion_control = bbr" ]; then echo -e "${GRN}BBR уже запущен${NC}" else echo "net.core.default_qdisc=fq" > /etc/sysctl.d/999-autoXRAY.conf echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.d/999-autoXRAY.conf sysctl --system echo -e "${GRN}BBR активирован${NC}" fi cat < /etc/security/limits.d/99-autoXRAY.conf * soft nofile 1048576 * hard nofile 1048576 root soft nofile 1048576 root hard nofile 1048576 EOF ulimit -n 65535 echo -e "${GRN}Лимиты применены. Текущий ulimit -n: $(ulimit -n) ${NC}" # Создание директории сайта WEB_PATH="/var/www/$DOMAIN" mkdir -p "$WEB_PATH" # Генерируем сайт маскировку bash -c "$(curl -L https://github.com/xVRVx/autoXRAY/raw/refs/heads/main/test/gen_page2.sh)" -- $WEB_PATH # Установка Xray bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install # Блок CERTBOT - START # Определяем путь к конфигу nginx if [ -f /etc/nginx/sites-available/default ]; then CONFIG_PATH="/etc/nginx/sites-available/default" echo -e "${GRN}Обнаружена стандартная сборка nginx. ${NC}" elif [ -f /etc/nginx/conf.d/default.conf ]; then CONFIG_PATH="/etc/nginx/conf.d/default.conf" echo -e "${YEL}Обнаружена нестандартная сборка nginx. Предварительная настройка NGINX для CERTBOT ${NC}" mkdir -p /var/www/html # Записываем временный конфиг cat < "$CONFIG_PATH" server { listen 80 default_server; server_name _; location /.well-known/acme-challenge/ { root /var/www/html; allow all; } location / { return 301 https://\$host\$request_uri; } } EOF systemctl reload nginx else echo -e "${RED}Не найден ни один default конфиг nginx${NC}" exit 1 fi mkdir -p /var/lib/xray/cert/ ### Проверить cp /etc/letsencrypt/live/$DOMAIN/fullchain.pem /var/lib/xray/cert/fullchain.pem cp /etc/letsencrypt/live/$DOMAIN/privkey.pem /var/lib/xray/cert/privkey.pem chmod 744 /var/lib/xray/cert/privkey.pem chmod 744 /var/lib/xray/cert/fullchain.pem certbot certonly --webroot -w /var/www/html \ -d $DOMAIN \ -m mail@$DOMAIN \ --agree-tos --non-interactive \ --deploy-hook "systemctl reload nginx; cp /etc/letsencrypt/live/$DOMAIN/fullchain.pem /var/lib/xray/cert/fullchain.pem; cp /etc/letsencrypt/live/$DOMAIN/privkey.pem /var/lib/xray/cert/privkey.pem; chmod 744 /var/lib/xray/cert/privkey.pem; chmod 744 /var/lib/xray/cert/fullchain.pem; systemctl restart xray" RET=$? if [ $RET -eq 0 ]; then echo -e "\n${GRN}========================================" echo "✅ Команда certbot успешно выполнена" echo "✅ Сертификат https от letsencrypt ПОЛУЧЕН" echo "========================================" echo -e "${NC}" else echo -e "\n${RED}========================================" echo "❌ CERTBOT ЗАВЕРШИЛСЯ С ОШИБКОЙ" echo "❌ Сертификат https от letsencrypt НЕ ПОЛУЧЕН!" echo "❌ Смотрите выше логи процесса получения сертификата" echo "❌ Код возврата: $RET" echo "========================================" echo -e "${NC}" exit 1 fi # Блок CERTBOT - END # конфиг nginx path_xhttp=$(openssl rand -base64 15 | tr -dc 'a-z0-9' | head -c 6) path_subpage=$(openssl rand -base64 15 | tr -dc 'A-Za-z0-9' | head -c 20) bash -c "cat > $CONFIG_PATH" < "$SCRIPT_DIR/config.json" { "log": { "dnsLog": false, "access": "/var/log/xray/access.log", "error": "/var/log/xray/error.log", "loglevel": "none" }, "dns": { "servers": [ "https+local://8.8.4.4/dns-query", "https+local://8.8.8.8/dns-query", "https+local://1.1.1.1/dns-query", "localhost" ], "queryStrategy": "UseIP" }, "inbounds": [ { "tag": "vsRAWrtyVISION", "port": 443, "listen": "0.0.0.0", "protocol": "vless", "settings": { "clients": [ { "flow": "xtls-rprx-vision", "id": "${xray_uuid_vrv}" } ], "decryption": "none", "fallbacks": [ { "dest": "3333", "xver": 2 } ] }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls", "quic" ] }, "streamSettings": { "network": "raw", "security": "reality", "sockopt": { "acceptProxyProtocol": false }, "realitySettings": { "show": false, "xver": 2, "target": "${TARGET_MTP}", "spiderX": "/", "shortIds": [ "${xray_shortIds_vrv}" ], "privateKey": "${xray_privateKey_vrv}", "serverNames": [ "$DOMAIN" ] } } }, { "tag": "vsXHTTPrty", "port": 3333, "listen": "127.0.0.1", "protocol": "vless", "settings": { "clients": [ { "id": "${xray_uuid_vrv}" } ], "decryption": "none" }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls", "quic" ] }, "streamSettings": { "network": "xhttp", "xhttpSettings": { "mode": "stream-one", "path": "/${path_xhttp}" }, "security": "none", "sockopt": { "acceptProxyProtocol": true } } }, { "tag": "vsRAWtlsVISION", "port": 8443, "listen": "0.0.0.0", "protocol": "vless", "settings": { "clients": [ { "flow": "xtls-rprx-vision", "id": "${xray_uuid_vrv}" } ], "decryption": "none", "fallbacks": [ { "path": "/${path_xhttp}22", "dest": "@vless-ws", "xver": 2 }, { "path": "/ssws", "dest": "4001" }, { "alpn": "h2", "dest": "/dev/shm/nginx_h2.sock", "xver": 2 }, { "dest": "/dev/shm/nginxTLS.sock", "xver": 2 } ] }, "streamSettings": { "network": "raw", "security": "tls", "tlsSettings": { "certificates": [ { "certificateFile": "/var/lib/xray/cert/fullchain.pem", "keyFile": "/var/lib/xray/cert/privkey.pem" } ], "minVersion": "1.2", "cipherSuites": "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "alpn": [ "h2", "http/1.1" ] } }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls", "quic" ] } }, { "tag": "vsXHTTPtls", "port": 8400, "listen": "127.0.0.1", "protocol": "vless", "settings": { "clients": [ { "id": "${xray_uuid_vrv}" } ], "decryption": "none" }, "streamSettings": { "network": "xhttp", "xhttpSettings": { "mode": "auto", "path": "/${path_xhttp}" }, "security": "none", "sockopt": { "acceptProxyProtocol": false } }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls", "quic" ] } }, { "tag": "vsGRPCtls", "port": 8411, "listen": "127.0.0.1", "protocol": "vless", "settings": { "clients": [ { "id": "${xray_uuid_vrv}" } ], "decryption": "none" }, "streamSettings": { "network": "grpc", "grpcSettings": { "serviceName": "${path_xhttp}11" }, "security": "none" }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls", "quic" ] } }, { "listen": "@vless-ws", "protocol": "vless", "settings": { "clients": [ { "id": "${xray_uuid_vrv}" } ], "decryption": "none" }, "streamSettings": { "network": "ws", "wsSettings": { "acceptProxyProtocol": true, "path": "/${path_xhttp}22" }, "security": "none" }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls", "quic" ] } }, { "tag": "socks5", "port": 10443, "listen": "0.0.0.0", "protocol": "mixed", "settings": { "ip": "0.0.0.0", "udp": true, "auth": "password", "accounts": [ { "user": "${socksUser}", "pass": "${socksPasw}" } ] } }, { "tag": "Hysteria2", "listen": "0.0.0.0", "port": 8080, "protocol": "hysteria", "settings": { "version": 2, "clients": [ { "auth": "${xray_shortIds_vrv}" } ] }, "streamSettings": { "network": "hysteria", "security": "tls", "tlsSettings": { "serverName": "$DOMAIN", "alpn": [ "h3" ], "certificates": [ { "usage": "encipherment", "certificateFile": "/var/lib/xray/cert/fullchain.pem", "keyFile": "/var/lib/xray/cert/privkey.pem" } ] }, "hysteriaSettings": { "version": 2, "auth": "${xray_shortIds_vrv}" }, "finalmask": { "quicParams": { "congestion": "brutal", "brutalUp": "100 mbps", "brutalDown": "100 mbps" } } } } ], "outbounds": [ { "tag": "direct", "protocol": "freedom", "settings": { "domainStrategy": "ForceIPv4" } }, { "tag": "block", "protocol": "blackhole" }, { "tag": "warp", "protocol": "socks", "settings": { "servers": [ { "address": "127.0.0.1", "port": 40000 } ] }, "targetStrategy": "ForceIPv4v6" } ], "routing": { "rules": [ { "ip": [ "geoip:private" ], "outboundTag": "block" }, { "port": "25", "outboundTag": "block" }, { "protocol": [ "bittorrent" ], "outboundTag": "block" }, { "domain": [ "geosite:category-ads", "geosite:win-spy", "geosite:private" ], "outboundTag": "block" }, { "outboundTag": "${TAG_WARP}", "domain": ["ifconfig.me","checkip.amazonaws.com","pify.org","2ip.io","habr.com","geosite:category-ip-geo-detect","geosite:canva"] } ], "domainStrategy": "IPIfNonMatch" } } EOF # Создаем JSON конфигурацию клиента print_config() { local PROXY_OUTBOUND="$1" local REMARK="$2" cat << TPL { "log": { "loglevel": "warning" }, "dns": { "servers": [ "https://8.8.4.4/dns-query", "https://8.8.8.8/dns-query", "https://1.1.1.1/dns-query" ], "queryStrategy": "UseIPv4" }, "routing": { "domainStrategy": "IPIfNonMatch", "rules": [ { "domain": [ "geosite:category-ads", "geosite:win-spy" ], "outboundTag": "block" }, { "protocol": [ "bittorrent" ], "outboundTag": "direct" }, { "domain": [ "habr.com", "apkmirror.com" ], "outboundTag": "proxy" }, { "domain": [ "geosite:private", "ifconfig.me", "checkip.amazonaws.com", "pify.org", "geosite:category-ip-geo-detect", "geosite:apple", "geosite:apple-pki", "geosite:f-droid", "geosite:yandex", "geosite:vk", "geosite:category-ru" ], "outboundTag": "direct" }, { "ip": [ "geoip:private" ], "outboundTag": "direct" } ] }, "inbounds": [ { "tag": "socks-in", "protocol": "socks", "listen": "127.0.0.1", "port": 10808, "settings": { "udp": true }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls", "quic" ] } }, { "tag": "socks-sb", "protocol": "socks", "listen": "127.0.0.1", "port": 2080, "settings": { "udp": true }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls", "quic" ] } }, { "tag": "http-in", "protocol": "http", "listen": "127.0.0.1", "port": 10809, "sniffing": { "enabled": true, "destOverride": [ "http", "tls", "quic" ] } } ], "outbounds": [ $PROXY_OUTBOUND, { "tag": "direct", "protocol": "freedom" }, { "tag": "block", "protocol": "blackhole" } ], "remarks": "$REMARK" } TPL } # --- Config 1 OUT_REALITY_VISION='{ "mux": { "concurrency": -1, "enabled": false }, "tag": "proxy", "protocol": "vless", "settings": { "vnext": [{ "address": "$DOMAIN", "port": 443, "users": [{ "id": "${xray_uuid_vrv}", "flow": "xtls-rprx-vision", "encryption": "none" }] }] }, "streamSettings": { "network": "raw", "security": "reality", "realitySettings": { "show": false, "fingerprint": "$fpBro", "serverName": "$DOMAIN", "password": "${xray_publicKey_vrv}", "shortId": "${xray_shortIds_vrv}", "spiderX": "/" } } }' # --- Config 2 OUT_REALITY_XHTTP='{ "mux": { "concurrency": -1, "enabled": false }, "tag": "proxy", "protocol": "vless", "settings": { "vnext": [{ "address": "$DOMAIN", "port": 443, "users": [{ "id": "${xray_uuid_vrv}", "encryption": "none" }] }] }, "streamSettings": { "network": "xhttp", "security": "reality", "xhttpSettings": { "mode": "stream-one", "path": "/${path_xhttp}", "extra": { "noGRPCHeader": false, "scMaxEachPostBytes": 1500000, "scMinPostsIntervalMs": 20, "scStreamUpServerSecs": "60-240", "xPaddingBytes": "400-800", "xmux": { "cMaxReuseTimes": "1000-3000", "hKeepAlivePeriod": 0, "hMaxRequestTimes": "400-700", "hMaxReusableSecs": "1200-1800", "maxConcurrency": "3-5", "maxConnections": 0 } } }, "realitySettings": { "show": false, "fingerprint": "$fpBro", "serverName": "$DOMAIN", "password": "${xray_publicKey_vrv}", "shortId": "${xray_shortIds_vrv}", "spiderX": "/" } } }' # --- Config 3 OUT_VISION='{ "tag": "proxy", "protocol": "vless", "settings": { "vnext": [{ "address": "$DOMAIN", "port": 8443, "users": [{ "id": "${xray_uuid_vrv}", "flow": "xtls-rprx-vision", "encryption": "none" }] }] }, "streamSettings": { "network": "raw", "security": "tls", "tlsSettings": { "serverName": "$DOMAIN", "fingerprint": "$fpBro" } } }' # --- Config 4 OUT_XHTTP='{ "tag": "proxy", "protocol": "vless", "settings": { "vnext": [{ "address": "$DOMAIN", "port": 8443, "users": [{ "id": "${xray_uuid_vrv}", "encryption": "none" }] }] }, "streamSettings": { "network": "xhttp", "xhttpSettings": { "extra": { "headers": { }, "noGRPCHeader": false, "scMaxEachPostBytes": 1500000, "scMinPostsIntervalMs": 20, "scStreamUpServerSecs": "60-240", "xPaddingBytes": "400-800", "xmux": { "cMaxReuseTimes": "1000-3000", "hKeepAlivePeriod": 0, "hMaxRequestTimes": "400-700", "hMaxReusableSecs": "1200-1800", "maxConcurrency": "3-5", "maxConnections": 0 } }, "mode": "auto", "path": "/${path_xhttp}" }, "security": "tls", "tlsSettings": { "serverName": "$DOMAIN", "fingerprint": "$fpBro" } } }' # --- Config 5 # Важно: alpn h2 обязателен для корректной работы через Nginx OUT_GRPC='{ "tag": "proxy", "protocol": "vless", "settings": { "vnext": [{ "address": "$DOMAIN", "port": 8443, "users": [{ "id": "${xray_uuid_vrv}", "encryption": "none" }] }] }, "streamSettings": { "network": "grpc", "grpcSettings": { "serviceName": "${path_xhttp}11", "multiMode": false }, "security": "tls", "tlsSettings": { "serverName": "$DOMAIN", "alpn": ["h2"], "fingerprint": "$fpBro" } } }' # --- Config 6 OUT_WS='{ "tag": "proxy", "protocol": "vless", "settings": { "vnext": [{ "address": "$DOMAIN", "port": 8443, "users": [{ "id": "${xray_uuid_vrv}", "encryption": "none" }] }] }, "streamSettings": { "network": "ws", "wsSettings": { "path": "/${path_xhttp}22" }, "security": "tls", "tlsSettings": { "serverName": "$DOMAIN", "fingerprint": "$fpBro" } } }' # --- Config 7 HYSTERIA2='{ "tag": "proxy", "protocol": "hysteria", "settings": { "address": "$DOMAIN", "port": 8080, "version": 2 }, "streamSettings": { "network": "hysteria", "security": "tls", "tlsSettings": { "serverName": "$DOMAIN", "alpn": [ "h3" ] }, "fingerprint": "$fpBro", "hysteriaSettings": { "version": 2, "auth": "${xray_shortIds_vrv}" }, "finalmask": { "quicParams": { "congestion": "brutal", "brutalUp": "100 mbps", "brutalDown": "100 mbps" } } } }' ( echo "[" print_config "$OUT_REALITY_XHTTP" "🇪🇺 VLESS XHTTP REALITY EXTRA" echo "," print_config "$OUT_REALITY_VISION" "🇪🇺 VLESS RAW REALITY VISION" echo "," print_config "$HYSTERIA2" "🇪🇺 HYSTERIA2" echo "," print_config "$OUT_VISION" "🇪🇺 VLESS RAW TLS VISION" echo "," print_config "$OUT_XHTTP" "🇪🇺 VLESS XHTTP TLS EXTRA" echo "," print_config "$OUT_GRPC" "🇪🇺 VLESS gRPC TLS" echo "," print_config "$OUT_WS" "🇪🇺 VLESS WS TLS" echo "]" ) | envsubst > "$WEB_PATH/$path_subpage.json" systemctl restart xray echo -e "Перезапуск XRAY" # Формирование ссылок subPageLink="https://$DOMAIN/$path_subpage.json" # Формирование ссылок hy2="hy2://${xray_shortIds_vrv}@$DOMAIN:8080/?sni=$DOMAIN&alpn=h3" linkRTY1="vless://${xray_uuid_vrv}@$DOMAIN:443?security=reality&type=tcp&headerType=&path=&host=&flow=xtls-rprx-vision&sni=$DOMAIN&fp=$fpBro&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&spx=%2F#vlessRAWrealityVISION-autoXRAY" linkRTY2="vless://${xray_uuid_vrv}@$DOMAIN:443?security=reality&type=xhttp&headerType=&path=%2F$path_xhttp&host=&mode=stream-one&extra=%7B%22xmux%22%3A%7B%22cMaxReuseTimes%22%3A%221000-3000%22%2C%22maxConcurrency%22%3A%223-5%22%2C%22maxConnections%22%3A0%2C%22hKeepAlivePeriod%22%3A0%2C%22hMaxRequestTimes%22%3A%22400-700%22%2C%22hMaxReusableSecs%22%3A%221200-1800%22%7D%2C%22headers%22%3A%7B%7D%2C%22noGRPCHeader%22%3Afalse%2C%22xPaddingBytes%22%3A%22400-800%22%2C%22scMaxEachPostBytes%22%3A1500000%2C%22scMinPostsIntervalMs%22%3A20%2C%22scStreamUpServerSecs%22%3A%2260-240%22%7D&sni=$DOMAIN&fp=$fpBro&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&spx=%2F#vlessXHTTPrealityEXTRA-autoXRAY" linkTLS1="vless://${xray_uuid_vrv}@$DOMAIN:8443?security=tls&type=tcp&headerType=&path=&host=&flow=xtls-rprx-vision&sni=$DOMAIN&fp=$fpBro&spx=%2F#vlessRAWtlsVision-autoXRAY" linkTLS2="vless://${xray_uuid_vrv}@$DOMAIN:8443?security=tls&type=xhttp&headerType=&path=%2F${path_xhttp}&host=&mode=auto&extra=%7B%22xmux%22%3A%7B%22cMaxReuseTimes%22%3A%221000-3000%22%2C%22maxConcurrency%22%3A%223-5%22%2C%22maxConnections%22%3A0%2C%22hKeepAlivePeriod%22%3A0%2C%22hMaxRequestTimes%22%3A%22400-700%22%2C%22hMaxReusableSecs%22%3A%221200-1800%22%7D%2C%22headers%22%3A%7B%7D%2C%22noGRPCHeader%22%3Afalse%2C%22xPaddingBytes%22%3A%22400-800%22%2C%22scMaxEachPostBytes%22%3A1500000%2C%22scMinPostsIntervalMs%22%3A20%2C%22scStreamUpServerSecs%22%3A%2260-240%22%7D&sni=$DOMAIN&fp=$fpBro&spx=%2F#vlessXHTTPtls-autoXRAY" linkTLS3="vless://${xray_uuid_vrv}@$DOMAIN:8443?security=tls&type=ws&headerType=&path=%2F${path_xhttp}22&host=&sni=$DOMAIN&fp=$fpBro&spx=%2F#vlessWStls-autoXRAY" linkTLS4="vless://${xray_uuid_vrv}@$DOMAIN:8443?security=tls&type=grpc&headerType=&serviceName=${path_xhttp}11&host=&sni=$DOMAIN&fp=$fpBro&spx=%2F#vlessGRPCtls-autoXRAY" configListLink="https://$DOMAIN/$path_subpage.html" CONFIGS_ARRAY=( "VLESS XHTTP REALITY EXTRA (для моста)|$linkRTY2" "VLESS RAW REALITY VISION|$linkRTY1" "HYSTERIA2|$hy2" "VLESS RAW TLS VISION|$linkTLS1" "VLESS XHTTP TLS EXTRA|$linkTLS2" "VLESS WS TLS|$linkTLS3" "VLESS GRPC TLS|$linkTLS4" ) ALL_LINKS_TEXT="" if [ "$INSTALL_MTP" = true ]; then echo -e "\n\n${GRN}Устанавливаем MTProto FakeTLS ${NC}" source <(curl -sL https://github.com/xVRVx/autoXRAY/raw/refs/heads/main/test/telemt-test.sh) else echo -e "\n\n${YEL}Установка MTProto FakeTLS пропущена.${NC}" MTProto="" fi # --- ЗАПИСЬ HEAD (СТАТИКА, МИНИФИЦИРОВАННЫЕ СТИЛИ И JS) --- cat > "$WEB_PATH/$path_subpage.html" <<'EOF' autoXRAY configs EOF # --- ЗАПИСЬ BODY (ДИНАМИЧЕСКИЕ ДАННЫЕ) --- cat >> "$WEB_PATH/$path_subpage.html" <📂 Ссылка на подписку (готовый конфиг клиента с роутингом)
Subscription

📱 Приложение HAPP (Windows/Android/iOS/MAC/Linux)

Маршрутизацию нужно выключить, она тут встроенная. По умолчанию она выключена - включается, если вы пользовались сторонними сервисами.

➡️ Конфиги

EOF # Цикл генерации строк конфигов idx=1 for item in "${CONFIGS_ARRAY[@]}"; do title="${item%%|*}" link="${item#*|}" if [ -z "$ALL_LINKS_TEXT" ]; then ALL_LINKS_TEXT="$link"; else ALL_LINKS_TEXT="$ALL_LINKS_TEXT
$link"; fi cat >> "$WEB_PATH/$path_subpage.html" <
$title
$link
EOF ((idx++)) done SOCKS5_url_tg="tg://socks?server=$DOMAIN&port=10443&user=${socksUser}&pass=${socksPasw}" SOCKS5_url="${socksUser}:${socksPasw}@$DOMAIN:10443" # Добавляем socks5 блок cat >> "$WEB_PATH/$path_subpage.html" <
socks5 WARNING
${SOCKS5_url}
EOF # Добавляем MTProxy блок только если он установлен if [ "$INSTALL_MTP" = true ]; then cat >> "$WEB_PATH/$path_subpage.html" <
MTProtoFakeTLS (TG)
${MTProto}
✈️ Add to TG EOF fi # Дописываем конец страницы cat >> "$WEB_PATH/$path_subpage.html" <💠 Все конфиги вместе
$ALL_LINKS_TEXT
EOF # --- ФИНАЛЬНАЯ ПРОВЕРКА --- echo -e "\n${YEL}=== Финальная проверка статусов ===${NC}" # Проверка WARP-cli (Socks5 порт 40000) if [ "$INSTALL_WARP" = true ]; then if ss -nlt | grep -q ":40000\b"; then echo -e "WARP-cli: ${GRN}LISTENING${NC}" else echo -e "WARP-cli: ${RED}NOT LISTENING${NC}" echo "Возникла ошибка! Возможные пути решения проблемы смотрите здесь:" echo "https://github.com/xVRVx/autoXRAY/blob/main/test/warp-readme.md" fi fi # Проверка Telemt if [ "$INSTALL_MTP" = true ]; then if systemctl is-active --quiet telemt; then echo -e "Telemt: ${GRN}RUNNING${NC}"; else echo -e "Telemt: ${RED}STOPPED/ERROR${NC}"; fi fi # Проверка Nginx if systemctl is-active --quiet nginx; then echo -e "Nginx: ${GRN}RUNNING${NC}" else echo -e "Nginx: ${RED}STOPPED/ERROR${NC}" fi # Проверка XRAY if systemctl is-active --quiet xray; then echo -e "XRAY: ${GRN}RUNNING${NC}" else echo -e "XRAY: ${RED}STOPPED/ERROR${NC}" fi echo -e "\n" if [ "$INSTALL_MTP" = true ]; then echo -e "${YEL}MTProto FakeTLS для ТГ${NC}\n$MTProto\n" fi echo -e "${YEL}VLESS XHTTP REALITY EXTRA (для моста) ${NC} $linkRTY2 ${YEL}VLESS RAW REALITY VISION ${NC} $linkRTY1 ${YEL}VLESS XHTTP TLS EXTRA ${NC} $linkTLS2 ${YEL}Ваша json страничка подписки ${NC} $subPageLink ${YEL}Ссылка на сохраненные конфиги ${NC} ${GRN}$configListLink ${NC} Скопируйте подписку в специализированное приложение: - iOS: Happ или v2RayTun или v2rayN - Android: Happ или v2RayTun или v2rayNG - Windows: конфиги Happ или winLoadXRAY или v2rayN для vless v2RayTun или Throne Открыт локальный socks5 на порту 10808, 2080 и http на 10809. ${GRN}Поддержать автора: https://github.com/xVRVx/autoXRAY ${NC} "