Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui/install.sh: add www-data to "sudo" group #784

Merged
merged 3 commits into from
Nov 12, 2021
Merged

Conversation

EricClaeys
Copy link
Collaborator

@EricClaeys EricClaeys commented Nov 12, 2021

so it can execute the vcgencmd command (new "show throttling" view on the "System" page).
There is a separate PR for the allsky-portal portion of this change.

so it can execute the vcgencmd command (new "show throttling" view on the "System" page).
Copy link
Collaborator

@linuxkidd linuxkidd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, can we not just add the specific command to /etc/sudoers.d/allsky (populated from here), instead of giving full sudo access to www-data ?

@EricClaeys
Copy link
Collaborator Author

@linuxkidd, I tried that on my Pi and it didn't work, even after a reboot. If you can get it to work with the file, I prefer that way.
Here's what I added to /etc/sudoers.d/allsky:

www-data ALL=(ALL) NOPASSWD:/usr/bin/vcgencmd get_throttled
www-data ALL=(ALL) NOPASSWD:/opt/vc/bin/vcgencmd get_throttled
www-data ALL=(ALL) NOPASSWD:/usr/bin/vcgencmd
www-data ALL=(ALL) NOPASSWD:/opt/vc/bin/vcgencmd

As you can see, I even tried the file the symbolic link pointed to.

@linuxkidd
Copy link
Collaborator

@EricClaeys I added only the last line to my /etc/sudoers.d/allsky file, and it worked for me:

www-data ALL=(ALL) NOPASSWD:/opt/vc/bin/vcgencmd

@EricClaeys
Copy link
Collaborator Author

@linuxkidd did you have to execute anything so the file would be re-read?

@linuxkidd
Copy link
Collaborator

Na, nothing extra needed. The file is re-read on each sudo attempt, so modifying, and saving is sufficient. I used the system.php file from your portal PR.

@linuxkidd linuxkidd merged commit 05b5fcd into master Nov 12, 2021
@EricClaeys
Copy link
Collaborator Author

Thanks Michael. I added the one-line change to the "allsky" sudoers file and got rid of the addition to install.sh.

@EricClaeys EricClaeys deleted the WebUi-vcgencmd branch November 12, 2021 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants