Secret Management

#1

Is there a way to move secrets out of my settings.js file and into another file which I can add to .gitignore ? I am looking for something similar to secrets.yaml on hass.

-John

1 Like
#2

Yes, absolutely. Since Node-RED uses Node.js, we can use the standard module form for including other files. You need a separate .js file that does an export of one or more variables/objects and then you use require in your settings.js.

#3

You can use node-red-contrib-credentials.
In this node you can configure a set of credentials which will not be stored in the flows.json file but in the flows_cred.json.

The extra nice thing is that this works perfectly together with the node-RED project feature as it will store those credentials in the encrypted _cred.json on github. So the credentials are also backed up without being readable by the world.