REF
This commit is contained in:
parent
e72fcb3b0f
commit
cb452d6abd
@ -56,13 +56,13 @@ export class User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async create() {
|
async create() {
|
||||||
let buffer = crypto.randomBytes(20);
|
let buffer = crypto.randomBytes(10);
|
||||||
let login = buffer.toString('hex');
|
let login = buffer.toString('hex');
|
||||||
|
|
||||||
buffer = crypto.randomBytes(20);
|
buffer = crypto.randomBytes(10);
|
||||||
let password = buffer.toString('hex');
|
let password = buffer.toString('hex');
|
||||||
|
|
||||||
buffer = crypto.randomBytes(48);
|
buffer = crypto.randomBytes(24);
|
||||||
let userid = buffer.toString('hex');
|
let userid = buffer.toString('hex');
|
||||||
this._login = login;
|
this._login = login;
|
||||||
this._password = password;
|
this._password = password;
|
||||||
|
@ -10,7 +10,7 @@ var Redis = require('ioredis');
|
|||||||
var redis = new Redis(config.redis);
|
var redis = new Redis(config.redis);
|
||||||
redis.monitor(function(err, monitor) {
|
redis.monitor(function(err, monitor) {
|
||||||
monitor.on('monitor', function(time, args, source, database) {
|
monitor.on('monitor', function(time, args, source, database) {
|
||||||
console.log('---MONITOR', args);
|
console.log('REDIS', args);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -34,14 +34,14 @@ if (process.env.TLSCERT) {
|
|||||||
}
|
}
|
||||||
console.log('using tls.cert', lndCert.toString('hex'));
|
console.log('using tls.cert', lndCert.toString('hex'));
|
||||||
let sslCreds = grpc.credentials.createSsl(lndCert);
|
let sslCreds = grpc.credentials.createSsl(lndCert);
|
||||||
|
let macaroon;
|
||||||
|
if (process.env.MACAROON) {
|
||||||
|
macaroon = process.env.MACAROON;
|
||||||
|
} else {
|
||||||
|
macaroon = fs.readFileSync('admin.macaroon').toString('hex');
|
||||||
|
}
|
||||||
|
console.log('using macaroon', macaroon);
|
||||||
let macaroonCreds = grpc.credentials.createFromMetadataGenerator(function(args, callback) {
|
let macaroonCreds = grpc.credentials.createFromMetadataGenerator(function(args, callback) {
|
||||||
let macaroon;
|
|
||||||
if (process.env.MACAROON) {
|
|
||||||
macaroon = process.env.MACAROON;
|
|
||||||
} else {
|
|
||||||
macaroon = fs.readFileSync('admin.macaroon').toString('hex');
|
|
||||||
}
|
|
||||||
console.log('using macaroon', macaroon);
|
|
||||||
let metadata = new grpc.Metadata();
|
let metadata = new grpc.Metadata();
|
||||||
metadata.add('macaroon', macaroon);
|
metadata.add('macaroon', macaroon);
|
||||||
callback(null, metadata);
|
callback(null, metadata);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user