From 06e24a377689c575886669b4894dd16895767a94 Mon Sep 17 00:00:00 2001 From: Malin Date: Thu, 12 Mar 2026 18:55:50 +0100 Subject: [PATCH] fix: pre-download pured daemon + start it before purevpn-cli The purevpn-cli binary hardcodes a wrong S3 path for the daemon download which returns HTTP 403. The correct URL (from the installer script) is: /cross-platform/linux-daemon/1.4.1/pured-linux-x64.gz purevpn-cli is a client that talks to the pured daemon on :9485. Pre-download the daemon during Docker build and start it in the entrypoint before any purevpn-cli invocations. Co-Authored-By: Claude Sonnet 4.6 --- vpn-node/Dockerfile | 7 +++++++ vpn-node/entrypoint.sh | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/vpn-node/Dockerfile b/vpn-node/Dockerfile index cd64067..b41d4bc 100644 --- a/vpn-node/Dockerfile +++ b/vpn-node/Dockerfile @@ -37,6 +37,13 @@ RUN curl -fsSL https://apps.purevpn-tools.com/cross-platform/linux-cli/productio && bash /tmp/cli-install.sh \ && rm -f /tmp/cli-install.sh +# ── Pre-download pured daemon (avoids runtime download which 403s) ──────────── +# The binary hardcodes the wrong S3 path; the correct URL is in the installer. +RUN curl -fsSL "https://apps.purevpn-tools.com/cross-platform/linux-daemon/1.4.1/pured-linux-x64.gz" \ + -o /opt/purevpn-cli/pured-linux-x64.gz \ + && gzip -d /opt/purevpn-cli/pured-linux-x64.gz \ + && chmod +x /opt/purevpn-cli/pured-linux-x64 + # ── PATH ────────────────────────────────────────────────────────────────────── ENV PATH=/opt/purevpn-cli/bin:/opt/purevpn-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin diff --git a/vpn-node/entrypoint.sh b/vpn-node/entrypoint.sh index c1ca7fe..2a2d30d 100755 --- a/vpn-node/entrypoint.sh +++ b/vpn-node/entrypoint.sh @@ -213,6 +213,16 @@ auto_mode() { # ════════════════════════════════════════════════════════════════════════════════ whitelist_eth0 +# ── Start pured daemon ──────────────────────────────────────────────────────── +log "Starting pured daemon …" +NODE_ENV=production /opt/purevpn-cli/pured-linux-x64 --start & +# Wait until daemon is listening on :9485 (up to 15s) +for i in $(seq 1 15); do + nc -z 127.0.0.1 9485 2>/dev/null && { log "pured listening on :9485"; break; } + sleep 1 +done +nc -z 127.0.0.1 9485 2>/dev/null || log "WARNING: pured not listening after 15s — continuing anyway" + if [[ "$MANUAL_CONNECT" == "true" ]]; then manual_mode else