Browse Source

Ability to change ip address WebUI binds to with WEBUI_HOST env var

pull/566/head
Rahil Bhimjiani 3 years ago
parent
commit
eea421a294
No known key found for this signature in database GPG Key ID: 6D39AB4713797E6F
  1. 1
      src/config.js
  2. 5
      src/lib/Server.js

1
src/config.js

@ -4,6 +4,7 @@ const { release } = require('./package.json');
module.exports.RELEASE = release;
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';

5
src/lib/Server.js

@ -12,6 +12,7 @@ const WireGuard = require('../services/WireGuard');
const {
PORT,
WEBUI_HOST,
RELEASE,
PASSWORD,
} = require('../config');
@ -135,8 +136,8 @@ module.exports = class Server {
return WireGuard.updateClientAddress({ clientId, address });
}))
.listen(PORT, () => {
debug(`Listening on http://0.0.0.0:${PORT}`);
.listen(PORT, WEBUI_HOST, () => {
debug(`Listening on http://${WEBUI_HOST}:${PORT}`);
});
}

Loading…
Cancel
Save