From 2d8b61b53ca391d9d15d5f203412bf4f40e8c46a Mon Sep 17 00:00:00 2001 From: paniy Date: Tue, 9 Mar 2021 14:12:35 +0800 Subject: [PATCH] Fix BUGs --- README.md | 6 ++---- install.sh | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6ac39a6..4ed5586 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ ### 使用说明 * 可以直接输入命令:`idleleo` 管理脚本。 -* 减少直接访问,隐藏代理域名,302 跳转至 https://www.idleleo.com/helloworld(了解配置过程可自行修改)。 +* 减少直接访问,隐藏代理域名 +* 访问域名 302 跳转至 https://www.idleleo.com/helloworld (了解配置过程可自行修改)。 * 阻止 HTTP 接访问服务器 IP ,更安全。 * 使用来自 [@DuckSoft](https://github.com/DuckSoft) 的分享链接[提案](https://github.com/XTLS/Xray-core/issues/91) (beta),支持Qv2ray、V2rayN、V2rayNG。 * 使用来自 [XTLS](https://github.com/XTLS/Xray-core/issues/158) 项目的提案,遵循 [UUIDv5](https://tools.ietf.org/html/rfc4122#section-4.3) 标准,可以将自定义字符串映射至 VLESS UUID 。 @@ -37,9 +38,6 @@ wget -N --no-check-certificate -q -O install.sh "https://raw.githubusercontent.c * 分享链接为实验版本,不排除未来变动的可能,请自行确认客户端是否支持。 * 自定义字符串映射至 UUID 需要客户端支持。 -### 更新日志 -> 更新内容请查看 CHANGELOG.md。 - ### 鸣谢 * ~~本脚本的另一个分支版本(Use Host)地址: https://github.com/dylanbai8/V2Ray_ws-tls_Website_onekey 请根据需求进行选择~~ 该作者可能已停止维护 * 本脚本中 MTProxy-go TLS 版本项目引用 https://github.com/whunt1/onekeymakemtg 在此感谢 whunt1 diff --git a/install.sh b/install.sh index e39cbb7..c2ca689 100644 --- a/install.sh +++ b/install.sh @@ -31,7 +31,7 @@ Error="${Red}[错误]${Font}" Warning="${Red}[警告]${Font}" # 版本 -shell_version="1.4.0.0" +shell_version="1.4.0.2" shell_mode="None" version_cmp="/tmp/version_cmp.tmp" xray_conf_dir="/usr/local/etc/xray" @@ -291,6 +291,7 @@ UUID_set() { #[ -z "$UUID" ] && UUID=$(cat /proc/sys/kernel/random/uuid) echo -e "${OK} ${GreenBG} UUID:${UUID} ${Font}" ;; + esac fi } @@ -328,16 +329,16 @@ modify_inbound_port() { if [[ "$shell_mode" != "xtls" ]]; then PORT=$((RANDOM + 10000)) # sed -i "/\"port\"/c \ \"port\":${PORT}," ${xray_conf} - sed -i "8c\\\t\\t\"port\":${PORT}," ${xray_conf} + sed -i "8c\ \"port\":${PORT}," ${xray_conf} else # sed -i "/\"port\"/c \ \"port\":${port}," ${xray_conf} - sed -i "8c\\\t\\t\"port\":${port}," ${xray_conf} + sed -i "8c\ \"port\":${port}," ${xray_conf} fi judge "Xray inbound_port 修改" } modify_UUID() { - sed -i "/\"id\"/c \\\t\\t\\t\\t\"id\":\"${UUID}\"," ${xray_conf} + sed -i "/\"id\"/c \ \"id\":\"${UUID}\"," ${xray_conf} judge "Xray UUID 修改" [ -f ${xray_qr_config_file} ] && sed -i "/\"id\"/c \\ \"id\": \"${UUID}\"," ${xray_qr_config_file} [ -f ${xray_qr_config_file} ] && sed -i "/\"idc\"/c \\ \"idc\": \"${UUID5_char}\"," ${xray_qr_config_file} @@ -878,9 +879,9 @@ vless_urlquote() vless_qr_link_image() { #vless_link="vless://$(base64 -w 0 $xray_qr_config_file)" if [[ "$shell_mode" != "xtls" ]]; then - vless_link="vless://${UUID}@$(vless_urlquote ${domain}):${port}?path=%2F$(vless_urlquote ${camouflage})%2F&security=tls&encryption=none&host=$(vless_urlquote ${domain})&type=ws#$(vless_urlquote ${domain})+ws%E5%8D%8F%E8%AE%AE" + vless_link="vless://$(info_extraction '\"id\"')@$(vless_urlquote $(info_extraction '\"add\"')):$(info_extraction '\"port\"')?path=%2F$(vless_urlquote $(info_extraction '\"path\"'))%2F&security=tls&encryption=none&host=$(vless_urlquote $(info_extraction '\"add\"'))&type=ws#$(vless_urlquote $(info_extraction '\"add\"'))+ws%E5%8D%8F%E8%AE%AE" else - vless_link="vless://${UUID}@$(vless_urlquote ${domain}):${port}?security=xtls&encryption=none&headerType=none&type=tcp&flow=xtls-rprx-direct#$(vless_urlquote ${domain})+xtls%E5%8D%8F%E8%AE%AE" + vless_link="vless://$(info_extraction '\"id\"')@$(vless_urlquote $(info_extraction '\"add\"')):$(info_extraction '\"port\"')?security=xtls&encryption=none&headerType=none&type=tcp&flow=xtls-rprx-direct#$(vless_urlquote $(info_extraction '\"add\"'))+xtls%E5%8D%8F%E8%AE%AE" fi echo -e "${OK} ${YellowBG} VLESS 目前分享链接规范为实验阶段,请自行判断是否适用 ${Font}" { @@ -1006,20 +1007,20 @@ EOF tls_type() { if [[ -f "/etc/nginx/sbin/nginx" ]] && [[ -f "$nginx_conf" ]] && [[ "$shell_mode" == "ws" ]]; then echo "请选择支持的 TLS 版本(default:2):" - echo "建议选择 TLS1.2 and TLS1.3兼容模式" + echo "建议选择 TLS1.2 and TLS1.3 (兼容模式)" echo "1: TLS1.1 TLS1.2 and TLS1.3(兼容模式)" echo "2: TLS1.2 and TLS1.3 (兼容模式)" echo "3: TLS1.3 only" read -rp "请输入:" tls_version [[ -z ${tls_version} ]] && tls_version=2 if [[ $tls_version == 3 ]]; then - sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.3;/' $nginx_conf + sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.3;/' $nginx_conf echo -e "${OK} ${GreenBG} 已切换至 TLS1.3 only ${Font}" elif [[ $tls_version == 1 ]]; then - sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;/' $nginx_conf + sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;/' $nginx_conf echo -e "${OK} ${GreenBG} 已切换至 TLS1.1 TLS1.2 and TLS1.3 ${Font}" else - sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.2 TLSv1.3;/' $nginx_conf + sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.2 TLSv1.3;/' $nginx_conf echo -e "${OK} ${GreenBG} 已切换至 TLS1.2 and TLS1.3 ${Font}" fi systemctl restart nginx