0

I have deployed Node-Red to an Azure Container Instance using the standard Node-Red image found at Docker Hub.

I would like to secure:

  1. access to the editor
  2. access to existing HTTP In nodes, used to create a simple API end-point

I am considering to deploy the Container Instance to a Azure Private Network with its own Network Security Group but I am not sure that will actually do the trick.

When reading up on how to secure Node-Red, it is dependent on settings on the Settings.json file.

But how do I even access and update that when running it as a Container Instance?

I am able to connect to the container file system using the Connect option for the Container Instance, but there seem to be no Settings file. Or at least it is not shown.

So:

  1. is it even possible to modify the Settings.json file when running a Container Instance?
  2. if so, how do I access it?
  3. how do I update it and reload Node-Red using it?

enter image description here

1 Answers1

0

From the container logs, you will see the path of settings file is /usr/src/node-red/node_modules/node-red/settings.js

enter image description here

To access the setting file, you can navigate to Container instances---Containers--- Connect---/bin/bash. Navigate to that path, you will find the settings.js file. Then you can use vim to edit it.

enter image description here

Update the containers in a running container group by redeploying an existing group with at least one modified property. When you update containers, please note that not all properties of a container group support updates. To change some properties of a container group, you must first delete, then redeploy the group. See Properties that require container delete.

Nancy
  • 26,865
  • 3
  • 18
  • 34
  • Excellent! Now I am able to find the Settings.js file. Since I am much a newbie on bash, how do I use vim from within the bash Connect To window for the container? – Tobias Persson Aug 27 '20 at 10:38
  • just type `vim settings.js` on Bash to open the file then type `i` into the editor mode. After that, type `ESC` and `:wq` to save and exit the file. https://tldp.org/LDP/intro-linux/html/sect_06_02.html – Nancy Aug 28 '20 at 06:45
  • Isn't it better to host your own settings file rather than edit from node_modules which will get overwritten on updates? – Neil Oct 07 '22 at 14:27