feat(脚本): 选择1.安装时默认安装reality(自己获取自己的SSL)

dev
mack-a 2023-03-26 22:49:10 +08:00
parent b7de041480
commit 270f92d996
1 changed files with 48 additions and 36 deletions

View File

@ -2953,7 +2953,6 @@ initXrayConfig() {
currentClients='[{"id":"'${uuid}'","add":"'${add}'","flow":"xtls-rprx-vision","email":"default-VLESS_TCP/TLS_Vision"}]' currentClients='[{"id":"'${uuid}'","add":"'${add}'","flow":"xtls-rprx-vision","email":"default-VLESS_TCP/TLS_Vision"}]'
echoContent yellow "\n ${uuid}" echoContent yellow "\n ${uuid}"
fi fi
# movePreviousConfig
# log # log
if [[ ! -f "/etc/v2ray-agent/xray/conf/00_log.json" ]]; then if [[ ! -f "/etc/v2ray-agent/xray/conf/00_log.json" ]]; then
@ -3196,11 +3195,22 @@ EOF
fi fi
# VLESS_TCP/reality # VLESS_TCP/reality
if echo "${selectCustomInstallType}" | grep -q 7; then if echo "${selectCustomInstallType}" | grep -q 7 || [[ "$1" == "all" ]]; then
local defaultPort=443 local defaultPort=443
if [[ -n "${customPort}" ]]; then if [[ -n "${customPort}" ]]; then
defaultPort=${customPort} defaultPort=${customPort}
fi fi
if [[ "$1" == "all" ]]; then
echoContent skyBlue "\n===================== 配置VLESS+Reality =====================\n"
initRealityPort
local defaultPort=443
if [[ -n "${customPort}" ]]; then
defaultPort=${customPort}
fi
realityDestDomain=${domain}:${defaultPort}
initRealityKey
realityServerNames=\"${domain}\"
fi
cat <<EOF >/etc/v2ray-agent/xray/conf/07_VLESS_vision_reality_inbounds.json cat <<EOF >/etc/v2ray-agent/xray/conf/07_VLESS_vision_reality_inbounds.json
{ {
@ -3269,48 +3279,50 @@ EOF
} }
EOF EOF
else fi
if echo "${selectCustomInstallType}" | grep -q 0 || [[ "$1" == "all" ]]; then
local defaultPort=443 local defaultPort=443
if [[ -n "${customPort}" ]]; then if [[ -n "${customPort}" ]]; then
defaultPort=${customPort} defaultPort=${customPort}
fi fi
cat <<EOF >/etc/v2ray-agent/xray/conf/02_VLESS_TCP_inbounds.json cat <<EOF >/etc/v2ray-agent/xray/conf/02_VLESS_TCP_inbounds.json
{
"inbounds":[
{ {
"port": ${defaultPort}, "inbounds":[
"protocol": "vless",
"tag":"VLESSTCP",
"settings": {
"clients":$(initXrayClients 0),
"decryption": "none",
"fallbacks": [
${fallbacksList}
]
},
"streamSettings": {
"network": "tcp",
"security": "tls",
"tlsSettings": {
"minVersion": "1.2",
"alpn": [
"http/1.1",
"h2"
],
"certificates": [
{ {
"certificateFile": "/etc/v2ray-agent/tls/${domain}.crt", "port": ${defaultPort},
"keyFile": "/etc/v2ray-agent/tls/${domain}.key", "protocol": "vless",
"ocspStapling": 3600, "tag":"VLESSTCP",
"usage":"encipherment" "settings": {
"clients":$(initXrayClients 0),
"decryption": "none",
"fallbacks": [
${fallbacksList}
]
},
"streamSettings": {
"network": "tcp",
"security": "tls",
"tlsSettings": {
"minVersion": "1.2",
"alpn": [
"http/1.1",
"h2"
],
"certificates": [
{
"certificateFile": "/etc/v2ray-agent/tls/${domain}.crt",
"keyFile": "/etc/v2ray-agent/tls/${domain}.key",
"ocspStapling": 3600,
"usage":"encipherment"
}
]
}
}
}
]
} }
]
}
}
}
]
}
EOF EOF
fi fi
@ -5936,7 +5948,7 @@ menu() {
cd "$HOME" || exit cd "$HOME" || exit
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者mack-a" echoContent green "作者mack-a"
echoContent green "当前版本v2.7.22_reality_beta" echoContent green "当前版本v2.7.23_reality_beta"
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