diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2021-03-09 02:44:59 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-03-09 02:44:59 +0300 |
commit | f7ca888651e737f18a0ea760326922da9d80e471 (patch) | |
tree | f61463affaf09ede1d6c720e618453775dbe065e /src/lib/server.js | |
parent | fc004fe70a89c43068b2a455c02f7a813adcc509 (diff) |
improvements, see full commit message
- added new option 'always_allow_localhost'
- improve jobctl, allow connecting to password-protected instances
without using configuration file
Diffstat (limited to 'src/lib/server.js')
-rw-r--r-- | src/lib/server.js | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/lib/server.js b/src/lib/server.js index 051b8be..8ed2be9 100644 --- a/src/lib/server.js +++ b/src/lib/server.js @@ -261,13 +261,7 @@ class Connection extends EventEmitter { * @type {boolean} * @private */ - this._isAuthorized = config.get('password') === '' - - /** - * @type {boolean} - * @private - */ - this._textConversationAllowed = false + this._isAuthorized = !config.get('password') /** * @type {boolean} @@ -328,10 +322,8 @@ class Connection extends EventEmitter { this.remoteAddress = socket.remoteAddress this.remotePort = socket.remotePort - if (this.remoteAddress === '127.0.0.1') { + if (this.remoteAddress === '127.0.0.1' && config.get('always_allow_localhost') === true) this._isAuthorized = true - this._textConversationAllowed = true - } this._setLogger() this._setSocketEvents() @@ -548,7 +540,7 @@ class Connection extends EventEmitter { // send password once (when talking to jobd-master) if (!this._isAuthorized) { - message.setPassword(config.get('password')) + message.setPassword(config.get('password') || '') this._isAuthorized = true } |