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 <noreply@anthropic.com>
This commit is contained in:
@@ -37,6 +37,13 @@ RUN curl -fsSL https://apps.purevpn-tools.com/cross-platform/linux-cli/productio
|
|||||||
&& bash /tmp/cli-install.sh \
|
&& bash /tmp/cli-install.sh \
|
||||||
&& rm -f /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 ──────────────────────────────────────────────────────────────────────
|
# ── PATH ──────────────────────────────────────────────────────────────────────
|
||||||
ENV PATH=/opt/purevpn-cli/bin:/opt/purevpn-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
ENV PATH=/opt/purevpn-cli/bin:/opt/purevpn-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
|
|||||||
@@ -213,6 +213,16 @@ auto_mode() {
|
|||||||
# ════════════════════════════════════════════════════════════════════════════════
|
# ════════════════════════════════════════════════════════════════════════════════
|
||||||
whitelist_eth0
|
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
|
if [[ "$MANUAL_CONNECT" == "true" ]]; then
|
||||||
manual_mode
|
manual_mode
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user