Compare commits

...

5 Commits

Author SHA1 Message Date
Nick O'Leary
b45ddadb09 Bump for 0.20.3 2019-03-20 15:24:23 +00:00
Nick O'Leary
a3cbe80a36 Do not dynamically add/remove upgrade listener in ws nodes
The way we dynamically added/removed event handlers for the
upgrade event was causing problems with the way sockjs (as
used by the worldmap node) tries to intercept the event.

This fix means the ws nodes won't ever remove the upgrade
listener - it gets added once when the first ws node is
deployed and will then remain until the last ws node is
removed and the runtime restarted.
2019-03-20 14:58:26 +00:00
Nick O'Leary
ee6c6266cc Avoid env var reference loops and support $parent. prefix
Fixes #2099
2019-03-20 13:37:33 +00:00
Nick O'Leary
962a29110c Ensure config._flow is non-enumerable so is ignored by JSON.stringify
Fixes  https://github.com/pdmangel/node-red-contrib-openhab2/issues/36
2019-03-18 15:11:56 +00:00
Nick O'Leary
a242475b38 Block loading ACE from cdn 2019-03-18 10:55:12 +00:00
14 changed files with 81 additions and 32 deletions

View File

@@ -1,3 +1,10 @@
#### 0.20.3: Maintenance Release
- Do not dynamically add/remove upgrade listener in ws nodes
- Avoid env var reference loops and support $parent. prefix Fixes #2099
- Ensure config.\_flow is non-enumerable so is ignored by JSON.stringify
- Block loading ACE from cdn
#### 0.20.2: Maintenance Release
- Filter out duplicate nodes when importing a flow

View File

@@ -1,6 +1,6 @@
{
"name": "node-red",
"version": "0.20.2",
"version": "0.20.3",
"description": "A visual tool for wiring the Internet of Things",
"homepage": "http://nodered.org",
"license": "Apache-2.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/editor-api",
"version": "0.20.2",
"version": "0.20.3",
"license": "Apache-2.0",
"main": "./lib/index.js",
"repository": {
@@ -16,8 +16,8 @@
}
],
"dependencies": {
"@node-red/util": "0.20.2",
"@node-red/editor-client": "0.20.2",
"@node-red/util": "0.20.3",
"@node-red/editor-client": "0.20.3",
"bcryptjs": "2.4.3",
"body-parser": "1.18.3",
"clone": "2.1.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/editor-client",
"version": "0.20.2",
"version": "0.20.3",
"license": "Apache-2.0",
"repository": {
"type": "git",

View File

@@ -46,6 +46,14 @@ var RED = (function() {
newScript.src = RED.settings.apiRootUrl+srcUrl;
hasDeferred = true;
} else {
if (/\/ace.js$/.test(srcUrl) || /\/ext-language_tools.js$/.test(srcUrl)) {
// Block any attempts to load ace.js from a CDN - this will
// break the version of ace included in the editor.
// At the time of commit, the contrib-python nodes did this.
// This is a crude fix until the python nodes are fixed.
console.warn("Blocked attempt to load",srcUrl,"by",moduleId)
$(el).remove();
}
scriptCount--;
}
})

View File

@@ -141,10 +141,10 @@ module.exports = function(RED) {
node.server.close();
node._inputNodes = [];
activeListenerNodes--;
if (activeListenerNodes === 0 && serverUpgradeAdded) {
RED.server.removeListener('upgrade', handleServerUpgrade);
serverUpgradeAdded = false;
}
// if (activeListenerNodes === 0 && serverUpgradeAdded) {
// RED.server.removeListener('upgrade', handleServerUpgrade);
// serverUpgradeAdded = false;
// }
}

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/nodes",
"version": "0.20.2",
"version": "0.20.3",
"license": "Apache-2.0",
"repository": {
"type": "git",

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/registry",
"version": "0.20.2",
"version": "0.20.3",
"license": "Apache-2.0",
"main": "./lib/index.js",
"repository": {
@@ -16,7 +16,7 @@
}
],
"dependencies": {
"@node-red/util": "0.20.2",
"@node-red/util": "0.20.3",
"semver": "5.6.0",
"uglify-js": "3.4.9",
"when": "3.7.8"

View File

@@ -68,6 +68,20 @@ class Flow {
})
}
/**
* Log an error-level message from this flow
* @param {[type]} msg [description]
* @return {[type]} [description]
*/
error(msg) {
Log.log({
id: this.id||"global",
level: Log.ERROR,
type:this.TYPE,
msg:msg
})
}
/**
* Log a info-level message from this flow
* @param {[type]} msg [description]

View File

@@ -263,17 +263,37 @@ class Subflow extends Flow {
* @return {Object} val value of env var
*/
getSetting(name) {
var env = this.env;
if (env && env.hasOwnProperty(name)) {
var val = env[name];
try {
var ret = redUtil.evaluateNodeProperty(val.value, val.type, this.node, null, null);
return ret;
}
catch (e) {
this.error(e);
return undefined;
this.trace("getSetting:"+name);
if (!/^\$parent\./.test(name)) {
var env = this.env;
if (env && env.hasOwnProperty(name)) {
var val = env[name];
// If this is an env type property we need to be careful not
// to get into lookup loops.
// 1. if the value to lookup is the same as this one, go straight to parent
// 2. otherwise, check if it is a compound env var ("foo $(bar)")
// and if so, substitute any instances of `name` with $parent.name
// See https://github.com/node-red/node-red/issues/2099
if (val.type !== 'env' || val.value !== name) {
let value = val.value;
if (val.type === 'env') {
value = value.replace(new RegExp("\\${"+name+"}","g"),"${$parent."+name+"}");
}
try {
var ret = redUtil.evaluateNodeProperty(value, val.type, this.node, null, null);
return ret;
}
catch (e) {
this.error(e);
return undefined;
}
} else {
// This _is_ an env property pointing at itself - go to parent
}
}
} else {
// name starts $parent. ... so delegate to parent automatically
name = name.substring(8);
}
var parent = this.parent;
if (parent) {

View File

@@ -479,7 +479,7 @@ module.exports = {
}
}
try {
conf._flow = flow;
Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true })
newNode = new nodeTypeConstructor(conf);
} catch (err) {
Log.log({

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/runtime",
"version": "0.20.2",
"version": "0.20.3",
"license": "Apache-2.0",
"main": "./lib/index.js",
"repository": {
@@ -16,8 +16,8 @@
}
],
"dependencies": {
"@node-red/registry": "0.20.2",
"@node-red/util": "0.20.2",
"@node-red/registry": "0.20.3",
"@node-red/util": "0.20.3",
"clone": "2.1.2",
"express": "4.16.4",
"fs-extra": "7.0.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/util",
"version": "0.20.2",
"version": "0.20.3",
"license": "Apache-2.0",
"repository": {
"type": "git",

View File

@@ -1,6 +1,6 @@
{
"name": "node-red",
"version": "0.20.2",
"version": "0.20.3",
"description": "A visual tool for wiring the Internet of Things",
"homepage": "http://nodered.org",
"license": "Apache-2.0",
@@ -31,10 +31,10 @@
"flow"
],
"dependencies": {
"@node-red/editor-api": "0.20.2",
"@node-red/runtime": "0.20.2",
"@node-red/util": "0.20.2",
"@node-red/nodes": "0.20.2",
"@node-red/editor-api": "0.20.3",
"@node-red/runtime": "0.20.3",
"@node-red/util": "0.20.3",
"@node-red/nodes": "0.20.3",
"basic-auth": "2.0.1",
"bcryptjs": "2.4.3",
"express": "4.16.4",