diff --git a/test/autoXRAYselfConfRUxhttp222.sh b/test/autoXRAYselfConfRUxhttp222.sh index 21eacda..72aa497 100644 --- a/test/autoXRAYselfConfRUxhttp222.sh +++ b/test/autoXRAYselfConfRUxhttp222.sh @@ -42,7 +42,6 @@ echo "✅ Записываем конфигурацию в $CONFIG_PATH для 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": { @@ -214,80 +206,6 @@ cat << 'EOF' | envsubst > "$SCRIPT_DIR/config.json" "queryStrategy": "UseIPv4" }, "inbounds": [ - { - "tag": "vsXHTTPtls", - "port": 8443, - "listen": "0.0.0.0", - "protocol": "vless", - "settings": { - "clients": [ - { - "id": "${xray_uuid_vrv}" - } - ], - "decryption": "none", - "fallbacks": [ - { - "dest": 80 - }, - { - "path": "/websocket", - "dest": 2222, - "xver": 1 - } - ] - }, - "sniffing": { - "enabled": true, - "destOverride": [ - "http", - "tls", - "quic" - ] - }, - "streamSettings": { - "network": "xhttp", - "xhttpSettings": { - "mode": "auto", - "path": "/${path_xhttp}" - }, - "security": "tls", - "tlsSettings": { - "serverName": "$DOMAIN", - "certificates": [ - { - "certificateFile": "/var/lib/xray/cert/fullchain.pem", - "keyFile": "/var/lib/xray/cert/privkey.pem" - } - ], - "alpn": [ - "h2", - "http/1.1" - ] - } - } - }, - { - "port": 2222, - "listen": "127.0.0.1", - "protocol": "vless", - "settings": { - "clients": [ - { - "id": "${xray_uuid_vrv}" - } - ], - "decryption": "none" - }, - "streamSettings": { - "network": "ws", - "security": "none", - "wsSettings": { - "acceptProxyProtocol": true, - "path": "/websocket" - } - } - }, { "tag": "vsRAWrtyXTLS", "port": 443, @@ -375,7 +293,7 @@ cat << 'EOF' | envsubst > "$SCRIPT_DIR/config.json" }, { "tag": "ShadowSocks2022", - "port": 4443, + "port": 8443, "listen": "0.0.0.0", "protocol": "shadowsocks", "settings": { @@ -391,26 +309,7 @@ cat << 'EOF' | envsubst > "$SCRIPT_DIR/config.json" "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}" - - } - ] - } } - ], "outbounds": [ { @@ -861,7 +760,7 @@ cat << 'EOF' | envsubst > "$WEB_PATH/$path_subpage.json" "settings": { "servers": [ { - "port": 4443, + "port": 8443, "method": "2022-blake3-chacha20-poly1305", "address": "$DOMAIN", "password": "${xray_sspasw_vrv}" @@ -893,16 +792,12 @@ echo -e "Готово!\n" subPageLink="https://$DOMAIN/$path_subpage.json" # Формирование ссылок -link01="vless://${xray_uuid_vrv}@$DOMAIN:8443?security=tls&type=xhttp&headerType=&path=%2F$path_xhttp&host=&mode=auto&sni=$DOMAIN&fp=chrome&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&spx=%2F#vlessXHTTPtls-autoXRAY" - -link02="vless://${xray_uuid_vrv}@$DOMAIN:8443?security=tls&type=ws&headerType=&path=%2Fwebsocket&host=&mode=auto&sni=$DOMAIN&fp=chrome&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&spx=%2F#vlessWStls-autoXRAY" - link1="vless://${xray_uuid_vrv}@$DOMAIN:443?security=reality&type=tcp&headerType=&path=&host=&flow=xtls-rprx-vision&sni=$DOMAIN&fp=chrome&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&spx=%2F#vlessRAWrealityXTLS-autoXRAY" link2="vless://${xray_uuid_vrv}@$DOMAIN:443?security=reality&type=xhttp&headerType=&path=%2F$path_xhttp&host=&mode=auto&sni=$DOMAIN&fp=chrome&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&spx=%2F#vlessXHTTPreality-autoXRAY" ENCODED_STRING=$(echo -n "2022-blake3-chacha20-poly1305:${xray_sspasw_vrv}" | base64) -link3="ss://$ENCODED_STRING@${DOMAIN}:4443#Shadowsocks2022-autoXRAY" +link3="ss://$ENCODED_STRING@${DOMAIN}:8443#Shadowsocks2022-autoXRAY" configListLink="https://$DOMAIN/$path_subpage.html" @@ -918,10 +813,6 @@ cat > "$WEB_PATH/$path_subpage.html" < $CONFIG_PATH" < "$WEB_PATH/index.html" < + + + + + $TITLE + + + + + +
+

$HEADER

+
+
+ + +
+
+ + +
+ +
+
+ + +EOF + + + +# Установка Xray +bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install + + +# Определяем директорию скрипта +#SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) +SCRIPT_DIR=/usr/local/etc/xray + +# Генерируем переменные +xray_uuid_vrv=$(xray uuid) + +key_output=$(xray x25519) +xray_privateKey_vrv=$(echo "$key_output" | awk -F': ' '/PrivateKey/ {print $2}') +xray_publicKey_vrv=$(echo "$key_output" | awk -F': ' '/Password/ {print $2}') + +key_mldsa65=$(xray mldsa65) +seed_mldsa65=$(echo "$key_mldsa65" | awk -F': ' '/Seed/ {print $2}') +verify_mldsa65=$(echo "$key_mldsa65" | awk -F': ' '/Verify/ {print $2}') + +xray_shortIds_vrv=$(openssl rand -hex 8) + +# xray_sspasw_vrv=$(openssl rand -base64 15 | tr -dc 'A-Za-z0-9' | head -c 20) +xray_sspasw_vrv=$(openssl rand -base64 32) + +path_subpage=$(openssl rand -base64 15 | tr -dc 'A-Za-z0-9' | head -c 20) + +path_xhttp=$(openssl rand -base64 15 | tr -dc 'a-z0-9' | head -c 6) + +socksUser=$(openssl rand -base64 20 | tr -dc 'A-Za-z0-9' | head -c 5) +socksPasw=$(openssl rand -base64 20 | tr -dc 'A-Za-z0-9' | head -c 10) + +# ipserv=$(hostname -I | awk '{print $1}') + + + +# Экспортируем переменные для envsubst +export xray_uuid_vrv xray_privateKey_vrv xray_publicKey_vrv xray_shortIds_vrv xray_sspasw_vrv DOMAIN path_subpage path_xhttp WEB_PATH socksUser socksPasw + +# Создаем JSON конфигурацию сервера +cat << 'EOF' | envsubst > "$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": "UseIPv4" + }, + "inbounds": [ + { + "tag": "vsXHTTPtls", + "port": 8443, + "listen": "0.0.0.0", + "protocol": "vless", + "settings": { + "clients": [ + { + "id": "${xray_uuid_vrv}" + } + ], + "decryption": "none", + "fallbacks": [ + { + "dest": 2222, + "xver": 1 + } + ] + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + }, + "streamSettings": { + "network": "xhttp", + "xhttpSettings": { + "mode": "auto", + "path": "/${path_xhttp}" + }, + "security": "tls", + "tlsSettings": { + "serverName": "$DOMAIN", + "certificates": [ + { + "certificateFile": "/var/lib/xray/cert/fullchain.pem", + "keyFile": "/var/lib/xray/cert/privkey.pem" + } + ], + "alpn": [ + "h2", + "http/1.1" + ] + } + } + }, + { + "port": 2222, + "listen": "127.0.0.1", + "protocol": "vless", + "settings": { + "clients": [ + { + "id": "${xray_uuid_vrv}" + } + ], + "decryption": "none" + }, + "streamSettings": { + "network": "ws", + "security": "none", + "wsSettings": { + "acceptProxyProtocol": true, + "path": "/websocket" + } + } + }, + { + "tag": "vsRAWrtyXTLS", + "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": 0 + } + ] + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + }, + "streamSettings": { + "network": "raw", + "security": "reality", + "realitySettings": { + "show": false, + "xver": 1, + "target": "/dev/shm/nginx.sock", + "spiderX": "/", + "shortIds": [ + "${xray_shortIds_vrv}" + ], + "privateKey": "${xray_privateKey_vrv}", + "serverNames": [ + "$DOMAIN" + ], + "limitFallbackUpload": { + "afterBytes": 0, + "bytesPerSec": 65536, + "burstBytesPerSec": 0 + }, + "limitFallbackDownload": { + "afterBytes": 5242880, + "bytesPerSec": 262144, + "burstBytesPerSec": 2097152 + } + } + } + }, + { + "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": "auto", + "path": "/${path_xhttp}" + } + } + }, + { + "tag": "ShadowSocks2022", + "port": 4443, + "listen": "0.0.0.0", + "protocol": "shadowsocks", + "settings": { + "method": "2022-blake3-chacha20-poly1305", + "password": "${xray_sspasw_vrv}", + "network": "tcp,udp" + }, + "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}" + + } + ] + } + } + + ], + "outbounds": [ + { + "tag": "direct", + "protocol": "freedom", + "settings": { + "domainStrategy": "ForceIPv4" + } + }, + { + "tag": "block", + "protocol": "blackhole" + } + ], + "routing": { + "rules": [ + { + "ip": [ + "geoip:private" + ], + "outboundTag": "block" + }, + { + "protocol": [ + "bittorrent" + ], + "outboundTag": "block" + }, + { + "domain": [ + "geosite:category-ads", + "geosite:win-spy", + "geosite:private" + ], + "outboundTag": "block" + } + ], + "domainStrategy": "IPIfNonMatch" + } +} + +EOF + +# Создаем JSON конфигурацию клиента +cat << 'EOF' | envsubst > "$WEB_PATH/$path_subpage.json" +[ +{ + "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": [ + "geosite:private", + "geosite:apple", + "geosite:apple-pki", + "geosite:huawei", + "geosite:xiaomi", + "geosite:category-android-app-download", + "geosite:f-droid", + "geosite:yandex", + "geosite:vk", + "geosite:microsoft", + "geosite:win-update", + "geosite:win-extra", + "geosite:google-play", + "geosite:steam", + "geosite:category-ru" + ], + "outboundTag": "direct" + }, + { + "ip": [ + "geoip:private" + ], + "outboundTag": "direct" + }, + { + "type": "field", + "ip": [ + "geoip:!ru" + ], + "outboundTag": "proxy" + }, + { + "domain": [ + "geosite:discord", + "geosite:youtube", + "geosite:tiktok", + "geosite:signal" + ], + "outboundTag": "proxy" + } + ] + }, + "inbounds": [ + { + "tag": "socks-in", + "protocol": "socks", + "listen": "127.0.0.1", + "port": 10808, + "settings": { + "udp": true + } + }, + { + "tag": "socks-sb", + "protocol": "socks", + "listen": "127.0.0.1", + "port": 2080, + "settings": { + "udp": true + } + }, + { + "tag": "http-in", + "protocol": "http", + "listen": "127.0.0.1", + "port": 10809 + } + ], + "outbounds": [ + { + "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": "chrome", + "serverName": "$DOMAIN", + "password": "${xray_publicKey_vrv}", + "shortId": "${xray_shortIds_vrv}", + "mldsa65Verify": "", + "spiderX": "/" + } + } + }, + { + "tag": "direct", + "protocol": "freedom" + }, + { + "tag": "block", + "protocol": "blackhole" + } + ], + "remarks": "🇧🇩 VlessRAWrealityXTLS - autoXRAY" +}, +{ + "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": [ + "geosite:private", + "geosite:apple", + "geosite:apple-pki", + "geosite:huawei", + "geosite:xiaomi", + "geosite:category-android-app-download", + "geosite:f-droid", + "geosite:yandex", + "geosite:vk", + "geosite:microsoft", + "geosite:win-update", + "geosite:win-extra", + "geosite:google-play", + "geosite:steam", + "geosite:category-ru" + ], + "outboundTag": "direct" + }, + { + "ip": [ + "geoip:private" + ], + "outboundTag": "direct" + }, + { + "type": "field", + "ip": [ + "geoip:!ru" + ], + "outboundTag": "proxy" + }, + { + "domain": [ + "geosite:discord", + "geosite:youtube", + "geosite:tiktok", + "geosite:signal" + ], + "outboundTag": "proxy" + } + ] + }, + "inbounds": [ + { + "tag": "socks-in", + "protocol": "socks", + "listen": "127.0.0.1", + "port": 10808, + "settings": { + "udp": true + } + }, + { + "tag": "socks-sb", + "protocol": "socks", + "listen": "127.0.0.1", + "port": 2080, + "settings": { + "udp": true + } + }, + { + "tag": "http-in", + "protocol": "http", + "listen": "127.0.0.1", + "port": 10809 + } + ], + "outbounds": [ + { + "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", + "xhttpSettings": { + "mode": "auto", + "path": "/${path_xhttp}" + }, + "security": "reality", + "realitySettings": { + "show": false, + "fingerprint": "chrome", + "serverName": "$DOMAIN", + "password": "${xray_publicKey_vrv}", + "shortId": "${xray_shortIds_vrv}", + "mldsa65Verify": "", + "spiderX": "/" + } + } + }, + { + "tag": "direct", + "protocol": "freedom" + }, + { + "tag": "block", + "protocol": "blackhole" + } + ], + "remarks": "🇧🇩 vlessXHTTPreality - autoXRAY" +}, +{ + "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": [ + "geosite:private", + "geosite:apple", + "geosite:apple-pki", + "geosite:huawei", + "geosite:xiaomi", + "geosite:category-android-app-download", + "geosite:f-droid", + "geosite:yandex", + "geosite:vk", + "geosite:microsoft", + "geosite:win-update", + "geosite:win-extra", + "geosite:google-play", + "geosite:steam", + "geosite:category-ru" + ], + "outboundTag": "direct" + }, + { + "ip": [ + "geoip:private" + ], + "outboundTag": "direct" + }, + { + "type": "field", + "ip": [ + "geoip:!ru" + ], + "outboundTag": "proxy" + }, + { + "domain": [ + "geosite:discord", + "geosite:youtube", + "geosite:tiktok", + "geosite:signal" + ], + "outboundTag": "proxy" + } + ] + }, + "inbounds": [ + { + "tag": "socks-in", + "protocol": "socks", + "listen": "127.0.0.1", + "port": 10808, + "settings": { + "udp": true + } + }, + { + "tag": "socks-sb", + "protocol": "socks", + "listen": "127.0.0.1", + "port": 2080, + "settings": { + "udp": true + } + }, + { + "tag": "http-in", + "protocol": "http", + "listen": "127.0.0.1", + "port": 10809 + } + ], + "outbounds": [ + { + "mux": { + "concurrency": -1, + "enabled": false + }, + "tag": "proxy", + "protocol": "shadowsocks", + "settings": { + "servers": [ + { + "port": 4443, + "method": "2022-blake3-chacha20-poly1305", + "address": "$DOMAIN", + "password": "${xray_sspasw_vrv}" + } + ] + } + }, + { + "tag": "direct", + "protocol": "freedom" + }, + { + "tag": "block", + "protocol": "blackhole" + } + ], + "remarks": "🇧🇩 ShadowS2022blake3 - autoXRAY" +} +] + +EOF + +# Перезапуск Xray +echo "Перезапуск Xray..." +systemctl restart xray +echo -e "Готово!\n" + +# Формирование ссылок +subPageLink="https://$DOMAIN/$path_subpage.json" + +# Формирование ссылок +link01="vless://${xray_uuid_vrv}@$DOMAIN:8443?security=tls&type=xhttp&headerType=&path=%2F$path_xhttp&host=&mode=auto&sni=$DOMAIN&fp=chrome&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&spx=%2F#vlessXHTTPtls-autoXRAY" + +link02="vless://${xray_uuid_vrv}@$DOMAIN:8443?security=tls&type=ws&headerType=&path=%2Fwebsocket&host=&mode=auto&sni=$DOMAIN&fp=chrome&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&spx=%2F#vlessWStls-autoXRAY" + +link1="vless://${xray_uuid_vrv}@$DOMAIN:443?security=reality&type=tcp&headerType=&path=&host=&flow=xtls-rprx-vision&sni=$DOMAIN&fp=chrome&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&spx=%2F#vlessRAWrealityXTLS-autoXRAY" + +link2="vless://${xray_uuid_vrv}@$DOMAIN:443?security=reality&type=xhttp&headerType=&path=%2F$path_xhttp&host=&mode=auto&sni=$DOMAIN&fp=chrome&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&spx=%2F#vlessXHTTPreality-autoXRAY" + +ENCODED_STRING=$(echo -n "2022-blake3-chacha20-poly1305:${xray_sspasw_vrv}" | base64) +link3="ss://$ENCODED_STRING@${DOMAIN}:4443#Shadowsocks2022-autoXRAY" + +configListLink="https://$DOMAIN/$path_subpage.html" + +# Создаем html файл с конфигами +cat > "$WEB_PATH/$path_subpage.html" <AutoXRAY configs + +

🚀 VLESS RAW Reality xtls-rprx-vision

$link1
+

🛸 VLESS XHTTP Reality - конфиг для роутера

$link2
+

🛡️ Shadowsocks2022blake3 - новый и быстрый

$link3

+📂 Ссылка на подписку (готовый конфиг клиента с роутингом)

$subPageLink

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

+

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

+EOF + +echo -e " +Тестовый TLS5: +$link01 + +$link02 + +Ваш конфиг vless RAW reality XTLS: +$link1 + +Ваш конфиг vless XHTTP reality: +$link2 + +Ваш конфиг Shadowsocks 2022-blake3-chacha20-poly1305: +$link3 + +Ваша страничка подписки: +\033[32m$subPageLink\033[0m + +Ссылка на сохраненые конфиги: +\033[32m$configListLink\033[0m + +Скопируйте подписку в специализированное приложение: +- iOS: Happ или v2RayTun или v2rayN +- Android: Happ или v2RayTun или v2rayNG +- Windows: конфиги Happ или winLoadXRAY или v2rayN + для vless v2RayTun или Throne + +Открыт локальный socks5 на порту 10808, 2080 и http на 10809. + +Поддержать автора: https://github.com/xVRVx/autoXRAY +"