@mako if you are using the default auth mechanism, then one vital extra step is to restart Node-RED for it to pickup any changes you make. So that makes it a bit more complicated if you want Node-RED to update itself - still doable, but more complicated.
A basic flow would be:
- File In node to read your current settings file
- a Function node to generate the new password hash (or Exec node to run
node-red-admin to do it)
- Function node to parse the settings file, figure out where to insert the new hash and do so
- File Out node to write the new settings file
- Exec node to trigger an appropriate command to restart Node-RED - the specifics will depend on how you are running Node-RED. This isn't trivial. If you exec
node-red-stop && node-red-start, then the
node-red-stop will kill the exec node and the
node-red-start will never happen.... so you need to figure some way around that.
A different alternative would be to create a custom authentication plugin that reads usernames/password from an external file and allows for the file to update without requiring a restart of node-red. Whilst that would make it easier to create a flow to update the password, it is more complicated to create the custom plugin in the first place.
I realise this doesn't give you all the answers, but it points you in a direction if you want to pursue it.