mirror of
https://github.com/mack-a/v2ray-agent.git
synced 2026-09-02 13:56:37 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c15f06d211 | ||
|
|
11da068e9a | ||
|
|
7b151c9623 | ||
|
|
89388ca675 | ||
|
|
8cf91bb313 | ||
|
|
85a2e32188 | ||
|
|
c959c40b32 | ||
|
|
e33374a74d | ||
|
|
e53655d573 |
+12
-47
@@ -4,6 +4,12 @@
|
||||
"level": "info",
|
||||
"timestamp": true
|
||||
},
|
||||
"http_clients": [
|
||||
{
|
||||
"tag": "rule_set_http",
|
||||
"detour": "本地直连"
|
||||
}
|
||||
],
|
||||
"experimental": {
|
||||
"clash_api": {
|
||||
"external_controller": "127.0.0.1:9090",
|
||||
@@ -24,8 +30,7 @@
|
||||
"server": "1.1.1.1",
|
||||
"server_port": 443,
|
||||
"detour": "自动选择",
|
||||
"path": "/dns-query",
|
||||
"domain_resolver": "dns_resolver"
|
||||
"path": "/dns-query"
|
||||
},
|
||||
{
|
||||
"tag": "dns_direct",
|
||||
@@ -33,18 +38,12 @@
|
||||
"server": "dns.alidns.com",
|
||||
"server_port": 443,
|
||||
"path": "/dns-query",
|
||||
"domain_resolver": "dns_resolver"
|
||||
"domain_resolver": "local"
|
||||
},
|
||||
{
|
||||
"tag": "google",
|
||||
"type": "tls",
|
||||
"server": "8.8.4.4",
|
||||
"domain_resolver": "dns_resolver"
|
||||
},
|
||||
{
|
||||
"tag": "dns_resolver",
|
||||
"type": "udp",
|
||||
"server": "114.114.114.114"
|
||||
"server": "8.8.4.4"
|
||||
},
|
||||
{
|
||||
"type": "local",
|
||||
@@ -73,35 +72,10 @@
|
||||
"server": "dns_proxy"
|
||||
}
|
||||
],
|
||||
"independent_cache": true,
|
||||
"strategy": "prefer_ipv4",
|
||||
"final": "dns_direct"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"type": "tun",
|
||||
"tag": "tun-in",
|
||||
"stack": "system",
|
||||
"address": [
|
||||
"172.18.0.1/30",
|
||||
"fdfe:dcba:9876::1/126"
|
||||
],
|
||||
"route_address": [
|
||||
"0.0.0.0/1",
|
||||
"128.0.0.0/1",
|
||||
"::/1",
|
||||
"8000::/1"
|
||||
],
|
||||
"route_exclude_address": [
|
||||
"192.168.0.0/16",
|
||||
"10.0.0.0/8",
|
||||
"172.16.0.0/12",
|
||||
"fc00::/7"
|
||||
],
|
||||
"mtu": 9000,
|
||||
"auto_route": true,
|
||||
"strict_route": true
|
||||
},
|
||||
{
|
||||
"type": "mixed",
|
||||
"tag": "mixed-in",
|
||||
@@ -210,10 +184,8 @@
|
||||
}
|
||||
],
|
||||
"route": {
|
||||
"default_domain_resolver": {
|
||||
"server": "dns_resolver",
|
||||
"strategy": "prefer_ipv4"
|
||||
},
|
||||
"default_http_client": "rule_set_http",
|
||||
"default_domain_resolver": "local",
|
||||
"rule_set": [
|
||||
{
|
||||
"tag": "geosite-category-ads-all",
|
||||
@@ -348,11 +320,6 @@
|
||||
"action": "sniff",
|
||||
"timeout": "1s"
|
||||
},
|
||||
{
|
||||
"inbound": "tun-in",
|
||||
"action": "sniff",
|
||||
"timeout": "1s"
|
||||
},
|
||||
{
|
||||
"protocol": "dns",
|
||||
"action": "hijack-dns"
|
||||
@@ -454,8 +421,6 @@
|
||||
"outbound": "本地直连"
|
||||
}
|
||||
],
|
||||
"final": "本地直连",
|
||||
"auto_detect_interface": true
|
||||
"final": "本地直连"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+91
-55
@@ -200,6 +200,7 @@ initVar() {
|
||||
# xray-core reality serverName publicKey
|
||||
xrayVLESSRealityServerName=
|
||||
xrayVLESSRealityPort=
|
||||
xrayVLESSRealityVisionPort=
|
||||
xrayVLESSRealityXHTTPServerName=
|
||||
xrayVLESSRealityXHTTPort=
|
||||
# xrayVLESSRealityPublicKey=
|
||||
@@ -425,6 +426,7 @@ readInstallProtocolType() {
|
||||
frontingType=
|
||||
|
||||
xrayVLESSRealityPort=
|
||||
xrayVLESSRealityVisionPort=
|
||||
xrayVLESSRealityServerName=
|
||||
|
||||
xrayVLESSRealityXHTTPort=
|
||||
@@ -476,6 +478,8 @@ readInstallProtocolType() {
|
||||
xrayVLESSRealityXHTTPServerName=$(jq -r .inbounds[0].streamSettings.realitySettings.serverNames[0] "${row}.json")
|
||||
|
||||
currentRealityXHTTPPublicKey=$(jq -r .inbounds[0].streamSettings.realitySettings.publicKey "${row}.json")
|
||||
currentRealityMldsa65Seed=$(jq -r '.inbounds[0].streamSettings.realitySettings.mldsa65Seed // empty' "${row}.json")
|
||||
currentRealityMldsa65Verify=$(jq -r '.inbounds[0].streamSettings.realitySettings.mldsa65Verify // empty' "${row}.json")
|
||||
# currentRealityXHTTPPrivateKey=$(jq -r .inbounds[0].streamSettings.realitySettings.privateKey "${row}.json")
|
||||
|
||||
# if [[ "${coreInstallType}" == "2" ]]; then
|
||||
@@ -523,8 +527,8 @@ readInstallProtocolType() {
|
||||
currentRealityPublicKey=$(jq -r .inbounds[1].streamSettings.realitySettings.publicKey "${row}.json")
|
||||
currentRealityPrivateKey=$(jq -r .inbounds[1].streamSettings.realitySettings.privateKey "${row}.json")
|
||||
|
||||
currentRealityMldsa65Seed=$(jq -r .inbounds[1].streamSettings.realitySettings.mldsa65Seed "${row}.json")
|
||||
currentRealityMldsa65Verify=$(jq -r .inbounds[1].streamSettings.realitySettings.mldsa65Verify "${row}.json")
|
||||
currentRealityMldsa65Seed=$(jq -r '.inbounds[1].streamSettings.realitySettings.mldsa65Seed // empty' "${row}.json")
|
||||
currentRealityMldsa65Verify=$(jq -r '.inbounds[1].streamSettings.realitySettings.mldsa65Verify // empty' "${row}.json")
|
||||
|
||||
frontingTypeReality=07_VLESS_vision_reality_inbounds
|
||||
|
||||
@@ -1876,16 +1880,21 @@ selectAcmeInstallSSL() {
|
||||
# 安装SSL证书
|
||||
acmeInstallSSL() {
|
||||
local dnsAPIDomain="${tlsDomain}"
|
||||
local dnsAPIExtraDomain="-d ${dnsTLSDomain}"
|
||||
if [[ "${dnsAPIStatus}" == "y" ]]; then
|
||||
dnsAPIDomain="*.${dnsTLSDomain}"
|
||||
else
|
||||
# 用户选择不使用通配符时,只为自己输入的子域申请证书,
|
||||
# 避免脚本追加根域 -d ${dnsTLSDomain} 导致根域不属于自己(例如 dpdns.org 等公共后缀)时签发失败
|
||||
dnsAPIExtraDomain=""
|
||||
fi
|
||||
|
||||
if [[ "${dnsAPIType}" == "cloudflare" ]]; then
|
||||
echoContent green " ---> DNS API 生成证书中"
|
||||
sudo CF_Token="${cfAPIToken}" "$HOME/.acme.sh/acme.sh" --issue -d "${dnsAPIDomain}" -d "${dnsTLSDomain}" --dns dns_cf -k ec-256 --server "${sslType}" ${sslIPv6} 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null
|
||||
sudo CF_Token="${cfAPIToken}" "$HOME/.acme.sh/acme.sh" --issue -d "${dnsAPIDomain}" ${dnsAPIExtraDomain} --dns dns_cf -k ec-256 --server "${sslType}" ${sslIPv6} 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null
|
||||
elif [[ "${dnsAPIType}" == "aliyun" ]]; then
|
||||
echoContent green " ---> DNS API 生成证书中"
|
||||
sudo Ali_Key="${aliKey}" Ali_Secret="${aliSecret}" "$HOME/.acme.sh/acme.sh" --issue -d "${dnsAPIDomain}" -d "${dnsTLSDomain}" --dns dns_ali -k ec-256 --server "${sslType}" ${sslIPv6} 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null
|
||||
sudo Ali_Key="${aliKey}" Ali_Secret="${aliSecret}" "$HOME/.acme.sh/acme.sh" --issue -d "${dnsAPIDomain}" ${dnsAPIExtraDomain} --dns dns_ali -k ec-256 --server "${sslType}" ${sslIPv6} 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null
|
||||
else
|
||||
echoContent green " ---> 生成证书中"
|
||||
sudo "$HOME/.acme.sh/acme.sh" --issue -d "${tlsDomain}" --standalone -k ec-256 --server "${sslType}" ${sslIPv6} 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null
|
||||
@@ -2502,10 +2511,15 @@ updateXray() {
|
||||
readInstallType
|
||||
|
||||
if [[ -z "${coreInstallType}" || "${coreInstallType}" != "1" ]]; then
|
||||
|
||||
if [[ "${prereleaseStatus}" == "true" ]]; then
|
||||
version=$(curl -s "https://api.github.com/repos/XTLS/Xray-core/releases?per_page=5" | jq -r ".[]|select (.prerelease==${prereleaseStatus})|.tag_name" | head -1)
|
||||
else
|
||||
version=$(curl -s https://api.github.com/repos/XTLS/Xray-core/releases/latest | jq -r .tag_name)
|
||||
fi
|
||||
|
||||
if [[ -n "$1" ]]; then
|
||||
version=$1
|
||||
else
|
||||
version=$(curl -s "https://api.github.com/repos/XTLS/Xray-core/releases?per_page=5" | jq -r ".[]|select (.prerelease==${prereleaseStatus})|.tag_name" | head -1)
|
||||
fi
|
||||
|
||||
echoContent green " ---> Xray-core版本:${version}"
|
||||
@@ -3280,43 +3294,6 @@ initTuicProtocol() {
|
||||
#EOF
|
||||
#}
|
||||
|
||||
# 初始化singbox route配置
|
||||
initSingBoxRouteConfig() {
|
||||
downloadSingBoxGeositeDB
|
||||
local outboundTag=$1
|
||||
if [[ ! -f "${singBoxConfigPath}${outboundTag}_route.json" ]]; then
|
||||
cat <<EOF >"${singBoxConfigPath}${outboundTag}_route.json"
|
||||
{
|
||||
"route": {
|
||||
"geosite": {
|
||||
"path": "${singBoxConfigPath}geosite.db"
|
||||
},
|
||||
"rules": [
|
||||
{
|
||||
"domain": [
|
||||
],
|
||||
"geosite": [
|
||||
],
|
||||
"outbound": "${outboundTag}"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
# 下载sing-box geosite db
|
||||
downloadSingBoxGeositeDB() {
|
||||
if [[ ! -f "${singBoxConfigPath}geosite.db" ]]; then
|
||||
if [[ "${release}" == "alpine" ]]; then
|
||||
wget -q -P "${singBoxConfigPath}" https://github.com/Johnshall/sing-geosite/releases/latest/download/geosite.db
|
||||
else
|
||||
wget -q "${wgetShowProgressStatus}" -P "${singBoxConfigPath}" https://github.com/Johnshall/sing-geosite/releases/latest/download/geosite.db
|
||||
fi
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
# 添加sing-box路由规则
|
||||
addSingBoxRouteRule() {
|
||||
local outboundTag=$1
|
||||
@@ -4033,6 +4010,9 @@ EOF
|
||||
],
|
||||
"privateKey": "${realityPrivateKey}",
|
||||
"publicKey": "${realityPublicKey}",
|
||||
"mldsa65Seed": "${realityMldsa65Seed}",
|
||||
"mldsa65Verify": "${realityMldsa65Verify}",
|
||||
"minClientVer": "1.8.2",
|
||||
"maxTimeDiff": 70000,
|
||||
"shortIds": [
|
||||
"",
|
||||
@@ -4201,6 +4181,7 @@ EOF
|
||||
"publicKey": "${realityPublicKey}",
|
||||
"mldsa65Seed": "${realityMldsa65Seed}",
|
||||
"mldsa65Verify": "${realityMldsa65Verify}",
|
||||
"minClientVer": "1.8.2",
|
||||
"maxTimeDiff": 70000,
|
||||
"shortIds": [
|
||||
"",
|
||||
@@ -4887,13 +4868,20 @@ EOF
|
||||
|
||||
elif [[ "${type}" == "vlessXHTTP" ]]; then
|
||||
|
||||
local xhttpMldsa65Param=
|
||||
local xhttpMldsa65ParamEncoded=
|
||||
if [[ -n "${currentRealityMldsa65Verify}" && "${currentRealityMldsa65Verify}" != "null" ]]; then
|
||||
xhttpMldsa65Param="&pqv=${currentRealityMldsa65Verify}"
|
||||
xhttpMldsa65ParamEncoded="%26pqv%3D${currentRealityMldsa65Verify}"
|
||||
fi
|
||||
|
||||
echoContent yellow " ---> 通用格式(VLESS+reality+XHTTP)"
|
||||
echoContent green " vless://${id}@${add}:${port}?encryption=none&security=reality&type=xhttp&sni=${xrayVLESSRealityXHTTPServerName}&host=${xrayVLESSRealityXHTTPServerName}&fp=chrome&path=${path}&pbk=${currentRealityXHTTPPublicKey}&sid=6ba85179e30d4fc2#${email}\n"
|
||||
echoContent green " vless://${id}@${add}:${port}?encryption=none&security=reality${xhttpMldsa65Param}&type=xhttp&sni=${xrayVLESSRealityXHTTPServerName}&host=${xrayVLESSRealityXHTTPServerName}&fp=chrome&path=${path}&pbk=${currentRealityXHTTPPublicKey}&sid=6ba85179e30d4fc2#${email}\n"
|
||||
|
||||
echoContent yellow " ---> 格式化明文(VLESS+reality+XHTTP)"
|
||||
echoContent green "协议类型:VLESS reality,地址:${add},publicKey:${currentRealityXHTTPPublicKey},shortId: 6ba85179e30d4fc2,serverNames:${xrayVLESSRealityXHTTPServerName},端口:${port},路径:${path},SNI:${xrayVLESSRealityXHTTPServerName},伪装域名:${xrayVLESSRealityXHTTPServerName},用户ID:${id},传输方式:xhttp,账户名:${email}\n"
|
||||
cat <<EOF >>"/etc/v2ray-agent/subscribe_local/default/${user}"
|
||||
vless://${id}@${add}:${port}?encryption=none&security=reality&type=xhttp&sni=${xrayVLESSRealityXHTTPServerName}&fp=chrome&path=${path}&pbk=${currentRealityXHTTPPublicKey}&sid=6ba85179e30d4fc2#${email}
|
||||
vless://${id}@${add}:${port}?encryption=none&security=reality${xhttpMldsa65Param}&type=xhttp&sni=${xrayVLESSRealityXHTTPServerName}&fp=chrome&path=${path}&pbk=${currentRealityXHTTPPublicKey}&sid=6ba85179e30d4fc2#${email}
|
||||
EOF
|
||||
|
||||
cat <<EOF >>"/etc/v2ray-agent/subscribe_local/clashMeta/${user}"
|
||||
@@ -4918,7 +4906,7 @@ EOF
|
||||
EOF
|
||||
|
||||
echoContent yellow " ---> 二维码 VLESS(VLESS+reality+XHTTP)"
|
||||
echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless%3A%2F%2F${id}%40${add}%3A${port}%3Fencryption%3Dnone%26security%3Dreality%26type%3Dxhttp%26sni%3D${xrayVLESSRealityXHTTPServerName}%26fp%3Dchrome%26path%3D${path}%26host%3D${xrayVLESSRealityXHTTPServerName}%26pbk%3D${currentRealityXHTTPPublicKey}%26sid%3D6ba85179e30d4fc2%23${email}\n"
|
||||
echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless%3A%2F%2F${id}%40${add}%3A${port}%3Fencryption%3Dnone%26security%3Dreality${xhttpMldsa65ParamEncoded}%26type%3Dxhttp%26sni%3D${xrayVLESSRealityXHTTPServerName}%26fp%3Dchrome%26path%3D${path}%26host%3D${xrayVLESSRealityXHTTPServerName}%26pbk%3D${currentRealityXHTTPPublicKey}%26sid%3D6ba85179e30d4fc2%23${email}\n"
|
||||
|
||||
elif
|
||||
[[ "${type}" == "vlessgrpc" ]]
|
||||
@@ -5247,6 +5235,20 @@ EOF
|
||||
|
||||
}
|
||||
|
||||
# 获取Reality订阅端口
|
||||
getRealitySubscriptionPort() {
|
||||
local protocol=$1
|
||||
if [[ "${coreInstallType}" == "2" ]]; then
|
||||
if [[ "${protocol}" == "grpc" ]]; then
|
||||
printf '%s\n' "${singBoxVLESSRealityGRPCPort}"
|
||||
else
|
||||
printf '%s\n' "${singBoxVLESSRealityVisionPort}"
|
||||
fi
|
||||
else
|
||||
printf '%s\n' "${xrayVLESSRealityVisionPort}"
|
||||
fi
|
||||
}
|
||||
|
||||
# 账号
|
||||
showAccounts() {
|
||||
readInstallType
|
||||
@@ -5415,7 +5417,7 @@ showAccounts() {
|
||||
|
||||
echoContent skyBlue "\n ---> 账号:${email}"
|
||||
echo
|
||||
defaultBase64Code vlessReality "${xrayVLESSRealityVisionPort}${singBoxVLESSRealityVisionPort}" "${email}" "$(echo "${user}" | jq -r .id//.uuid)"
|
||||
defaultBase64Code vlessReality "$(getRealitySubscriptionPort vision)" "${email}" "$(echo "${user}" | jq -r .id//.uuid)"
|
||||
done
|
||||
fi
|
||||
# VLESS reality gRPC
|
||||
@@ -5427,7 +5429,7 @@ showAccounts() {
|
||||
|
||||
echoContent skyBlue "\n ---> 账号:${email}"
|
||||
echo
|
||||
defaultBase64Code vlessRealityGRPC "${xrayVLESSRealityVisionPort}${singBoxVLESSRealityGRPCPort}" "${email}" "$(echo "${user}" | jq -r .id//.uuid)"
|
||||
defaultBase64Code vlessRealityGRPC "$(getRealitySubscriptionPort grpc)" "${email}" "$(echo "${user}" | jq -r .id//.uuid)"
|
||||
done
|
||||
fi
|
||||
# tuic
|
||||
@@ -6891,7 +6893,7 @@ getDLCGeositeName() {
|
||||
escapedInput=$(escapeDLCRegexPattern "${normalizedInput}")
|
||||
|
||||
local matchedLine=
|
||||
matchedLine=$(grep -n -m1 -E "^[[:space:]]*-[[:space:]]*name:[[:space:]]*${escapedInput}[[:space:]]*$" "${dlcFilePath}")
|
||||
matchedLine=$(grep -n -m1 -E "^[[:space:]]*-[[:space:]]*name:[[:space:]]*\"?${escapedInput}\"?[[:space:]]*$" "${dlcFilePath}")
|
||||
if [[ -n "${matchedLine}" ]]; then
|
||||
echo "${normalizedInput}"
|
||||
fi
|
||||
@@ -7095,7 +7097,7 @@ addSingBoxGeoIPRouteRule() {
|
||||
"type": "remote",
|
||||
"format": "binary",
|
||||
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-${geoipCode}.srs",
|
||||
"download_detour": "01_direct_outbound"
|
||||
"http_client": "rule_set_http"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -7788,7 +7790,7 @@ initSingBoxRules() {
|
||||
matchedRuleName=$(getDLCGeositeName "${normalizedLine}" "/etc/v2ray-agent/sing-box")
|
||||
|
||||
if [[ -n "${matchedRuleName}" ]]; then
|
||||
ruleSet=$(echo "${ruleSet}" | jq -r ". += [{\"tag\":\"${matchedRuleName}_$2\",\"type\":\"remote\",\"format\":\"binary\",\"url\":\"https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-${matchedRuleName}.srs\",\"download_detour\":\"01_direct_outbound\"}]")
|
||||
ruleSet=$(echo "${ruleSet}" | jq -r ". += [{\"tag\":\"${matchedRuleName}_$2\",\"type\":\"remote\",\"format\":\"binary\",\"url\":\"https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-${matchedRuleName}.srs\",\"http_client\":\"rule_set_http\"}]")
|
||||
else
|
||||
domainRules=$(echo "${domainRules}" | jq -r --arg reg "^([a-zA-Z0-9_-]+\\.)*${normalizedLine//./\\.}" '. += [$reg]')
|
||||
fi
|
||||
@@ -7860,13 +7862,44 @@ setSocks5InboundRouting() {
|
||||
|
||||
# 设置sniff routing规则
|
||||
setSniffRouting() {
|
||||
local singBoxDNSConfigPath="/etc/v2ray-agent/sing-box/conf/config/dns.json"
|
||||
if [[ -f "${singBoxDNSConfigPath}" ]]; then
|
||||
jq '
|
||||
.dns.servers = (.dns.servers // [])
|
||||
| if any(.dns.servers[]?; .tag == "local") then .
|
||||
elif any(.dns.servers[]?; .type == "local" and ((.tag // "") == "")) then
|
||||
.dns.servers |= map(if .type == "local" and ((.tag // "") == "") then .tag = "local" else . end)
|
||||
else
|
||||
.dns.servers += [{"tag": "local", "type": "local"}]
|
||||
end
|
||||
' "${singBoxDNSConfigPath}" >"${singBoxDNSConfigPath}.tmp" && mv "${singBoxDNSConfigPath}.tmp" "${singBoxDNSConfigPath}"
|
||||
else
|
||||
cat <<EOF >"${singBoxDNSConfigPath}"
|
||||
{
|
||||
"dns": {
|
||||
"servers": [
|
||||
{
|
||||
"tag": "local",
|
||||
"type": "local"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat <<EOF >"/etc/v2ray-agent/sing-box/conf/config/sniff.json"
|
||||
{
|
||||
"route":{
|
||||
"default_domain_resolver": "local",
|
||||
"rules":[
|
||||
{
|
||||
"action": "sniff",
|
||||
"timeout": "1s"
|
||||
},
|
||||
{
|
||||
"protocol": "dns",
|
||||
"action": "hijack-dns"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -8316,6 +8349,7 @@ EOF
|
||||
"dns": {
|
||||
"servers":[
|
||||
{
|
||||
"tag":"local",
|
||||
"type":"local"
|
||||
}
|
||||
]
|
||||
@@ -9584,7 +9618,7 @@ initRealityMldsa65() {
|
||||
length=$(/etc/v2ray-agent/xray/xray tls ping "${realityServerName}:${realityDomainPort}" | grep "Certificate chain's total length:" | awk '{print $5}' | head -1)
|
||||
|
||||
if [ "$length" -gt 3500 ]; then
|
||||
if [[ -n "${currentRealityMldsa65}" && -z "${lastInstallationConfig}" ]]; then
|
||||
if [[ -n "${currentRealityMldsa65Seed}" && -z "${lastInstallationConfig}" ]]; then
|
||||
read -r -p "读取到上次安装记录,是否使用上次安装时的Seed/Verify ?[y/n]:" historyMldsa65Status
|
||||
if [[ "${historyMldsa65Status}" == "y" ]]; then
|
||||
realityMldsa65Seed=${currentRealityMldsa65Seed}
|
||||
@@ -9620,7 +9654,7 @@ checkRealityDest() {
|
||||
local traceResult=
|
||||
traceResult=$(curl -s "https://$(echo "${realityDestDomain}" | cut -d ':' -f 1)/cdn-cgi/trace" | grep "visit_scheme=https")
|
||||
if [[ -n "${traceResult}" ]]; then
|
||||
echoContent red "\n ---> 检测到使用的域名,托管在cloudflare并开启了代理,使用此类型域名可能导致VPS流量被其他人使用[不建议使用]\n"
|
||||
echoContent red "\n ---> 禁止使用已启用 Cloudflare 代理的域名。强制使用将导致 VPS 流量被他人滥用,相关后果由您自行承担。\n"
|
||||
read -r -p "是否继续 ?[y/n]" setRealityDestStatus
|
||||
if [[ "${setRealityDestStatus}" != 'y' ]]; then
|
||||
exit 0
|
||||
@@ -9635,7 +9669,7 @@ initRealityClientServersName() {
|
||||
if [[ "${coreInstallType}" == "1" || "${selectCoreType}" == "1" ]]; then
|
||||
realityDestDomainList="download-installer.cdn.mozilla.net,addons.mozilla.org,s0.awsstatic.com,d1.awsstatic.com,images-na.ssl-images-amazon.com,m.media-amazon.com,player.live-video.net,one-piece.com,lol.secure.dyn.riotcdn.net,www.lovelive-anime.jp,academy.nvidia.com,dl.google.com,www.google-analytics.com,www.caltech.edu,www.calstatela.edu,www.suny.edu,www.suffolk.edu,www.python.org,vuejs-jp.org,vuejs.org,zh-hk.vuejs.org,react.dev,www.java.com,www.oracle.com,www.mysql.com,www.mongodb.com,redis.io,cname.vercel-dns.com,vercel-dns.com,www.swift.com,academy.nvidia.com,www.swift.com,www.cisco.com,www.asus.com,www.samsung.com,www.amd.com,www.umcg.nl,www.fom-international.com,www.u-can.co.jp,github.io"
|
||||
elif [[ "${coreInstallType}" == "2" || "${selectCoreType}" == "2" ]]; then
|
||||
realityDestDomainList="download-installer.cdn.mozilla.net,addons.mozilla.org,s0.awsstatic.com,d1.awsstatic.com,images-na.ssl-images-amazon.com,m.media-amazon.com,player.live-video.net,one-piece.com,lol.secure.dyn.riotcdn.net,www.lovelive-anime.jp,academy.nvidia.com,dl.google.com,www.google-analytics.com,www.python.org,vuejs-jp.org,vuejs.org,zh-hk.vuejs.org,react.dev,www.java.com,www.oracle.com,www.mysql.com,www.mongodb.com,cname.vercel-dns.com,vercel-dns.com,www.swift.com,academy.nvidia.com,www.swift.com,www.cisco.com,www.asus.com,www.samsung.com,www.amd.com,www.fom-international.com,github.io"
|
||||
realityDestDomainList="download-installer.cdn.mozilla.net,addons.mozilla.org,s0.awsstatic.com,d1.awsstatic.com,images-na.ssl-images-amazon.com,m.media-amazon.com,player.live-video.net,one-piece.com,www.lovelive-anime.jp,academy.nvidia.com,dl.google.com,www.google-analytics.com,www.python.org,vuejs-jp.org,vuejs.org,zh-hk.vuejs.org,react.dev,www.oracle.com,www.mysql.com,www.mongodb.com,cname.vercel-dns.com,vercel-dns.com,www.swift.com,academy.nvidia.com,www.swift.com,www.cisco.com,www.asus.com,www.samsung.com,www.amd.com,www.fom-international.com,github.io"
|
||||
fi
|
||||
if [[ -n "${realityServerName}" && -z "${lastInstallationConfig}" ]]; then
|
||||
if echo ${realityDestDomainList} | grep -q "${realityServerName}"; then
|
||||
@@ -9701,6 +9735,8 @@ initRealityClientServersName() {
|
||||
fi
|
||||
fi
|
||||
|
||||
realityDestDomain="${realityServerName}:${realityDomainPort}"
|
||||
checkRealityDest
|
||||
echoContent yellow "\n ---> 客户端可用域名: ${realityServerName}:${realityDomainPort}\n"
|
||||
}
|
||||
# 初始化reality端口
|
||||
@@ -9978,7 +10014,7 @@ menu() {
|
||||
cd "$HOME" || exit
|
||||
echoContent red "\n=============================================================="
|
||||
echoContent green "作者:mack-a"
|
||||
echoContent green "当前版本:v3.5.19"
|
||||
echoContent green "当前版本:v3.5.22"
|
||||
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
||||
echoContent green "描述:八合一共存脚本\c"
|
||||
showInstallStatus
|
||||
|
||||
@@ -2049,6 +2049,7 @@ _buildVisionInbounds() {
|
||||
"serverNames": ["$(jsonEscape "${sName}")"],
|
||||
"privateKey": "$(jsonEscape "${privKey}")",
|
||||
"publicKey": "$(jsonEscape "${pubKey}")",
|
||||
"minClientVer": "1.8.2",
|
||||
"maxTimeDiff": 70000,
|
||||
"shortIds": ["", "6ba85179e30d4fc2"]
|
||||
}
|
||||
@@ -2095,6 +2096,7 @@ _buildXHTTPInbound() {
|
||||
"serverNames": ["$(jsonEscape "${sName}")"],
|
||||
"privateKey": "$(jsonEscape "${privKey}")",
|
||||
"publicKey": "$(jsonEscape "${pubKey}")",
|
||||
"minClientVer": "1.8.2",
|
||||
"maxTimeDiff": 70000,
|
||||
"shortIds": ["", "6ba85179e30d4fc2"]
|
||||
},
|
||||
|
||||
@@ -2031,6 +2031,7 @@ _buildVisionInbounds() {
|
||||
"serverNames": ["$(jsonEscape "${sName}")"],
|
||||
"privateKey": "$(jsonEscape "${privKey}")",
|
||||
"publicKey": "$(jsonEscape "${pubKey}")",
|
||||
"minClientVer": "1.8.2",
|
||||
"maxTimeDiff": 70000,
|
||||
"shortIds": ["", "6ba85179e30d4fc2"]
|
||||
}
|
||||
@@ -2077,6 +2078,7 @@ _buildXHTTPInbound() {
|
||||
"serverNames": ["$(jsonEscape "${sName}")"],
|
||||
"privateKey": "$(jsonEscape "${privKey}")",
|
||||
"publicKey": "$(jsonEscape "${pubKey}")",
|
||||
"minClientVer": "1.8.2",
|
||||
"maxTimeDiff": 70000,
|
||||
"shortIds": ["", "6ba85179e30d4fc2"]
|
||||
},
|
||||
|
||||
Regular → Executable
+5742
-3899
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user