feat(脚本): xray-core自定义安装可安装无需域名的reality

pull/1006/head
mack-a 2024-03-13 11:09:36 +08:00
parent 498166b1e8
commit 340107be84
1 changed files with 40 additions and 24 deletions

View File

@ -1314,7 +1314,7 @@ updateRedirectNginxConf() {
} }
EOF EOF
if echo "${selectCustomInstallType}" | grep -q ",2," && echo "${selectCustomInstallType}" | grep -q ",5," || [[ -z "${selectCustomInstallType}" ]]; then if echo "${selectCustomInstallType}" | grep -qE ",2,|,5," || [[ -z "${selectCustomInstallType}" ]]; then
cat <<EOF >>${nginxConfigPath}alone.conf cat <<EOF >>${nginxConfigPath}alone.conf
server { server {
@ -3817,7 +3817,7 @@ EOF
fi fi
# VLESS_WS_TLS # VLESS_WS_TLS
if echo "${selectCustomInstallType}" | grep -q 1 || [[ "$1" == "all" ]]; then if echo "${selectCustomInstallType}" | grep -q ",1," || [[ "$1" == "all" ]]; then
fallbacksList=${fallbacksList}',{"path":"/'${customPath}'ws","dest":31297,"xver":1}' fallbacksList=${fallbacksList}',{"path":"/'${customPath}'ws","dest":31297,"xver":1}'
cat <<EOF >/etc/v2ray-agent/xray/conf/03_VLESS_WS_inbounds.json cat <<EOF >/etc/v2ray-agent/xray/conf/03_VLESS_WS_inbounds.json
{ {
@ -7292,7 +7292,7 @@ customSingBoxInstall() {
# Xray-core个性化安装 # Xray-core个性化安装
customXrayInstall() { customXrayInstall() {
echoContent skyBlue "\n========================个性化安装============================" echoContent skyBlue "\n========================个性化安装============================"
echoContent yellow "VLESS前置默认安装0如果只需要安装0则只选择0即可" echoContent yellow "VLESS前置默认安装0无域名安装Reality只选择7即可"
echoContent yellow "0.VLESS+TLS_Vision+TCP[推荐]" echoContent yellow "0.VLESS+TLS_Vision+TCP[推荐]"
echoContent yellow "1.VLESS+TLS+WS[仅CDN推荐]" echoContent yellow "1.VLESS+TLS+WS[仅CDN推荐]"
echoContent yellow "2.Trojan+TLS+gRPC[仅CDN推荐]" echoContent yellow "2.Trojan+TLS+gRPC[仅CDN推荐]"
@ -7311,19 +7311,26 @@ customXrayInstall() {
echoContent red " ---> 多选请使用英文逗号分隔" echoContent red " ---> 多选请使用英文逗号分隔"
exit 0 exit 0
fi fi
if [[ "${selectCustomInstallType: -1}" != "," ]]; then if [[ "${selectCustomInstallType//,/}" =~ ^[0-5]+$ ]]; then
selectCustomInstallType="${selectCustomInstallType}," if ! echo "${selectCustomInstallType}" | grep -q "0,"; then
selectCustomInstallType=",0,${selectCustomInstallType},"
else
selectCustomInstallType=",${selectCustomInstallType},"
fi
fi fi
if [[ "${selectCustomInstallType}" == "7" ]]; then
if [[ "${selectCustomInstallType:0:1}" != "," ]]; then
selectCustomInstallType=",${selectCustomInstallType}," selectCustomInstallType=",${selectCustomInstallType},"
fi fi
if [[ "${selectCustomInstallType//,/}" =~ ^[0-7]+$ ]]; then # if [[ "${selectCustomInstallType: -1}" != "," ]]; then
# selectCustomInstallType="${selectCustomInstallType},"
# fi
#
# if [[ "${selectCustomInstallType:0:1}" != "," ]]; then
# selectCustomInstallType=",${selectCustomInstallType},"
# fi
if ! echo "${selectCustomInstallType}" | grep -q ",0,"; then if [[ "${selectCustomInstallType//,/}" =~ ^[0-7]+$ ]]; then
selectCustomInstallType=",0,${selectCustomInstallType},"
fi
unInstallSubscribe unInstallSubscribe
checkBTPanel checkBTPanel
totalProgress=12 totalProgress=12
@ -7334,15 +7341,18 @@ customXrayInstall() {
customPortFunction customPortFunction
else else
# 申请tls # 申请tls
initTLSNginxConfig 2 if [[ "${selectCustomInstallType}" != ",7," ]]; then
handleXray stop initTLSNginxConfig 2
# handleNginx start handleXray stop
installTLS 3 installTLS 3
else
echoContent skyBlue "\n进度 2/${totalProgress} : 检测到仅安装Reality跳过TLS证书步骤"
fi
fi fi
handleNginx stop handleNginx stop
# 随机path # 随机path
if echo "${selectCustomInstallType}" | grep -q ",1," || echo "${selectCustomInstallType}" | grep -q ",2," || echo "${selectCustomInstallType}" | grep -q ",3," || echo "${selectCustomInstallType}" | grep -q ",5,"; then if echo "${selectCustomInstallType}" | grep -qE ",1,|,2,|,3,|,5,"; then
randomPathFunction 4 randomPathFunction 4
fi fi
if [[ -n "${btDomain}" ]]; then if [[ -n "${btDomain}" ]]; then
@ -7350,16 +7360,20 @@ customXrayInstall() {
else else
nginxBlog 6 nginxBlog 6
fi fi
updateRedirectNginxConf if [[ "${selectCustomInstallType}" != ",7," ]]; then
handleNginx start updateRedirectNginxConf
handleNginx start
fi
# 安装Xray # 安装Xray
installXray 7 false installXray 7 false
installXrayService 8 installXrayService 8
initXrayConfig custom 9 initXrayConfig custom 9
cleanUp singBoxDel cleanUp singBoxDel
if [[ "${selectCustomInstallType}" != ",7," ]]; then
installCronTLS 10
fi
installCronTLS 10
handleXray stop handleXray stop
handleXray start handleXray start
# 生成账号 # 生成账号
@ -7609,17 +7623,18 @@ installSubscribe() {
local SSLType= local SSLType=
local listenIPv6= local listenIPv6=
if [[ "${coreInstallType}" == "2" || "${selectCoreType}" == "2" ]] && [[ -z "${subscribePort}" ]]; then if [[ "${coreInstallType}" == "2" || "${coreInstallType}" == "1" || "${selectCoreType}" == "2" || "${selectCoreType}" == "1" ]] && [[ -z "${subscribePort}" ]]; then
nginxVersion=$(nginx -v 2>&1) nginxVersion=$(nginx -v 2>&1)
echoContent yellow "开始配置订阅,请输入订阅的端口\n" echoContent yellow "开始配置订阅,请输入订阅的端口\n"
mapfile -t result < <(initSingBoxPort "${subscribePort}") mapfile -t result < <(initSingBoxPort "${subscribePort}")
echo
echoContent yellow " ---> 开始配置订阅的伪装站点\n" echoContent yellow " ---> 开始配置订阅的伪装站点\n"
nginxBlog nginxBlog
local httpSubscribeStatus= local httpSubscribeStatus=
if [[ "${selectInstallType}" == "2" || "${coreInstallType}" == "2" ]]; then if [[ "${selectInstallType}" == "2" || "${coreInstallType}" == "2" && "${selectInstallType}" == "1" || "${coreInstallType}" == "1" ]]; then
if [[ -n "${selectCustomInstallType}" ]] && ! echo "${selectCustomInstallType}" | grep -q -E ",0,|,1,|,2,|,3,|,4,|,5,|,6,|,9,|,10,"; then if [[ -n "${selectCustomInstallType}" ]] && ! echo "${selectCustomInstallType}" | grep -q -E ",0,|,1,|,2,|,3,|,4,|,5,|,6,|,9,|,10,"; then
httpSubscribeStatus=true httpSubscribeStatus=true
elif [[ -n "${currentInstallProtocolType}" ]] && ! echo "${currentInstallProtocolType}" | grep -q -E ",0,|,1,|,2,|,3,|,4,|,5,|,6,|,9,|,10,"; then elif [[ -n "${currentInstallProtocolType}" ]] && ! echo "${currentInstallProtocolType}" | grep -q -E ",0,|,1,|,2,|,3,|,4,|,5,|,6,|,9,|,10,"; then
@ -8107,8 +8122,9 @@ initRandomSalt() {
# 订阅 # 订阅
subscribe() { subscribe() {
readInstallProtocolType readInstallProtocolType
if [[ "${coreInstallType}" == "1" && "${selectCustomInstallType}" == ",7," ]] || [[ "${coreInstallType}" == "2" ]]; then
installSubscribe installSubscribe
fi
readNginxSubscribe readNginxSubscribe
if [[ "${coreInstallType}" == "1" || "${coreInstallType}" == "2" ]]; then if [[ "${coreInstallType}" == "1" || "${coreInstallType}" == "2" ]]; then
@ -8703,7 +8719,7 @@ menu() {
cd "$HOME" || exit cd "$HOME" || exit
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者mack-a" echoContent green "作者mack-a"
echoContent green "当前版本v3.2.19" echoContent green "当前版本v3.2.20"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent" echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c" echoContent green "描述:八合一共存脚本\c"
showInstallStatus showInstallStatus