Merge pull request #27 from pheiduck/determ_interface

fixup: Determine interface of default network rather than assume eth0
This commit is contained in:
Philip H 2023-11-14 13:34:03 +01:00 committed by GitHub
commit b0def28938
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
'use strict';
const { execSync } = require('child_process');
const { release } = require('./package.json');
module.exports.RELEASE = release;
@ -7,7 +8,7 @@ module.exports.PORT = process.env.PORT || 51821;
module.exports.WEBUI_HOST = process.env.WEBUI_HOST || '0.0.0.0';
module.exports.PASSWORD = process.env.PASSWORD;
module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/';
module.exports.WG_DEVICE = process.env.WG_DEVICE || 'eth0';
module.exports.WG_DEVICE = process.env.WG_DEVICE || execSync("ip r | grep default | cut -d ' ' -f 5 | head -n1");
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;