http: autogen rpc creds.
This commit is contained in:
parent
91a1477aeb
commit
bea7bc4677
@ -53,6 +53,12 @@ function HTTPServer(options) {
|
|||||||
this.rpcPassword = options.rpcPassword;
|
this.rpcPassword = options.rpcPassword;
|
||||||
this.rpc = null;
|
this.rpc = null;
|
||||||
|
|
||||||
|
if (!this.rpcUser)
|
||||||
|
this.rpcUser = 'admin';
|
||||||
|
|
||||||
|
if (!this.rpcPassword)
|
||||||
|
this.rpcPassword = bcoin.ec.random(20).toString('hex');
|
||||||
|
|
||||||
if (this.apiKey) {
|
if (this.apiKey) {
|
||||||
if (typeof this.apiKey === 'string') {
|
if (typeof this.apiKey === 'string') {
|
||||||
assert(utils.isHex(this.apiKey), 'API key must be a hex string.');
|
assert(utils.isHex(this.apiKey), 'API key must be a hex string.');
|
||||||
@ -1011,6 +1017,7 @@ HTTPServer.prototype._initIO = function _initIO() {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
HTTPServer.prototype.open = function open(callback) {
|
HTTPServer.prototype.open = function open(callback) {
|
||||||
|
this.logger.info('RPC credentials: %s:%s', this.rpcUser, this.rpcPassword);
|
||||||
this.server.open(callback);
|
this.server.open(callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user