Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
winston.info('Server listening on port ' + app.get('port') + ' in ' + BLITITOR.env + ' mode')
console.info("=== Server listening on port " + clc.yellow(app.get('port')) + " in " + clc.red(BLITITOR.env) + " mode");
// display default route table
// misc.showRouteTable();
});
if (!process.send) {
// If run using `node app`, log copyright info along with server info
const config = require('../package.json');
winston.info('----------------------------------------------------------------');
winston.info('BLITITOR v' + config.version + ' Copyright (C) 2016 @' + config.author + '.');
winston.info('This program comes with ABSOLUTELY NO WARRANTY.');
winston.info('This is free software, under ' + config.license + ' license');
winston.info('and you are welcome to redistribute it under certain conditions.');
winston.info('----------------------------------------------------------------');
winston.verbose('module data file loaded. ' + BLITITOR.moduleList.length + ' modules located');
}
if (BLITITOR.env === 'development') { // Only in dev environment
process.nextTick(function () {
winston.info('update route data to log folder');
misc.showGlobalVar(BLITITOR);
misc.showRoutes(app);
});
}
async function registerRoutes (routes) {
try {
await routes.then(router => {
app
.use(router.routes())
.use(router.allowedMethods())
})
.catch(err => {
winston.error(err)
// mail.error(err)
process.exit(1)
})
winston.verbose('All Routes Load done.')
} catch (e) {
winston.error(e)
// mail.error(e)
process.exit(1)
}
}
bcrypt.compare(params.password, auth.user_password, function (err, result) {
if (err) {
winston.error("bcrypt system error", err);
return res.redirect('back');
}
if (!result) {
winston.verbose('user given password not exactly same with authorized hash', result);
req.flash('error', {msg: '로그인 과정에 문제가 발생했습니다.'});
return res.redirect('back');
} else {
// retrieve with auth
account.findUserByAuthID(auth.id, function (error, userData) {
if (error || !userData) {
req.flash('error', {msg: '로그인 데이터베이스에 문제가 있습니다.'});
winston.error(err);
return res.redirect('back');
}
const user = {
.then(tx => {
// create user record
const userData = {
userName: username,
password: password,
};
logger.verbose('userData >', userData);
// create user record
const channelData = {
channelName : `@${username}`,
channelClaimId: tx.claim_id,
};
logger.verbose('channelData >', channelData);
// create certificate record
const certificateData = {
claimId: tx.claim_id,
name : `@${username}`,
// address,
};
logger.verbose('certificateData >', certificateData);
// save user and certificate to db
return Promise.all([db.User.create(userData), db.Channel.create(channelData), db.Certificate.create(certificateData)]);
})
constructor() {
Winston.verbose('SongPlayer -> constructor');
this.volume = 100;
this.cronometer = new Cronometer();
this.playing = false;
}
init() {
set: function (val) {
maxThreads = val;
if (!process.env.minifier_child) {
winston.verbose('[minifier] utilizing a maximum of ' + maxThreads + ' additional threads');
}
},
configurable: true,
batch.processSortedSet('posts:pid', function (pids, next) {
winston.verbose('upgraded ' + count + ' posts');
count += pids.length;
async.each(pids, function (pid, next) {
async.parallel({
upvotes: function (next) {
db.setCount('pid:' + pid + ':upvote', next);
},
downvotes: function (next) {
db.setCount('pid:' + pid + ':downvote', next);
},
}, function (err, results) {
if (err) {
return next(err);
}
var data = {};
if (parseInt(results.upvotes, 10) > 0) {
exports.handler = function (argv) {
require('../../lib/config/LoggingConfig')(argv);
validate(argv);
const config = require('../../lib/config/SyntheticsConfig').getConfig(argv);
logger.verbose('Config: ' + argv.name + ':' + argv.id);
logger.verbose(argv);
const changeConfigOrchestrator = dependencies(config).changeConfigOrchestrator;
if (!_.isNil(argv.id)) {
changeConfigOrchestrator.changeConfigurationById(
argv.id,
argv.frequency,
argv.locations,
argv.uri,
argv.status,
argv.rename,
argv.addemail,
argv.rmemail
);
} else if (!_.isNil(argv.name)) {
changeConfigOrchestrator.changeConfigurationByName(
_this.store.set(key, buffer, function (res) {
if (res) {
winston.verbose('added url', { key: key });
response.writeHead(200, { 'content-type': 'application/json' });
response.end(JSON.stringify({ key: key }));
}
else {
winston.verbose('error adding url');
response.writeHead(500, { 'content-type': 'application/json' });
response.end(JSON.stringify({ message: 'Error adding document.' }));
}
}, true);
});
nextSong() {
Winston.info('Playlist -> nextSong');
this.currentSong += 1;
if (this.currentSong > this.songs.length - 1) {
this.currentSong = 0;
}
this.songPlayer.reset();
this.clientsControl.sendPlaylist({
songs: this.songs,
currentSong: this.getCurrentSong(),
});
this.songPlayer.play();
Winston.verbose('Playlist -> nextSong -> now playing #', this.currentSong);
}
}