thanks @r0ller
I have to work on that.
You're welcome. Let me know if you need more details. I did not copy our solution here as it got a bit complex, extended with user role check (we reuse the nodered authentication api for our single user dashboard ui where user roles make a difference though) and we also added a dynamic editor login enable/disable logic as well.
for those running Node-RED in an environment that auto-restarts the service (for example in Home Assistant with Watchdog enabled):
in my case the previously posted commands (node-red-restart
, systemctrl
, etc.) were not available.
what did work though is the kill
command: Node-RED gets shut down via a pkill node-red
exec block; Home Assistant will then auto-restart the service, which also reloads settings.js.
example flow:
[{"id":"fbaa1fab24df3a48","type":"inject","z":"efc8809275cbb7a5","name":"trigger restart","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":710,"y":620,"wires":[["deb4bf5a0e2a8e4d"]]},{"id":"deb4bf5a0e2a8e4d","type":"exec","z":"efc8809275cbb7a5","command":"pkill node-red","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":880,"y":620,"wires":[[],[],[]]}]