From f90de75380b26117baf53c6064a1f0cc337d2f22 Mon Sep 17 00:00:00 2001 From: wulabing Date: Thu, 6 Feb 2020 15:40:49 +0800 Subject: [PATCH 01/42] =?UTF-8?q?1.0.7=20=E4=BF=AE=E5=A4=8D=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E6=96=87=E4=BB=B6=E6=B8=85=E7=90=86=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 906548a..d369015 100644 --- a/install.sh +++ b/install.sh @@ -344,8 +344,8 @@ nginx_install(){ # 删除临时文件 - rm -rf nginx-"${nginx_version}" - rm -rf openssl-"${openssl_version}" + rm -rf ../nginx-"${nginx_version}" + rm -rf ../openssl-"${openssl_version}" rm -rf ../nginx-"${nginx_version}".tar.gz rm -rf ../openssl-"${openssl_version}".tar.gz From e7d8371ed9b43fefa7cc1bb53bf81438bfc8f8f0 Mon Sep 17 00:00:00 2001 From: wulabing Date: Thu, 6 Feb 2020 15:43:04 +0800 Subject: [PATCH 02/42] =?UTF-8?q?1.0.7=20Nginx=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20XFF=E6=B7=BB=E5=8A=A0=20=E6=84=9F=E8=B0=A2=20tg:@Cl?= =?UTF-8?q?iwired?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install.sh b/install.sh index d369015..9b8715a 100644 --- a/install.sh +++ b/install.sh @@ -465,6 +465,8 @@ nginx_conf_add(){ proxy_redirect off; proxy_pass http://127.0.0.1:10000; proxy_http_version 1.1; + proxy_set_header X-Real-IP \$remote_addr; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_set_header Upgrade \$http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host \$http_host; From b9392c4e1168cd28f3f717cd1540c52ded12d465 Mon Sep 17 00:00:00 2001 From: wulabing Date: Fri, 7 Feb 2020 14:15:58 +0800 Subject: [PATCH 03/42] =?UTF-8?q?1.0.7=20=E4=BF=AE=E5=A4=8D=20bbr4?= =?UTF-8?q?=E5=90=881=20403=20forbidden=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 9b8715a..5ff43f8 100644 --- a/install.sh +++ b/install.sh @@ -671,10 +671,12 @@ ssl_update_manuel(){ [ -f ${amce_sh_file} ] && "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" || echo -e "${RedBG}证书签发工具不存在,请确认你是否使用了自己的证书${Font}" } bbr_boost_sh(){ + [ -f "tcp.sh" ] && rm -rf ./tcp.sh wget -N --no-check-certificate "https://github.com/ylx2016/Linux-NetSpeed/releases/download/sh/tcp.sh" && chmod +x tcp.sh && ./tcp.sh } mtproxy_sh(){ - wget -N --no-check-certificate https://github.com/whunt1/onekeymakemtg/raw/master/mtproxy_go.sh && chmod +x mtproxy_go.sh && bash mtproxy_go.sh + [ -f "mtproxy_go.sh" ] && rm -rf ./mtproxy_go.sh + wget -N --no-check-certificate https://github.com/whunt1/onekeymakemtg/raw/master/mtproxy_go.sh && chmod +x mtproxy_go.sh && ./mtproxy_go.sh } uninstall_all(){ From 734081675faf634d69e376eb1bbacfed0eef05b9 Mon Sep 17 00:00:00 2001 From: wulabing Date: Fri, 7 Feb 2020 14:17:41 +0800 Subject: [PATCH 04/42] =?UTF-8?q?1.0.7=20=E4=BF=AE=E5=A4=8D=20bbr4?= =?UTF-8?q?=E5=90=881=20403=20forbidden=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5ff43f8..52955de 100644 --- a/install.sh +++ b/install.sh @@ -24,7 +24,7 @@ OK="${Green}[OK]${Font}" Error="${Red}[错误]${Font}" # 版本 -shell_version="1.0.6" +shell_version="1.0.7" shell_mode="None" version_cmp="/tmp/version_cmp.tmp" v2ray_conf_dir="/etc/v2ray" From 0bcebd4dde9a632e66bc339c186767dccc837ba8 Mon Sep 17 00:00:00 2001 From: wulabing Date: Fri, 7 Feb 2020 14:30:19 +0800 Subject: [PATCH 05/42] =?UTF-8?q?1.0.7=20=E5=8D=B8=E8=BD=BD=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=20Nginx=20=E4=BF=9D=E7=95=99=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 52955de..b0096c0 100644 --- a/install.sh +++ b/install.sh @@ -684,7 +684,19 @@ uninstall_all(){ [[ -f $nginx_systemd_file ]] && rm -f $nginx_systemd_file [[ -f $v2ray_systemd_file ]] && rm -f $v2ray_systemd_file [[ -d $v2ray_bin_file ]] && rm -rf $v2ray_bin_file - [[ -d $nginx_dir ]] && rm -rf $nginx_dir + if [[ -d $nginx_dir ]] + then + echo -e "${OK} ${Green} 是否卸载 Nginx [Y/N]? ${Font}" + read -r uninstall_nginx + case $uninstall_nginx in + [yY][eE][sS]|[yY]) + rm -rf $nginx_dir + echo -e "${OK} ${Green} 已卸载 Nginx ${Font}" + ;; + *) + ;; + esac + fi [[ -d $v2ray_conf_dir ]] && rm -rf $v2ray_conf_dir [[ -d $web_dir ]] && rm -rf $web_dir systemctl daemon-reload From a0b99471e781c16b6d8c7e4d3450d606a42be8d8 Mon Sep 17 00:00:00 2001 From: wulabing Date: Fri, 7 Feb 2020 14:31:22 +0800 Subject: [PATCH 06/42] =?UTF-8?q?1.0.7=20=E9=BB=98=E8=AE=A4=E4=BB=85?= =?UTF-8?q?=E4=BF=9D=E7=95=99=20TLS1.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b0096c0..4efcc9d 100644 --- a/install.sh +++ b/install.sh @@ -454,7 +454,7 @@ nginx_conf_add(){ listen 443 ssl http2; ssl_certificate /data/v2ray.crt; ssl_certificate_key /data/v2ray.key; - ssl_protocols TLSv1.2 TLSv1.3; + ssl_protocols TLSv1.3; ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5; server_name serveraddr.com; index index.html index.htm; From 178b2950059555820da9cef2d9820327f8fa4246 Mon Sep 17 00:00:00 2001 From: wulabing Date: Fri, 7 Feb 2020 15:12:28 +0800 Subject: [PATCH 07/42] =?UTF-8?q?1.0.7=20=E4=BF=AE=E5=A4=8D=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=9B=B4=E6=96=B0=E8=AF=81=E4=B9=A6=20Nginx=20?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化部分逻辑 --- install.sh | 19 +++++++++++++------ ssl_update.sh | 9 +++++++++ 2 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 ssl_update.sh diff --git a/install.sh b/install.sh index 4efcc9d..5327c9a 100644 --- a/install.sh +++ b/install.sh @@ -42,6 +42,7 @@ v2ray_systemd_file="/etc/systemd/system/v2ray.service" v2ray_access_log="/var/log/v2ray/access.log" v2ray_error_log="/var/log/v2ray/error.log" amce_sh_file="/root/.acme.sh/acme.sh" +ssl_update_file="/usr/bin/ssl_update.sh" nginx_version="1.16.1" openssl_version="1.1.1d" @@ -72,10 +73,13 @@ check_system(){ fi $INS install dbus - systemctl stop firewalld && systemctl disable firewalld + + systemctl stop firewalld + systemctl disable firewalld echo -e "${OK} ${GreenBG} firewalld 已关闭 ${Font}" - systemctl stop ufw && systemctl disable ufw + systemctl stop ufw + systemctl disable ufw echo -e "${OK} ${GreenBG} ufw 已关闭 ${Font}" } @@ -531,12 +535,15 @@ nginx_process_disabled(){ # judge "rc.local 配置" #} acme_cron_update(){ + [ ! -f ${ssl_update_file} ] && wget -P /usr/bin "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh" if [[ "${ID}" == "centos" ]];then - sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ - &> /dev/null" /var/spool/cron/root +# sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ +# &> /dev/null" /var/spool/cron/root + sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update}" else - sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ - &> /dev/null" /var/spool/cron/crontabs/root +# sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ +# &> /dev/null" /var/spool/cron/crontabs/root + sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update}" fi judge "cron 计划任务更新" } diff --git a/ssl_update.sh b/ssl_update.sh new file mode 100644 index 0000000..5057e0f --- /dev/null +++ b/ssl_update.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +systemctl stop nginx &> /dev/null +sleep 2 +"/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" &> /dev/null +sleep 2 +systemctl start nginx &> /dev/null From 804841caa4f10f47deec0511d18fbf6091a4f91c Mon Sep 17 00:00:00 2001 From: wulabing Date: Fri, 7 Feb 2020 15:15:10 +0800 Subject: [PATCH 08/42] =?UTF-8?q?1.0.7=20=E4=BF=AE=E5=A4=8D=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=9B=B4=E6=96=B0=E8=AF=81=E4=B9=A6=20Nginx=20?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 5327c9a..b68ec1e 100644 --- a/install.sh +++ b/install.sh @@ -539,11 +539,11 @@ acme_cron_update(){ if [[ "${ID}" == "centos" ]];then # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ # &> /dev/null" /var/spool/cron/root - sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update}" + sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" else # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ # &> /dev/null" /var/spool/cron/crontabs/root - sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update}" + sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" fi judge "cron 计划任务更新" } From c4b3e8b33cc0ac8ec29ddc4324191590d7d80df6 Mon Sep 17 00:00:00 2001 From: wulabing Date: Fri, 7 Feb 2020 15:16:23 +0800 Subject: [PATCH 09/42] =?UTF-8?q?1.0.7=20=E4=BF=AE=E5=A4=8D=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=9B=B4=E6=96=B0=E8=AF=81=E4=B9=A6=20Nginx=20?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index b68ec1e..7fd97b1 100644 --- a/install.sh +++ b/install.sh @@ -539,11 +539,11 @@ acme_cron_update(){ if [[ "${ID}" == "centos" ]];then # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ # &> /dev/null" /var/spool/cron/root - sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" + sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" /var/spool/cron/root else # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ # &> /dev/null" /var/spool/cron/crontabs/root - sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" + sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" /var/spool/cron/crontabs/root fi judge "cron 计划任务更新" } From dcee59f2a7473798ca8b6154ac881870084c0d9d Mon Sep 17 00:00:00 2001 From: wulabing Date: Fri, 7 Feb 2020 15:22:48 +0800 Subject: [PATCH 10/42] =?UTF-8?q?1.0.7=20CHANGELOG.md=20=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 798725a..bcc4b7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 2020-2-7 +1.0.7 +* 修复 自动更新证书 Nginx 重启异常 +* 修复 bbr4合1 403 forbidden 问题 +* 修复 部分临时文件清理异常 问题 +* 变更 默认仅保留 TLS1.3 +* 添加 卸载提供 Nginx 保留选项 +* 添加 Nginx配置文件 XFF 感谢 tg:@Cliwired +* 添加 ws DOH配置 感谢 tg:@auth_chain_b + ## 2020-01-25 * 修复 curl依赖确实 * 添加 MT-proxy-go 安装代码,在此感谢 whunt1 的贡献 From 7414b3bfc9e6049014cc782a586c3142c6d34d1f Mon Sep 17 00:00:00 2001 From: wulabing Date: Fri, 7 Feb 2020 16:40:24 +0800 Subject: [PATCH 11/42] =?UTF-8?q?1.0.7.1=20=E5=AE=8C=E5=96=84=E8=AF=81?= =?UTF-8?q?=E4=B9=A6=E5=AD=98=E5=9C=A8=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E6=9B=BF=E6=8D=A2~=E4=B8=BA$HOME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index 7fd97b1..c690366 100644 --- a/install.sh +++ b/install.sh @@ -1,4 +1,6 @@ #!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH cd $(cd "$(dirname "$0")"; pwd) #==================================================== @@ -24,7 +26,7 @@ OK="${Green}[OK]${Font}" Error="${Red}[错误]${Font}" # 版本 -shell_version="1.0.7" +shell_version="1.0.7.1" shell_mode="None" version_cmp="/tmp/version_cmp.tmp" v2ray_conf_dir="/etc/v2ray" @@ -409,29 +411,29 @@ port_exist_check(){ fi } acme(){ - ~/.acme.sh/acme.sh --issue -d ${domain} --standalone -k ec-256 --force --test + $HOME/.acme.sh/acme.sh --issue -d ${domain} --standalone -k ec-256 --force --test if [[ $? -eq 0 ]];then echo -e "${OK} ${GreenBG} SSL 证书测试签发成功,开始正式签发 ${Font}" sleep 2 else echo -e "${Error} ${RedBG} SSL 证书测试签发失败 ${Font}" - rm -rf "~/.acme.sh/${domain}_ecc/${domain}.key" && rm -rf "~/.acme.sh/${domain}_ecc/${domain}.cer" + rm -rf "$HOME/.acme.sh/${domain}_ecc/${domain}.key" && rm -rf "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" exit 1 fi - ~/.acme.sh/acme.sh --issue -d ${domain} --standalone -k ec-256 --force + $HOME/.acme.sh/acme.sh --issue -d ${domain} --standalone -k ec-256 --force if [[ $? -eq 0 ]];then echo -e "${OK} ${GreenBG} SSL 证书生成成功 ${Font}" sleep 2 mkdir /data - ~/.acme.sh/acme.sh --installcert -d ${domain} --fullchainpath /data/v2ray.crt --keypath /data/v2ray.key --ecc + $HOME/.acme.sh/acme.sh --installcert -d ${domain} --fullchainpath /data/v2ray.crt --keypath /data/v2ray.key --ecc if [[ $? -eq 0 ]];then echo -e "${OK} ${GreenBG} 证书配置成功 ${Font}" sleep 2 fi else echo -e "${Error} ${RedBG} SSL 证书生成失败 ${Font}" - rm -rf "~/.acme.sh/${domain}_ecc/${domain}.key" && rm -rf "~/.acme.sh/${domain}_ecc/${domain}.cer" + rm -rf "$HOME/.acme.sh/${domain}_ecc/${domain}.key" && rm -rf "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" exit 1 fi } @@ -610,11 +612,25 @@ show_information(){ cat ${v2ray_info_file} } ssl_judge_and_install(){ -# if [[ -f "/data/v2ray.key" && -f "/data/v2ray.crt" ]];then -# echo "证书文件已存在" - if [[ -f "~/.acme.sh/${domain}_ecc/${domain}.key" && -f "~/.acme.sh/${domain}_ecc/${domain}.cer" ]];then + if [[ -f "/data/v2ray.key" || -f "/data/v2ray.crt" ]];then + echo "/data 目录下证书文件已存在" + echo -e "${OK} ${GreenBG} 是否删除 [Y/N]? ${Font}" + read -r ssl_delete + case $ssl_delete in + [yY][eE][sS]|[yY]) + rm -rf /data/* + echo -e "${OK} ${GreenBG} 已删除 ${Font}" + ;; + *) + ;; + esac + fi + + if [[ -f "/data/v2ray.key" || -f "/data/v2ray.crt" ]];then echo "证书文件已存在" - ~/.acme.sh/acme.sh --installcert -d ${domain} --fullchainpath /data/v2ray.crt --keypath /data/v2ray.key --ecc + elif [[ -f "$HOME/.acme.sh/${domain}_ecc/${domain}.key" && -f "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" ]];then + echo "证书文件已存在" + $HOME/.acme.sh/acme.sh --installcert -d ${domain} --fullchainpath /data/v2ray.crt --keypath /data/v2ray.key --ecc judge "证书应用" else ssl_install From fe476a588d05a343bb35125552e3725338e8ba7f Mon Sep 17 00:00:00 2001 From: wulabing Date: Fri, 7 Feb 2020 21:12:18 +0800 Subject: [PATCH 12/42] =?UTF-8?q?readme=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加捐赠信息 修改部分内容逻辑及顺序 删除部分过期信息 --- README.md | 59 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 7396844..4c3fca9 100644 --- a/README.md +++ b/README.md @@ -3,20 +3,30 @@ > 感谢 JetBrains 提供的非商业开源软件开发授权 > Thanks for non-commercial open source development authorization by JetBrains +### Telegram 群组 +* telegram 交流群:https://t.me/wulabing_v2ray +* telegram 更新公告频道:https://t.me/wulabing_channel + +### 准备工作 +* 准备一个域名,并将A记录添加好。 +* [V2ray官方说明](https://www.v2ray.com/),了解 TLS WebSocket 及 V2ray 相关信息 +* 安装好 wget + +### 安装/更新方式(h2 和 ws 版本已合并) +Vmess+websocket+TLS+Nginx+Website +``` +wget -N --no-check-certificate -q -O install.sh "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install.sh" && chmod +x install.sh && bash install.sh +``` + ### 注意事项 * 如果你不了解脚本中各项设置的具体含义,除域名外,请使用脚本提供的默认值 * 使用本脚本需要你拥有 Linux 基础及使用经验,了解计算机网络部分知识,计算机基础操作 * 目前支持Debian 9+ / Ubuntu 18.04+ / Centos7+ ,部分Centos模板可能存在难以处理的编译问题,建议遇到编译问题时,请更换至其他系统模板 -* telegram 交流群:https://t.me/wulabing_v2ray * 群主仅提供极其有限的支持,如有问题可以询问群友 * 每周日的凌晨3点,Nginx 会自动重启以配合证书的签发定时任务进行,在此期间,节点无法正常连接,预计持续时间为若干秒至两分钟 ### 更新日志 -> 更多内容请查看 CHANGELOG.md -## 2020-01-25 -* 修复 curl依赖确实 -* 添加 MT-proxy-go 安装代码,在此感谢 whunt1 的贡献 -* 修复 测试签发成功,正式签发失败,后续重装导致的跳过证书签发问题 +> 更新内容请查看 CHANGELOG.md ### 鸣谢 * ~~本脚本的另一个分支版本(Use Host)地址: https://github.com/dylanbai8/V2Ray_ws-tls_Website_onekey 请根据需求进行选择~~ 该作者可能已停止维护 @@ -27,7 +37,7 @@ ### 证书 > 如果你已经拥有了你所使用域名的证书文件,可以将 crt 和 key 文件命名为 v2ray.crt v2ray.key 放在 /data 目录下(若目录不存在请先建目录),请注意证书文件权限及证书有效期,自定义证书有效期过期后请自行续签 -脚本支持自动生成 let's encrypted 证书,有效期3个月,理论上自动生成的证书支持自动续签,自动续签功能有待检验 +脚本支持自动生成 let's encrypted 证书,有效期3个月,理论上自动生成的证书支持自动续签 ### 查看客户端配置 `cat ~/v2ray_info.txt` @@ -35,23 +45,14 @@ ### V2ray 简介 * V2Ray是一个优秀的开源网络代理工具,可以帮助你畅爽体验互联网,目前已经全平台支持Windows、Mac、Android、IOS、Linux等操作系统的使用。 -* ~~本脚本的另一个分支版本(Use Host)地址: https://github.com/dylanbai8/V2Ray_ws-tls_Website_onekey 请根据需求进行选择~~ 该作者可能已停止维护 * 本脚本为一键完全配置脚本,在所有流程正常运行完毕后,直接按照输出结果设置客户端即可使用 * 请注意:我们依然强烈建议你全方面的了解整个程序的工作流程及原理 - ### 建议单服务器仅搭建单个代理 * 本脚本默认安装最新版本的V2ray core -* V2ray core 目前最新版本为 4.21.3(同时请注意客户端 core 的同步更新,需要保证客户端内核版本 >= 服务端内核版本) +* V2ray core 目前最新版本为 4.22.1(同时请注意客户端 core 的同步更新,需要保证客户端内核版本 >= 服务端内核版本) * 建议使用默认的443端口作为连接端口 * 伪装内容可自行替换。 -### V2ray core 更新方式 -执行: -`bash <(curl -L -s https://install.direct/go.sh)` - -( 来源参考 :[V2ray官方说明](https://www.v2ray.com/chapter_00/install.html)) -* 如果为最新版本,会输出提示并停止安装。否则会自动更新 -* 未来会将相关内容集成到本脚本中并进行交互式操作更新 ### 注意事项 * 推荐在纯净环境下使用本脚本,如果你是新手,请不要使用Centos系统。 @@ -60,15 +61,8 @@ * V2Ray 的部分功能依赖于系统时间,请确保您使用V2RAY程序的系统 UTC 时间误差在三分钟之内,时区无关。 * 本 bash 依赖于 [V2ray 官方安装脚本](https://install.direct/go.sh) 及 [acme.sh](https://github.com/Neilpang/acme.sh) 工作。 * Centos 系统用户请预先在防火墙中放行程序相关端口(默认:80,443) -### 准备工作 -* 准备一个域名,并将A记录添加好。 -* [V2ray官方说明](https://www.v2ray.com/),了解 TLS WebSocket 及 V2ray 相关信息 -* 安装好 curl -### 安装/更新方式(h2 和 ws 版本已合并) -Vmess+websocket+TLS+Nginx+Website -``` -wget -N --no-check-certificate -q -O install.sh "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install.sh" && chmod +x install.sh && bash install.sh -``` + + ### 启动方式 启动 V2ray:`systemctl start v2ray` @@ -89,7 +83,16 @@ V2ray 客户端配置: `~/v2ray_info.txt` Nginx 目录: `/etc/nginx` -证书文件: `/data/v2ray.key 和 /data/v2ray.crt` - +证书文件: `/data/v2ray.key 和 /data/v2ray.crt` 请注意证书权限设置 + +### 捐赠 + +目前支持通过 MugglePay 接受虚拟货币捐赠 + +𝒘𝒖𝒍𝒂𝒃𝒊𝒏𝒈 邀请您使用麻瓜宝,基于Telegram的电子钱包,匿名支付0手续费秒级到账。https://telegram.me/MugglePayBot?start=T3Y78AZ3 + +您可以通过Telegram向我匿名捐赠:发送 /pay @wulabing xxx 到 @MugglePayBot 即可 默认货币为 USDT + +如需要通过支付宝/微信捐赠,请Telegram私聊 @wulabing 感谢您的支持 From 187c8fadfe46924a403fb661a4b2efd0d5629b31 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 8 Feb 2020 10:04:28 +0800 Subject: [PATCH 13/42] =?UTF-8?q?1.0.8=20=E8=8A=82=E7=82=B9=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=20vmess=E9=93=BE=E6=8E=A5=20=E4=B8=8E=20=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E7=A0=81=20=E9=A1=BA=E5=BA=8F=E4=BA=92=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index c690366..0383c14 100644 --- a/install.sh +++ b/install.sh @@ -26,7 +26,7 @@ OK="${Green}[OK]${Font}" Error="${Red}[错误]${Font}" # 版本 -shell_version="1.0.7.1" +shell_version="1.0.8" shell_mode="None" version_cmp="/tmp/version_cmp.tmp" v2ray_conf_dir="/etc/v2ray" @@ -587,8 +587,8 @@ EOF vmess_qr_link_image(){ vmess_link="vmess://$(cat $v2ray_qr_config_file | base64 -w 0)" - echo -e "${Red} URL导入链接:${vmess_link} ${Font}" >> ${v2ray_info_file} echo -e "${Red} 二维码: ${Font}" >> ${v2ray_info_file} + echo -e "${Red} URL导入链接:${vmess_link} ${Font}" >> ${v2ray_info_file} echo -n "${vmess_link}"| qrencode -o - -t utf8 >> ${v2ray_info_file} } From af8bdd9e3c0b07b228c9b65777c03b6e81c61504 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 8 Feb 2020 10:25:14 +0800 Subject: [PATCH 14/42] =?UTF-8?q?1.0.8=20Nginx=20=E6=B7=BB=E5=8A=A0=20jema?= =?UTF-8?q?lloc=20=E6=8F=90=E5=8D=87=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/install.sh b/install.sh index 0383c14..0f71ded 100644 --- a/install.sh +++ b/install.sh @@ -47,6 +47,7 @@ amce_sh_file="/root/.acme.sh/acme.sh" ssl_update_file="/usr/bin/ssl_update.sh" nginx_version="1.16.1" openssl_version="1.1.1d" +jemalloc_version="5.2.1" #生成伪装路径 camouflage=`cat /dev/urandom | head -n 10 | md5sum | head -c 8` @@ -311,6 +312,8 @@ nginx_install(){ judge "Nginx 下载" wget -nc https://www.openssl.org/source/openssl-${openssl_version}.tar.gz -P ${nginx_openssl_src} judge "openssl 下载" + wget -nc https://github.com/jemalloc/jemalloc/releases/download/${jemalloc_version}/jemalloc-${jemalloc_version}.tar.bz2 -P ${nginx_openssl_src} + judge "jemalloc 下载" cd ${nginx_openssl_src} @@ -320,8 +323,23 @@ nginx_install(){ [[ -d openssl-"$openssl_version" ]] && rm -rf openssl-"$openssl_version" tar -zxvf openssl-"$openssl_version".tar.gz + [[ -d jemalloc-"${jemalloc_version}" ]] && rm -rf openssl-"$openssl_version" + tar -xvf openssl-"$openssl_version".tar.bz2 + [[ -d "$nginx_dir" ]] && rm -rf ${nginx_dir} + + echo -e "${OK} ${GreenBG} 即将开始编译安装 jemalloc ${Font}" + sleep 2 + + cd jemalloc-${jemalloc_version} + ./configure + judge "编译检查" + make && make install + judge "jemalloc 编译安装" + echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf + ldconfig + echo -e "${OK} ${GreenBG} 即将开始编译安装 Nginx, 过程稍久,请耐心等待 ${Font}" sleep 4 @@ -336,6 +354,7 @@ nginx_install(){ --with-http_mp4_module \ --with-http_secure_link_module \ --with-http_v2_module \ + --with-ld-opt="-ljemalloc" \ --with-openssl=../openssl-"$openssl_version" judge "编译检查" make && make install From 93660209073b262f62234059fffed0987ed6e07d Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 8 Feb 2020 10:32:21 +0800 Subject: [PATCH 15/42] =?UTF-8?q?1.0.8=20Nginx=20=E6=B7=BB=E5=8A=A0=20jema?= =?UTF-8?q?lloc=20=E6=8F=90=E5=8D=87=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bug修正 --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 0f71ded..f340866 100644 --- a/install.sh +++ b/install.sh @@ -323,8 +323,8 @@ nginx_install(){ [[ -d openssl-"$openssl_version" ]] && rm -rf openssl-"$openssl_version" tar -zxvf openssl-"$openssl_version".tar.gz - [[ -d jemalloc-"${jemalloc_version}" ]] && rm -rf openssl-"$openssl_version" - tar -xvf openssl-"$openssl_version".tar.bz2 + [[ -d jemalloc-"${jemalloc_version}" ]] && rm -rf jemalloc-"${jemalloc_version}" + tar -xvf jemalloc-"${jemalloc_version}".tar.bz2 [[ -d "$nginx_dir" ]] && rm -rf ${nginx_dir} From 48a795e90a9eaad18626eaf7379e0371ab394f91 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 8 Feb 2020 10:38:19 +0800 Subject: [PATCH 16/42] =?UTF-8?q?1.0.8=20Nginx=20=E6=B7=BB=E5=8A=A0=20jema?= =?UTF-8?q?lloc=20=E6=8F=90=E5=8D=87=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bug修正 --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f340866..ce60d5e 100644 --- a/install.sh +++ b/install.sh @@ -343,7 +343,7 @@ nginx_install(){ echo -e "${OK} ${GreenBG} 即将开始编译安装 Nginx, 过程稍久,请耐心等待 ${Font}" sleep 4 - cd nginx-${nginx_version} + cd ../nginx-${nginx_version} ./configure --prefix="${nginx_dir}" \ --with-http_ssl_module \ --with-http_gzip_static_module \ From 1a34d603f2f6f5267851478306e3186b5f0101a1 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 8 Feb 2020 10:47:16 +0800 Subject: [PATCH 17/42] =?UTF-8?q?1.0.8=20=E8=B0=83=E6=95=B4=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E9=85=8D=E7=BD=AE=E4=BF=A1=E6=81=AF=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bug修正 --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index ce60d5e..5a85b04 100644 --- a/install.sh +++ b/install.sh @@ -607,8 +607,8 @@ EOF vmess_qr_link_image(){ vmess_link="vmess://$(cat $v2ray_qr_config_file | base64 -w 0)" echo -e "${Red} 二维码: ${Font}" >> ${v2ray_info_file} - echo -e "${Red} URL导入链接:${vmess_link} ${Font}" >> ${v2ray_info_file} echo -n "${vmess_link}"| qrencode -o - -t utf8 >> ${v2ray_info_file} + echo -e "${Red} URL导入链接:${vmess_link} ${Font}" >> ${v2ray_info_file} } info_extraction(){ From 2b17f767b40d9c18b3530c6b26e7f88fcdec509f Mon Sep 17 00:00:00 2001 From: wulabing Date: Sun, 9 Feb 2020 16:25:27 +0800 Subject: [PATCH 18/42] =?UTF-8?q?tls=20default=20=E5=80=BC=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 5a85b04..8ee86e8 100644 --- a/install.sh +++ b/install.sh @@ -48,6 +48,7 @@ ssl_update_file="/usr/bin/ssl_update.sh" nginx_version="1.16.1" openssl_version="1.1.1d" jemalloc_version="5.2.1" +v2ray_plugin_version="$(wget -qO- "https://github.com/shadowsocks/v2ray-plugin/tags" |grep -E "/shadowsocks/v2ray-plugin/releases/tag/" |head -1|sed -r 's/.*tag\/v(.+)\">.*/\1/')" #生成伪装路径 camouflage=`cat /dev/urandom | head -n 10 | md5sum | head -c 8` @@ -681,12 +682,12 @@ judge "Nginx systemd ServerFile 添加" tls_type(){ if [[ -f "/etc/nginx/sbin/nginx" ]] && [[ -f "$nginx_conf" ]] && [[ "$shell_mode" == "ws" ]];then - echo "请选择支持的 TLS 版本(default:1):" + echo "请选择支持的 TLS 版本(default:3):" echo "1: TLS1.1 TLS1.2 and TLS1.3" echo "2: TLS1.2 and TLS1.3" echo "3: TLS1.3 only" read -p "请输入:" tls_version - [[ -z ${tls_version} ]] && tls_version=2 + [[ -z ${tls_version} ]] && tls_version=3 if [[ $tls_version == 3 ]];then sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.3;/' $nginx_conf echo -e "${OK} ${GreenBG} 已切换至 TLS1.3 only ${Font}" From fa936c6da3777ca04d89e304a45f04451f5ba217 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 16:21:10 +0800 Subject: [PATCH 19/42] =?UTF-8?q?1.1.0=20=E6=B7=BB=E5=8A=A0ws=E9=A6=96?= =?UTF-8?q?=E6=AC=A1=E5=AE=89=E8=A3=85=E6=97=B6tls=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E9=80=89=E6=8B=A9=EF=BC=8C=E5=B9=B6=E5=90=AF=E7=94=A8=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 8ee86e8..1562556 100644 --- a/install.sh +++ b/install.sh @@ -26,7 +26,7 @@ OK="${Green}[OK]${Font}" Error="${Red}[错误]${Font}" # 版本 -shell_version="1.0.8" +shell_version="1.1.0" shell_mode="None" version_cmp="/tmp/version_cmp.tmp" v2ray_conf_dir="/etc/v2ray" @@ -683,8 +683,9 @@ judge "Nginx systemd ServerFile 添加" tls_type(){ if [[ -f "/etc/nginx/sbin/nginx" ]] && [[ -f "$nginx_conf" ]] && [[ "$shell_mode" == "ws" ]];then echo "请选择支持的 TLS 版本(default:3):" - echo "1: TLS1.1 TLS1.2 and TLS1.3" - echo "2: TLS1.2 and TLS1.3" + echo "请注意,如果你使用 Quantaumlt X / 路由器 / 旧版 Shadowrocket / 低于 4.18.1 版本的 V2ray core 请选择 兼容模式" + echo "1: TLS1.1 TLS1.2 and TLS1.3(兼容模式)" + echo "2: TLS1.2 and TLS1.3 (兼容模式)" echo "3: TLS1.3 only" read -p "请输入:" tls_version [[ -z ${tls_version} ]] && tls_version=3 @@ -772,6 +773,7 @@ install_v2ray_ws_tls(){ v2ray_conf_add_tls nginx_conf_add web_camouflage + tls_type ssl_judge_and_install nginx_systemd vmess_qr_config_tls_ws From e08988f807e0c9d9f4f5c2eca196228ca06f7073 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 16:28:20 +0800 Subject: [PATCH 20/42] =?UTF-8?q?1.1.0=20Nginx=20=E5=86=B2=E7=AA=81?= =?UTF-8?q?=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index 1562556..c4e7b32 100644 --- a/install.sh +++ b/install.sh @@ -300,6 +300,10 @@ nginx_exist_check(){ if [[ -f "/etc/nginx/sbin/nginx" ]];then echo -e "${OK} ${GreenBG} Nginx已存在,跳过编译安装过程 ${Font}" sleep 2 + elif [[ -d "/usr/local/nginx/" ]] + then + echo -e "${OK} ${GreenBG} 检测到其他套件安装的Nginx,继续安装会造成冲突,请处理后安装${Font}" + exit 1 else nginx_install fi From 6edadc683c0dae0d4e252474d57a52ee7b736f8e Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 16:39:22 +0800 Subject: [PATCH 21/42] =?UTF-8?q?1.1.0=20config.json=20=E6=8E=92=E7=89=88?= =?UTF-8?q?=20=E6=B2=A1=E6=9C=89=E5=8D=B5=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tls/config.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tls/config.json b/tls/config.json index 2242c68..af62008 100644 --- a/tls/config.json +++ b/tls/config.json @@ -41,11 +41,11 @@ "dns": { "servers": [ "https+local://1.1.1.1/dns-query", - "1.1.1.1", - "1.0.0.1", - "8.8.8.8", - "8.8.4.4", - "localhost" + "1.1.1.1", + "1.0.0.1", + "8.8.8.8", + "8.8.4.4", + "localhost" ] }, "routing": { From 0450ab21f7490bc1f8fa3cf871dbf9b84f2dff49 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 16:42:42 +0800 Subject: [PATCH 22/42] =?UTF-8?q?1.1.0=20=E5=B0=9D=E8=AF=95=20config.json?= =?UTF-8?q?=20dns=20=E9=83=A8=E5=88=86=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tls/config.json | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tls/config.json b/tls/config.json index af62008..b1b5ac1 100644 --- a/tls/config.json +++ b/tls/config.json @@ -40,12 +40,23 @@ ], "dns": { "servers": [ - "https+local://1.1.1.1/dns-query", - "1.1.1.1", - "1.0.0.1", - "8.8.8.8", - "8.8.4.4", - "localhost" + { + "address": "223.5.5.5", + "expectIPs": [ + "geoip:cn" + ] + }, + { + "address": "https+local://1.1.1.1/dns-query", + "domains": [ + "geosite:geolocation-!cn" + ] + }, + "localhost", + "1.1.1.1", + "1.0.0.1", + "8.8.8.8", + "8.8.4.4", ] }, "routing": { From 04092d19a7ca3504a04c8a1ba406dceea02be3d8 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 16:49:55 +0800 Subject: [PATCH 23/42] =?UTF-8?q?1.1.0=20=E8=B0=83=E6=95=B4tls=E8=AF=A2?= =?UTF-8?q?=E9=97=AE=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index c4e7b32..2dda797 100644 --- a/install.sh +++ b/install.sh @@ -777,12 +777,12 @@ install_v2ray_ws_tls(){ v2ray_conf_add_tls nginx_conf_add web_camouflage - tls_type ssl_judge_and_install nginx_systemd vmess_qr_config_tls_ws basic_information vmess_qr_link_image + tls_type show_information start_process_systemd enable_process_systemd From 1632c765554d532982064f908b7eed9cf922808b Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 17:08:30 +0800 Subject: [PATCH 24/42] =?UTF-8?q?1.1.0=20=E4=BF=AE=E5=A4=8Ddaemon-reload?= =?UTF-8?q?=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/install.sh b/install.sh index 2dda797..9dc8ac4 100644 --- a/install.sh +++ b/install.sh @@ -464,6 +464,20 @@ acme(){ v2ray_conf_add_tls(){ cd /etc/v2ray wget https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/tls/config.json -O config.json + if [[ -f $v2ray_qr_config_file ]] + then + echo -e "${OK} ${Green} 检测到旧配置文件,是否读取旧文件配置 [Y/N]?" + read -r "" + case $ssl_delete in + [yY][eE][sS]|[yY]) + echo -e "${OK} ${Green} 已保留旧配置 [Y/N]?" + ;; + *) + rm -rf $v2ray_qr_config_file + echo -e "${OK} ${Green} 已删除旧配置 [Y/N]?" + ;; + esac + fi modify_path modify_alterid modify_inbound_port @@ -682,6 +696,7 @@ WantedBy=multi-user.target EOF judge "Nginx systemd ServerFile 添加" +systemctl daemon-reload } tls_type(){ From 42d28b30db7c39cb3cc46c164423ed6838f1b717 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 21:04:44 +0800 Subject: [PATCH 25/42] =?UTF-8?q?1.1.0=20=E9=87=8D=E6=96=B0=E5=AE=89?= =?UTF-8?q?=E8=A3=85/=E5=8D=87=E7=BA=A7=E6=97=B6=E6=97=A7=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 9dc8ac4..8665562 100644 --- a/install.sh +++ b/install.sh @@ -48,6 +48,7 @@ ssl_update_file="/usr/bin/ssl_update.sh" nginx_version="1.16.1" openssl_version="1.1.1d" jemalloc_version="5.2.1" +old_config_status="off" v2ray_plugin_version="$(wget -qO- "https://github.com/shadowsocks/v2ray-plugin/tags" |grep -E "/shadowsocks/v2ray-plugin/releases/tag/" |head -1|sed -r 's/.*tag\/v(.+)\">.*/\1/')" #生成伪装路径 @@ -194,7 +195,7 @@ dependency_install(){ ${INS} -y install haveged # judge "haveged 安装" - sed -i -r '/^HRNGDEVICE/d;/#HRNGDEVICE=\/dev\/null/a HRNGDEVICE=/dev/urandom' /etc/default/rng-tools +# sed -i -r '/^HRNGDEVICE/d;/#HRNGDEVICE=\/dev\/null/a HRNGDEVICE=/dev/urandom' /etc/default/rng-tools if [[ "${ID}" == "centos" ]];then # systemctl start rngd && systemctl enable rngd @@ -229,16 +230,28 @@ port_alterid_set(){ [[ -z ${alterID} ]] && alterID="2" } modify_path(){ + if [[ "on" == "$old_config_status" ]] + then + camouflage="$(cat $v2ray_qr_config_file | grep '\"net\"' | awk -F '"' '{print $4}')" + fi sed -i "/\"path\"/c \\\t \"path\":\"\/${camouflage}\/\"" ${v2ray_conf} judge "V2ray 伪装路径 修改" } modify_alterid(){ + if [[ "on" == "$old_config_status" ]] + then + alterID="$(cat $v2ray_qr_config_file | grep '\"id\"' | awk -F '"' '{print $4}')" + fi sed -i "/\"alterId\"/c \\\t \"alterId\":${alterID}" ${v2ray_conf} judge "V2ray alterid 修改" [ -f ${v2ray_qr_config_file} ] && sed -i "/\"aid\"/c \\ \"aid\": \"${alterID}\"," ${v2ray_qr_config_file} echo -e "${GreenBG} alterID:${alterID} ${Font}" } modify_inbound_port(){ + if [[ "on" == "$old_config_status" ]] + then + port="$(cat $v2ray_qr_config_file | grep '\"port\"' | awk -F '"' '{print $4}')" + fi if [[ "$shell_mode" != "h2" ]] then let PORT=$RANDOM+10000 @@ -250,12 +263,20 @@ modify_inbound_port(){ } modify_UUID(){ [ -z $UUID ] && UUID=$(cat /proc/sys/kernel/random/uuid) + if [[ "on" == "$old_config_status" ]] + then + UUID="$(cat $v2ray_qr_config_file | grep '\"id\"' | awk -F '"' '{print $4}')" + fi sed -i "/\"id\"/c \\\t \"id\":\"${UUID}\"," ${v2ray_conf} judge "V2ray UUID 修改" [ -f ${v2ray_qr_config_file} ] && sed -i "/\"id\"/c \\ \"id\": \"${UUID}\"," ${v2ray_qr_config_file} echo -e "${GreenBG} UUID:${UUID} ${Font}" } modify_nginx_port(){ + if [[ "on" == "$old_config_status" ]] + then + port="$(cat $v2ray_qr_config_file | grep '\"port\"' | awk -F '"' '{print $4}')" + fi sed -i "/ssl http2;$/c \\\tlisten ${port} ssl http2;" ${nginx_conf} judge "V2ray port 修改" [ -f ${v2ray_qr_config_file} ] && sed -i "/\"port\"/c \\ \"port\": \"${port}\"," ${v2ray_qr_config_file} @@ -471,6 +492,7 @@ v2ray_conf_add_tls(){ case $ssl_delete in [yY][eE][sS]|[yY]) echo -e "${OK} ${Green} 已保留旧配置 [Y/N]?" + old_config_status="on" ;; *) rm -rf $v2ray_qr_config_file From 121086d1c3dd9cb8e1da7ba4fc57f057b9dd6806 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 21:08:15 +0800 Subject: [PATCH 26/42] =?UTF-8?q?1.1.0=20=E9=87=8D=E6=96=B0=E5=AE=89?= =?UTF-8?q?=E8=A3=85/=E5=8D=87=E7=BA=A7=E6=97=B6=E6=97=A7=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/install.sh b/install.sh index 8665562..b33b1bd 100644 --- a/install.sh +++ b/install.sh @@ -224,10 +224,13 @@ basic_optimization(){ } port_alterid_set(){ - read -p "请输入连接端口(default:443):" port - [[ -z ${port} ]] && port="443" - read -p "请输入alterID(default:2 仅允许填数字):" alterID - [[ -z ${alterID} ]] && alterID="2" + if [[ "on" != "$old_config_status" ]] + then + read -p "请输入连接端口(default:443):" port + [[ -z ${port} ]] && port="443" + read -p "请输入alterID(default:2 仅允许填数字):" alterID + [[ -z ${alterID} ]] && alterID="2" + fi } modify_path(){ if [[ "on" == "$old_config_status" ]] @@ -485,6 +488,20 @@ acme(){ v2ray_conf_add_tls(){ cd /etc/v2ray wget https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/tls/config.json -O config.json + modify_path + modify_alterid + modify_inbound_port + modify_UUID +} +v2ray_conf_add_h2(){ + cd /etc/v2ray + wget https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/http2/config.json -O config.json + modify_path + modify_alterid + modify_inbound_port + modify_UUID +} +old_config_exist_check(){ if [[ -f $v2ray_qr_config_file ]] then echo -e "${OK} ${Green} 检测到旧配置文件,是否读取旧文件配置 [Y/N]?" @@ -500,18 +517,6 @@ v2ray_conf_add_tls(){ ;; esac fi - modify_path - modify_alterid - modify_inbound_port - modify_UUID -} -v2ray_conf_add_h2(){ - cd /etc/v2ray - wget https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/http2/config.json -O config.json - modify_path - modify_alterid - modify_inbound_port - modify_UUID } nginx_conf_add(){ touch ${nginx_conf_dir}/v2ray.conf @@ -806,6 +811,7 @@ install_v2ray_ws_tls(){ dependency_install basic_optimization domain_check + old_config_exist_check port_alterid_set v2ray_install port_exist_check 80 From aa2d534f4002f3966ffc87cb55689df28705c9af Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 21:10:18 +0800 Subject: [PATCH 27/42] =?UTF-8?q?1.1.0=20=E6=97=A7=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=9D=E7=95=99bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index b33b1bd..e3cb174 100644 --- a/install.sh +++ b/install.sh @@ -504,16 +504,16 @@ v2ray_conf_add_h2(){ old_config_exist_check(){ if [[ -f $v2ray_qr_config_file ]] then - echo -e "${OK} ${Green} 检测到旧配置文件,是否读取旧文件配置 [Y/N]?" - read -r "" + echo -e "${OK} ${Green} 检测到旧配置文件,是否读取旧文件配置 [Y/N]? ${Font}" + read -r ssl_delete case $ssl_delete in [yY][eE][sS]|[yY]) - echo -e "${OK} ${Green} 已保留旧配置 [Y/N]?" + echo -e "${OK} ${Green} 已保留旧配置 [Y/N]? ${Font}" old_config_status="on" ;; *) rm -rf $v2ray_qr_config_file - echo -e "${OK} ${Green} 已删除旧配置 [Y/N]?" + echo -e "${OK} ${Green} 已删除旧配置 [Y/N]? ${Font}" ;; esac fi From 11b7e8369d24f798caeac137119c6ed41c5600cc Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 21:16:43 +0800 Subject: [PATCH 28/42] =?UTF-8?q?1.1.0=20=E9=97=B4=E6=8E=A5=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20v2ray=20daemon=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index e3cb174..4e86a89 100644 --- a/install.sh +++ b/install.sh @@ -311,6 +311,7 @@ v2ray_install(){ ## wget http://install.direct/go.sh if [[ -f go.sh ]];then + rm -rf $v2ray_systemd_file bash go.sh --force judge "安装 V2ray" else From c61c64837ee7d9808c98c20ad129219f498a0d85 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 21:17:16 +0800 Subject: [PATCH 29/42] =?UTF-8?q?1.1.0=20=E9=97=B4=E6=8E=A5=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20v2ray=20daemon=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 4e86a89..6d6fa43 100644 --- a/install.sh +++ b/install.sh @@ -312,6 +312,7 @@ v2ray_install(){ if [[ -f go.sh ]];then rm -rf $v2ray_systemd_file + systemctl daemon-reload bash go.sh --force judge "安装 V2ray" else From ff899d7d33195139a3d26e428ad4bf46a870c52e Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 21:26:24 +0800 Subject: [PATCH 30/42] =?UTF-8?q?1.1.0=20=E5=8F=98=E6=9B=B4v2ray=5Fqr=5Fco?= =?UTF-8?q?nfig=5Ffile=E4=BD=8D=E7=BD=AE=EF=BC=8C=E9=80=82=E9=85=8D?= =?UTF-8?q?=E6=97=A7=E9=85=8D=E7=BD=AE=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 6d6fa43..3e883fb 100644 --- a/install.sh +++ b/install.sh @@ -38,7 +38,7 @@ web_dir="/home/wwwroot" nginx_openssl_src="/usr/local/src" v2ray_bin_file="/usr/bin/v2ray" v2ray_info_file="$HOME/v2ray_info.inf" -v2ray_qr_config_file="/etc/v2ray/vmess_qr.json" +v2ray_qr_config_file="/usr/local/vmess_qr.json" nginx_systemd_file="/etc/systemd/system/nginx.service" v2ray_systemd_file="/etc/systemd/system/v2ray.service" v2ray_access_log="/var/log/v2ray/access.log" @@ -51,6 +51,9 @@ jemalloc_version="5.2.1" old_config_status="off" v2ray_plugin_version="$(wget -qO- "https://github.com/shadowsocks/v2ray-plugin/tags" |grep -E "/shadowsocks/v2ray-plugin/releases/tag/" |head -1|sed -r 's/.*tag\/v(.+)\">.*/\1/')" +#移动旧版本配置信息 对小于 1.1.0 版本适配 +[[ -f "/etc/v2ray/vmess_qr.json" ]] && mv /etc/v2ray/vmess_qr.json $v2ray_qr_config_file + #生成伪装路径 camouflage=`cat /dev/urandom | head -n 10 | md5sum | head -c 8` @@ -510,12 +513,12 @@ old_config_exist_check(){ read -r ssl_delete case $ssl_delete in [yY][eE][sS]|[yY]) - echo -e "${OK} ${Green} 已保留旧配置 [Y/N]? ${Font}" + echo -e "${OK} ${Green} 已保留旧配置 ${Font}" old_config_status="on" ;; *) rm -rf $v2ray_qr_config_file - echo -e "${OK} ${Green} 已删除旧配置 [Y/N]? ${Font}" + echo -e "${OK} ${Green} 已删除旧配置 ${Font}" ;; esac fi From 625f7a0d5218d7cafc555d4817af158933ba6889 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 21:33:31 +0800 Subject: [PATCH 31/42] =?UTF-8?q?1.1.0=20=E6=97=A7=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=80=82=E9=85=8D=20bug=20=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 3e883fb..b1c9958 100644 --- a/install.sh +++ b/install.sh @@ -238,7 +238,7 @@ port_alterid_set(){ modify_path(){ if [[ "on" == "$old_config_status" ]] then - camouflage="$(cat $v2ray_qr_config_file | grep '\"net\"' | awk -F '"' '{print $4}')" + camouflage="$(cat $v2ray_qr_config_file | grep '\"path\"' | awk -F '"' '{print $4}')" fi sed -i "/\"path\"/c \\\t \"path\":\"\/${camouflage}\/\"" ${v2ray_conf} judge "V2ray 伪装路径 修改" @@ -671,7 +671,7 @@ basic_information(){ echo -e "${Red} 地址(address):${Font} $(info_extraction "add") " >> ${v2ray_info_file} echo -e "${Red} 端口(port):${Font} $(info_extraction "port") " >> ${v2ray_info_file} echo -e "${Red} 用户id(UUID):${Font} $(info_extraction '\"id\"')" >> ${v2ray_info_file} - echo -e "${Red} 额外id(alterId):${Font} $(info_extraction "aid")" >> ${v2ray_info_file} + echo -e "${Red} 额外id(alterId):${Font} $(info_extraction '\"aid\"')" >> ${v2ray_info_file} echo -e "${Red} 加密方式(security):${Font} 自适应 " >> ${v2ray_info_file} echo -e "${Red} 传输协议(network):${Font} $(info_extraction "net") " >> ${v2ray_info_file} echo -e "${Red} 伪装类型(type):${Font} none " >> ${v2ray_info_file} From b139f17b317cedcd00d92dbb5d65674cd59d2526 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 21:35:00 +0800 Subject: [PATCH 32/42] =?UTF-8?q?1.1.0=20=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index b1c9958..fb0898f 100644 --- a/install.sh +++ b/install.sh @@ -342,11 +342,11 @@ nginx_install(){ # rm -rf /etc/nginx # fi - wget -nc http://nginx.org/download/nginx-${nginx_version}.tar.gz -P ${nginx_openssl_src} + wget -nc --no-check-certificate http://nginx.org/download/nginx-${nginx_version}.tar.gz -P ${nginx_openssl_src} judge "Nginx 下载" - wget -nc https://www.openssl.org/source/openssl-${openssl_version}.tar.gz -P ${nginx_openssl_src} + wget -nc --no-check-certificate https://www.openssl.org/source/openssl-${openssl_version}.tar.gz -P ${nginx_openssl_src} judge "openssl 下载" - wget -nc https://github.com/jemalloc/jemalloc/releases/download/${jemalloc_version}/jemalloc-${jemalloc_version}.tar.bz2 -P ${nginx_openssl_src} + wget -nc --no-check-certificate https://github.com/jemalloc/jemalloc/releases/download/${jemalloc_version}/jemalloc-${jemalloc_version}.tar.bz2 -P ${nginx_openssl_src} judge "jemalloc 下载" cd ${nginx_openssl_src} From dce8eaec41041bb3d82b26d9f56425bcc97adca9 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sat, 15 Feb 2020 21:35:46 +0800 Subject: [PATCH 33/42] =?UTF-8?q?1.1.0=20=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index fb0898f..42764f7 100644 --- a/install.sh +++ b/install.sh @@ -492,7 +492,7 @@ acme(){ } v2ray_conf_add_tls(){ cd /etc/v2ray - wget https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/tls/config.json -O config.json + wget --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/tls/config.json -O config.json modify_path modify_alterid modify_inbound_port @@ -500,7 +500,7 @@ v2ray_conf_add_tls(){ } v2ray_conf_add_h2(){ cd /etc/v2ray - wget https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/http2/config.json -O config.json + wget --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/http2/config.json -O config.json modify_path modify_alterid modify_inbound_port @@ -607,7 +607,7 @@ nginx_process_disabled(){ # judge "rc.local 配置" #} acme_cron_update(){ - [ ! -f ${ssl_update_file} ] && wget -P /usr/bin "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh" + [ ! -f ${ssl_update_file} ] && wget -P --no-check-certificate /usr/bin "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh" if [[ "${ID}" == "centos" ]];then # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ # &> /dev/null" /var/spool/cron/root From 9c2576f4d86fbbc54bb569626aff56c6a5d279d5 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sun, 16 Feb 2020 00:12:03 +0800 Subject: [PATCH 34/42] =?UTF-8?q?1.1.0=20=E5=85=B3=E9=97=AD=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E6=9B=B4=E6=96=B0=EF=BC=88=E5=8F=AF=E4=BB=A5=E9=80=89?= =?UTF-8?q?=E6=8B=A9N=EF=BC=89=20camouflage=20=E9=80=82=E9=85=8D=E6=97=A7?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BF=9D=E7=95=99=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 42764f7..0e1c207 100644 --- a/install.sh +++ b/install.sh @@ -55,7 +55,7 @@ v2ray_plugin_version="$(wget -qO- "https://github.com/shadowsocks/v2ray-plugin/t [[ -f "/etc/v2ray/vmess_qr.json" ]] && mv /etc/v2ray/vmess_qr.json $v2ray_qr_config_file #生成伪装路径 -camouflage=`cat /dev/urandom | head -n 10 | md5sum | head -c 8` +camouflage="/`cat /dev/urandom | head -n 10 | md5sum | head -c 8`/" source /etc/os-release @@ -240,13 +240,13 @@ modify_path(){ then camouflage="$(cat $v2ray_qr_config_file | grep '\"path\"' | awk -F '"' '{print $4}')" fi - sed -i "/\"path\"/c \\\t \"path\":\"\/${camouflage}\/\"" ${v2ray_conf} + sed -i "/\"path\"/c \\\t \"path\":\"${camouflage}\"" ${v2ray_conf} judge "V2ray 伪装路径 修改" } modify_alterid(){ if [[ "on" == "$old_config_status" ]] then - alterID="$(cat $v2ray_qr_config_file | grep '\"id\"' | awk -F '"' '{print $4}')" + alterID="$(cat $v2ray_qr_config_file | grep '\"aid\"' | awk -F '"' '{print $4}')" fi sed -i "/\"alterId\"/c \\\t \"alterId\":${alterID}" ${v2ray_conf} judge "V2ray alterid 修改" @@ -290,7 +290,7 @@ modify_nginx_port(){ } modify_nginx_other(){ sed -i "/server_name/c \\\tserver_name ${domain};" ${nginx_conf} - sed -i "/location/c \\\tlocation \/${camouflage}\/" ${nginx_conf} + sed -i "/location/c \\\tlocation ${camouflage}" ${nginx_conf} sed -i "/proxy_pass/c \\\tproxy_pass http://127.0.0.1:${PORT};" ${nginx_conf} sed -i "/return/c \\\treturn 301 https://${domain}\$request_uri;" ${nginx_conf} #sed -i "27i \\\tproxy_intercept_errors on;" ${nginx_dir}/conf/nginx.conf @@ -632,7 +632,7 @@ vmess_qr_config_tls_ws(){ "net": "ws", "type": "none", "host": "${domain}", - "path": "/${camouflage}/", + "path": "${camouflage}", "tls": "tls" } EOF @@ -649,7 +649,7 @@ vmess_qr_config_h2(){ "aid": "${alterID}", "net": "h2", "type": "none", - "path": "/${camouflage}/", + "path": "${camouflage}", "tls": "tls" } EOF @@ -869,9 +869,9 @@ update_sh(){ [yY][eE][sS]|[yY]) wget -N --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install.sh echo -e "${OK} ${Green} 更新完成 ${Font}" + exit 0 ;; *) - exit 0 ;; esac else @@ -905,6 +905,7 @@ list(){ } menu(){ + update_sh echo -e "\t V2ray 安装管理脚本 ${Red}[${shell_version}]${Font}" echo -e "\t---authored by wulabing---" echo -e "\thttps://github.com/wulabing\n" @@ -932,7 +933,6 @@ menu(){ echo -e "${Green}15.${Font} 更新 证书crontab计划任务" echo -e "${Green}16.${Font} 退出 \n" - update_sh read -p "请输入数字:" menu_num case $menu_num in 0) From 69041031a99c898f7db4ca99911fcafd4e265bf6 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sun, 16 Feb 2020 00:18:43 +0800 Subject: [PATCH 35/42] =?UTF-8?q?1.1.0=20h2=20=E7=89=88=E6=9C=AC=E6=97=A7?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BF=9D=E7=95=99=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 0e1c207..66869eb 100644 --- a/install.sh +++ b/install.sh @@ -843,6 +843,7 @@ install_v2_h2(){ dependency_install basic_optimization domain_check + old_config_exist_check port_alterid_set v2ray_install port_exist_check 80 From 03190a63a1dfc699028b49b8490ee1b1c83a4109 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sun, 16 Feb 2020 00:21:27 +0800 Subject: [PATCH 36/42] =?UTF-8?q?1.1.0=20=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 66869eb..ca0818a 100644 --- a/install.sh +++ b/install.sh @@ -28,6 +28,7 @@ Error="${Red}[错误]${Font}" # 版本 shell_version="1.1.0" shell_mode="None" +github_branch="dev" version_cmp="/tmp/version_cmp.tmp" v2ray_conf_dir="/etc/v2ray" nginx_conf_dir="/etc/nginx/conf/conf.d" @@ -492,7 +493,7 @@ acme(){ } v2ray_conf_add_tls(){ cd /etc/v2ray - wget --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/tls/config.json -O config.json + wget --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/${github_branch}/tls/config.json -O config.json modify_path modify_alterid modify_inbound_port @@ -500,7 +501,7 @@ v2ray_conf_add_tls(){ } v2ray_conf_add_h2(){ cd /etc/v2ray - wget --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/http2/config.json -O config.json + wget --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/${github_branch}/http2/config.json -O config.json modify_path modify_alterid modify_inbound_port @@ -771,7 +772,7 @@ bbr_boost_sh(){ } mtproxy_sh(){ [ -f "mtproxy_go.sh" ] && rm -rf ./mtproxy_go.sh - wget -N --no-check-certificate https://github.com/whunt1/onekeymakemtg/raw/master/mtproxy_go.sh && chmod +x mtproxy_go.sh && ./mtproxy_go.sh + wget -N --no-check-certificate https://github.com/whunt1/onekeymakemtg/raw/${github_branch}/mtproxy_go.sh && chmod +x mtproxy_go.sh && ./mtproxy_go.sh } uninstall_all(){ @@ -859,7 +860,7 @@ install_v2_h2(){ } update_sh(){ - ol_version=$(curl -L -s https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install.sh | grep "shell_version=" | head -1 |awk -F '=|"' '{print $3}') + ol_version=$(curl -L -s https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/${github_branch}/install.sh | grep "shell_version=" | head -1 |awk -F '=|"' '{print $3}') echo "$ol_version" > $version_cmp echo "$shell_version" >> $version_cmp if [[ "$shell_version" < "$(sort -rV $version_cmp | head -1)" ]] @@ -868,7 +869,7 @@ update_sh(){ read -r update_confirm case $update_confirm in [yY][eE][sS]|[yY]) - wget -N --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install.sh + wget -N --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/${github_branch}/install.sh echo -e "${OK} ${Green} 更新完成 ${Font}" exit 0 ;; From b0aec4abcec199991d66de1fb3f671f33a21a9fa Mon Sep 17 00:00:00 2001 From: wulabing Date: Sun, 16 Feb 2020 00:28:46 +0800 Subject: [PATCH 37/42] =?UTF-8?q?1.1.0=20=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index ca0818a..a22a0f3 100644 --- a/install.sh +++ b/install.sh @@ -257,7 +257,7 @@ modify_alterid(){ modify_inbound_port(){ if [[ "on" == "$old_config_status" ]] then - port="$(cat $v2ray_qr_config_file | grep '\"port\"' | awk -F '"' '{print $4}')" + port="$(info_extraction '\"port\"')" fi if [[ "$shell_mode" != "h2" ]] then @@ -272,7 +272,7 @@ modify_UUID(){ [ -z $UUID ] && UUID=$(cat /proc/sys/kernel/random/uuid) if [[ "on" == "$old_config_status" ]] then - UUID="$(cat $v2ray_qr_config_file | grep '\"id\"' | awk -F '"' '{print $4}')" + UUID="$(info_extraction '\"id\"')" fi sed -i "/\"id\"/c \\\t \"id\":\"${UUID}\"," ${v2ray_conf} judge "V2ray UUID 修改" @@ -282,7 +282,7 @@ modify_UUID(){ modify_nginx_port(){ if [[ "on" == "$old_config_status" ]] then - port="$(cat $v2ray_qr_config_file | grep '\"port\"' | awk -F '"' '{print $4}')" + port="$(info_extraction '\"port\"')" fi sed -i "/ssl http2;$/c \\\tlisten ${port} ssl http2;" ${nginx_conf} judge "V2ray port 修改" @@ -765,6 +765,8 @@ show_error_log(){ } ssl_update_manuel(){ [ -f ${amce_sh_file} ] && "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" || echo -e "${RedBG}证书签发工具不存在,请确认你是否使用了自己的证书${Font}" + domain="$(info_extraction '\"add\"')" + $HOME/.acme.sh/acme.sh --installcert -d ${domain} --fullchainpath /data/v2ray.crt --keypath /data/v2ray.key --ecc } bbr_boost_sh(){ [ -f "tcp.sh" ] && rm -rf ./tcp.sh From c8c27bcf38539830d8a0717e45e9379b444ec6d7 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sun, 16 Feb 2020 00:41:22 +0800 Subject: [PATCH 38/42] =?UTF-8?q?1.1.0=20=E8=AF=81=E4=B9=A6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 3 ++- ssl_update.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index a22a0f3..1e46d02 100644 --- a/install.sh +++ b/install.sh @@ -516,6 +516,7 @@ old_config_exist_check(){ [yY][eE][sS]|[yY]) echo -e "${OK} ${Green} 已保留旧配置 ${Font}" old_config_status="on" + port=$(info_extraction '\"port\"') ;; *) rm -rf $v2ray_qr_config_file @@ -608,7 +609,7 @@ nginx_process_disabled(){ # judge "rc.local 配置" #} acme_cron_update(){ - [ ! -f ${ssl_update_file} ] && wget -P --no-check-certificate /usr/bin "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh" + wget -P --no-check-certificate /usr/bin "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh" if [[ "${ID}" == "centos" ]];then # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ # &> /dev/null" /var/spool/cron/root diff --git a/ssl_update.sh b/ssl_update.sh index 5057e0f..607baec 100644 --- a/ssl_update.sh +++ b/ssl_update.sh @@ -2,8 +2,12 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH +v2ray_qr_config_file="/usr/local/vmess_qr.json" +domain=$(grep '\"add\"' $v2ray_qr_config_file | awk -F '"' '{print $4}') + systemctl stop nginx &> /dev/null -sleep 2 +sleep 1 "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" &> /dev/null -sleep 2 +"/root/.acme.sh"/acme.sh --installcert -d ${domain} --fullchainpath /data/v2ray.crt --keypath /data/v2ray.key --ecc +sleep 1 systemctl start nginx &> /dev/null From e93e884c0cae3d6dae7cf3c89d52c1215f344371 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sun, 16 Feb 2020 00:47:05 +0800 Subject: [PATCH 39/42] =?UTF-8?q?1.1.0=20=E6=81=A2=E5=A4=8Dconfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tls/config.json | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/tls/config.json b/tls/config.json index b1b5ac1..febee14 100644 --- a/tls/config.json +++ b/tls/config.json @@ -40,35 +40,24 @@ ], "dns": { "servers": [ - { - "address": "223.5.5.5", - "expectIPs": [ - "geoip:cn" - ] - }, - { - "address": "https+local://1.1.1.1/dns-query", - "domains": [ - "geosite:geolocation-!cn" - ] - }, - "localhost", - "1.1.1.1", - "1.0.0.1", - "8.8.8.8", - "8.8.4.4", + "https+local://1.1.1.1/dns-query", + "1.1.1.1", + "1.0.0.1", + "8.8.8.8", + "8.8.4.4", + "localhost" ] }, "routing": { - "domainStrategy": "AsIs", + "domainStrategy": "AsIs", "rules": [ { - "type": "field", + "type": "field", "inboundTag": [ "vmess-in" - ], + ], "outboundTag": "direct" } ] } -} +} \ No newline at end of file From d2d4e8ce68bbfd92affc6a30703b227c90a8884b Mon Sep 17 00:00:00 2001 From: wulabing Date: Sun, 16 Feb 2020 01:09:07 +0800 Subject: [PATCH 40/42] =?UTF-8?q?1.1.0=20bug=20=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 1e46d02..5d55217 100644 --- a/install.sh +++ b/install.sh @@ -609,7 +609,7 @@ nginx_process_disabled(){ # judge "rc.local 配置" #} acme_cron_update(){ - wget -P --no-check-certificate /usr/bin "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh" + wget -P /usr/bin --no-check-certificate "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh" if [[ "${ID}" == "centos" ]];then # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ # &> /dev/null" /var/spool/cron/root @@ -775,7 +775,7 @@ bbr_boost_sh(){ } mtproxy_sh(){ [ -f "mtproxy_go.sh" ] && rm -rf ./mtproxy_go.sh - wget -N --no-check-certificate https://github.com/whunt1/onekeymakemtg/raw/${github_branch}/mtproxy_go.sh && chmod +x mtproxy_go.sh && ./mtproxy_go.sh + wget -N --no-check-certificate https://github.com/whunt1/onekeymakemtg/raw/master/mtproxy_go.sh && chmod +x mtproxy_go.sh && ./mtproxy_go.sh } uninstall_all(){ From 12f0678591ed3d4db5b06c5d4b70aac2637fab10 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sun, 16 Feb 2020 01:13:50 +0800 Subject: [PATCH 41/42] =?UTF-8?q?1.1.0=20bug=20=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5d55217..e5f65e7 100644 --- a/install.sh +++ b/install.sh @@ -609,7 +609,7 @@ nginx_process_disabled(){ # judge "rc.local 配置" #} acme_cron_update(){ - wget -P /usr/bin --no-check-certificate "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh" + wget -N -P /usr/bin --no-check-certificate "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh" if [[ "${ID}" == "centos" ]];then # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ # &> /dev/null" /var/spool/cron/root From c121f914c3ad955baf6c8cc7a8cdb0409de1f593 Mon Sep 17 00:00:00 2001 From: wulabing Date: Sun, 16 Feb 2020 01:18:12 +0800 Subject: [PATCH 42/42] =?UTF-8?q?1.1.0=20=E7=89=88=E6=9C=AC=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 +++++++++ install.sh | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcc4b7e..61681be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 2020-2-16 +1.1.0 +* 修复 证书更新后未正确应用的问题 +* 添加 旧配置文件保留 +* 添加 安装流程 TLS 版本选择 +* 变更 v2ray_qr_config_file位置 +* 修复 v2ray daemon判断逻辑错误 +* 添加 Nginx 冲突检测 + ## 2020-2-7 1.0.7 * 修复 自动更新证书 Nginx 重启异常 diff --git a/install.sh b/install.sh index e5f65e7..30e4c0d 100644 --- a/install.sh +++ b/install.sh @@ -28,7 +28,7 @@ Error="${Red}[错误]${Font}" # 版本 shell_version="1.1.0" shell_mode="None" -github_branch="dev" +github_branch="master" version_cmp="/tmp/version_cmp.tmp" v2ray_conf_dir="/etc/v2ray" nginx_conf_dir="/etc/nginx/conf/conf.d"