Flows_cred.json are encrypted

flows_cred.json How do I execute the command to load the credentials in flows.json below the privacy, how do I modify the configuration file, load it through the sh command?

How to solve this problem? Thank you for informing me!

{
        "id": "3b95270be04c4e92",
        "type": "influxdb",
        "hostname": "127.0.0.1",
        "port": "8086",
        "protocol": "http",
        "database": "database",
        "name": "210office",
        "usetls": false,
        "tls": "d50d0c9f.31e858",
        "influxdbVersion": "2.0",
        "url": "http://127.0.0.1:8086",
        "rejectUnauthorized": false,
         "credentials": {
            "token": "xoxo"
        }
    }

If I change the token content, how can I update the contents of the encrypted flows_cred.json file? Otherwise, I cannot use the new account password in the node
Otherwise I need to redeploy to execute the command. Do you have a demo or case to encrypt this using Python?

Welcome to the forum.

You do not need to do anything with the credentials json file. Node-RED takes care of it for you. Any node that wants to keep credentials safe will define something as a credential and the value is automatically encrypted into the cred file and retrieved as needed.

However, after I restart the service, the new token will not be added to the certificate again, and I need to go to the web side of the node to deploy it again. Why is this?

Which influxdb node do you have installed?
This should be available in your .node-red folder/package.json
eg

pi@Zero2Pink:~ $ grep influx ~/.node-red/package.json
    "node-red-contrib-influxdb": "~0.7.0",


Are you trying to change the credentials file from a process external to Node-red? Why?

My token in influxdb changes. After I modify the flows.json file, restarting the service does not take effect. I want to write an sh script to make the certificate take effect without performing operations on the web side of the node

In that case, you may be better off not using that node. You don't really need a node for InfluxDB anyway since the API uses standard REST. That means that you can simply use an http-request node with the appropriate headers set. That will give you full control over the interaction & should let you use a more dynamic token without the need for a shell script.

1 Like