
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@naimo84/node-red-context-redis
Advanced tools
This is a work in progress.
The Redis plugin holds context data in the Redis.
To run this you need a Redis server running. For details see the Redis site.
Run the following command in your Node-RED user directory - typically ~/.node-red
npm install git+https://github.com/GruppoFilippetti/node-red-context-redis
Add a configuration in settings.js:
contextStorage: {
redis: {
module: require("node-red-context-redis"),
config: {
// see below options
}
}
}
This plugin exposes some options defined in node_redis as itself options. It needs following configuration options:
| Options | Description |
|---|---|
| host | The IP address of the Redis server. Default: "127.0.0.1" |
| port | The port of the Redis server. Default: 6379 |
| db | The Redis logical database to connect. Default: 0 |
| prefix | If set, the string used to prefix all used keys. |
| password | If set, the plugin will run Redis AUTH command on connect. Note: the password will be sent as plaintext. |
| tls | An object containing options to pass to tls.connect to set up a TLS connection to the server. |
see https://github.com/NodeRedis/node_redis#options-object-properties
Node-RED Redis
+-------------------+ +-------------------------------+
| global context | | logical database |
| +---------------+ | | +---------------------------+ |
| | +-----+-----+ | | | | +-----------------+-----+ | |
| | | key |value| | | <-----> | | | global:key |value| | |
| | +-----+-----+ | | | | +-----------------+-----+ | |
| +---------------+ | | | | |
| | | | | |
| flow context | | | | |
| +---------------+ | | | | |
| | +-----+-----+ | | | | +-----------------+-----+ | |
| | | key |value| | | <-----> | | | <flow's id>:key |value| | |
| | +-----+-----+ | | | | +-----------------+-----+ | |
| +---------------+ | | | | |
| | | | | |
| node context | | | | |
| +---------------+ | | | | |
| | +-----+-----+ | | | | +-----------------+-----+ | |
| | | key |value| | | <-----> | | | <node's id>:key |value| | |
| | +-----+-----+ | | | | +-----------------+-----+ | |
| +---------------+ | | +---------------------------+ |
+-------------------+ +-------------------------------+
global context will be prefixed with global: .
e.g. Set "foo" to hold "bar" in the global context -> Set "global:foo" to hold "bar" in the Redis logical database.flow context will be prefixed with <id of the flow>: .
e.g. Set "foo" to hold "bar" in the flow context whose id is 8588e4b8.784b38 -> Set "8588e4b8.784b38:foo" to hold "bar" in the Redis.node context will be prefixed with <id of the node>: .
e.g. Set "foo" to hold "bar" in the node context whose id is 80d8039e.2b82:8588e4b8.784b38 -> Set "80d8039e.2b82:8588e4b8.784b38:foo" to hold "bar" in the Redis.Node-RED Redis
+------------------------------+ +---------------------------------------------+
| global context | | logical database |
| +--------------------------+ | | +-----------------------------------------+ |
| | +--------+-------------+ | | | | +---------------+---------------------+ | |
| | | str | "foo" | | | <-----> | | | global:str | "\"foo\"" | | |
| | +--------+-------------+ | | | | +---------------+---------------------+ | |
| | | num | 1 | | | <-----> | | | global:num | "1" | | |
| | +--------+-------------+ | | | | +---------------+---------------------+ | |
| | | nstr | "10" | | | <-----> | | | global:nstr | "\"10\"" | | |
| | +--------+-------------+ | | | | +---------------+---------------------+ | |
| | | bool | false | | | <-----> | | | global:bool | "false" | | |
| | +--------+-------------+ | | | | +---------------+---------------------+ | |
| | | arr | ["a","b"] | | | <-----> | | | global:arr | "[\"a\",\"b\"]" | | |
| | +--------+-------------+ | | | | +---------------+---------------------+ | |
| | | obj | {foo,"bar"} | | | <-----> | | | global:obj | "{\"foo\",\"bar\"}" | | |
| | +--------+-------------+ | | | | +---------------+---------------------+ | |
| +--------------------------+ | | +-----------------------------------------+ |
+------------------------------+ +---------------------------------------------+
Other Redis client(e.g. redis-cli) can get the value stored by Node-RED like followings.
Node-RED
global.set("foo","bar","redis");
global.set("obj",{key:"value"},"redis");
redis-cli
redis> GET global:foo
"\"var\""
redis> GET global:obj
"{\"key\":\"value\"}"
redis>
FAQs
A Node-RED Context store plugin backed by Redis
We found that @naimo84/node-red-context-redis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.