BrainStone
4 years ago
No known key found for this signature in database
GPG Key ID: 66CCC234C2CEB306
2 changed files with
4 additions and
2 deletions
-
src/config.js
-
src/lib/Server.js
|
|
@ -3,6 +3,7 @@ |
|
|
const { release } = require('./package.json'); |
|
|
const { release } = require('./package.json'); |
|
|
|
|
|
|
|
|
module.exports.RELEASE = release; |
|
|
module.exports.RELEASE = release; |
|
|
|
|
|
module.exports.LISTEN_IP = process.env.LISTEN_IP || '0.0.0.0'; |
|
|
module.exports.PORT = process.env.PORT || 51821; |
|
|
module.exports.PORT = process.env.PORT || 51821; |
|
|
module.exports.PASSWORD = process.env.PASSWORD; |
|
|
module.exports.PASSWORD = process.env.PASSWORD; |
|
|
module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; |
|
|
module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; |
|
|
|
|
|
@ -11,6 +11,7 @@ const ServerError = require('./ServerError'); |
|
|
const WireGuard = require('../services/WireGuard'); |
|
|
const WireGuard = require('../services/WireGuard'); |
|
|
|
|
|
|
|
|
const { |
|
|
const { |
|
|
|
|
|
LISTEN_IP, |
|
|
PORT, |
|
|
PORT, |
|
|
RELEASE, |
|
|
RELEASE, |
|
|
PASSWORD, |
|
|
PASSWORD, |
|
|
@ -135,8 +136,8 @@ module.exports = class Server { |
|
|
return WireGuard.updateClientAddress({ clientId, address }); |
|
|
return WireGuard.updateClientAddress({ clientId, address }); |
|
|
})) |
|
|
})) |
|
|
|
|
|
|
|
|
.listen(PORT, () => { |
|
|
.listen(PORT, LISTEN_IP, () => { |
|
|
debug(`Listening on http://0.0.0.0:${PORT}`); |
|
|
debug(`Listening on http://${LISTEN_IP}:${PORT}`); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|