Authentication #170
|
@ -1,19 +1,20 @@
|
|||
👍 :+1:
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
{
|
||||
"WalletConfig": {
|
||||
"LbryClaimAddress": "none",
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"DefaultChannel": "none"
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"LbryClaimAddress": null,
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"DefaultChannel": null
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
},
|
||||
"AnalyticsConfig":{
|
||||
"GoogleId": "none"
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"GoogleId": null
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
},
|
||||
"Database": {
|
||||
"Database": "lbry",
|
||||
"Username": "none",
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"Password": "none"
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"Username": null,
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
Is there a reason this file uses Is there a reason this file uses `"none"` as a string instead of `null` or something falsier?
I did it so that when I called the variable later, if l logged the variable and got 'none' I knew the variable had been created but wasn't updated with the proper value for the environment. Not very clean/efficient. I fixed this now. They are all set to I did it so that when I called the variable later, if l logged the variable and got 'none' I knew the variable had been created but wasn't updated with the proper value for the environment. Not very clean/efficient. I fixed this now. They are all set to `null` and a script runs through them when the server loads and prints their values so I can check them up front. (https://github.com/lbryio/spee.ch/pull/170/commits/250ead165bd51c4b9812d514c724d320f526d90c)
|
||||
"Password": null
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": "none",
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"SlackErrorChannel": "none",
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"SlackInfoChannel": "none"
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"LogLevel": null,
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"SlackWebHook": null,
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"SlackErrorChannel": null,
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
"SlackInfoChannel": null
|
||||
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked. Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.
👍 :+1:
|
||||
}
|
||||
}
|
|
@ -12,10 +12,6 @@ module.exports = (winston, logLevel) => {
|
|||
],
|
||||
});
|
||||
|
||||
// winston.on('error', (err) => {
|
||||
// console.log('unhandled exception in winston >> ', err);
|
||||
// });
|
||||
|
||||
winston.error('Level 0');
|
||||
winston.warn('Level 1');
|
||||
winston.info('Level 2');
|
||||
|
|
|
@ -5,23 +5,28 @@ const SLACK_INFO_CHANNEL = config.get('Logging.SlackInfoChannel');
|
|||
const winstonSlackWebHook = require('winston-slack-webhook').SlackWebHook;
|
||||
|
||||
module.exports = (winston) => {
|
||||
// add a transport for errors
|
||||
winston.add(winstonSlackWebHook, {
|
||||
name : 'slack-errors-transport',
|
||||
level : 'error',
|
||||
webhookUrl: SLACK_WEB_HOOK,
|
||||
channel : SLACK_ERROR_CHANNEL,
|
||||
username : 'spee.ch',
|
||||
iconEmoji : ':face_with_head_bandage:',
|
||||
});
|
||||
winston.add(winstonSlackWebHook, {
|
||||
name : 'slack-info-transport',
|
||||
level : 'info',
|
||||
webhookUrl: SLACK_WEB_HOOK,
|
||||
channel : SLACK_INFO_CHANNEL,
|
||||
username : 'spee.ch',
|
||||
iconEmoji : ':nerd_face:',
|
||||
});
|
||||
// send test message
|
||||
winston.error('Testing slack logging... slack logging is online.');
|
||||
if (SLACK_WEB_HOOK) {
|
||||
// add a transport for errors to slack
|
||||
winston.add(winstonSlackWebHook, {
|
||||
name : 'slack-errors-transport',
|
||||
level : 'error',
|
||||
webhookUrl: SLACK_WEB_HOOK,
|
||||
channel : SLACK_ERROR_CHANNEL,
|
||||
username : 'spee.ch',
|
||||
iconEmoji : ':face_with_head_bandage:',
|
||||
});
|
||||
winston.add(winstonSlackWebHook, {
|
||||
name : 'slack-info-transport',
|
||||
level : 'info',
|
||||
webhookUrl: SLACK_WEB_HOOK,
|
||||
channel : SLACK_INFO_CHANNEL,
|
||||
username : 'spee.ch',
|
||||
iconEmoji : ':nerd_face:',
|
||||
});
|
||||
// send test message
|
||||
winston.error('Slack error logging is online.');
|
||||
winston.info('Slack info logging is online.');
|
||||
} else {
|
||||
winston.error('Slack logging is not enabled because no SLACK_WEB_HOOK env var provided.');
|
||||
}
|
||||
};
|
||||
|
|
Great design here! Love that this makes it easy to use different channels on staging/dev and production as well as easy to change if forked.