From a44a201f0088a48a4240f380dded8c815ed4411e Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Mon, 14 Mar 2016 22:51:16 -0500 Subject: [PATCH 01/15] rewrite js files to a valid stub --- advanced/lighttpd.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/advanced/lighttpd.conf b/advanced/lighttpd.conf index 5a662ffa..124371a9 100644 --- a/advanced/lighttpd.conf +++ b/advanced/lighttpd.conf @@ -53,4 +53,6 @@ $HTTP["url"] =~ "^/admin/" { $HTTP["url"] =~ "^(?!/admin)/.*" { # Create a response header for debugging using curl -I setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." ) + # rewrite only js requests + url.rewrite = ("(.*).js" => "pihole/index.js") } From d3971b26e4e278a227f861697c2063acd6bfe9a8 Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Mon, 14 Mar 2016 22:52:02 -0500 Subject: [PATCH 02/15] add a valid js stub --- advanced/index.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 advanced/index.js diff --git a/advanced/index.js b/advanced/index.js new file mode 100644 index 00000000..6e81b42f --- /dev/null +++ b/advanced/index.js @@ -0,0 +1 @@ +var x = "X-Pi-hole: A black hole for Internet advertisements." From 404ea0ce6daaf61b1e6739d2ae3647d85390b24d Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Mon, 14 Mar 2016 22:54:45 -0500 Subject: [PATCH 03/15] copy both the html and js stubs during install --- 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 b3e6202f..35c885e8 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -619,7 +619,7 @@ installPiholeWeb() { else $SUDO mkdir /var/www/html/pihole $SUDO mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig - $SUDO cp /etc/.pihole/advanced/index.html /var/www/html/pihole/index.html + $SUDO cp /etc/.pihole/advanced/index.* /var/www/html/pihole/. $SUDO echo " done!" fi } From b79db363368310cc47fcea4b4abd2426ce898c5d Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Mon, 14 Mar 2016 22:59:38 -0500 Subject: [PATCH 04/15] no need for the X- header prefix in the string --- advanced/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/index.js b/advanced/index.js index 6e81b42f..c9da5aff 100644 --- a/advanced/index.js +++ b/advanced/index.js @@ -1 +1 @@ -var x = "X-Pi-hole: A black hole for Internet advertisements." +var x = "Pi-hole: A black hole for Internet advertisements." From fad5fafa328923f47d1f3a2a04fff49abfe76e43 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 20 Mar 2016 13:26:02 +0000 Subject: [PATCH 05/15] Increase disk space to verify... .. was missing a couple of zeros, and not verifying enough space! Fixes #384 --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index b3e6202f..3a53f6dc 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -117,8 +117,8 @@ welcomeDialogs() { verifyFreeDiskSpace() { - # 25MB is the minimum space needed (20MB install + 5MB one day of logs.) - requiredFreeBytes=51200 + # 50MB is the minimum space needed (45MB install (includes web admin bootstrap/jquery libraries etc) + 5MB one day of logs.) + requiredFreeBytes=5000000 existingFreeBytes=`df -lk / 2>&1 | awk '{print $4}' | head -2 | tail -1` if ! [[ "$existingFreeBytes" =~ ^([0-9])+$ ]]; then From 02bb5b6742c92426b8677626bc51647fdbec4f59 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 20 Mar 2016 20:50:31 +0000 Subject: [PATCH 06/15] Revert previous change Reopens #384 --- 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 3a53f6dc..7365104d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -118,7 +118,7 @@ welcomeDialogs() { verifyFreeDiskSpace() { # 50MB is the minimum space needed (45MB install (includes web admin bootstrap/jquery libraries etc) + 5MB one day of logs.) - requiredFreeBytes=5000000 + requiredFreeBytes=51200 existingFreeBytes=`df -lk / 2>&1 | awk '{print $4}' | head -2 | tail -1` if ! [[ "$existingFreeBytes" =~ ^([0-9])+$ ]]; then From fa2cef639566c5763d6998c4c0afe2915a2b897f Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Mon, 21 Mar 2016 08:29:19 -0500 Subject: [PATCH 07/15] link to get LED alerts article added a link to a cool project that makes an LED blink for each ad that gets blocked. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1a181d6f..4ad56250 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ reddit: [/r/pihole](https://www.reddit.com/r/pihole/) [![Pi-hole exlplained](http://i.imgur.com/qNybJDX.png)](https://vimeo.com/135965232) ## Pi-hole Projects +- [Get LED alerts for each blocked ad](http://www.stinebaugh.info/get-led-alerts-for-each-blocked-ad-using-pi-hole/) - [Pi-hole on Ubuntu 14.04 on VirtualBox](http://hbalagtas.blogspot.com/2016/02/adblocking-with-pi-hole-and-ubuntu-1404.html) - [x86 Docker container that runs Pi-hole](https://hub.docker.com/r/diginc/pi-hole/) - [Splunk: Pi-hole Visualizser](https://splunkbase.splunk.com/app/3023/) From 396c7ab9eebf75e1364056113d50d1c78342d342 Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Tue, 22 Mar 2016 21:21:08 -0500 Subject: [PATCH 08/15] link to tekthing mention tekthing mentioned us again as one of 5 easy projects for the Raspberry Pi. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4ad56250..28e6791b 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ reddit: [/r/pihole](https://www.reddit.com/r/pihole/) - [Minibian Pi-hole](http://munkjensen.net/wiki/index.php/See_my_Pi-Hole#Minibian_Pi-hole) ## Coverage +- [TekThing: 5 fun, easy projects for a Raspberry Pi](https://youtu.be/QwrKlyC2kdM?t=1m42s) - [Pi-hole on Adafruit's blog](https://blog.adafruit.com/2016/03/04/pi-hole-is-a-black-hole-for-internet-ads-piday-raspberrypi-raspberry_pi/) - [The Defrag Show - MSDN/Channel 9](https://channel9.msdn.com/Shows/The-Defrag-Show/Defrag-Endoscope-USB-Camera-The-Final-HoloLens-Vote-Adblock-Pi-and-more?WT.mc_id=dlvr_twitter_ch9#time=20m39s) - [MacObserver Podcast 585](http://www.macobserver.com/tmo/podcast/macgeekgab-585) From 45cb9a2e800118196187c45627083b5a7f1847da Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Mon, 28 Mar 2016 22:51:54 -0400 Subject: [PATCH 09/15] fix template team link --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 071fdf89..b289a1c0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,4 +8,4 @@ Changes proposed in this pull request: - -@pihole/gravity +@pi-hole/gravity From 7014b5a150247ea832182c5b67efbc41aff456b3 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Tue, 29 Mar 2016 17:45:00 -0400 Subject: [PATCH 10/15] Reverted password for web interface Work will continue in the secure-web-interface branch --- automated install/basic-install.sh | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 97b47dad..0b2513da 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -658,19 +658,6 @@ setUser(){ fi } -setPassword() { - # Password needed to authorize changes to lists from admin page - pass=$(whiptail --passwordbox "Please enter a password to secure your Pi-hole web interface." 10 50 3>&1 1>&2 2>&3) - - if [ $? = 0 ]; then - # Entered password - echo $pass > /etc/pihole/password.txt - else - echo "::: Cancel selected, exiting...." - exit 1 - fi -} - installPihole() { # Install base files and web interface checkForDependencies # done @@ -721,9 +708,6 @@ use4andor6 # Decide what upstream DNS Servers to use setDNS -# Set the admin page password -setPassword - # Install and log everything to a file installPihole | tee $tmpLog From ec4d2d65a656e0bf479a99919cb740a8fa98bb27 Mon Sep 17 00:00:00 2001 From: nate Date: Wed, 30 Mar 2016 19:49:39 -0500 Subject: [PATCH 11/15] PromoFaux request: Detailed adlists.list output Now tells user (and logs to pihole_Debug.log) that the adlists.default file is in use --- advanced/Scripts/piholeDebug.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index d2c8e245..145a602c 100644 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -258,8 +258,8 @@ then cat "$ADLISTSFILE" >> $DEBUG_LOG echo >> $DEBUG_LOG else - echo "No adlists.list file found!" >> $DEBUG_LOG - printf ":::\tNo adlists.list file found!\n" + echo "No adlists.list file found... using adlists.default!" >> $DEBUG_LOG + printf ":::\tNo adlists.list file found... using adlists.default!\n" fi From 5f7c11f4959e1ca4dca1c0111d4401600522a264 Mon Sep 17 00:00:00 2001 From: nate Date: Wed, 30 Mar 2016 19:51:09 -0500 Subject: [PATCH 12/15] Sudo added to ifconfig to ensure it runs if debug not run as root --- advanced/Scripts/piholeDebug.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 145a602c..e9d95234 100644 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -118,7 +118,7 @@ function testNslookup { ### Check Pi internet connections ### # Log the IP addresses of this Pi -IPADDR=$(ifconfig | perl -nle 's/dr:(\S+)/print $1/e') +IPADDR=$($SUDO ifconfig | perl -nle 's/dr:(\S+)/print $1/e') echo "::: Writing local IPs to debug log" echo "IP Addresses of this Pi:" >> $DEBUG_LOG echo "$IPADDR" >> $DEBUG_LOG From 45f24c8a85edf0162530e785e9b0a2bfea3318a4 Mon Sep 17 00:00:00 2001 From: nate Date: Wed, 30 Mar 2016 19:56:11 -0500 Subject: [PATCH 13/15] Readded `cat`s that were originally considered UUOC --- gravity.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gravity.sh b/gravity.sh index 0e13cb95..ddc177a0 100755 --- a/gravity.sh +++ b/gravity.sh @@ -222,7 +222,7 @@ function gravity_Schwarzchild() { truncate -s 0 $piholeDir/$matterandlight & spinner $! for i in "${activeDomains[@]}" do - "$i" |tr -d '\r' >> $piholeDir/$matterandlight + cat "$i" | tr -d '\r' >> $piholeDir/$matterandlight done echo " done!" @@ -282,12 +282,12 @@ function gravity_hostFormat() { if [[ -n $piholeIPv6 ]];then #Add dummy domain Pi-Hole.IsWorking.OK to the top of gravity.list to make ping result return a friendlier looking domain! echo -e "$piholeIP Pi-Hole.IsWorking.OK \n$piholeIPv6 Pi-Hole.IsWorking.OK" > $piholeDir/$accretionDisc - $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> $piholeDir/$accretionDisc + cat $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> $piholeDir/$accretionDisc else # Otherwise, just create gravity.list as normal using IPv4 #Add dummy domain Pi-Hole.IsWorking.OK to the top of gravity.list to make ping result return a friendlier looking domain! echo -e "$piholeIP Pi-Hole.IsWorking.OK" > $piholeDir/$accretionDisc - $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" '{sub(/\r$/,""); print ipv4addr" "$0}' >> $piholeDir/$accretionDisc + cat $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" '{sub(/\r$/,""); print ipv4addr" "$0}' >> $piholeDir/$accretionDisc fi # Copy the file over as /etc/pihole/gravity.list so dnsmasq can use it cp $piholeDir/$accretionDisc $adList From 2625d9f7fe52fce75a19ba18964e93c99d6a9ea9 Mon Sep 17 00:00:00 2001 From: nate Date: Wed, 30 Mar 2016 20:09:19 -0500 Subject: [PATCH 14/15] Made piholeDebug.sh +x --- advanced/Scripts/piholeDebug.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 advanced/Scripts/piholeDebug.sh diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh old mode 100644 new mode 100755 From 4b0a7c22524e0a7b9af1ed92e0a90c4f21f7179b Mon Sep 17 00:00:00 2001 From: nate Date: Wed, 30 Mar 2016 20:23:24 -0500 Subject: [PATCH 15/15] Added 01-pihole.conf to be removed on uninstall regardless of removing dnsmasq --- automated install/uninstall.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index 786e8cea..44c40791 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -114,6 +114,7 @@ function removeNoPurge { $SUDO mv /etc/lighttpd/lighttpd.conf.orig /etc/lighttpd/lighttpd.conf fi fi + $SUDO rm /usr/local/bin/gravity.sh &> /dev/null $SUDO rm /usr/local/bin/chronometer.sh &> /dev/null $SUDO rm /usr/local/bin/whitelist.sh &> /dev/null @@ -123,6 +124,7 @@ function removeNoPurge { $SUDO rm /usr/local/bin/updateDashboard.sh &> /dev/null $SUDO rm /usr/local/bin/uninstall.sh &> /dev/null $SUDO rm /etc/dnsmasq.d/adList.conf &> /dev/null + $SUDO rm /etc/dnsmasq.d/01-pihole.conf &> /dev/null $SUDO rm -rf /var/log/*pihole* &> /dev/null $SUDO rm -rf /etc/pihole/ &> /dev/null $SUDO rm -rf /etc/.pihole/ &> /dev/null