fix: add build-time binary search + runtime path-finder for purevpn-cli

This commit is contained in:
2026-03-11 10:08:44 +01:00
parent fa5918a36d
commit ed4076abca
2 changed files with 20 additions and 1 deletions

View File

@@ -16,7 +16,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN curl -fsSL https://apps.purevpn-tools.com/cross-platform/linux-cli/production/cli-install.sh \
-o /tmp/cli-install.sh \
&& bash /tmp/cli-install.sh \
&& rm -f /tmp/cli-install.sh
&& rm -f /tmp/cli-install.sh \
&& echo ">>> purevpn-cli install search:" \
&& find / -maxdepth 8 -name "purevpn*" 2>/dev/null || true \
&& echo ">>> /etc/pure-linux-cli contents:" \
&& ls -la /etc/pure-linux-cli/ 2>/dev/null || echo "(directory not found)"
# ── Add purevpn-cli to PATH (as per official docs) ────────────────────────────
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/etc/pure-linux-cli/

View File

@@ -6,6 +6,21 @@ set -euo pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/etc/pure-linux-cli/
# ── Locate purevpn-cli wherever the installer put it ─────────────────────────
if ! command -v purevpn-cli &>/dev/null; then
_bin=$(find / -maxdepth 8 -name "purevpn-cli" -type f 2>/dev/null | head -1)
if [[ -n "$_bin" ]]; then
export PATH="$(dirname "$_bin"):$PATH"
echo "[entrypoint] purevpn-cli found at $_bin — PATH updated"
else
echo "[entrypoint] FATAL: purevpn-cli not found anywhere on the filesystem"
echo "[entrypoint] All purevpn* files:"
find / -maxdepth 8 -name "purevpn*" 2>/dev/null || true
exit 1
fi
fi
echo "[entrypoint] Using purevpn-cli: $(command -v purevpn-cli)"
SOCKS5_PORT="${SOCKS5_INNER_PORT:-1080}"
VPN_IF="tun0"
VPN_WAIT=60 # max seconds to wait for tun0 to appear