Merge pull request #154 from DerDanilo/add-WG_MTU

add optional client profile MTU var
This commit is contained in:
Emile Nijssen 2022-01-10 22:55:08 -08:00 committed by GitHub
commit f829bbdf41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 0 deletions

View file

@ -8,6 +8,7 @@ module.exports.PASSWORD = process.env.PASSWORD;
module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/';
module.exports.WG_HOST = process.env.WG_HOST;
module.exports.WG_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;
module.exports.WG_DEFAULT_ADDRESS = process.env.WG_DEFAULT_ADDRESS || '10.8.0.x';
module.exports.WG_DEFAULT_DNS = typeof process.env.WG_DEFAULT_DNS === 'string'

View file

@ -14,6 +14,7 @@ const {
WG_PATH,
WG_HOST,
WG_PORT,
WG_MTU,
WG_DEFAULT_DNS,
WG_DEFAULT_ADDRESS,
WG_PERSISTENT_KEEPALIVE,
@ -191,6 +192,9 @@ AllowedIPs = ${client.address}/32`;
PrivateKey = ${client.privateKey}
Address = ${client.address}/24
${WG_DEFAULT_DNS ? `DNS = ${WG_DEFAULT_DNS}` : ''}
if (typeof ${WG_MTU} !== 'undefined' || ${WG_MTU} !== null) {
MTU = ${WG_MTU}
}
[Peer]
PublicKey = ${config.server.publicKey}