From c7141966475985a5675597428b8d136b6dd8268d Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sun, 17 Apr 2016 22:46:06 -0400 Subject: [PATCH 1/4] Add Sudoer file for WebUI --- advanced/pihole.sudo | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 advanced/pihole.sudo diff --git a/advanced/pihole.sudo b/advanced/pihole.sudo new file mode 100755 index 00000000..ef06249a --- /dev/null +++ b/advanced/pihole.sudo @@ -0,0 +1,12 @@ +# Pi-hole: A black hole for Internet advertisements +# (c) 2015, 2016 by Jacob Salmela +# Network-wide ad blocking via your Raspberry Pi +# http://pi-hole.net +# Allows the WebUI to use Pi-hole commands +# +# Pi-hole is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. + +www-data ALL=NOPASSWD: /usr/local/bin/pihole From d7abbbfac43bad3aa4c7bfd8db742140981e0a43 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sun, 17 Apr 2016 22:49:47 -0400 Subject: [PATCH 2/4] Change mode of sudoer file --- advanced/pihole.sudo | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 advanced/pihole.sudo diff --git a/advanced/pihole.sudo b/advanced/pihole.sudo old mode 100755 new mode 100644 From 09cdf5081c8f7a1f728c2932aea24b8d547fbcf7 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sun, 17 Apr 2016 23:03:12 -0400 Subject: [PATCH 3/4] Install sudoer file --- automated install/basic-install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 139a7a4b..ca8f1aae 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -636,6 +636,11 @@ installPiholeWeb() { $SUDO cp /etc/.pihole/advanced/index.* /var/www/html/pihole/. $SUDO echo " done!" fi + # Install Sudoer file + echo -n "::: Installing sudoer file..." + $SUDO cp /etc/.pihole/advanced/pihole.sudo /etc/sudoers.d/pihole + $SUDO chmod 0440 /etc/sudoers.d/pihole + echo " done!" } installCron() { From 24de6d6fc9a82dbbbb74ecc1225ba92b5ca5ded9 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Wed, 20 Apr 2016 21:43:01 -0400 Subject: [PATCH 4/4] Allow sudoers file to be uninstalled --- automated install/uninstall.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index 484a544d..19f416b2 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -122,8 +122,9 @@ function removeNoPurge { $SUDO rm -rf /etc/.pihole/ &> /dev/null $SUDO rm -rf /opt/pihole/ &> /dev/null $SUDO rm /usr/local/bin/pihole &> /dev/null - $SUDO rm /etc/bash_completion.d/pihole - + $SUDO rm /etc/bash_completion.d/pihole &> /dev/null + $SUDO rm /etc/sudoers.d/pihole &> /dev/null + echo ":::" printf "::: Finished removing PiHole from your system. Sorry to see you go!\n" printf "::: Reach out to us at https://github.com/pi-hole/pi-hole/issues if you need help\n"