From 6ade5e35bf59d2fb93075c1a72e3a3e94ea831ef Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Sun, 24 Apr 2022 11:09:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E4=BC=98=E5=8C=963?= =?UTF-8?q?02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 63 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/install.sh b/install.sh index 4385b83..d38ecfc 100644 --- a/install.sh +++ b/install.sh @@ -360,7 +360,7 @@ readConfigHostPathUUID() { currentDefaultPort= currentUUID= currentHost= - currentPort= + # currentPort= currentAdd= # 读取path if [[ -n "${configPath}" ]]; then @@ -395,7 +395,7 @@ readConfigHostPathUUID() { if [[ "${currentAdd}" == "null" ]]; then currentAdd=${currentHost} fi - currentPort=$(jq .inbounds[0].port ${configPath}${frontingType}.json) + # currentPort=$(jq .inbounds[0].port ${configPath}${frontingType}.json) elif [[ "${coreInstallType}" == "2" || "${coreInstallType}" == "3" ]]; then if [[ "${coreInstallType}" == "3" ]]; then @@ -410,7 +410,7 @@ readConfigHostPathUUID() { currentAdd=${currentHost} fi currentUUID=$(jq -r .inbounds[0].settings.clients[0].id ${configPath}${frontingType}.json) - currentPort=$(jq .inbounds[0].port ${configPath}${frontingType}.json) + # currentPort=$(jq .inbounds[0].port ${configPath}${frontingType}.json) fi } @@ -875,6 +875,9 @@ server { grpc_read_timeout 1071906480m; grpc_pass grpc://127.0.0.1:31304; } + location / { + add_header Strict-Transport-Security "max-age=15552000; preload" always; + } } EOF elif echo "${selectCustomInstallType}" | grep -q 5 || [[ -z "${selectCustomInstallType}" ]]; then @@ -2712,8 +2715,8 @@ showAccounts() { if echo ${currentInstallProtocolType} | grep -q 5; then echoContent skyBlue "\n=============================== VLESS gRPC TLS CDN ===============================\n" echoContent red "\n --->gRPC处于测试阶段,可能对你使用的客户端不兼容,如不能使用请忽略" - local serviceName - serviceName=$(jq -r .inbounds[0].streamSettings.grpcSettings.serviceName ${configPath}06_VLESS_gRPC_inbounds.json) + # local serviceName + # serviceName=$(jq -r .inbounds[0].streamSettings.grpcSettings.serviceName ${configPath}06_VLESS_gRPC_inbounds.json) jq .inbounds[0].settings.clients ${configPath}06_VLESS_gRPC_inbounds.json | jq -c '.[]' | while read -r user; do echoContent skyBlue "\n ---> 帐号:$(echo "${user}" | jq -r .email)_$(echo "${user}" | jq -r .id)" echo @@ -2735,8 +2738,8 @@ showAccounts() { if echo ${currentInstallProtocolType} | grep -q 2; then echoContent skyBlue "\n================================ Trojan gRPC TLS ================================\n" echoContent red "\n --->gRPC处于测试阶段,可能对你使用的客户端不兼容,如不能使用请忽略" - local serviceName= - serviceName=$(jq -r .inbounds[0].streamSettings.grpcSettings.serviceName ${configPath}04_trojan_gRPC_inbounds.json) + # local serviceName= + # serviceName=$(jq -r .inbounds[0].streamSettings.grpcSettings.serviceName ${configPath}04_trojan_gRPC_inbounds.json) jq .inbounds[0].settings.clients ${configPath}04_trojan_gRPC_inbounds.json | jq -c '.[]' | while read -r user; do echoContent skyBlue "\n ---> 帐号:$(echo "${user}" | jq -r .email)_$(echo "${user}" | jq -r .password)" echo @@ -2751,15 +2754,19 @@ showAccounts() { # 移除nginx302配置 removeNginx302() { # 查找到302那行并删除 - local line302Result= - line302Result=$(grep -n "return 302" 移除302重定向成功" - exit 0 - fi + # local line302Result= + # line302Result=$(grep -n "return 302" /etc/nginx/conf.d/tmpfile && mv /etc/nginx/conf.d/tmpfile /etc/nginx/conf.d/alone.conf + count=$((count + 1)) + else + echoContent red " ---> 302添加失败" + backupNginxConfig restoreBackup + fi - if [[ -n "${line302Result}" ]]; then - sed "$(echo "${line302Result}" | awk -F "[:]" '{print $1}')i return 302 '$1';" /etc/nginx/conf.d/alone.conf >/etc/nginx/conf.d/tmpfile && mv /etc/nginx/conf.d/tmpfile /etc/nginx/conf.d/alone.conf - else - echoContent red " ---> 302添加失败" - backupNginxConfig restoreBackup - fi + done } + # 更新伪装站 updateNginxBlog() { echoContent skyBlue "\n进度 $1/${totalProgress} : 更换伪装站点" @@ -4541,7 +4556,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.5.62" + echoContent green "当前版本:v2.5.63" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus