Browse Source

add WG_SERVER_MTU to config.js, enable MTU only if mtu is specified

pull/1573/head
Michail Montesantos 8 months ago
parent
commit
edf55835c8
  1. 1
      src/config.js
  2. 2
      src/lib/WireGuard.js

1
src/config.js

@ -13,6 +13,7 @@ module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/';
module.exports.WG_DEVICE = process.env.WG_DEVICE || 'eth0';
module.exports.WG_HOST = process.env.WG_HOST;
module.exports.WG_PORT = process.env.WG_PORT || '51820';
module.exports.WG_SERVER_MTU = process.env.WG_SERVER_MTU;
module.exports.WG_CONFIG_PORT = process.env.WG_CONFIG_PORT || process.env.WG_PORT || '51820';
module.exports.WG_MTU = process.env.WG_MTU || null;
module.exports.WG_PERSISTENT_KEEPALIVE = process.env.WG_PERSISTENT_KEEPALIVE || '0';

2
src/lib/WireGuard.js

@ -108,7 +108,7 @@ module.exports = class WireGuard {
PrivateKey = ${config.server.privateKey}
Address = ${config.server.address}/24
ListenPort = ${WG_PORT}
MTU = ${WG_SERVER_MTU}
${WG_SERVER_MTU ? `MTU = ${WG_SERVER_MTU}` : ''}
PreUp = ${WG_PRE_UP}
PostUp = ${WG_POST_UP}
PreDown = ${WG_PRE_DOWN}

Loading…
Cancel
Save