Browse Source

Determine interface of default network rather than assume eth0

fixup: import child_process before package.json
pull/686/head
Chris Debenham 2 years ago
committed by Philip H.
parent
commit
e227c9ea41
  1. 3
      src/config.js

3
src/config.js

@ -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;

Loading…
Cancel
Save