Skip to content

Design: Node blacklist whitelist function

kazuhitoyokoi edited this page Mar 9, 2017 · 1 revision

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 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 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.

Clone this wiki locally