victronenergy / node-red-contrib-victron

MIT License
87 stars 18 forks source link

[BUG] node-red running w/o root permissions does not allow port binding #180

Open alex191117 opened 10 months ago

alex191117 commented 10 months ago

Describe the bug

Note: Likely this issue is not be solvable by this project. In this case please advice where to send according request for fixing

As node-red is started as non-root user it does not have sufficient permissions to bind ports with lower portnumbers for security reasons. This is leading to problems e.g. when trying to setup a modbus server using modbus-server node that trys binding to standard modbus port 502. For compatibility reasons with other bus devices, it is not an option to move to a higher port in certain use cases.

To Reproduce

Expected behavior Node-red installations on other linux systems appear to address this issue by allowing to set port binding capabilities for the node-red binary/process with setcap command like _"sudo setcap 'cap_net_bindservice=+ep' /usr/local/bin/node" . Unfortunately the large image for cerbo gx does not contain the setcap tool.

I suggest to a) add the setcap related tools to the large image b) consider setting binding permissions for node-red by default or allowing user to set it as configuration option

Hardware (please complete the following information):

Software (please complete the following information):