diff --git a/vpn-node/Dockerfile b/vpn-node/Dockerfile index b41d4bc..f7f75c7 100644 --- a/vpn-node/Dockerfile +++ b/vpn-node/Dockerfile @@ -44,6 +44,15 @@ RUN curl -fsSL "https://apps.purevpn-tools.com/cross-platform/linux-daemon/1.4.1 && gzip -d /opt/purevpn-cli/pured-linux-x64.gz \ && chmod +x /opt/purevpn-cli/pured-linux-x64 +# ── Fake systemctl (pured.service) ─────────────────────────────────────────── +# purevpn-cli checks `systemctl is-active pured.service` to detect missing +# components. Without systemd, this always returns inactive → endless sudo loop. +# Fake systemctl returns "active" when the daemon is reachable on :9485. +COPY systemctl.sh /usr/local/bin/systemctl +RUN chmod +x /usr/local/bin/systemctl \ + && mkdir -p /etc/systemd/system \ + && cp /opt/purevpn-cli/pured.service /etc/systemd/system/pured.service + # ── 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/systemctl.sh b/vpn-node/systemctl.sh new file mode 100644 index 0000000..81b1811 --- /dev/null +++ b/vpn-node/systemctl.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Fake systemctl for containers — handles pured.service lifecycle without systemd. +# All other commands are no-ops so purevpn-cli installer steps don't break. +case "$*" in + *"is-active pured"*) + nc -z 127.0.0.1 9485 2>/dev/null && echo "active" && exit 0 + echo "inactive"; exit 1 ;; + *"start pured"*) + NODE_ENV=production /opt/purevpn-cli/pured-linux-x64 --start & + sleep 2; exit 0 ;; + *"stop pured"*|*"disable pured"*) + pkill -f "pured-linux-x64" 2>/dev/null || true; exit 0 ;; + *) + exit 0 ;; +esac