From c4233232ea9f1db4cafc087b246aaa2ba9fcf807 Mon Sep 17 00:00:00 2001 From: nasis Date: Sun, 5 Feb 2017 18:26:53 +0200 Subject: [PATCH 1/5] docker events arrive as objects and not strings --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 504e1f5..a402c91 100644 --- a/index.js +++ b/index.js @@ -66,7 +66,7 @@ module.exports = function dockerEvents(opts) { events.pipe(through.obj(function(chunk, enc, cb) { var _this = this; - var data = JSON.parse(chunk); + var data = chunk; var container = docker.getContainer(data.id); container.inspect(function(err, containerData) { if (!err) { From 58d97518dba254887d0a69ec3acac1d721cf9f89 Mon Sep 17 00:00:00 2001 From: nasis Date: Mon, 6 Feb 2017 14:01:31 +0200 Subject: [PATCH 2/5] Fix the fix --- index.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a402c91..cb67f1d 100644 --- a/index.js +++ b/index.js @@ -66,8 +66,17 @@ module.exports = function dockerEvents(opts) { events.pipe(through.obj(function(chunk, enc, cb) { var _this = this; - var data = chunk; - var container = docker.getContainer(data.id); + var data; + try { + data = JSON.parse(chunk); + } catch (e) { + // if we start reading the stream of events when some containers are running the first couple of messages + // arrive corrupted in an unclear way + console.log("Error parsing chunk as JSON: " + chunk.toString('utf8')); + cb(); + return; + } + var container = docker.getContainer(data.id); container.inspect(function(err, containerData) { if (!err) { _this.push(toEmit(data, containerData)); From c8f58388669096b47190d84252242d6ee53f8270 Mon Sep 17 00:00:00 2001 From: nasis Date: Mon, 6 Feb 2017 15:08:14 +0200 Subject: [PATCH 3/5] better use of javascript streams --- index.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index cb67f1d..068eca0 100644 --- a/index.js +++ b/index.js @@ -64,19 +64,23 @@ module.exports = function dockerEvents(opts) { } }); - events.pipe(through.obj(function(chunk, enc, cb) { + var splitEvents = events.pipe(through.obj(function (chunk, enc, cb) { var _this = this; - var data; - try { - data = JSON.parse(chunk); - } catch (e) { - // if we start reading the stream of events when some containers are running the first couple of messages - // arrive corrupted in an unclear way - console.log("Error parsing chunk as JSON: " + chunk.toString('utf8')); - cb(); - return; + // the initial set of events arrives as one chunk + var events = chunk.toString().split('\n'); + for (var i in events) { + var event = events[i]; + if (event) { + _this.push(event); } - var container = docker.getContainer(data.id); + } + cb() + })); + + splitEvents.pipe(through.obj(function(chunk, enc, cb) { + var _this = this; + var data = JSON.parse(chunk); + var container = docker.getContainer(data.id); container.inspect(function(err, containerData) { if (!err) { _this.push(toEmit(data, containerData)); From cc35b9264651ffcca9d57bd0c4b53587794279bf Mon Sep 17 00:00:00 2001 From: "whitesource-bolt-for-github[bot]" Date: Sun, 31 Mar 2019 10:00:41 +0000 Subject: [PATCH 4/5] Initial WhiteSource configuration file --- .whitesource | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .whitesource diff --git a/.whitesource b/.whitesource new file mode 100644 index 0000000..f340c5d --- /dev/null +++ b/.whitesource @@ -0,0 +1,8 @@ +########################################################## +#### WhiteSource Integration configuration file #### +########################################################## + +# Configuration # +#---------------# +ws.repo.scan=true +vulnerable.check.run.conclusion.level=failure From 3058f5b2c2cefc05601ef1fd7eec4720842ca7f3 Mon Sep 17 00:00:00 2001 From: "whitesource-for-github-com[bot]" <50673670+whitesource-for-github-com[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2019 08:05:45 +0000 Subject: [PATCH 5/5] Migrate WhiteSource configuration file to json format --- .whitesource | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.whitesource b/.whitesource index f340c5d..e0aaa3e 100644 --- a/.whitesource +++ b/.whitesource @@ -1,8 +1,8 @@ -########################################################## -#### WhiteSource Integration configuration file #### -########################################################## - -# Configuration # -#---------------# -ws.repo.scan=true -vulnerable.check.run.conclusion.level=failure +{ + "checkRunSettings": { + "vulnerableCheckRunConclusionLevel": "failure" + }, + "issueSettings": { + "minSeverityLevel": "LOW" + } +} \ No newline at end of file