openenergymonitor / EmonScripts

Emoncms Stack Installation and Update scripts
16 stars 30 forks source link

Use of root user banned #142

Closed borpin closed 2 years ago

borpin commented 2 years ago

https://github.com/openenergymonitor/EmonScripts/blob/1a5ed0b90f9bacdb70001c35f1c1c3093a284bc1/update/main.sh#L23-L27

Whilst I can understand the warning, this absolute block should be removed as there may be a good reason why it is being run as root.

glynhudson commented 2 years ago

I would prefer the block to stay in place. Any user which has the knowledge to run scripts as root will be able to comment out this block. Lots of people prepend 'sudo' onto a script to try to make it run, it causes a lot of issues if it's ran as root. It would be a potential security risk to allow the script to run as root since it can be called via the web.

borpin commented 2 years ago

It is the absolute block that is the issue. Some mechanism to allow it to run would be very useful even by a Y/N if interactive (not service-runner).