Changing flows_cred.json values at runtime

Hi everyone!
My current environment is Node-Red Express and I'd like to be able to modify the flows_cred.json values at runtime without restarting Node Red. In this way, I thought, the configuration nodes' credentials can be automatically saved every time Node Red restarts, as I couldn't do it in the settings.js file ('credentialSecret'). The flows_cred.json file is changed indeed when the credential for a new node (e.g. Dropbox) is added. However, when I rewrite the file at runtime, the values were overwritten, but nothing happened. There are still nodes that prompt for API keys that are missing. Any ideas? Is it even possible? Also, I looked in previous posts here, but did not find an answer.
Here's my flow. Thanks for your help:)

[{"id":"ce2af8611ac69557","type":"inject","z":"01ea9a32d834b1d1","name":"Read","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":470,"y":2040,"wires":[["5ec2d01b3f965a59"]]},{"id":"5ec2d01b3f965a59","type":"file in","z":"01ea9a32d834b1d1","name":"Current flows_cred.json","filename":"./flows_cred.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":670,"y":2040,"wires":[["edba61c0ce961690"]]},{"id":"879bcaf27cd56d57","type":"debug","z":"01ea9a32d834b1d1","name":"debug 331","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":945,"y":2040,"wires":[],"l":false},{"id":"cbfb8e4cefeff163","type":"inject","z":"01ea9a32d834b1d1","name":"Write","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"$\":\"564004............\"}","payloadType":"json","x":450,"y":2100,"wires":[["5411d82543fbb210"]]},{"id":"5411d82543fbb210","type":"file","z":"01ea9a32d834b1d1","name":"NEW flows_cred.json","filename":"./.flows_cred.json","filenameType":"str","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":660,"y":2100,"wires":[["3844099f4b8ea3b5"]]},{"id":"3844099f4b8ea3b5","type":"debug","z":"01ea9a32d834b1d1","name":"debug 332","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":845,"y":2100,"wires":[],"l":false},{"id":"61c927818e1a4c19","type":"inject","z":"01ea9a32d834b1d1","name":"Recently changed files","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"find . -mmin -5","payloadType":"str","x":500,"y":2180,"wires":[["c4a393200c8ac118"]]},{"id":"c4a393200c8ac118","type":"exec","z":"01ea9a32d834b1d1","command":"","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":690,"y":2180,"wires":[["fb83d00784e3b1da"],["fb83d00784e3b1da"],["fb83d00784e3b1da"]]},{"id":"fb83d00784e3b1da","type":"debug","z":"01ea9a32d834b1d1","name":"debug 333","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":835,"y":2180,"wires":[],"l":false},{"id":"edba61c0ce961690","type":"json","z":"01ea9a32d834b1d1","name":"","property":"payload","action":"","pretty":false,"x":850,"y":2040,"wires":[["879bcaf27cd56d57"]]}]

once you have re-written them you need to then restart node-red so it re-reads them.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.