From 48498c1f4365dbf122b9a512476453e06cdfa85b Mon Sep 17 00:00:00 2001 From: Malin Date: Wed, 11 Mar 2026 10:44:03 +0100 Subject: [PATCH] fix: sudo wrapper strips --install-missing-components and reruns command as root --- vpn-node/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vpn-node/Dockerfile b/vpn-node/Dockerfile index 6457008..c198738 100644 --- a/vpn-node/Dockerfile +++ b/vpn-node/Dockerfile @@ -24,10 +24,11 @@ RUN curl -fsSL https://apps.purevpn-tools.com/cross-platform/linux-cli/productio # ── Fake sudo wrapper ───────────────────────────────────────────────────────── # purevpn-cli calls `sudo purevpn-cli --connect X --install-missing-components` -# which crashes in its own pkg/Node.js bootstrap (bug in the CLI). -# Since we are root and pre-installed all VPN packages, we intercept that flag -# and exit 0 so the parent process continues to the actual connect step. -RUN printf '#!/bin/sh\nfor a in "$@"; do\n case "$a" in\n --install-missing-components)\n echo "[sudo] skipping --install-missing-components (pre-installed)"\n exit 0 ;;\n esac\ndone\nexec "$@"\n' \ +# which crashes in its own pkg/Node.js bootstrap when that flag combination is +# run through pkg's argument parser (bug in the CLI). +# Fix: strip --install-missing-components and run the real command as-is. +# We are already root in Docker so the re-run won't trigger sudo again. +RUN printf '#!/bin/bash\nnew=(); for a in "$@"; do [[ "$a" == "--install-missing-components" ]] && continue; new+=("$a"); done\nexec "${new[@]}"\n' \ > /usr/local/bin/sudo && chmod +x /usr/local/bin/sudo # ── PATH: installer puts binary in /opt/purevpn-cli/bin/ ─────────────────────