From 29c593b8b01c86f31c5b3f5e52f24785003a9af7 Mon Sep 17 00:00:00 2001 From: Chad Howell Date: Mon, 25 Jan 2016 00:28:53 -0500 Subject: [PATCH 01/14] Add user pihole if user does not exsist Check if user pihole exist and add if not. This will give pihole its own system user without a login or home directory that is not system dependent. --- automated install/basic-install.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index d9e448a9..b07145b2 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -431,6 +431,16 @@ runGravity(){ } +setUser(){ + # Check if user pihole exists and create if not + echo "::: Checking if user 'pihole' exists..." + if id -u pihole > /dev/null 2>&1; then + echo "::: User 'pihole' already exists" + else + echo "::: User 'pihole' doesn't exist. Creating..." + $SUDO useradd -r -s /usr/sbin/nologin pihole + fi +} installPihole(){ checkForDependencies # done @@ -438,7 +448,7 @@ installPihole(){ $SUDO chown www-data:www-data /var/www/html $SUDO chmod 775 /var/www/html - $SUDO usermod -a -G www-data pi + $SUDO usermod -a -G www-data pihole $SUDO lighty-enable-mod fastcgi fastcgi-php > /dev/null getGitFiles From f8897942f3e7e13335247af7a7ada666349a000f Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 15 Feb 2016 19:26:39 +0000 Subject: [PATCH 02/14] Update adlists.default Remove 'securemecca.com` list, as they block other content, not just ads and malware. Pi-hole is about ad-blocking and privacy, not about censoring content. See :https://www.reddit.com/r/pihole/comments/45xuh8/slug/d00xg02 --- adlists.default | 2 -- 1 file changed, 2 deletions(-) diff --git a/adlists.default b/adlists.default index c2385f7e..b8932eb2 100644 --- a/adlists.default +++ b/adlists.default @@ -6,7 +6,6 @@ http://pgl.yoyo.org/adservers/serverlist.php? http://someonewhocares.org/hosts/hosts http://winhelp2002.mvps.org/hosts.txt http://mirror1.malwaredomains.com/files/justdomains -http://securemecca.com/Downloads/hosts.txt https://hosts.neocities.org/ http://sysctl.org/cameleon/hosts https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist @@ -14,4 +13,3 @@ https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt http://optimate.dl.sourceforge.net/project/adzhosts/HOSTS.txt https://raw.githubusercontent.com/quidsup/notrack/master/trackers.txt - From c4fc2e089d78daef76a10fb60eb10f568013b956 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Mon, 15 Feb 2016 17:36:59 -0500 Subject: [PATCH 03/14] Removed dead list Fixes #316 --- adlists.default | 1 - 1 file changed, 1 deletion(-) diff --git a/adlists.default b/adlists.default index b8932eb2..cf5ca45b 100644 --- a/adlists.default +++ b/adlists.default @@ -6,7 +6,6 @@ http://pgl.yoyo.org/adservers/serverlist.php? http://someonewhocares.org/hosts/hosts http://winhelp2002.mvps.org/hosts.txt http://mirror1.malwaredomains.com/files/justdomains -https://hosts.neocities.org/ http://sysctl.org/cameleon/hosts https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt From 40f541bc31a23e49853f9536b809f4ab403d0baa Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Tue, 16 Feb 2016 23:00:48 +0000 Subject: [PATCH 04/14] update verifyFreeDiskSpace()... addresses #322. Will now check free space on the first file system output by 'df- lkP`, as opposed to `/` to make pi-hole more compatible with other distros. --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 514ac8e6..837c3179 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -120,7 +120,7 @@ verifyFreeDiskSpace() { # 25MB is the minimum space needed (20MB install + 5MB one day of logs.) requiredFreeBytes=25600 - existingFreeBytes=`df -lkP / | awk '{print $4}' | tail -1` + existingFreeBytes=`df -lkP | awk '{print $4}' | tail -1` if [[ $existingFreeBytes -lt $requiredFreeBytes ]]; then whiptail --msgbox --backtitle "Insufficient Disk Space" --title "Insufficient Disk Space" "\nYour system appears to be low on disk space. pi-hole recomends a minimum of $requiredFreeBytes Bytes.\nYou only have $existingFreeBytes Free.\n\nIf this is a new install you may need to expand your disk.\n\nTry running:\n 'sudo raspi-config'\nChoose the 'expand file system option'\n\nAfter rebooting, run this installation again.\n\ncurl -L install.pi-hole.net | bash\n" $r $c From 21c688a8a8c415ea32e79b3b9ef143d5fbf09e0e Mon Sep 17 00:00:00 2001 From: Hippyjake Date: Tue, 16 Feb 2016 18:06:49 -0700 Subject: [PATCH 05/14] add uptime -p to chrono script --- advanced/Scripts/chronometer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/advanced/Scripts/chronometer.sh b/advanced/Scripts/chronometer.sh index 9153d9ba..ebed8684 100755 --- a/advanced/Scripts/chronometer.sh +++ b/advanced/Scripts/chronometer.sh @@ -88,6 +88,7 @@ function normalChrono(){ echo " $(ifconfig eth0 | awk '/inet addr/ {print $2}' | cut -d':' -f2)" echo "" uptime | cut -d' ' -f11- + uptime -p echo "-------------------------------" # Uncomment to continually read the log file and display the current domain being blocked #tail -f /var/log/pihole.log | awk '/\/etc\/pihole\/gravity.list/ {if ($7 != "address" && $7 != "name" && $7 != "/etc/pihole/gravity.list") print $7; else;}' From c3c051385c6bb8e98d15632e1d4473a558369a71 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 17 Feb 2016 12:42:31 +0000 Subject: [PATCH 06/14] Update basic-install.sh Corrected mistake in previous commit --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 837c3179..5850b27e 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -120,7 +120,7 @@ verifyFreeDiskSpace() { # 25MB is the minimum space needed (20MB install + 5MB one day of logs.) requiredFreeBytes=25600 - existingFreeBytes=`df -lkP | awk '{print $4}' | tail -1` + existingFreeBytes=`df -lk | awk '{print $4}' | head -2 | tail -1` if [[ $existingFreeBytes -lt $requiredFreeBytes ]]; then whiptail --msgbox --backtitle "Insufficient Disk Space" --title "Insufficient Disk Space" "\nYour system appears to be low on disk space. pi-hole recomends a minimum of $requiredFreeBytes Bytes.\nYou only have $existingFreeBytes Free.\n\nIf this is a new install you may need to expand your disk.\n\nTry running:\n 'sudo raspi-config'\nChoose the 'expand file system option'\n\nAfter rebooting, run this installation again.\n\ncurl -L install.pi-hole.net | bash\n" $r $c From 8e289215b4f937795cfb4b1488895d0353cc7cf3 Mon Sep 17 00:00:00 2001 From: Daniel Fayette Date: Wed, 17 Feb 2016 10:00:36 -0600 Subject: [PATCH 07/14] Account for CHIP pc not having root on '/' --- automated install/basic-install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 5850b27e..346b419c 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -120,7 +120,10 @@ verifyFreeDiskSpace() { # 25MB is the minimum space needed (20MB install + 5MB one day of logs.) requiredFreeBytes=25600 - existingFreeBytes=`df -lk | awk '{print $4}' | head -2 | tail -1` + existingFreeBytes=`df -lk / 2>&1 | awk '{print $4}' | head -2 | tail -1` + if ! [[ "$existingFreeBytes" =~ ^[0-9]\+$ ]]; then + existingFreeBytes=`df -lk /dev 2>&1 | awk '{print $4}' | head -2 | tail -1` + fi if [[ $existingFreeBytes -lt $requiredFreeBytes ]]; then whiptail --msgbox --backtitle "Insufficient Disk Space" --title "Insufficient Disk Space" "\nYour system appears to be low on disk space. pi-hole recomends a minimum of $requiredFreeBytes Bytes.\nYou only have $existingFreeBytes Free.\n\nIf this is a new install you may need to expand your disk.\n\nTry running:\n 'sudo raspi-config'\nChoose the 'expand file system option'\n\nAfter rebooting, run this installation again.\n\ncurl -L install.pi-hole.net | bash\n" $r $c From 9ad7c12710c75ca50b243585e8a2af5582e97edd Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 17 Feb 2016 22:15:33 +0000 Subject: [PATCH 08/14] Create PULL_REQUEST_TEMPLATE --- .github/PULL_REQUEST_TEMPLATE | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE new file mode 100644 index 00000000..1a2aa1ab --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE @@ -0,0 +1,6 @@ +Fixes #[issue number] . + +Changes proposed in this pull request: +- +- +- From 6581f119fd1fdf5328ab1f0e20d33fdd21803fed Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 17 Feb 2016 22:16:04 +0000 Subject: [PATCH 09/14] Update PULL_REQUEST_TEMPLATE --- .github/PULL_REQUEST_TEMPLATE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE index 1a2aa1ab..c9ec842a 100644 --- a/.github/PULL_REQUEST_TEMPLATE +++ b/.github/PULL_REQUEST_TEMPLATE @@ -4,3 +4,5 @@ Changes proposed in this pull request: - - - + +@pihole/gravity From b1515c5e3fa679edbe4fe77b410baafde073757c Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 17 Feb 2016 22:17:20 +0000 Subject: [PATCH 10/14] Rename PULL_REQUEST_TEMPLATE to PULL_REQUEST_TEMPLATE.md --- .github/{PULL_REQUEST_TEMPLATE => PULL_REQUEST_TEMPLATE.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{PULL_REQUEST_TEMPLATE => PULL_REQUEST_TEMPLATE.md} (100%) diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE rename to .github/PULL_REQUEST_TEMPLATE.md From 6530ec58c7ae117e722ea9c03efcd1c27ba7863e Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 17 Feb 2016 22:18:43 +0000 Subject: [PATCH 11/14] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c9ec842a..8b924ac2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,8 +1,12 @@ Fixes #[issue number] . -Changes proposed in this pull request: -- -- + +#####Changes proposed in this pull request: + - +- + +- + @pihole/gravity From 950480bb776f73fd731ece61dd12c02d40e3d166 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 17 Feb 2016 22:20:01 +0000 Subject: [PATCH 12/14] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8b924ac2..071fdf89 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,9 +1,8 @@ Fixes #[issue number] . +Changes proposed in this pull request: -#####Changes proposed in this pull request: - -- +- - From 5f9e5869e94048488118aaae89c3a37b8a09306b Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 17 Feb 2016 22:23:01 +0000 Subject: [PATCH 13/14] Create ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..04303614 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,7 @@ +##### Expected Behaviour: + + +##### Actual Behaviour: + + +##### Steps to reproduce this issue: From 4a1e88f4bf8b11a1dac57075d22c6e1f5331c3a0 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 20 Feb 2016 09:48:06 -0500 Subject: [PATCH 14/14] Fixed Pi-hole user not being created --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index faed1077..ac57db43 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -558,6 +558,7 @@ installPihole() { # Install base files and web interface checkForDependencies # done stopServices + setUser $SUDO mkdir -p /etc/pihole/ $SUDO chown www-data:www-data /var/www/html $SUDO chmod 775 /var/www/html @@ -567,7 +568,6 @@ installPihole() { getGitFiles installScripts installConfigs - #installWebAdmin CreateLogFile installPiholeWeb installCron