Update sudoers .env permissions, systemd service user

This commit is contained in:
billz 2024-03-08 10:48:41 +01:00
parent 5d8fed824a
commit 87216bdc02
2 changed files with 5 additions and 1 deletions

View file

@ -28,6 +28,9 @@ www-data ALL=(ALL) NOPASSWD:/bin/systemctl stop openvpn-client@client
www-data ALL=(ALL) NOPASSWD:/bin/systemctl disable openvpn-client@client
www-data ALL=(ALL) NOPASSWD:/bin/systemctl start restapi.service
www-data ALL=(ALL) NOPASSWD:/bin/systemctl stop restapi.service
www-data ALL=(ALL) NOPASSWD:/bin/systemctl status restapi.service
www-data ALL=(ALL) NOPASSWD:/bin/touch /etc/raspap/api/.env
www-data ALL=(ALL) NOPASSWD:/bin/mv /tmp/.env /etc/raspap/api/.env
www-data ALL=(ALL) NOPASSWD:/bin/mv /tmp/ovpn/* /etc/openvpn/client/*.conf
www-data ALL=(ALL) NOPASSWD:/usr/bin/ln -s /etc/openvpn/client/*.conf /etc/openvpn/client/*.conf
www-data ALL=(ALL) NOPASSWD:/bin/rm /etc/openvpn/client/*.conf

View file

@ -3,10 +3,11 @@ Description=raspap-restapi
After=network.target
[Service]
User=%i
User=pi
WorkingDirectory=/etc/raspap/api
LimitNOFILE=4096
ExecStart=/usr/bin/python3 -m uvicorn main:app --host 0.0.0.0 --port 8081 --reload
ExecStop=/bin/kill -HUP ${MAINPID}
Restart=on-failure
RestartSec=5s