Browse Source

WG commands are executed by wg which runs as root already

pull/394/head
BrainStone 4 years ago
parent
commit
1360af644f
No known key found for this signature in database GPG Key ID: 66CCC234C2CEB306
  1. 8
      src/config.js

8
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 || '';

Loading…
Cancel
Save