NodeRed: how to enable contextStorage on local filesystem

I would like to store some NodeRed configuration in global context and ensure that it is persistent with restarts. NodeRed provides contextStorage options to reside on local filesystem, but you need to modify your settings.js.
I have found that /usr/lib/node_modules/node-red/settings.js resides on read-only filesystem so I suspect this cannot be changed as it may be overwritten with Cerbo firmware upgrade.

Is there a way to change this on Cerbo?
Or can Cerbo NodeRed ship with option to also have local filesystem option, like this:

contextStorage: {
   default: "memoryOnly",
   memoryOnly: { module: 'memory' },
   file: { module: 'localfilesystem' }
}

If you want to get really creative with nodered, you may be better off adding a dedicated instance on a Pi or similar.
This can be pointed to the Cerbo for Victron access and will enable proper customisation, including your signalk requirements.

Hi Lure,
in order to activate that feature configure in file “/data/home/nodered/.node-red/settings-user.js”

module.exports = {
     contextStorage: {
         default: { module:"memory" },
         storeInFile: { module:"localfilesystem" }
     },
}

Information is stored in directory “/data/home/nodered/.node-red/context”, which is persistent to reboots and FW updates.
Just consider extension like flow.set(“Set_Limit_Std”, xyz, “storeInFile”) or flow.get(“Set_Limit_Std”, “storeInFile”)

@nickdb : I don’t see your concern, I use that and more adjustments longer than 2 years on native Victron node red installation

1 Like

Thomas, it works!
I was able to make my configuration parameters persistent over restarts.
Thank you very much for your help!