v1.2.13 Compatible with Sing-box 1.12.0-alpha.18

This commit is contained in:
fscarmen
2025-03-18 05:43:17 +00:00
parent 490940b0af
commit bf575805bb
4 changed files with 24 additions and 16 deletions
+4 -3
View File
@@ -19,14 +19,16 @@
* * * * * *
## 1.更新信息 ## 1.更新信息
2025.01.31 v1.2.12 In order to prevent sing-box from upgrading to a certain version which may cause errors, add a mandatory version file; 以防止sing-box某个版本升级导致运行报错,增加强制指定版本号文件 2025.03.18 v1.2.13 Compatible with Sing-box 1.12.0-alpha.18+; 适配 Sing-box 1.12.0-alpha.18+
2025.01.28 v1.2.11 1. Add server-side time synchronization configuration; 2. Replace some CDNs; 3. Fix the bug of getting the latest version error when upgrading; 1. 添加服务端时间同步配置; 2. 替换某些 CDN; 3. 修复升级时获取最新版本错误的 bu 2025.01.31 v1.2.12 In order to prevent sing-box from upgrading to a certain version which may cause errors, add a mandatory version file; 以防止sing-box某个版本升级导致运行报错,增加强制指定版本号文件
<details> <details>
<summary>历史更新 history(点击即可展开或收起)</summary> <summary>历史更新 history(点击即可展开或收起)</summary>
<br> <br>
>2025.01.28 v1.2.11 1. Add server-side time synchronization configuration; 2. Replace some CDNs; 3. Fix the bug of getting the latest version error when upgrading; 1. 添加服务端时间同步配置; 2. 替换某些 CDN; 3. 修复升级时获取最新版本错误的 bu
>
>2024.12.31 v1.2.10 Adapted v1.11.0-beta.17 to add port hopping for hysteria2 in sing-box client output; 适配 v1.11.0-beta.17,在 sing-box 客户端输出中添加 hysteria2 的端口跳跃 >2024.12.31 v1.2.10 Adapted v1.11.0-beta.17 to add port hopping for hysteria2 in sing-box client output; 适配 v1.11.0-beta.17,在 sing-box 客户端输出中添加 hysteria2 的端口跳跃
> >
>2024.12.29 v1.2.9 Refactored the chatGPT detection method based on lmc999's detection and unlocking script; 根据 lmc999 的检测解锁脚本,重构了检测 chatGPT 方法 >2024.12.29 v1.2.9 Refactored the chatGPT detection method based on lmc999's detection and unlocking script; 根据 lmc999 的检测解锁脚本,重构了检测 chatGPT 方法
@@ -544,7 +546,6 @@ services:
## 10.鸣谢下列作者的文章和项目: ## 10.鸣谢下列作者的文章和项目:
千歌 sing-box 模板: https://github.com/chika0801/sing-box-examples 千歌 sing-box 模板: https://github.com/chika0801/sing-box-examples
瞎折腾 sing-box 模板: https://t.me/ztvps/100
## 11.免责声明: ## 11.免责声明:
+14 -6
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# 脚本更新日期 2024.12.20 # 脚本更新日期 2025.03.18
WORK_DIR=/sing-box WORK_DIR=/sing-box
PORT=$START_PORT PORT=$START_PORT
SUBSCRIBE_TEMPLATE="https://raw.githubusercontent.com/fscarmen/client_template/main" SUBSCRIBE_TEMPLATE="https://raw.githubusercontent.com/fscarmen/client_template/main"
@@ -28,8 +28,17 @@ check_arch() {
# 检查 sing-box 最新版本 # 检查 sing-box 最新版本
check_latest_sing-box() { check_latest_sing-box() {
local VERSION_LATEST=$(wget -qO- "https://api.github.com/repos/SagerNet/sing-box/releases" | awk -F '["v-]' '/tag_name/{print $5}' | sort -r | sed -n '1p') # 检查是否强制指定版本
wget -qO- "https://api.github.com/repos/SagerNet/sing-box/releases" | awk -F '["v]' -v var="tag_name.*$VERSION_LATEST" '$0 ~ var {print $5; exit}' local FORCE_VERSION=$(wget --no-check-certificate --tries=2 --timeout=3 -qO- https://raw.githubusercontent.com/fscarmen/sing-box/refs/heads/main/force_version | sed 's/^[vV]//g')
# 没有强制指定版本时,获取最新版本
grep -q '.' <<< "$FORCE_VERSION" || local FORCE_VERSION=$(wget --no-check-certificate --tries=2 --timeout=3 -qO- https://api.github.com/repos/SagerNet/sing-box/releases | awk -F '["v-]' '/tag_name/{print $5}' | sort -Vr | sed -n '1p')
# 获取最终版本号
local VERSION=$(wget --no-check-certificate --tries=2 --timeout=3 -qO- https://api.github.com/repos/SagerNet/sing-box/releases | awk -F '["v]' -v var="tag_name.*$FORCE_VERSION" '$0 ~ var {print $5; exit}')
VERSION=${VERSION:-'1.12.0-alpha.18'}
echo "$VERSION"
} }
# 安装 sing-box 容器 # 安装 sing-box 容器
@@ -37,7 +46,6 @@ install() {
# 下载 sing-box # 下载 sing-box
echo "正在下载 sing-box ..." echo "正在下载 sing-box ..."
local ONLINE=$(check_latest_sing-box) local ONLINE=$(check_latest_sing-box)
local ONLINE=${ONLINE:-'1.11.0-beta.15'}
wget https://github.com/SagerNet/sing-box/releases/download/v$ONLINE/sing-box-$ONLINE-linux-$SING_BOX_ARCH.tar.gz -O- | tar xz -C ${WORK_DIR} sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box && mv ${WORK_DIR}/sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box ${WORK_DIR}/sing-box && rm -rf ${WORK_DIR}/sing-box-$ONLINE-linux-$SING_BOX_ARCH wget https://github.com/SagerNet/sing-box/releases/download/v$ONLINE/sing-box-$ONLINE-linux-$SING_BOX_ARCH.tar.gz -O- | tar xz -C ${WORK_DIR} sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box && mv ${WORK_DIR}/sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box ${WORK_DIR}/sing-box && rm -rf ${WORK_DIR}/sing-box-$ONLINE-linux-$SING_BOX_ARCH
# 下载 jq # 下载 jq
@@ -205,7 +213,7 @@ EOF
"dns":{ "dns":{
"servers":[ "servers":[
{ {
"address":"local" "type":"local"
} }
] ]
} }
@@ -1126,7 +1134,7 @@ $(hint "${NEKOBOX_SUBSCRIBE}")
$(info "$(echo "{ \"outbounds\":[ ${INBOUND_REPLACE%,} ] }" | ${WORK_DIR}/jq) $(info "$(echo "{ \"outbounds\":[ ${INBOUND_REPLACE%,} ] }" | ${WORK_DIR}/jq)
各客户端配置文件路径: ${WORK_DIR}/subscribe/\n 完整模板可参照:\n https://t.me/ztvps/100\n https://github.com/chika0801/sing-box-examples/tree/main/Tun") 各客户端配置文件路径: ${WORK_DIR}/subscribe/\n 完整模板可参照:\n https://github.com/chika0801/sing-box-examples/tree/main/Tun")
" "
EXPORT_LIST_FILE+=" EXPORT_LIST_FILE+="
-1
View File
@@ -1 +0,0 @@
1.11.0
+6 -6
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# 当前脚本版本号 # 当前脚本版本号
VERSION='v1.2.12 (2025.01.31)' VERSION='v1.2.13 (2025.03.18)'
# 各变量默认值 # 各变量默认值
GH_PROXY='https://ghproxy.lvedong.eu.org/' GH_PROXY='https://ghproxy.lvedong.eu.org/'
@@ -27,8 +27,8 @@ mkdir -p $TEMP_DIR
E[0]="Language:\n 1. English (default) \n 2. 简体中文" E[0]="Language:\n 1. English (default) \n 2. 简体中文"
C[0]="${E[0]}" C[0]="${E[0]}"
E[1]="In order to prevent sing-box from upgrading to a certain version which may cause errors, add a mandatory version file." E[1]="Compatible with Sing-box 1.12.0-alpha.18+."
C[1]="以防止sing-box某个版本升级导致运行报错,增加强制指定版本号文件" C[1]="适配 Sing-box 1.12.0-alpha.18+"
E[2]="Downloading Sing-box. Please wait a seconds ..." E[2]="Downloading Sing-box. Please wait a seconds ..."
C[2]="下载 Sing-box 中,请稍等 ..." C[2]="下载 Sing-box 中,请稍等 ..."
E[3]="Input errors up to 5 times.The script is aborted." E[3]="Input errors up to 5 times.The script is aborted."
@@ -169,8 +169,8 @@ E[70]="Please set inSecure in tls to true."
C[70]="请把 tls 里的 inSecure 设置为 true" C[70]="请把 tls 里的 inSecure 设置为 true"
E[71]="Create shortcut [ sb ] successfully." E[71]="Create shortcut [ sb ] successfully."
C[71]="创建快捷 [ sb ] 指令成功!" C[71]="创建快捷 [ sb ] 指令成功!"
E[72]="Path to each client configuration file: ${WORK_DIR}/subscribe/\n The full template can be found at:\n https://t.me/ztvps/100\n https://github.com/chika0801/sing-box-examples/tree/main/Tun" E[72]="Path to each client configuration file: ${WORK_DIR}/subscribe/\n The full template can be found at:\n https://github.com/chika0801/sing-box-examples/tree/main/Tun"
C[72]="各客户端配置文件路径: ${WORK_DIR}/subscribe/\n 完整模板可参照:\n https://t.me/ztvps/100\n https://github.com/chika0801/sing-box-examples/tree/main/Tun" C[72]="各客户端配置文件路径: ${WORK_DIR}/subscribe/\n 完整模板可参照:\n https://github.com/chika0801/sing-box-examples/tree/main/Tun"
E[73]="There is no protocol left, if you are sure please re-run [ sb -u ] to uninstall all." E[73]="There is no protocol left, if you are sure please re-run [ sb -u ] to uninstall all."
C[73]="没有协议剩下,如确定请重新执行 [ sb -u ] 卸载所有" C[73]="没有协议剩下,如确定请重新执行 [ sb -u ] 卸载所有"
E[74]="Keep protocols" E[74]="Keep protocols"
@@ -1294,7 +1294,7 @@ EOF
"dns":{ "dns":{
"servers":[ "servers":[
{ {
"address":"local" "type":"local"
} }
] ]
} }