From b871e20357e64633ac3061a82a7e56dc3218e454 Mon Sep 17 00:00:00 2001 From: kazuhitoyokoi Date: Thu, 9 Mar 2017 11:20:50 +0000 Subject: [PATCH] Created Design: Node blacklist/whitelist function (markdown) --- Design:-Node-blacklist-whitelist-function.md | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Design:-Node-blacklist-whitelist-function.md diff --git a/Design:-Node-blacklist-whitelist-function.md b/Design:-Node-blacklist-whitelist-function.md new file mode 100644 index 0000000..ecd7f5e --- /dev/null +++ b/Design:-Node-blacklist-whitelist-function.md @@ -0,0 +1,22 @@ +## Use cases +- To use only nodes which correspond with operation policy +- To avoid/accept the installation of specific nodes + +## Node blacklist function +Current Node-RED has blacklist function using nodesExclude in settings.js +For example, [bluemix-settings.js](https://github.com/ibmets/node-red-bluemix-starter/blob/master/bluemix-settings.js) in node-red-bluemix-starter includes the following configuration. +``` +nodesExcludes:['66-mongodb.js','75-exec.js','35-arduino.js','36-rpi-gpio.js','25-serial.js','28-tail.js','50-file.js','31-tcpin.js','32-udp.js','23-watch.js'] +``` +In this case, Node-RED doesn't load these nodes into Node-RED palette when it starts. +nodesExcludes supports array of JavaScript file names and module names. + +## Node whitelist function +The [pull request](https://github.com/node-red/node-red/pull/1184) of node whitelist function was posted for Node-RED v0.17. +To use the whitelist function, settings.js should have nodesIncludes. +nodesIncludes also supports array of JavaScript file names and module names. +For example, inject, debug, twitter-in and twitter-out nodes will be shown on Node-RED palette when nodesInclude has the following configuration. +``` +nodesIncludes: ['20-inject.js','58-debug.js','node-red-node-twitter'] +``` +If both nodesExcludes and nodesIncludes are used in the settings.js, Node-RED palette has nodes of nodesIncludes except nodes of nodesExcludes. \ No newline at end of file