diff --git a/.codeclimate.yml b/.codeclimate.yml index 75cf8a1..a23fa86 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,9 +1,9 @@ -engines: +engines: eslint: enabled: true - channel: "eslint-3" + channel: "eslint-4" config: - config: ".eslintrc.json" + config: ".eslintrc.yaml" ratings: paths: diff --git a/.gitignore b/.gitignore index 5148e52..f8faa6b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ jspm_packages # Optional REPL history .node_repl_history + +package-lock.json diff --git a/Changes.md b/Changes.md index 0fb0ec0..4e7155c 100644 --- a/Changes.md +++ b/Changes.md @@ -1,4 +1,10 @@ +## 1.0.10 - 2019-03-22 + +* Add an 'if' to "blocked message" HTML header +* CI testing updates (node.js versions) +* moved config/karma.ini to test/config/karma.ini + ## 1.0.9 - 2017-08-17 * also prune syslog hostname when no PID in entry diff --git a/appveyor.yml b/appveyor.yml index 8858bc2..edbfbe0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ environment: - nodejs_version: "6" + nodejs_version: "8" install: - ps: Install-Product node $env:nodejs_version diff --git a/index.js b/index.js index e6b387c..b2dc238 100644 --- a/index.js +++ b/index.js @@ -10,29 +10,29 @@ exports.register = function () { plugin = this; plugin.get_logreader_ini(); plugin.load_karma_ini(); -}; +} exports.hook_init_http = function (next, server) { server.http.app.use('/logs/:uuid', exports.get_logs); server.http.app.use('/karma/rules', exports.get_rules); - return next(); -}; + next(); +} exports.get_logreader_ini = function () { plugin = this; plugin.cfg = plugin.config.get('log.reader.ini', function () { plugin.get_logreader_ini(); - }); + }) if (plugin.cfg.log && plugin.cfg.log.file) { log = plugin.cfg.log.file; } -}; +} exports.load_karma_ini = function () { plugin.karma_cfg = plugin.config.get('karma.ini', function () { plugin.load_karma_ini(); - }); + }) if (!plugin.karma_cfg.result_awards) return; if (!plugin.result_awards) plugin.result_awards = {}; @@ -52,11 +52,11 @@ exports.load_karma_ini = function () { resolution : parts[6], }; }); -}; +} exports.get_rules = function (req, res) { res.send(JSON.stringify(plugin.result_awards)); -}; +} exports.get_logs = function (req, res) { @@ -77,7 +77,7 @@ exports.get_logs = function (req, res) { res.send(html); }); }); -}; +} exports.grepWithShell = function (file, uuid, done) { @@ -239,13 +239,13 @@ function htmlHead () { function htmlBody (uuid, awards, resolve) { let str = '
\Our filters mistook your server for a malicious computer attempting \ to send spam. To improve your mail servers reputation, please contact \ your IT helpdesk or Systems Administrator and ask them for help.
'; if (awards) { - str += '