Merge branch 'devel'

This commit is contained in:
Lauri Ojansivu 2017-11-23 17:48:13 +02:00
commit 9c283112ed
6 changed files with 11 additions and 170 deletions

View file

@ -52,7 +52,6 @@
"prefer-const": 2,
"prefer-spread": 2,
"prefer-template": 2,
"no-console": 0,
"no-unused-vars" : "warn"
},
"globals": {
@ -125,7 +124,6 @@
"Checklists": true,
"Settings": true,
"InvitationCodes": true,
"Winston":true,
"JsonRoutes": true,
"Authentication": true,
"Integrations": true,

View file

@ -1,3 +1,11 @@
# v0.59 2017-11-23 Wekan release.
This release fixes the following bugs:
* [Fix not working stdout logging by removing Winston logger](https://github.com/wekan/wekan/pull/1352).
Thanks to GitHub user pierreozoux for contributions.
# v0.58 2017-11-23 Wekan release
This release adds the following new features:

View file

@ -1,6 +1,6 @@
{
"name": "wekan",
"version": "0.58.0",
"version": "0.59.0",
"description": "The open-source Trello-like kanban",
"private": true,
"scripts": {
@ -29,8 +29,6 @@
"es6-promise": "^4.1.0",
"meteor-node-stubs": "^0.2.6",
"os": "^0.1.1",
"winston": "^2.3.1",
"winston-zulip": "0.0.6",
"xss": "^0.3.3"
}
}

View file

@ -22,10 +22,10 @@ const pkgdef :Spk.PackageDefinition = (
appTitle = (defaultText = "Wekan"),
# The name of the app as it is displayed to the user.
appVersion = 43,
appVersion = 44,
# Increment this for every release.
appMarketingVersion = (defaultText = "0.58.0~2017-11-23"),
appMarketingVersion = (defaultText = "0.59.0~2017-11-23"),
# Human-readable presentation of the app version.
minUpgradableAppVersion = 0,

View file

@ -1,63 +0,0 @@
Meteor.startup(() => {
Winston = require('winston');
require('winston-zulip');
const fs = require('fs');
//remove default logger
Winston.remove(Winston.transports.Console);
const loggerEnable = process.env.LOGGER_ENABLE || true;
if (loggerEnable) {
Winston.log('info', 'logger is enable');
const loggers = process.env.LOGGERS ? process.env.LOGGERS.split(',') : 'console';
if (loggers.includes('console')) {
Winston.add(Winston.transports.Console, {
json: true,
timestamp: true,
});
}
if (loggers.includes('file')) {
//create logs directory
fs.mkdir('logs', (err) => {
if (err) throw err;
});
const fileName = `logs/${process.env.LOGGER_FILE_NAME}` || 'logs/server.log';
Winston.add(Winston.transports.File, {
filename: fileName,
json: true,
options: {
flags: 'a+',
},
});
}
if (loggers.includes('zulip')) {
const loggerZulipUsername = process.env.LOGGER_ZULIP_USERNAME;
const loggerZulipApikey = process.env.LOGGER_ZULIP_APIKEY;
const loggerZulipRealm = process.env.LOGGER_ZULIP_REALM;
const loggerZulipTo = process.env.LOGGER_ZULIP_TO || 'logs';
const loggerZulipSubject = process.env.LOGGER_ZULIP_SUBJECT || 'wekan';
const zulipConfig = {
zulipUsername: loggerZulipUsername,
zulipApikey: loggerZulipApikey,
zulipRealm: loggerZulipRealm,
zulipTo: loggerZulipTo,
zulipSubject: loggerZulipSubject,
};
Winston.add(Winston.transports.Zulip, zulipConfig);
Winston.log('info', `zulipconfig ${zulipConfig}`);
}
}
Winston.log('info', 'Logger is completly instanciate');
});

View file

@ -1,100 +0,0 @@
class Message {
constructor(userId, type, method, doc, selector, fieldNames, modifier) {
this.userId = userId;
this.type = type;
this.method = method;
this.doc = doc;
this.selector;
this.fieldNames = fieldNames;
this.modifier = modifier;
}
}
//------------- CARDS --------------------
Cards.before.update(function (userId, doc, fieldNames, modifier, options) {
Winston.log('info', new Message(userId, 'card', 'update', doc, null, fieldNames, modifier));
});
Cards.before.remove(function (userId, doc) {
Winston.log('info', new Message(userId, 'card', 'remove', doc));
});
Cards.before.insert(function (userId, doc) {
Winston.log('info', new Message(userId, 'card', 'insert', doc));
});
Cards.before.upsert(function (userId, selector, modifier, options) {
Winston.log('info', new Message(userId, 'card', 'update', null, selector, null, modifier));
});
//------------- BOARDS --------------------
Boards.before.update(function (userId, doc, fieldNames, modifier, options) {
Winston.log('info', new Message(userId, 'board', 'update', doc, null, fieldNames, modifier));
});
Boards.before.remove(function (userId, doc) {
Winston.log('info', new Message(userId, 'board', 'remove', doc));
});
Boards.before.insert(function (userId, doc) {
Winston.log('info', new Message(userId, 'board', 'insert', doc));
});
Boards.before.upsert(function (userId, selector, modifier, options) {
Winston.log('info', new Message(userId, 'board', 'update', null, selector, null, modifier));
});
//------------- LISTS --------------------
Lists.before.update(function (userId, doc, fieldNames, modifier, options) {
Winston.log('info', new Message(userId, 'list', 'update', doc, null, fieldNames, modifier));
});
Lists.before.remove(function (userId, doc) {
Winston.log('info', new Message(userId, 'list', 'remove', doc));
});
Lists.before.insert(function (userId, doc) {
Winston.log('info', new Message(userId, 'list', 'insert', doc));
});
Lists.before.upsert(function (userId, selector, modifier, options) {
Winston.log('info', new Message(userId, 'list', 'update', null, selector, null, modifier));
});
//------------- CARD COMMENTS --------------------
CardComments.before.update(function (userId, doc, fieldNames, modifier, options) {
Winston.log('info', new Message(userId, 'card-comments', 'update', doc, null, fieldNames, modifier));
});
CardComments.before.remove(function (userId, doc) {
Winston.log('info', new Message(userId, 'card-comments', 'remove', doc));
});
CardComments.before.insert(function (userId, doc) {
Winston.log('info', new Message(userId, 'card-comments', 'insert', doc));
});
CardComments.before.upsert(function (userId, selector, modifier, options) {
Winston.log('info', new Message(userId, 'card-comments', 'update', null, selector, null, modifier));
});
//------------- USERS --------------------
Users.before.update(function (userId, doc, fieldNames, modifier, options) {
Winston.log('info', new Message(userId, 'user', 'update', doc, null, fieldNames, modifier));
});
Users.before.remove(function (userId, doc) {
Winston.log('info', new Message(userId, 'user', 'remove', doc));
});
Users.before.insert(function (userId, doc) {
Winston.log('info', new Message(userId, 'user', 'insert', doc));
});
Users.before.upsert(function (userId, selector, modifier, options) {
Winston.log('info', new Message(userId, 'user', 'update', null, selector, null, modifier));
});