feat(脚本): 修改sing-boxIPv6分流、优化sing-box geosite.db文件

pull/852/head
mack-a 2023-11-09 11:43:39 +08:00
parent 922d9c89be
commit 6f3400168f
2 changed files with 66 additions and 41 deletions

View File

@ -1,4 +1,4 @@
# 一键脚本快速安装 # Xray-core/sing-box 一键脚本快速安装
- [感谢 JetBrains 提供的非商业开源软件开发授权](https://www.jetbrains.com/?from=v2ray-agent) - [感谢 JetBrains 提供的非商业开源软件开发授权](https://www.jetbrains.com/?from=v2ray-agent)
- [Thanks for non-commercial open source development authorization by JetBrains](https://www.jetbrains.com/?from=v2ray-agent) - [Thanks for non-commercial open source development authorization by JetBrains](https://www.jetbrains.com/?from=v2ray-agent)
@ -13,21 +13,44 @@
# 一、项目介绍 # 一、项目介绍
- [一键安装教程【推荐】](https://www.v2ray-agent.com/archives/1682491479771) ## 核心
- 支持Xray-core/sing-box/Hysteria/Tuic
- 支持多种传输协议VLESSReality、VMess、Trojan、Hysteria、Tuic支持多种协议组合。
- 支持自动申请和更新证书
- 支持自主更换伪装站点
- [支持批量添加CDN节点并配合ClashMeta自动优选](https://www.v2ray-agent.com/archives/1684858575649)
- 支持订阅以及多VPS组合订阅
- [支持多种分流工具Warp、IPv6、任意门、DNS、VMess(ws)、SNI反向代理](https://www.v2ray-agent.com/archives/ba-he-yi-jiao-ben-yu-ming-fen-liu-jiao-cheng)
- 支持批量新增端口
- 支持Core的升级以及回退
- [支持无域名版本的VLESS Reality搭建](https://www.v2ray-agent.com/archives/1680104902581)
- [Reality教程和介绍【推荐】](https://www.v2ray-agent.com/archives/1680104902581)
- [搭建最新的Vision和Reality防止VPS端口封禁](https://www.v2ray-agent.com/archives/1680104902581)
# 二、线路推荐 - Xray-core
- v2ray-core[暂停维护]
- sing-box
## 协议
> 以下均使用TLS支持多种协议组合
- VLESS(Reality、Vision、TCP、WS、gRPC)
- VMess(TCP、WS)
- Trojan(TCP、gRPC)
- Hysteria2
- Tuic
## 功能
- [支持无域名版本的VLESS Reality搭建](https://www.v2ray-agent.com/archives/1680104902581)
- [支持多种分流用于解锁wireguard、IPv6、任意门、DNS、VMess(ws)、SNI反向代理](https://www.v2ray-agent.com/archives/ba-he-yi-jiao-ben-yu-ming-fen-liu-jiao-cheng)
- [支持批量添加CDN节点并配合ClashMeta自动优选](https://www.v2ray-agent.com/archives/1684858575649)
- 支持证书自动申请及更新
- [支持订阅以及多VPS组合订阅](https://www.v2ray-agent.com/archives/1681804748677)
- 支持批量新增端口
- 支持核心的升级以及回退
- 支持自主更换伪装站点
- 支持BT下载管理以及域名黑名单管理
# 二、使用指南
- [脚本快速搭建教程](https://www.v2ray-agent.com/archives/1682491479771)
- [垃圾VPS大救星hysteria2最新协议一键搭建](https://www.v2ray-agent.com/archives/1697162969693)
- [Tuic V5性能提升及使用方法](https://www.v2ray-agent.com/archives/1687167522196)
- [Cloudflare优选IP、自动选择最快节点教程](https://www.v2ray-agent.com/archives/1684858575649)
- [脚本异常处理](https://www.v2ray-agent.com/archives/1684115970026)
# 三、线路推荐
> 再好的协议也比不上一个高品质的VPS。推荐以下线路 > 再好的协议也比不上一个高品质的VPS。推荐以下线路
@ -38,7 +61,7 @@
- [日本软银](https://www.v2ray-agent.com/tags/ruan-yin) - [日本软银](https://www.v2ray-agent.com/tags/ruan-yin)
- [CMI](https://www.v2ray-agent.com/tags/cmi) - [CMI](https://www.v2ray-agent.com/tags/cmi)
# 、安装使用 # 、安装使用
## 1.下载脚本 ## 1.下载脚本
@ -56,7 +79,7 @@ wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-
wget -P /root -N --no-check-certificate "https://www.v2ray-agent.com/v2ray-agent/install.sh" && chmod 700 /root/install.sh && /root/install.sh wget -P /root -N --no-check-certificate "https://www.v2ray-agent.com/v2ray-agent/install.sh" && chmod 700 /root/install.sh && /root/install.sh
``` ```
## [2.搭建教程](https://www.v2ray-agent.com/archives/1682491479771) ## [2.脚本快速搭建教程](https://www.v2ray-agent.com/archives/1682491479771)
# 四、反馈和建议 # 四、反馈和建议
@ -74,7 +97,3 @@ wget -P /root -N --no-check-certificate "https://www.v2ray-agent.com/v2ray-agent
# 六、许可证 # 六、许可证
[AGPL-3.0](https://github.com/mack-a/v2ray-agent/blob/master/LICENSE) [AGPL-3.0](https://github.com/mack-a/v2ray-agent/blob/master/LICENSE)
## Stargazers over time
[![Stargazers over time](https://starchart.cc/mack-a/v2ray-agent.svg)](https://starchart.cc/mack-a/v2ray-agent)

View File

@ -3157,14 +3157,14 @@ EOF
# 初始化singbox route配置 # 初始化singbox route配置
initSingBoxRouteConfig() { initSingBoxRouteConfig() {
downloadSingBoxGeositeDB
local outboundTag=$1 local outboundTag=$1
if [[ ! -f "${singBoxConfigPath}config/${outboundTag}_route.json" ]]; then if [[ ! -f "${singBoxConfigPath}config/${outboundTag}_route.json" ]]; then
cat <<EOF >"${singBoxConfigPath}config/${outboundTag}_route.json" cat <<EOF >"${singBoxConfigPath}config/${outboundTag}_route.json"
{ {
"route": { "route": {
"geosite": { "geosite": {
"path": "${singBoxConfigPath}geosite.db", "path": "${singBoxConfigPath}geosite.db"
"download_url": "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db"
}, },
"rules": [ "rules": [
{ {
@ -3180,6 +3180,12 @@ initSingBoxRouteConfig() {
EOF EOF
fi fi
} }
# 下载sing-box geosite db
downloadSingBoxGeositeDB() {
if [[ ! -f "${singBoxConfigPath}geosite.db" ]]; then
wget -q -P "${singBoxConfigPath}" https://github.com/Johnshall/sing-geosite/releases/latest/download/geosite.db
fi
}
# sing-box 路由规则配置配置 # sing-box 路由规则配置配置
configurationSingBoxRoute() { configurationSingBoxRoute() {
@ -4622,7 +4628,7 @@ showAccounts() {
local show local show
# VLESS TCP # VLESS TCP
if echo "${currentInstallProtocolType}" | grep -q trojan; then if echo "${currentInstallProtocolType}" | grep -q trojan; then
echoContent skyBlue "===================== Trojan TCP TLS_Vision ======================\n" echoContent skyBlue "===================== Trojan TCP TLS_Vision[不推荐] ======================\n"
jq .inbounds[0].settings.clients ${configPath}02_trojan_TCP_inbounds.json | jq -c '.[]' | while read -r user; do jq .inbounds[0].settings.clients ${configPath}02_trojan_TCP_inbounds.json | jq -c '.[]' | while read -r user; do
local email= local email=
email=$(echo "${user}" | jq -r .email) email=$(echo "${user}" | jq -r .email)
@ -4645,7 +4651,7 @@ showAccounts() {
# VLESS WS # VLESS WS
if echo ${currentInstallProtocolType} | grep -q 1; then if echo ${currentInstallProtocolType} | grep -q 1; then
echoContent skyBlue "\n================================ VLESS WS TLS CDN ================================\n" echoContent skyBlue "\n================================ VLESS WS TLS [仅CDN不推荐] ================================\n"
jq .inbounds[0].settings.clients ${configPath}03_VLESS_WS_inbounds.json | jq -c '.[]' | while read -r user; do jq .inbounds[0].settings.clients ${configPath}03_VLESS_WS_inbounds.json | jq -c '.[]' | while read -r user; do
local email= local email=
@ -4667,7 +4673,7 @@ showAccounts() {
# VLESS grpc # VLESS grpc
if echo ${currentInstallProtocolType} | grep -q 5; then if echo ${currentInstallProtocolType} | grep -q 5; then
echoContent skyBlue "\n=============================== VLESS gRPC TLS CDN ===============================\n" echoContent skyBlue "\n=============================== VLESS gRPC TLS [仅CDN不推荐] ===============================\n"
jq .inbounds[0].settings.clients ${configPath}06_VLESS_gRPC_inbounds.json | jq -c '.[]' | while read -r user; do jq .inbounds[0].settings.clients ${configPath}06_VLESS_gRPC_inbounds.json | jq -c '.[]' | while read -r user; do
local email= local email=
@ -4688,7 +4694,7 @@ showAccounts() {
# VMess WS # VMess WS
if echo ${currentInstallProtocolType} | grep -q 3; then if echo ${currentInstallProtocolType} | grep -q 3; then
echoContent skyBlue "\n================================ VMess WS TLS CDN ================================\n" echoContent skyBlue "\n================================ VMess WS TLS [仅CDN不推荐] ================================\n"
local path="${currentPath}vws" local path="${currentPath}vws"
if [[ ${coreInstallType} == "1" ]]; then if [[ ${coreInstallType} == "1" ]]; then
path="${currentPath}vws" path="${currentPath}vws"
@ -4711,7 +4717,7 @@ showAccounts() {
# trojan tcp # trojan tcp
if echo ${currentInstallProtocolType} | grep -q 4; then if echo ${currentInstallProtocolType} | grep -q 4; then
echoContent skyBlue "\n================================== Trojan TLS ==================================\n" echoContent skyBlue "\n================================== Trojan TLS [不推荐] ==================================\n"
jq .inbounds[0].settings.clients ${configPath}04_trojan_TCP_inbounds.json | jq -c '.[]' | while read -r user; do jq .inbounds[0].settings.clients ${configPath}04_trojan_TCP_inbounds.json | jq -c '.[]' | while read -r user; do
local email= local email=
email=$(echo "${user}" | jq -r .email) email=$(echo "${user}" | jq -r .email)
@ -4722,7 +4728,7 @@ showAccounts() {
fi fi
if echo ${currentInstallProtocolType} | grep -q 2; then if echo ${currentInstallProtocolType} | grep -q 2; then
echoContent skyBlue "\n================================ Trojan gRPC TLS ================================\n" echoContent skyBlue "\n================================ Trojan gRPC TLS [仅CDN不推荐] ================================\n"
jq .inbounds[0].settings.clients ${configPath}04_trojan_gRPC_inbounds.json | jq -c '.[]' | while read -r user; do jq .inbounds[0].settings.clients ${configPath}04_trojan_gRPC_inbounds.json | jq -c '.[]' | while read -r user; do
local email= local email=
email=$(echo "${user}" | jq -r .email) email=$(echo "${user}" | jq -r .email)
@ -4740,7 +4746,7 @@ showAccounts() {
done done
fi fi
if echo ${currentInstallProtocolType} | grep -q 6; then if echo ${currentInstallProtocolType} | grep -q 6; then
echoContent skyBlue "\n================================ Hysteria TLS ================================\n" echoContent skyBlue "\n================================ Hysteria2 TLS [推荐] ================================\n"
jq -r -c '.inbounds[]|select(.type=="hysteria2")|.users[]' "${singBoxConfigPath}config.json" | while read -r user; do jq -r -c '.inbounds[]|select(.type=="hysteria2")|.users[]' "${singBoxConfigPath}config.json" | while read -r user; do
echoContent skyBlue "\n ---> 账号:$(echo "${user}" | jq -r .name)" echoContent skyBlue "\n ---> 账号:$(echo "${user}" | jq -r .name)"
echo echo
@ -4752,7 +4758,7 @@ showAccounts() {
# VLESS reality vision # VLESS reality vision
if echo ${currentInstallProtocolType} | grep -q 7; then if echo ${currentInstallProtocolType} | grep -q 7; then
show=1 show=1
echoContent skyBlue "============================= VLESS reality_vision ==============================\n" echoContent skyBlue "============================= VLESS reality_vision [推荐] ==============================\n"
jq .inbounds[0].settings.clients ${configPath}07_VLESS_vision_reality_inbounds.json | jq -c '.[]' | while read -r user; do jq .inbounds[0].settings.clients ${configPath}07_VLESS_vision_reality_inbounds.json | jq -c '.[]' | while read -r user; do
local email= local email=
email=$(echo "${user}" | jq -r .email) email=$(echo "${user}" | jq -r .email)
@ -4766,7 +4772,7 @@ showAccounts() {
# VLESS reality # VLESS reality
if echo ${currentInstallProtocolType} | grep -q 8; then if echo ${currentInstallProtocolType} | grep -q 8; then
show=1 show=1
echoContent skyBlue "============================== VLESS reality_gRPC ===============================\n" echoContent skyBlue "============================== VLESS reality_gRPC [推荐] ===============================\n"
jq .inbounds[0].settings.clients ${configPath}08_VLESS_reality_fallback_grpc_inbounds.json | jq -c '.[]' | while read -r user; do jq .inbounds[0].settings.clients ${configPath}08_VLESS_reality_fallback_grpc_inbounds.json | jq -c '.[]' | while read -r user; do
local email= local email=
email=$(echo "${user}" | jq -r .email) email=$(echo "${user}" | jq -r .email)
@ -4778,7 +4784,7 @@ showAccounts() {
fi fi
# tuic # tuic
if echo ${currentInstallProtocolType} | grep -q 9; then if echo ${currentInstallProtocolType} | grep -q 9; then
echoContent skyBlue "\n================================ Tuic TLS ================================\n" echoContent skyBlue "\n================================ Tuic TLS [推荐] ================================\n"
jq -r -c '.inbounds[]|select(.type=="tuic")|.users[]' "${singBoxConfigPath}config.json" | while read -r user; do jq -r -c '.inbounds[]|select(.type=="tuic")|.users[]' "${singBoxConfigPath}config.json" | while read -r user; do
echoContent skyBlue "\n ---> 账号:$(echo "${user}" | jq -r .name)" echoContent skyBlue "\n ---> 账号:$(echo "${user}" | jq -r .name)"
echo echo
@ -5759,7 +5765,7 @@ ipv6Routing() {
echo "${outbounds}" | jq . >${configPath}10_ipv4_outbounds.json echo "${outbounds}" | jq . >${configPath}10_ipv4_outbounds.json
configurationSingBoxRoute add IPv6-out "${domainList}" configurationSingBoxRoute add IPv6-out "${domainList}"
addSingBoxOutbound IPv6_out addSingBoxOutbound IPv6-out
echoContent green " ---> 添加成功" echoContent green " ---> 添加成功"
elif [[ "${ipv6Status}" == "3" ]]; then elif [[ "${ipv6Status}" == "3" ]]; then
@ -7043,13 +7049,13 @@ customXrayInstall() {
echoContent skyBlue "\n========================个性化安装============================" echoContent skyBlue "\n========================个性化安装============================"
echoContent yellow "VLESS前置默认安装0如果只需要安装0则只选择0即可" echoContent yellow "VLESS前置默认安装0如果只需要安装0则只选择0即可"
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推荐]"
echoContent yellow "3.VMess+TLS+WS[CDN]" echoContent yellow "3.VMess+TLS+WS[CDN推荐]"
echoContent yellow "4.Trojan+TLS" echoContent yellow "4.Trojan+TLS[不推荐]"
echoContent yellow "5.VLESS+TLS+gRPC[CDN]" echoContent yellow "5.VLESS+TLS+gRPC[CDN推荐]"
echoContent yellow "7.VLESS+Reality+uTLS+Vision[推荐]" echoContent yellow "7.VLESS+Reality+uTLS+Vision[推荐]"
# echoContent yellow "8.VLESS+Reality+gRPC" # echoContent yellow "8.VLESS+Reality+gRPC"
read -r -p "请选择[多选][例如:123]:" selectCustomInstallType read -r -p "请选择[多选][例如:123]:" selectCustomInstallType
echoContent skyBlue "--------------------------------------------------------------" echoContent skyBlue "--------------------------------------------------------------"
if [[ -z ${selectCustomInstallType} ]]; then if [[ -z ${selectCustomInstallType} ]]; then
@ -8391,7 +8397,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.11.8" echoContent green "当前版本v2.11.9"
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