From 3e2b897cf3f1fbe93b6861ea7044c95187a02f70 Mon Sep 17 00:00:00 2001 From: ccbkkb <9201575@gmail.com> Date: Mon, 23 Mar 2026 23:29:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BA=AF=20IPv4=20?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8B=20Docker=20=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 永远不要假设用户默认启用了 Docker IPv6 网络监听 - 为 wget 添加了 `--timeout=15` --- entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 00d18ff..5e1389e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,7 +19,7 @@ if [ ! -f "$WG_CONF" ]; then WGCF_VER=$(curl -sL https://api.github.com/repos/ViRb3/wgcf/releases/latest | grep '"tag_name"' | sed 's/.*"v\(.*\)".*/\1/') echo "==> [MicroWARP] 检测到最新 wgcf 版本: v${WGCF_VER}" - wget -qO wgcf "https://github.com/ViRb3/wgcf/releases/download/v${WGCF_VER}/wgcf_${WGCF_VER}_linux_${WGCF_ARCH}" + wget --timeout=15 -qO wgcf "https://github.com/ViRb3/wgcf/releases/download/v${WGCF_VER}/wgcf_${WGCF_VER}_linux_${WGCF_ARCH}" chmod +x wgcf echo "==> [MicroWARP] 正在向 CF 注册设备..." @@ -40,9 +40,14 @@ fi # ========================================== # 2. 强力洗白与内核兼容性处理 (魔改 wg0.conf) # ========================================== -# 删 DNS 就足够了,删多了跑不了了 + +# 确保在纯 IPv4 Docker 环境下 100% 成功拉起网卡 +# 永远不要假设用户默认启用了 Docker IPv6 网络监听 +sed -i 's/^AllowedIPs.*/AllowedIPs = 0.0.0.0\/0/g' "$WG_CONF" +sed -i '/Address.*:/d' "$WG_CONF" sed -i '/^DNS.*/d' "$WG_CONF" + # 删除 Alpine 系统自带 wg-quick 中不兼容的路由标记 sed -i '/src_valid_mark/d' /usr/bin/wg-quick