|
|
|
@ -39,22 +39,35 @@ if (!process.env.WG_POST_UP) { |
|
|
|
iptables -A FORWARD -o wg0 -j ACCEPT;`;
|
|
|
|
|
|
|
|
if (modules.includes('ip6table_nat')) { |
|
|
|
module.exports.WG_POST_UP += `ip6tables -t nat -A POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS6.replace('x', '0')}/64 -o ${module.exports.WG_DEVICE} -j MASQUERADE;
|
|
|
|
ip6tables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT; |
|
|
|
ip6tables -A FORWARD -i wg0 -j ACCEPT; |
|
|
|
ip6tables -A FORWARD -o wg0 -j ACCEPT;`;
|
|
|
|
module.exports.WG_POST_UP += ` |
|
|
|
ip6tables -t nat -A POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS6.replace('x', '0')}/64 -o ${module.exports.WG_DEVICE} -j MASQUERADE; |
|
|
|
ip6tables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT; |
|
|
|
ip6tables -A FORWARD -i wg0 -j ACCEPT; |
|
|
|
ip6tables -A FORWARD -o wg0 -j ACCEPT;`;
|
|
|
|
} |
|
|
|
|
|
|
|
module.exports.WG_POST_UP = module.exports.WG_POST_UP.split('\n').join(' '); |
|
|
|
} |
|
|
|
|
|
|
|
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 ${module.exports.WG_PORT} -j ACCEPT; |
|
|
|
iptables -D FORWARD -i wg0 -j ACCEPT; |
|
|
|
iptables -D FORWARD -o wg0 -j ACCEPT; |
|
|
|
`.split('\n').join(' ');
|
|
|
|
module.exports.WG_POST_DOWN = process.env.WG_POST_DOWN; |
|
|
|
if (!process.env.WG_POST_DOWN) { |
|
|
|
module.exports.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 ${module.exports.WG_PORT} -j ACCEPT; |
|
|
|
iptables -D FORWARD -i wg0 -j ACCEPT; |
|
|
|
iptables -D FORWARD -o wg0 -j ACCEPT;`;
|
|
|
|
|
|
|
|
if (modules.includes('ip6table_nat')) { |
|
|
|
module.exports.WG_POST_UP += ` |
|
|
|
ip6tables -t nat -D POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS6.replace('x', '0')}/64 -o ${module.exports.WG_DEVICE} -j MASQUERADE; |
|
|
|
ip6tables -D INPUT -p udp -m udp --dport 51820 -j ACCEPT; |
|
|
|
ip6tables -D FORWARD -i wg0 -j ACCEPT; |
|
|
|
ip6tables -D FORWARD -o wg0 -j ACCEPT;`;
|
|
|
|
} |
|
|
|
|
|
|
|
module.exports.WG_POST_UP = module.exports.WG_POST_UP.split('\n').join(' '); |
|
|
|
} |
|
|
|
module.exports.LANG = process.env.LANG || 'en'; |
|
|
|
module.exports.UI_TRAFFIC_STATS = process.env.UI_TRAFFIC_STATS || 'false'; |
|
|
|
module.exports.UI_CHART_TYPE = process.env.UI_CHART_TYPE || 0; |
|
|
|
|