inonoob / pirowflo

All-in-one data interface for your Waterrower S4 Monitor or Smartrow
GNU General Public License v3.0
141 stars 32 forks source link

Full Autoupdate root vs pi user #29

Open inonoob opened 3 years ago

inonoob commented 3 years ago

Problem description:

The update script gets the newest release and replace the old one. That's working fine, but the user still has to manually start the install script:

sudo ./install.sh

What would be a good practice to then after start the install.sh without the user doing something. Because as long as this is not solved the Autoupdate from the screen won't work. And supervisor now runs as user pi, so for the moment it can't start the script.

Possible solution

reconfigure supervisor to start as root again in the systemd service config. And in the config file of supervisor specify that the update script needs to be run as root. The file ownership and group of the PiRowFlo updater and supervisor.conf must then be set to root in order to prevent that someone re-write the script to do bad stuff as root.