From 1360af644f5114d0941a5442e056c0447504b775 Mon Sep 17 00:00:00 2001 From: BrainStone Date: Tue, 11 Oct 2022 02:26:46 +0200 Subject: [PATCH] WG commands are executed by wg which runs as root already --- src/config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config.js b/src/config.js index 000f06d2..10bd59cf 100644 --- a/src/config.js +++ b/src/config.js @@ -20,10 +20,10 @@ module.exports.WG_ALLOWED_IPS = process.env.WG_ALLOWED_IPS || '0.0.0.0/0, ::/0'; module.exports.WG_PRE_UP = process.env.WG_PRE_UP || ''; module.exports.WG_POST_UP = process.env.WG_POST_UP || ` -${module.exports.SUDO_STRING}iptables -t nat -A POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o eth0 -j MASQUERADE; -${module.exports.SUDO_STRING}iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT; -${module.exports.SUDO_STRING}iptables -A FORWARD -i wg0 -j ACCEPT; -${module.exports.SUDO_STRING}iptables -A FORWARD -o wg0 -j ACCEPT; +iptables -t nat -A POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o eth0 -j MASQUERADE; +iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT; +iptables -A FORWARD -i wg0 -j ACCEPT; +iptables -A FORWARD -o wg0 -j ACCEPT; `.split('\n').join(' '); module.exports.WG_PRE_DOWN = process.env.WG_PRE_DOWN || '';