From 8df1b6ff543750d48a7db9ae5b1b51f9bd866664 Mon Sep 17 00:00:00 2001 From: taohua <4320960+datewu@users.noreply.github.com> Date: Tue, 14 May 2024 11:24:31 +0800 Subject: [PATCH] Update config.js should respect WG_PORT, not hard code 51820. --- src/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.js b/src/config.js index 1fff4c2..b76c534 100644 --- a/src/config.js +++ b/src/config.js @@ -21,7 +21,7 @@ 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 || ` iptables -t nat -A POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o ${module.exports.WG_DEVICE} -j MASQUERADE; -iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT; +iptables -A INPUT -p udp -m udp --dport ${module.exports.WG_PORT} -j ACCEPT; iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; `.split('\n').join(' '); @@ -29,7 +29,7 @@ iptables -A FORWARD -o wg0 -j ACCEPT; module.exports.WG_PRE_DOWN = process.env.WG_PRE_DOWN || ''; module.exports.WG_POST_DOWN = process.env.WG_POST_DOWN || ` iptables -t nat -D POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o ${module.exports.WG_DEVICE} -j MASQUERADE; -iptables -D INPUT -p udp -m udp --dport 51820 -j ACCEPT; +iptables -D INPUT -p udp -m udp --dport ${module.exports.WG_PORT} -j ACCEPT; iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; `.split('\n').join(' ');