Email node IDs and openwethermap API KEY disappears when copy flow.json

Hi,

I'm using these node packages :

        "node-red-node-email": "~1.14.0",
        "node-red-node-openweathermap": "~0.5.1"

When i work in multi-users, and i copy original flow in an userDir, i see that this tow node lost his parameters.

  • Send email node lost id and password of the email account,
  • and OpenWeatherMap node lost his API key.

I must to enter manualy for each user. This is not awesome.
I have seek in the module package to see where is stored these parameters, but i don't understand.

Necessarily, there is a file where that node extra parameters are stored ?!

Perhaps, there is a solution to store this settings for example from the functionGlobalContext in the settings.js file ? Or other way ?

Thanks,

Anything marked as a credential by the node is not stored in the flow file. This is a deliberate choice.

They are also never made available to the editor after they are entered the first time so will not be included if you select nodes and choose the export option in the editor.

These values are encrypted and stored in the flow_creds.json file that will be in the useDir next to the flow.json

The encryption key for this file is either in the .config.runtime.json file if you have not manually added one to the settings.js file.

This is, that i missed !!

So, i have just test you fix with succes, and i add this below for others :

  • You need to enable and set a personal secret key in the settings.js file.
  • Then configure all node with any credential, and deploy.
  • After, for a new instance of user, copy / paste into is userDir :
    • settings.js
    • flow.json
    • flow_cred.json.

Thank you very much @hardillb, clear and precise

:wink:

It is usually best to copy everything across except the node_modules folder, and then to go into the folder and run
npm install
which will install any extra nodes you need.

If you don't copy package.json across then if you run an npm command in the new one (to install a new node-type for example) it will uninstall any extra nodes you had installed in the master.

Yes @Colin, you explained me that before :wink: thanks again.

In multi-users instances, i link each node_modules user folder to a unique node_modules in a admin .node-red folder.
So i make npm install or update in this folder only, and consider that all users use the same flow and their node-red éditor disabled.
In this case only, i copy this three files on each userDir folder.

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