diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index e7990de..05dd3d6 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -19,19 +19,4 @@ jobs: target_repo_url: git@gitlab.com:${{ github.repository }}.git ssh_private_key: - ${{ secrets.PRIVATE_KEY }} - - mirror_to_bitbucket: - runs-on: ubuntu-latest - steps: - - name: 'Checkout' - uses: actions/checkout@v4.2.2 - with: - fetch-depth: 0 - - name: 'Mirror to bitbucket' - uses: fscarmen/repository-mirroring-action@v1.0.0 - with: - target_repo_url: - git@bitbucket.org:${{ github.repository }}.git - ssh_private_key: - ${{ secrets.PRIVATE_KEY }} + ${{ secrets.PRIVATE_KEY }} \ No newline at end of file diff --git a/README.md b/README.md index fababe8..43e8ebf 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b --START_PORT 8881 \ --PORT_NGINX 60000 \ --SERVER_IP 123.123.123.123 \ - --CDN skk.moe\ + --CDN skk.moe \ --VMESS_HOST_DOMAIN vmess.test.com \ --VLESS_HOST_DOMAIN vless.test.com \ --UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \ @@ -185,7 +185,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b --START_PORT 8881 \ --PORT_NGINX 60000 \ --SERVER_IP 123.123.123.123 \ - --CDN skk.moe\ + --CDN skk.moe \ --VMESS_HOST_DOMAIN vmess.test.com \ --VLESS_HOST_DOMAIN vless.test.com \ --UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \ @@ -205,7 +205,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b --START_PORT 8881 \ --PORT_NGINX 60000 \ --SERVER_IP 123.123.123.123 \ - --CDN skk.moe\ + --CDN skk.moe \ --UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \ --SUBSCRIBE=true \ --ARGO=true \ @@ -225,7 +225,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b --START_PORT 8881 \ --PORT_NGINX 60000 \ --SERVER_IP 123.123.123.123 \ - --CDN skk.moe\ + --CDN skk.moe \ --UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \ --ARGO=true \ --PORT_HOPPING_RANGE 50000:51000 \ @@ -244,7 +244,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b --START_PORT 8881 \ --PORT_NGINX 60000 \ --SERVER_IP 123.123.123.123 \ - --CDN skk.moe\ + --CDN skk.moe \ --UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \ --SUBSCRIBE=true \ --ARGO=true \ @@ -266,7 +266,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b --START_PORT 8881 \ --PORT_NGINX 60000 \ --SERVER_IP 123.123.123.123 \ - --CDN skk.moe\ + --CDN skk.moe \ --UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \ --ARGO=true \ --ARGO_DOMAIN=sb.argo.com \ @@ -287,7 +287,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b --START_PORT 8881 \ --PORT_NGINX 60000 \ --SERVER_IP 123.123.123.123 \ - --CDN skk.moe\ + --CDN skk.moe \ --UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \ --SUBSCRIBE=true \ --ARGO=true \ @@ -309,7 +309,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b --START_PORT 8881 \ --PORT_NGINX 60000 \ --SERVER_IP 123.123.123.123 \ - --CDN skk.moe\ + --CDN skk.moe \ --UUID_CONFIRM 20f7fca4-86e5-4ddf-9eed-24142073d197 \ --ARGO=true \ --ARGO_DOMAIN=sb.argo.com \ diff --git a/docker_init.sh b/docker_init.sh index 8f5dd86..fca7fd2 100644 --- a/docker_init.sh +++ b/docker_init.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# 脚本更新日期 2025.07.01 +# 脚本更新日期 2025.07.12 WORK_DIR=/sing-box PORT=$START_PORT SUBSCRIBE_TEMPLATE="https://raw.githubusercontent.com/fscarmen/client_template/main" @@ -1258,7 +1258,7 @@ $(${WORK_DIR}/qrencode https://${ARGO_DOMAIN}/${UUID}/auto) # 显示脚本使用情况数据 hint "\n*******************************************\n" - local STAT=$(wget -qO- --timeout=3 "https://stat-api.netlify.app/updateStats?script=sing-box-docker.sh") + local STAT=$(wget --no-check-certificate -qO- --timeout=3 "http://stat.cloudflare.now.cc:4000/api/updateStats?script=sing-box-docker.sh") [[ "$STAT" =~ \"todayCount\":([0-9]+),\"totalCount\":([0-9]+) ]] && local TODAY="${BASH_REMATCH[1]}" && local TOTAL="${BASH_REMATCH[2]}" hint "\n 脚本当天运行次数: $TODAY,累计运行次数: $TOTAL \n" } diff --git a/sing-box.sh b/sing-box.sh index e6dca9e..8d11ee6 100644 --- a/sing-box.sh +++ b/sing-box.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash # 当前脚本版本号 -VERSION='v1.2.17 (2025.05.19)' +VERSION='v1.2.17 (2025.07.12)' # 各变量默认值 -GH_PROXY='https://ghfast.top/' +GH_PROXY='gh-proxy.com/' TEMP_DIR='/tmp/sing-box' WORK_DIR='/etc/sing-box' START_PORT_DEFAULT='8881' @@ -263,7 +263,7 @@ text() { grep -q '\$' <<< "${E[$*]}" && eval echo "\$(eval echo "\${${L}[$*]}")" # 检测是否需要启用 Github CDN,如能直接连通,则不使用 check_cdn() { - [ -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 + [ -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 } # 检测是否解锁 chatGPT,以决定是否使用 warp 链式代理或者是 direct out,此处判断改编自 https://github.com/lmc999/RegionRestrictionCheck @@ -302,7 +302,7 @@ statistics_of_run-times() { local UPDATE_OR_GET=$1 local SCRIPT=$2 if grep -q 'update' <<< "$UPDATE_OR_GET"; then - { wget -qO- --timeout=3 "https://stat-api.netlify.app/updateStats?script=${SCRIPT}" > $TEMP_DIR/statistics 2>/dev/null || true; }& + { wget --no-check-certificate -qO- --timeout=3 "http://stat.cloudflare.now.cc:4000/api/updateStats?script=${SCRIPT}" > $TEMP_DIR/statistics 2>/dev/null || true; }& elif grep -q 'get' <<< "$UPDATE_OR_GET"; then [ -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 hint "\n*******************************************\n\n $(text 55) \n" @@ -641,10 +641,10 @@ check_install() { { # 获取需要下载的 sing-box 版本 local ONLINE=$(get_sing_box_version) - 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 + 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 [ -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 - 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 - 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 + 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 + 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 }& fi @@ -681,7 +681,7 @@ check_install() { fi # 下载 cloudflared 如果需要 - [[ "${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; }& + [[ "${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; }& } # 为了适配 alpine,定义 cmd_systemctl 的函数 @@ -792,15 +792,15 @@ check_system_info() { # 获取 sing-box 最新版本 get_sing_box_version() { # FORCE_VERSION 用于在 sing-box 某个主程序出现 bug 时,强制为指定版本,以防止运行出错 - 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') + 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') if grep -q '.' <<< "$FORCE_VERSION"; then local RESULT_VERSION="$FORCE_VERSION" else # 先判断 github api 返回 http 状态码是否为 200,有时候 IP 会被限制,导致获取不到最新版本 - 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') + 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') if grep -q 'HTTP.* 200' <<< "$API_RESPONSE"; then local VERSION_LATEST=$(awk -F '["v-]' '/tag_name/{print $5}' <<< "$API_RESPONSE" | sort -Vr | sed -n '1p') - 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}') + 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}') else local RESULT_VERSION="$DEFAULT_NEWEST_VERSION" fi @@ -3274,7 +3274,7 @@ version() { if [ "${UPDATE,,}" = 'y' ]; then check_system_info - 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 + 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 if [ -s $TEMP_DIR/sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box ]; then cmd_systemctl disable sing-box @@ -3381,11 +3381,11 @@ menu_setting() { ACTION[4]() { change_argo; exit; } ACTION[5]() { change_start_port; exit; } ACTION[6]() { version; exit; } - ACTION[7]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit; } + ACTION[7]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit; } ACTION[8]() { change_protocols; exit; } ACTION[9]() { uninstall; exit; } - ACTION[10]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/fscarmen/argox/main/argox.sh) -$L; exit; } - ACTION[11]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/fscarmen/sba/main/sba.sh) -$L; exit; } + ACTION[10]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/fscarmen/argox/main/argox.sh) -$L; exit; } + ACTION[11]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/fscarmen/sba/main/sba.sh) -$L; exit; } ACTION[12]() { bash <(wget --no-check-certificate -qO- https://tcp.hy2.sh/); exit; } else OPTION[1]="1. $(text 34) + Argo + $(text 80) $(text 89)" @@ -3401,10 +3401,10 @@ menu_setting() { ACTION[2]() { IS_SUB=no_sub; IS_ARGO=is_argo; install_sing-box; export_list install; create_shortcut; exit; } ACTION[3]() { IS_SUB=is_sub; IS_ARGO=no_argo; install_sing-box; export_list install; create_shortcut; exit; } ACTION[4]() { install_sing-box; export_list install; create_shortcut; exit; } - ACTION[5]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit; } - ACTION[6]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/fscarmen/argox/main/argox.sh) -$L; exit; } - ACTION[7]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/fscarmen/sba/main/sba.sh) -$L; exit; } - ACTION[8]() { bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://tcp.hy2.sh/); exit; } + ACTION[5]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit; } + ACTION[6]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/fscarmen/argox/main/argox.sh) -$L; exit; } + ACTION[7]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/fscarmen/sba/main/sba.sh) -$L; exit; } + ACTION[8]() { bash <(wget --no-check-certificate -qO- https://${GH_PROXY}tcp.hy2.sh/); exit; } fi [ "${#OPTION[@]}" -ge '10' ] && OPTION[0]="0 . $(text 35)" || OPTION[0]="0. $(text 35)" @@ -3508,7 +3508,7 @@ for z in ${!ALL_PARAMETER[@]}; do check_arch; version; exit 0 ;; -B ) - bash <(wget --no-check-certificate -qO- ${GH_PROXY}https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit + bash <(wget --no-check-certificate -qO- https://${GH_PROXY}raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh); exit ;; -R ) change_protocols; exit 0