feat: add bundled WireGuard tools support for macOS desktop client with fallback path resolution

Add wg and wg-quick bundling to build-tunnel-helper.sh for aarch64-apple-darwin target. Check for wireguard-tools installation and copy binaries to output directory with execute permissions.

Implement find_wg_quick helper with bundled tool detection and standard path fallbacks. Add bundled_macos_tool to check for tools in current executable directory. Update connect_direct and disconnect_direct to use explicit
This commit is contained in:
2026-03-18 14:31:37 +01:00
parent 5233e90dce
commit 8eb293e01e
2 changed files with 73 additions and 2 deletions

View File

@@ -76,4 +76,21 @@ else
cargo build --manifest-path "${HELPER_DIR}/Cargo.toml" --release --target "${TARGET}"
fi
cp "${HELPER_DIR}/target/${TARGET}/release/${OUTPUT_NAME}" "${OUTPUT_DIR}/${OUTPUT_NAME}"
if [ "${TARGET}" = "aarch64-apple-darwin" ]; then
WG_BIN="$(command -v wg || true)"
WG_QUICK_BIN="$(command -v wg-quick || true)"
if [ -z "${WG_BIN}" ] || [ -z "${WG_QUICK_BIN}" ]; then
echo "macOS bundle requires wg and wg-quick to be installed on the build machine."
echo "Install them with:"
echo " brew install wireguard-tools"
exit 1
fi
cp "${WG_BIN}" "${OUTPUT_DIR}/wg"
cp "${WG_QUICK_BIN}" "${OUTPUT_DIR}/wg-quick"
chmod +x "${OUTPUT_DIR}/wg" "${OUTPUT_DIR}/wg-quick"
fi
echo "Bundled ${OUTPUT_NAME} into ${OUTPUT_DIR}"