Skip to content

Commit b520674

Browse files
committed
Prioritize using a GitHub proxy and replace the script execution count tracking service.
1 parent 38a7f4c commit b520674

4 files changed

Lines changed: 31 additions & 46 deletions

File tree

.github/workflows/mirror.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,4 @@ jobs:
1919
target_repo_url:
2020
git@gitlab.com:${{ github.repository }}.git
2121
ssh_private_key:
22-
${{ secrets.PRIVATE_KEY }}
23-
24-
mirror_to_bitbucket:
25-
runs-on: ubuntu-latest
26-
steps:
27-
- name: 'Checkout'
28-
uses: actions/checkout@v4.2.2
29-
with:
30-
fetch-depth: 0
31-
- name: 'Mirror to bitbucket'
32-
uses: fscarmen/repository-mirroring-action@v1.0.0
33-
with:
34-
target_repo_url:
35-
git@bitbucket.org:${{ github.repository }}.git
36-
ssh_private_key:
37-
${{ secrets.PRIVATE_KEY }}
22+
${{ secrets.PRIVATE_KEY }}

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b
163163
--START_PORT 8881 \
164164
--PORT_NGINX 60000 \
165165
--SERVER_IP 123.123.123.123 \
166-
--CDN skk.moe\
166+
--CDN skk.moe \
167167
--VMESS_HOST_DOMAIN vmess.test.com \
168168
--VLESS_HOST_DOMAIN vless.test.com \
169169
--UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \
@@ -185,7 +185,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b
185185
--START_PORT 8881 \
186186
--PORT_NGINX 60000 \
187187
--SERVER_IP 123.123.123.123 \
188-
--CDN skk.moe\
188+
--CDN skk.moe \
189189
--VMESS_HOST_DOMAIN vmess.test.com \
190190
--VLESS_HOST_DOMAIN vless.test.com \
191191
--UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \
@@ -205,7 +205,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b
205205
--START_PORT 8881 \
206206
--PORT_NGINX 60000 \
207207
--SERVER_IP 123.123.123.123 \
208-
--CDN skk.moe\
208+
--CDN skk.moe \
209209
--UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \
210210
--SUBSCRIBE=true \
211211
--ARGO=true \
@@ -225,7 +225,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b
225225
--START_PORT 8881 \
226226
--PORT_NGINX 60000 \
227227
--SERVER_IP 123.123.123.123 \
228-
--CDN skk.moe\
228+
--CDN skk.moe \
229229
--UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \
230230
--ARGO=true \
231231
--PORT_HOPPING_RANGE 50000:51000 \
@@ -244,7 +244,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b
244244
--START_PORT 8881 \
245245
--PORT_NGINX 60000 \
246246
--SERVER_IP 123.123.123.123 \
247-
--CDN skk.moe\
247+
--CDN skk.moe \
248248
--UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \
249249
--SUBSCRIBE=true \
250250
--ARGO=true \
@@ -266,7 +266,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b
266266
--START_PORT 8881 \
267267
--PORT_NGINX 60000 \
268268
--SERVER_IP 123.123.123.123 \
269-
--CDN skk.moe\
269+
--CDN skk.moe \
270270
--UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \
271271
--ARGO=true \
272272
--ARGO_DOMAIN=sb.argo.com \
@@ -287,7 +287,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b
287287
--START_PORT 8881 \
288288
--PORT_NGINX 60000 \
289289
--SERVER_IP 123.123.123.123 \
290-
--CDN skk.moe\
290+
--CDN skk.moe \
291291
--UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \
292292
--SUBSCRIBE=true \
293293
--ARGO=true \
@@ -309,7 +309,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b
309309
--START_PORT 8881 \
310310
--PORT_NGINX 60000 \
311311
--SERVER_IP 123.123.123.123 \
312-
--CDN skk.moe\
312+
--CDN skk.moe \
313313
--UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \
314314
--ARGO=true \
315315
--ARGO_DOMAIN=sb.argo.com \

docker_init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# 脚本更新日期 2025.07.01
3+
# 脚本更新日期 2025.07.12
44
WORK_DIR=/sing-box
55
PORT=$START_PORT
66
SUBSCRIBE_TEMPLATE="https://raw.githubusercontent.com/fscarmen/client_template/main"
@@ -1258,7 +1258,7 @@ $(${WORK_DIR}/qrencode https://${ARGO_DOMAIN}/${UUID}/auto)
12581258

12591259
# 显示脚本使用情况数据
12601260
hint "\n*******************************************\n"
1261-
local STAT=$(wget -qO- --timeout=3 "https://stat-api.netlify.app/updateStats?script=sing-box-docker.sh")
1261+
local STAT=$(wget --no-check-certificate -qO- --timeout=3 "http://stat.cloudflare.now.cc:4000/api/updateStats?script=sing-box-docker.sh")
12621262
[[ "$STAT" =~ \"todayCount\":([0-9]+),\"totalCount\":([0-9]+) ]] && local TODAY="${BASH_REMATCH[1]}" && local TOTAL="${BASH_REMATCH[2]}"
12631263
hint "\n 脚本当天运行次数: $TODAY,累计运行次数: $TOTAL \n"
12641264
}

sing-box.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22

33
# 当前脚本版本号
4-
VERSION='v1.2.17 (2025.05.19)'
4+
VERSION='v1.2.17 (2025.07.12)'
55

66
# 各变量默认值
7-
GH_PROXY='https://ghfast.top/'
7+
GH_PROXY='gh-proxy.com/'
88
TEMP_DIR='/tmp/sing-box'
99
WORK_DIR='/etc/sing-box'
1010
START_PORT_DEFAULT='8881'
@@ -263,7 +263,7 @@ text() { grep -q '\$' <<< "${E[$*]}" && eval echo "\$(eval echo "\${${L}[$*]}")"
263263

264264
# 检测是否需要启用 Github CDN,如能直接连通,则不使用
265265
check_cdn() {
266-
[ -n "$GH_PROXY" ] && wget --server-response --quiet --output-document=/dev/null --no-check-certificate --tries=2 --timeout=3 https://raw.githubusercontent.com/fscarmen/sing-box/main/README.md >/dev/null 2>&1 && unset GH_PROXY
266+
[ -n "$GH_PROXY" ] && wget --server-response --quiet --output-document=/dev/null --no-check-certificate --tries=2 --timeout=3 https://${GH_PROXY}raw.githubusercontent.com/fscarmen/sing-box/main/README.md >/dev/null 2>&1 || unset GH_PROXY
267267
}
268268

269269
# 检测是否解锁 chatGPT,以决定是否使用 warp 链式代理或者是 direct out,此处判断改编自 https://github.com/lmc999/RegionRestrictionCheck
@@ -302,7 +302,7 @@ statistics_of_run-times() {
302302
local UPDATE_OR_GET=$1
303303
local SCRIPT=$2
304304
if grep -q 'update' <<< "$UPDATE_OR_GET"; then
305-
{ wget -qO- --timeout=3 "https://stat-api.netlify.app/updateStats?script=${SCRIPT}" > $TEMP_DIR/statistics 2>/dev/null || true; }&
305+
{ wget --no-check-certificate -qO- --timeout=3 "http://stat.cloudflare.now.cc:4000/api/updateStats?script=${SCRIPT}" > $TEMP_DIR/statistics 2>/dev/null || true; }&
306306
elif grep -q 'get' <<< "$UPDATE_OR_GET"; then
307307
[ -s $TEMP_DIR/statistics ] && [[ $(cat $TEMP_DIR/statistics) =~ \"todayCount\":([0-9]+),\"totalCount\":([0-9]+) ]] && local TODAY="${BASH_REMATCH[1]}" && local TOTAL="${BASH_REMATCH[2]}" && rm -f $TEMP_DIR/statistics
308308
hint "\n*******************************************\n\n $(text 55) \n"
@@ -641,10 +641,10 @@ check_install() {
641641
{
642642
# 获取需要下载的 sing-box 版本
643643
local ONLINE=$(get_sing_box_version)
644-
wget --no-check-certificate --continue ${GH_PROXY}https://github.com/SagerNet/sing-box/releases/download/v$ONLINE/sing-box-$ONLINE-linux-$SING_BOX_ARCH.tar.gz -qO- | tar xz -C $TEMP_DIR sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box >/dev/null 2>&1
644+
wget --no-check-certificate --continue https://${GH_PROXY}github.com/SagerNet/sing-box/releases/download/v$ONLINE/sing-box-$ONLINE-linux-$SING_BOX_ARCH.tar.gz -qO- | tar xz -C $TEMP_DIR sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box >/dev/null 2>&1
645645
[ -s $TEMP_DIR/sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box ] && mv $TEMP_DIR/sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box $TEMP_DIR
646-
wget --no-check-certificate --continue -qO $TEMP_DIR/jq ${GH_PROXY}https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-$JQ_ARCH >/dev/null 2>&1 && chmod +x $TEMP_DIR/jq >/dev/null 2>&1
647-
wget --no-check-certificate --continue -qO $TEMP_DIR/qrencode ${GH_PROXY}https://github.com/fscarmen/client_template/raw/main/qrencode-go/qrencode-go-linux-$QRENCODE_ARCH >/dev/null 2>&1 && chmod +x $TEMP_DIR/qrencode >/dev/null 2>&1
646+
wget --no-check-certificate --continue -qO $TEMP_DIR/jq https://${GH_PROXY}github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-$JQ_ARCH >/dev/null 2>&1 && chmod +x $TEMP_DIR/jq >/dev/null 2>&1
647+
wget --no-check-certificate --continue -qO $TEMP_DIR/qrencode https://${GH_PROXY}github.com/fscarmen/client_template/raw/main/qrencode-go/qrencode-go-linux-$QRENCODE_ARCH >/dev/null 2>&1 && chmod +x $TEMP_DIR/qrencode >/dev/null 2>&1
648648
}&
649649
fi
650650

@@ -681,7 +681,7 @@ check_install() {
681681
fi
682682

683683
# 下载 cloudflared 如果需要
684-
[[ "${STATUS[1]}" = "$(text 26)" || "$NONINTERACTIVE_INSTALL" = 'noninteractive_install' ]] && [ ! -s ${WORK_DIR}/cloudflared ] && { wget --no-check-certificate -qO $TEMP_DIR/cloudflared ${GH_PROXY}https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-$ARGO_ARCH >/dev/null 2>&1 && chmod +x $TEMP_DIR/cloudflared >/dev/null 2>&1; }&
684+
[[ "${STATUS[1]}" = "$(text 26)" || "$NONINTERACTIVE_INSTALL" = 'noninteractive_install' ]] && [ ! -s ${WORK_DIR}/cloudflared ] && { wget --no-check-certificate -qO $TEMP_DIR/cloudflared https://${GH_PROXY}github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-$ARGO_ARCH >/dev/null 2>&1 && chmod +x $TEMP_DIR/cloudflared >/dev/null 2>&1; }&
685685
}
686686

687687
# 为了适配 alpine,定义 cmd_systemctl 的函数
@@ -792,15 +792,15 @@ check_system_info() {
792792
# 获取 sing-box 最新版本
793793
get_sing_box_version() {
794794
# FORCE_VERSION 用于在 sing-box 某个主程序出现 bug 时,强制为指定版本,以防止运行出错
795-
local FORCE_VERSION=$(wget --no-check-certificate --tries=2 --timeout=3 -qO- ${GH_PROXY}https://raw.githubusercontent.com/fscarmen/sing-box/refs/heads/main/force_version | sed 's/^[vV]//g; s/\r//g')
795+
local FORCE_VERSION=$(wget --no-check-certificate --tries=2 --timeout=3 -qO- https://${GH_PROXY}raw.githubusercontent.com/fscarmen/sing-box/refs/heads/main/force_version | sed 's/^[vV]//g; s/\r//g')
796796
if grep -q '.' <<< "$FORCE_VERSION"; then
797797
local RESULT_VERSION="$FORCE_VERSION"
798798
else
799799
# 先判断 github api 返回 http 状态码是否为 200,有时候 IP 会被限制,导致获取不到最新版本
800-
local API_RESPONSE=$(wget --no-check-certificate --server-response --tries=2 --timeout=3 -qO- "${GH_PROXY}https://api.github.com/repos/SagerNet/sing-box/releases" 2>&1 | grep -E '^[ ]+HTTP/|tag_name')
800+
local API_RESPONSE=$(wget --no-check-certificate --server-response --tries=2 --timeout=3 -qO- "https://${GH_PROXY}api.github.com/repos/SagerNet/sing-box/releases" 2>&1 | grep -E '^[ ]+HTTP/|tag_name')
801801
if grep -q 'HTTP.* 200' <<< "$API_RESPONSE"; then
802802
local VERSION_LATEST=$(awk -F '["v-]' '/tag_name/{print $5}' <<< "$API_RESPONSE" | sort -Vr | sed -n '1p')
803-
local RESULT_VERSION=$(wget --no-check-certificate --tries=2 --timeout=3 -qO- ${GH_PROXY}https://api.github.com/repos/SagerNet/sing-box/releases | awk -F '["v]' -v var="tag_name.*$VERSION_LATEST" '$0 ~ var {print $5; exit}')
803+
local RESULT_VERSION=$(wget --no-check-certificate --tries=2 --timeout=3 -qO- https://${GH_PROXY}api.github.com/repos/SagerNet/sing-box/releases | awk -F '["v]' -v var="tag_name.*$VERSION_LATEST" '$0 ~ var {print $5; exit}')
804804
else
805805
local RESULT_VERSION="$DEFAULT_NEWEST_VERSION"
806806
fi
@@ -3274,7 +3274,7 @@ version() {
32743274

32753275
if [ "${UPDATE,,}" = 'y' ]; then
32763276
check_system_info
3277-
wget --no-check-certificate --continue ${GH_PROXY}https://github.com/SagerNet/sing-box/releases/download/v$ONLINE/sing-box-$ONLINE-linux-$SING_BOX_ARCH.tar.gz -qO- | tar xz -C $TEMP_DIR sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box
3277+
wget --no-check-certificate --continue https://${GH_PROXY}github.com/SagerNet/sing-box/releases/download/v$ONLINE/sing-box-$ONLINE-linux-$SING_BOX_ARCH.tar.gz -qO- | tar xz -C $TEMP_DIR sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box
32783278

32793279
if [ -s $TEMP_DIR/sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box ]; then
32803280
cmd_systemctl disable sing-box
@@ -3381,11 +3381,11 @@ menu_setting() {
33813381
ACTION[4]() { change_argo; exit; }
33823382
ACTION[5]() { change_start_port; exit; }
33833383
ACTION[6]() { version; exit; }
3384-
ACTION[7]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit; }
3384+
ACTION[7]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit; }
33853385
ACTION[8]() { change_protocols; exit; }
33863386
ACTION[9]() { uninstall; exit; }
3387-
ACTION[10]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/fscarmen/argox/main/argox.sh) -$L; exit; }
3388-
ACTION[11]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/fscarmen/sba/main/sba.sh) -$L; exit; }
3387+
ACTION[10]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/fscarmen/argox/main/argox.sh) -$L; exit; }
3388+
ACTION[11]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/fscarmen/sba/main/sba.sh) -$L; exit; }
33893389
ACTION[12]() { bash <(wget --no-check-certificate -qO- https://tcp.hy2.sh/); exit; }
33903390
else
33913391
OPTION[1]="1. $(text 34) + Argo + $(text 80) $(text 89)"
@@ -3401,10 +3401,10 @@ menu_setting() {
34013401
ACTION[2]() { IS_SUB=no_sub; IS_ARGO=is_argo; install_sing-box; export_list install; create_shortcut; exit; }
34023402
ACTION[3]() { IS_SUB=is_sub; IS_ARGO=no_argo; install_sing-box; export_list install; create_shortcut; exit; }
34033403
ACTION[4]() { install_sing-box; export_list install; create_shortcut; exit; }
3404-
ACTION[5]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit; }
3405-
ACTION[6]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/fscarmen/argox/main/argox.sh) -$L; exit; }
3406-
ACTION[7]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/fscarmen/sba/main/sba.sh) -$L; exit; }
3407-
ACTION[8]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://tcp.hy2.sh/); exit; }
3404+
ACTION[5]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit; }
3405+
ACTION[6]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/fscarmen/argox/main/argox.sh) -$L; exit; }
3406+
ACTION[7]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/fscarmen/sba/main/sba.sh) -$L; exit; }
3407+
ACTION[8]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}tcp.hy2.sh/); exit; }
34083408
fi
34093409

34103410
[ "${#OPTION[@]}" -ge '10' ] && OPTION[0]="0 . $(text 35)" || OPTION[0]="0. $(text 35)"
@@ -3508,7 +3508,7 @@ for z in ${!ALL_PARAMETER[@]}; do
35083508
check_arch; version; exit 0
35093509
;;
35103510
-B )
3511-
bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit
3511+
bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit
35123512
;;
35133513
-R )
35143514
change_protocols; exit 0

0 commit comments

Comments
 (0)