From e61ec09b189f1294d0d5b605b13aa5d356e120e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=80=D0=B5=D0=B2?= Date: Sun, 31 May 2026 12:26:40 +0300 Subject: [PATCH] fix: find -type f for wg-obfuscator binary in archive (tar unpacks to dir) Co-Authored-By: Claude Opus 4.8 --- install.sh | 2 +- overlay/phobos-client.sh | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 784fee0..c19f1f3 100755 --- a/install.sh +++ b/install.sh @@ -98,7 +98,7 @@ for _am in "aarch64:linux-arm64" "mipsel:linux-mipsel-mips32" "mips:linux-mips-m _t=$(mktemp -d) curl -fsSL -m30 "${_CB}/wg-obfuscator-${_OBF_TAG}-${_ss}.tar.gz" -o "$_t/o.tgz" 2>/dev/null && tar -xzf "$_t/o.tgz" -C "$_t" 2>/dev/null && - _b=$(find "$_t" -name "wg-obfuscator" | head -1) && + _b=$(find "$_t" -name "wg-obfuscator" -type f | head -1) && [ -n "$_b" ] && cp "$_b" "$PHOBOS_DIR/bin/wg-obfuscator-${_da}" && chmod +x "$PHOBOS_DIR/bin/wg-obfuscator-${_da}" && echo " +wg-obfuscator-${_da} (ClusterM ${_OBF_TAG})" rm -rf "$_t" fi diff --git a/overlay/phobos-client.sh b/overlay/phobos-client.sh index e611296..8a7e167 100755 --- a/overlay/phobos-client.sh +++ b/overlay/phobos-client.sh @@ -209,8 +209,21 @@ action_package() { cp "$dir/${id}.conf" "$pkg_root/${id}.conf" cp "$dir/wg-obfuscator.conf" "$pkg_root/wg-obfuscator.conf" - for arch in mipsel mips aarch64 armv7 x86_64; do - [[ -f "$PHOBOS_DIR/bin/wg-obfuscator-$arch" ]] && cp "$PHOBOS_DIR/bin/wg-obfuscator-$arch" "$pkg_root/bin/" + # Fetch missing router-arch binaries from ClusterM on-demand (Ground-Zerro = x86_64 only) + local _tag; _tag=$(curl -fsSL -m10 https://api.github.com/repos/ClusterM/wg-obfuscator/releases/latest 2>/dev/null | grep '"tag_name"' | head -1 | sed 's/.*"tag_name": *"\(.*\)".*/\1/') + local _cb="https://github.com/ClusterM/wg-obfuscator/releases/download/${_tag}" + declare -A _am=([aarch64]="linux-arm64" [mipsel]="linux-mipsel-mips32" [mips]="linux-mips-mips32" [armv7]="linux-armv7-hf" [x86_64]="linux-x64") + for _arch in aarch64 mipsel mips armv7 x86_64; do + if [[ ! -f "$PHOBOS_DIR/bin/wg-obfuscator-$_arch" ]] && [[ -n "$_tag" ]]; then + local _t; _t=$(mktemp -d) + if curl -fsSL -m30 "${_cb}/wg-obfuscator-${_tag}-${_am[$_arch]}.tar.gz" -o "$_t/o.tgz" 2>/dev/null; then + tar -xzf "$_t/o.tgz" -C "$_t" 2>/dev/null || true + local _b; _b=$(find "$_t" -name "wg-obfuscator" -type f | head -1) + [[ -n "$_b" ]] && cp "$_b" "$PHOBOS_DIR/bin/wg-obfuscator-$_arch" && chmod +x "$PHOBOS_DIR/bin/wg-obfuscator-$_arch" && log_info "+wg-obfuscator-$_arch (ClusterM ${_tag})" + fi + rm -rf "$_t" + fi + [[ -f "$PHOBOS_DIR/bin/wg-obfuscator-$_arch" ]] && cp "$PHOBOS_DIR/bin/wg-obfuscator-$_arch" "$pkg_root/bin/" done local tpl_dir="$REPO_DIR/client/templates"