From f23eb2653e05a3f871229745ac06eb07456a59ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Mon, 4 Feb 2019 10:54:45 +0100 Subject: [PATCH 1/9] FIX config.orion.url --- config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.js b/config.js index 60615e01..12e966c0 100644 --- a/config.js +++ b/config.js @@ -147,7 +147,7 @@ config.smpp = { * Orion (Context Broker) endpoint options */ config.orion = { - URL: 'http://orion-endpoint:1026/NGSI10/updateContext' + URL: 'http://orion-endpoint:1026' }; /** From f99789c620f18cec8e451fcf6e8c1e7e8b18decf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Mon, 4 Feb 2019 10:56:54 +0100 Subject: [PATCH 2/9] FIX config.orion.url --- config.js.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.js.erb b/config.js.erb index a367f2e6..5aaea55e 100644 --- a/config.js.erb +++ b/config.js.erb @@ -124,7 +124,7 @@ config.sms = { * Orion (Context Broker) endpoint options */ config.orion = { - URL : 'http://<%= @cb_host %>:<%= @cb_port %>/NGSI10/updateContext' + URL : 'http://<%= @cb_host %>:<%= @cb_port %>' }; /** @@ -145,4 +145,4 @@ config.collections = { config.DEFAULT_SERVICE= '/'; config.DEFAULT_TENANT= 'unknownt'; -module.exports = config; \ No newline at end of file +module.exports = config; From 7d3410eb8ea68dcd36ab79351575c8576f562b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Mon, 4 Feb 2019 11:59:20 +0100 Subject: [PATCH 3/9] REMOVE duplicated dropEntities() function --- test/utils/utilsT.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/test/utils/utilsT.js b/test/utils/utilsT.js index 945d9657..6e2ec666 100644 --- a/test/utils/utilsT.js +++ b/test/utils/utilsT.js @@ -79,28 +79,6 @@ function dropRules(callback) { function dropExecutions(callback) { remove(config.collections.executions, callback); } -function dropEntities(callback) { - MongoClient.connect( - new URL('v1/updateContext', config.orion.URL), - function(err, db) { - if (err) { - return callback(err); - } - db.collection(config.orionDb.collection, {}, function(err, coll) { - if (err) { - return callback(err); - } - coll.remove({}, function(err, result) { - if (err) { - return callback(err); - } - db.close(); - return callback(null, result); - }); - }); - } - ); -} function dropCollection(collection, callback) { MongoClient.connect( From c344f24b24180284ac51b22bea1d9c785c56dc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Mon, 4 Feb 2019 12:04:15 +0100 Subject: [PATCH 4/9] REMOVE unused variable (lint error) --- test/utils/utilsT.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/utils/utilsT.js b/test/utils/utilsT.js index 6e2ec666..5929dc0b 100644 --- a/test/utils/utilsT.js +++ b/test/utils/utilsT.js @@ -30,8 +30,7 @@ var fs = require('fs'), fakeServerPort = 9753, fakeServerCode = 200, fakeServerMessage = 'All right', - fakeServerCallback, - URL = require('url').URL; + fakeServerCallback function loadExample(fileName) { var f = fs.readFileSync(fileName); From 38ae2c038580ebe54929b1cf854f2f50dd40235b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Mon, 4 Feb 2019 12:28:59 +0100 Subject: [PATCH 5/9] FIX lint error --- test/utils/utilsT.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/utilsT.js b/test/utils/utilsT.js index 5929dc0b..4025f9ec 100644 --- a/test/utils/utilsT.js +++ b/test/utils/utilsT.js @@ -30,7 +30,7 @@ var fs = require('fs'), fakeServerPort = 9753, fakeServerCode = 200, fakeServerMessage = 'All right', - fakeServerCallback + fakeServerCallback; function loadExample(fileName) { var f = fs.readFileSync(fileName); From 5f7630296fae6f5f7b81575f13c28ca21ec702d5 Mon Sep 17 00:00:00 2001 From: Carlos Blanco Date: Mon, 4 Feb 2019 13:05:26 +0100 Subject: [PATCH 6/9] Fix unused param problem in .jshintrc and solve related lint problems --- .jshintrc | 1 - lib/models/actions.js | 9 +++------ lib/models/noSignal.js | 4 ++-- lib/models/twitterAction.js | 2 +- lib/myutils.js | 2 +- lib/perseo.js | 2 +- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.jshintrc b/.jshintrc index 46e5229c..280765ea 100644 --- a/.jshintrc +++ b/.jshintrc @@ -16,7 +16,6 @@ "maxlen": 120, "node": true, "expr": true, - "unused": "vars", "esversion": 6, "globals": { "describe":true, diff --git a/lib/models/actions.js b/lib/models/actions.js index 0c92762f..bad976c3 100644 --- a/lib/models/actions.js +++ b/lib/models/actions.js @@ -144,8 +144,7 @@ function conditionalExec(task, lastTime, callbackW) { function slaveExec(task, alreadyExecuted, callback) { if (!alreadyExecuted) { async.waterfall([executionsStore.LastTime.bind(null, task), conditionalExec.bind(null, task)], function( - err, - tasks + err ) { callback(err); }); @@ -161,15 +160,13 @@ function execAxn(task, cbCe) { logger.debug('executing axn task %j', task); if (config.isMaster) { async.waterfall([executionsStore.LastTime.bind(null, task), conditionalExec.bind(null, task)], function( - err, - results + err ) { cbCe(err); }); } else { async.waterfall([executionsStore.AlreadyDone.bind(null, task), slaveExec.bind(null, task)], function( - err, - results + err ) { cbCe(err); }); diff --git a/lib/models/noSignal.js b/lib/models/noSignal.js index b03e217b..139c8f64 100644 --- a/lib/models/noSignal.js +++ b/lib/models/noSignal.js @@ -101,7 +101,7 @@ function alertFunc(nsLineRule, entity) { function checkNoSignal(period) { var list = nsRulesByInterval[period] || []; logger.debug(context, 'Executing no-signal handler for period of %d (%d rules)', period, list.length); - list.forEach(function(nsrule, i) { + list.forEach(function(nsrule) { entitiesStore.FindSilentEntities( nsrule[SERVICE], nsrule[SUBSERVICE], @@ -265,7 +265,7 @@ function refreshAllRules(rules) { if (rule.nosignal) { //check if any checkInterval has been modified, and delete if so. oldRuleArr = getNSRule(rule.service, rule.subservice, rule.name); - deleteNSRuleIf(function(srv, subsrv, name) { + deleteNSRuleIf(function() { return oldRuleArr && oldRuleArr[CHECK_INTERVAL] !== rule.nosignal.checkInterval; }); if (addNSRule(rule.service, rule.subservice, rule.name, rule.nosignal) > 0) { diff --git a/lib/models/twitterAction.js b/lib/models/twitterAction.js index 3ab4306d..035aef5f 100644 --- a/lib/models/twitterAction.js +++ b/lib/models/twitterAction.js @@ -56,7 +56,7 @@ function doIt(action, event, callback) { client = new Twitter(options); text = buildTwitterOptions(action, event).text; - client.post('statuses/update', { status: text }, function(err, params, response) { + client.post('statuses/update', { status: text }, function(err, params) { if (err) { metrics.IncMetrics(event.service, event.subservice, metrics.failedActionTwitter); } else { diff --git a/lib/myutils.js b/lib/myutils.js index d5deea1e..cfd85d34 100644 --- a/lib/myutils.js +++ b/lib/myutils.js @@ -238,7 +238,7 @@ function respond(resp, err, data, withCount, raw) { return respondAux(resp, err, data, withCount, raw, true); } -function respondWOMetrics(resp, err, data, withCount, raw, withMetrics) { +function respondWOMetrics(resp, err, data, withCount, raw) { return respondAux(resp, err, data, withCount, raw, false); } diff --git a/lib/perseo.js b/lib/perseo.js index f9173715..12ad37b4 100644 --- a/lib/perseo.js +++ b/lib/perseo.js @@ -68,7 +68,7 @@ function start(callbackStart) { app.use(domainMiddleware); app.use( bodyParser.json({ - verify: function(req, res, buf, encoding) { + verify: function(req, res, buf) { // actions are internal, not to be included if ( req.url !== config.endpoint.actionsPath && From 834578fcd64adeca4db23a15643c227180b9e2ad Mon Sep 17 00:00:00 2001 From: Fermin Galan Marquez Date: Thu, 7 Feb 2019 18:03:34 +0100 Subject: [PATCH 7/9] Step: 1.7.0-next -> 1.8.0 --- CHANGES_NEXT_RELEASE | 18 ------------------ package.json | 2 +- rpm/SPECS/cep.spec | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 1c106cbd..e69de29b 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,18 +0,0 @@ -- Set Nodejs 8.12.0 as minimum version in packages.json -- Add: use NodeJS 8 in Dockerfile -- Add: use PM2 in Dockerfile -- Upgrade depedency logops from 1.0.0-alpha.7 to 2.1.0 -- Upgrade dev dependency istanbul from ~0.1.34 to ~0.4.5 -- Upgrade dev dependency mocha from 2.4.5 to to 5.2.0 -- Remove: old unused development dependencies - * grunt and grunt related module - * closure-linter-wrapper -- Add 'ruleName' as variable automatically in rule text field (EPL) on rule creation time (#307) -- Change on the PERSEO_ORION_URL env var behaviour. Now it represents Context Broker base URL instead of the - updateContext endpoint -- Add: new ngsijs ~1.2.0 dependency -- Add: new rewire ~4.0.1 dev dependency -- Add: NGSIv2 support in both notification reception and CB update action -- Upgrade dev dependency chai from ~1.8.0 to ~4.1.2 -- Upgrade dev dependency sinon from ~1.7.3 to ~6.1.0 -- Upgrade dev dependency sinon-chai from 2.4.0 to ~3.2.0 diff --git a/package.json b/package.json index 94893223..4ff497f5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "perseo", "description": "IOT CEP front End", "license": "AGPL-3.0-only", - "version": "1.7.0-next", + "version": "1.8.0", "homepage": "", "author": { "name": "crbrox", diff --git a/rpm/SPECS/cep.spec b/rpm/SPECS/cep.spec index 4ea56c12..58e8558a 100644 --- a/rpm/SPECS/cep.spec +++ b/rpm/SPECS/cep.spec @@ -162,6 +162,26 @@ rm -rf $RPM_BUILD_ROOT %{_install_dir} %changelog +* Fri Feb 08 2019 Fermin Galan 1.8.0 +- Add: NGSIv2 support in both notification reception and CB update action +- Change on the PERSEO_ORION_URL env var behaviour. Now it represents Context Broker base URL instead of the + updateContext endpoint +- Add: 'ruleName' as variable automatically in rule text field (EPL) on rule creation time (#307) +- Set Nodejs 8.12.0 as minimum version in packages.json (effectively removing Nodev4 and Nodev6 as supported versions) +- Add: use NodeJS 8 in Dockerfile +- Add: use PM2 in Dockerfile +- Add: new ngsijs ~1.2.0 dependency +- Add: new rewire ~4.0.1 dev dependency +- Upgrade depedency logops from 1.0.0-alpha.7 to 2.1.0 +- Upgrade dev dependency istanbul from ~0.1.34 to ~0.4.5 +- Upgrade dev dependency mocha from 2.4.5 to to 5.2.0 +- Upgrade dev dependency chai from ~1.8.0 to ~4.1.2 +- Upgrade dev dependency sinon from ~1.7.3 to ~6.1.0 +- Upgrade dev dependency sinon-chai from 2.4.0 to ~3.2.0 +- Remove: old unused development dependencies + * grunt and grunt related module + * closure-linter-wrapper + * Thu Sep 20 2018 Fermin Galan 1.7.0 - Add: new parameter to updateAction card: actionType: APPEND (default) or UPDATE (#278) - Using precise dependencies (~=) in packages.json From 5d92266004aace9bfc8916aec632eb2bceff23e4 Mon Sep 17 00:00:00 2001 From: Fermin Galan Marquez Date: Fri, 8 Feb 2019 09:26:24 +0100 Subject: [PATCH 8/9] Step: 1.8.0 -> 1.8.0-next --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ff497f5..07008366 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "perseo", "description": "IOT CEP front End", "license": "AGPL-3.0-only", - "version": "1.8.0", + "version": "1.8.0-next", "homepage": "", "author": { "name": "crbrox", From 40b8f5e8e460aae0c26fa7433d943740a4252e2c Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Mon, 18 Feb 2019 13:02:49 +0100 Subject: [PATCH 9/9] Add AGPL Statement --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e7483ae7..482d629e 100644 --- a/README.md +++ b/README.md @@ -31,4 +31,24 @@ CEP implementation for IoT platform |---| ## License -Perseo FE is licensed under Affero General Public License (GPL) version 3. +Perseo FE is licensed under [Affero General Public License (GPL) +version 3](./LICENSE). + + + +### Are there any legal issues with AGPL 3.0? Is it safe for me to use? + +There is absolutely no problem in using a product licensed under AGPL 3.0. Issues with GPL +(or AGPL) licenses are mostly related with the fact that different people assign different +interpretations on the meaning of the term “derivate work” used in these licenses. Due to this, +some people believe that there is a risk in just _using_ software under GPL or AGPL licenses +(even without _modifying_ it). + +For the avoidance of doubt, the owners of this software licensed under an AGPL 3.0 license +wish to make a clarifying public statement as follows: + +> Please note that software derived as a result of modifying the source code of this +> software in order to fix a bug or incorporate enhancements is considered a derivative +> work of the product. Software that merely uses or aggregates (i.e. links to) an otherwise +> unmodified version of existing software is not considered a derivative work, and therefore +> it does not need to be released as under the same license, or even released as open source.