Use of environment variables to set editor user name and password

Has the option to use NODE_RED_USERNAME and NODE_RED_PASSWORD to set an admin login for the editor been removed? It works in NR 1.x, but apparently not in NR 2.x.

Thanks

Hi @hammoaj

those env vars are specific to the wrapper used when running Node-RED in IBM Cloud. It isn't a core feature.

As far as I can see, the code is still there to use them - node-red-app/index.js at master · IBM/node-red-app · GitHub

Thanks @knolleary

Am I right in thinking that I read that you can use environment variables to override individual options in the settings file? If so, could you point me at the documentation?

The IBM-specific env vars are listed here: GitHub - IBM/node-red-app: Node-RED application that can be deployed into IBM Cloud with a few clicks

Hi Nick - that wasn't a question re IBM. More specifically it was a question as to whether I can set an environment variable when I run a docker container versus having to update the settings file.

For example if I want to override httpAdminRoot is there a way of doing it with a environment variable?

The only env vars the core supports are:

  • NODE_RED_HOME - to set the userDir (same as the -u command line option)
  • NODE_RED_ENABLE_SAFE_MODE - to start in safe mode (same as --safe option)
  • NODE_RED_ENABLE_PROJECTS - to enable the projects feature
  • NODE_RED_ENABLE_TOURS - to enable/disable the new welcome tour feature

Thanks! I must have been dreaming it.

Perhaps you edited settings.js to use the env var.

I did precisely that!!

Can the -D option when you call mode-red also be used to do this?

Well node-red -h suggests that you can. Have you tried?

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