-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
pihole
user to run pihole
command as the pihole
user
Signed-off-by: Adam Warner <[email protected]>
- Loading branch information
Showing
2 changed files
with
2 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pihole ALL = NOPASSWD: /usr/local/bin/pihole" |
2b17817
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May i suggest to use
doas
instead ofsudo
? It can do the same (of what there is currently) and is lighter to do it and should be more secure.Alpine use the
OpenDoas
implementation (https://github.com/Duncaen/OpenDoas)The variant file for pihole would look like this doing the same thing:
In
/etc/doas.conf
:permit
(allow the user)nopass
(without password)pihole
(the user)cmd
(the command the user is allowed to execute)/usr/local/bin/pihole
(the executable path)2b17817
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should run as the pihole user by default with this command if i'm not mistaken, but if not just adding
as pihole
behindpihole
andcmd
should solve it ^^2b17817
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review/comments
Actually, on reflection - this issue was actually down to the
${USER}
variable being blank inside the container (see pi-hole/pi-hole#5341) so the addition to the sudoers is actually no longer required - have just tested this on a fresh build without these changes.start.sh
actually needs to run as root to set a few things up first (though this could change in future), whenpihole-FTL
is run, then it is started as thepihole
user.We can take a look at
doas
in the future if we still require that kind of thing