From aa1d3a4c2ea3f490e5079a5d19bb21ef8fdd0c51 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Mon, 1 Feb 2016 22:19:17 +0000 Subject: [PATCH 01/10] Fix logic in versionCheckDNSmasq, as dnsmasq.conf was being overwritten every time install was run. Fixes @kmr2319 's concern in #98 --- automated install/basic-install.sh | 62 ++++++++++++++++-------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 3992665d..f3221743 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -303,35 +303,39 @@ setDNS(){ } versionCheckDNSmasq(){ - # Check if /etc/dnsmasq.conf is from pihole. If so replace with an original and install new in .d directory - dnsFile1="/etc/dnsmasq.conf" - dnsFile2="/etc/dnsmasq.conf.orig" - dnsSearch="addn-hosts=/etc/pihole/gravity.list" - - # Check if /etc/dnsmasq.conf exists - if [ -d "/etc/dnsmasq.conf" ]; then - # If true, Check dnsmasq.conf for pihole magic - if grep -q $dnsSearch $dnsFile1; then - # If true, Check dnsmasq.conf.orig for pihole magic - if grep -q $dnsSearch $dnsFile2; then - # If true, use advanced/dnsmasq.conf.original - $SUDO mv -f /etc/dnsmasq.conf /etc/dnsmasq.conf.orig - $SUDO cp /etc/.pihole/advanced/dnsmasq.conf.original /etc/dnsmasq.conf - else - # If false, mv original file back - $SUDO mv -f /etc/dnsmasq.conf.orig /etc/dnsmasq.conf - fi - # If false, This is a fresh install - fi - else - # If false, use advanced/dnsmasq.conf.original - $SUDO cp /etc/.pihole/advanced/dnsmasq.conf.original /etc/dnsmasq.conf - fi - - $SUDO cp /etc/.pihole/advanced/01-pihole.conf /etc/dnsmasq.d/01-pihole.conf - $SUDO sed -i "s/@INT@/$piholeInterface/" /etc/dnsmasq.d/01-pihole.conf - $SUDO sed -i "s/@DNS1@/$piholeDNS1/" /etc/dnsmasq.d/01-pihole.conf - $SUDO sed -i "s/@DNS2@/$piholeDNS2/" /etc/dnsmasq.d/01-pihole.conf + # Check if /etc/dnsmasq.conf is from pihole. If so replace with an original and install new in .d directory + dnsFile1="/etc/dnsmasq.conf" + dnsFile2="/etc/dnsmasq.conf.orig" + dnsSearch="addn-hosts=/etc/pihole/gravity.list" + + defaultFile="/etc/.pihole/advanced/dnsmasq.conf.original" + newFileToInstall="/etc/.pihole/advanced/01-pihole.conf" + newFileFinalLocation="/etc/dnsmasq.d/01-pihole.conf" + + if [ -f $dnsFile1 ]; then + echo -n "::: Existing dnsmasq.conf found..." + if grep -q $dnsSearch $dnsFile1; then + echo " it is from a previous pi-hole install." + echo -n "::: Backing up dnsmasq.conf to dnsmasq.conf.orig..." + $SUDO mv -f $dnsFile1 $dnsFile2 + echo " done." + echo -n "::: Restoring default dnsmasq.conf..." + $SUDO cp $defaultFile $dnsFile1 + echo " done." + else + echo " it is not a pi-hole file, leaving alone!" + fi + else + echo -n "::: No dnsmasq.conf found.. restoring default dnsmasq.conf..." + $SUDO cp $defaultFile $dnsFile1 + echo " done." + fi + + echo "::: copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf" + $SUDO cp $newFileToInstall $newFileFinalLocation + $SUDO sed -i "s/@INT@/$piholeInterface/" $newFileFinalLocation + $SUDO sed -i "s/@DNS1@/$piholeDNS1/" $newFileFinalLocation + $SUDO sed -i "s/@DNS2@/$piholeDNS2/" $newFileFinalLocation } installScripts() { From 06cba7defdae776b8bacaf7b3c96f50066a66b45 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Mon, 1 Feb 2016 22:25:28 +0000 Subject: [PATCH 02/10] Fix script output around new changes --- automated install/basic-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 516b145d..099cf01c 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -331,8 +331,9 @@ versionCheckDNSmasq(){ echo " done." fi - echo "::: copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf" + echo "::: Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf..." $SUDO cp $newFileToInstall $newFileFinalLocation + echo " done." $SUDO sed -i "s/@INT@/$piholeInterface/" $newFileFinalLocation $SUDO sed -i "s/@DNS1@/$piholeDNS1/" $newFileFinalLocation $SUDO sed -i "s/@DNS2@/$piholeDNS2/" $newFileFinalLocation @@ -355,11 +356,10 @@ installScripts() { installConfigs() { # Install the configs from /etc/.pihole to their various locations $SUDO echo ":::" - $SUDO echo -n "::: Installing configs..." + $SUDO echo "::: Installing configs..." versionCheckDNSmasq $SUDO mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig $SUDO cp /etc/.pihole/advanced/lighttpd.conf /etc/lighttpd/lighttpd.conf - $SUDO echo " done." } stopServices() { From c93c4cc5e61c737a4dc76b79e6eea499506b7c1b Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 1 Feb 2016 22:28:35 +0000 Subject: [PATCH 03/10] Update basic-install.sh ahem --- 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 099cf01c..11bdf0c5 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -331,7 +331,7 @@ versionCheckDNSmasq(){ echo " done." fi - echo "::: Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf..." + echo -n "::: Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf..." $SUDO cp $newFileToInstall $newFileFinalLocation echo " done." $SUDO sed -i "s/@INT@/$piholeInterface/" $newFileFinalLocation From 8a90a47fc286ce036b2fbbff17081ea080dea8ea Mon Sep 17 00:00:00 2001 From: CDeeRON Date: Tue, 2 Feb 2016 12:20:30 -0500 Subject: [PATCH 04/10] ATV Hulu domain add added ads-e-darwin.hulu.com which I found to be used when serving ADs on ATV. --- block hulu ads/lighttpd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block hulu ads/lighttpd.conf b/block hulu ads/lighttpd.conf index 9e8d1f80..636fd07d 100644 --- a/block hulu ads/lighttpd.conf +++ b/block hulu ads/lighttpd.conf @@ -38,6 +38,6 @@ include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port include_shell "/usr/share/lighttpd/create-mime.assign.pl" include_shell "/usr/share/lighttpd/include-conf-enabled.pl" -$HTTP["host"] =~ "ads.hulu.com|ads-v-darwin.hulu.com" { +$HTTP["host"] =~ "ads.hulu.com|ads-v-darwin.hulu.com|ads-e-darwin.hulu.com" { url.redirect = ( ".*" => "http://192.168.1.101:8200/MediaItems/19.mov") } From 3bf61cce95447a17f103a2dc06d2761d554c03cc Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Wed, 3 Feb 2016 10:53:23 -0800 Subject: [PATCH 05/10] Add alternative installation method Add installation method for non-pipe installs --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index a0bf4cc3..b51b2201 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,13 @@ ### ```curl -L install.pi-hole.net | bash``` +#### Alternative Semi-Automated install #### +``` +wget -O basic-install.sh install.pi-hole.net +chmod +x basic-install.sh +./basic-install.sh +``` + Once installed, [configure your router to have **DHCP clients use the Pi as their DNS server**](http://pi-hole.net/faq/can-i-set-the-pi-hole-to-be-the-dns-server-at-my-router-so-i-dont-have-to-change-settings-for-my-devices/) and then any device that connects to your network will have ads blocked without any further configuration. Alternatively, you can manually set each device to [use the Raspberry Pi as its DNS server](http://pi-hole.net/faq/how-do-i-use-the-pi-hole-as-my-dns-server/). ## Pi-hole Is Free, But Powered By Your Donations From c18a1c3ecabdfbaa7aaf67091fb05d426c602002 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 4 Feb 2016 01:17:00 -0800 Subject: [PATCH 06/10] Add A+ to Raspberry Pi Platforms A+ Supported --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b51b2201..7e938834 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Automated Install -##### Designed For Raspberry Pi B, B+, 2, and Zero (with an Ethernet adapter) +##### Designed For Raspberry Pi A+, B, B+, 2, and Zero (with an Ethernet adapter) 1. Install Raspbian 2. Run the command below From 8e6ec6ef0ca323964d9cb89f0069c2d18dc00cd5 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Fri, 5 Feb 2016 15:50:15 +0000 Subject: [PATCH 07/10] Create CONTRIBUTING.md Initial commit. Basic list, could probably do with some work.... --- CONTRIBUTING.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..8fac7c45 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,6 @@ +This is a basic checklist for now, We will update it in future. + +* Fork the repo and create your new branch based on the `development` branch. +* Submit Pull Requests to the development branch only. +* Before Submitting your Pull Request, merge `development` with your new branch and fix any conflicts. (Make sure you don't break anything in development!) +* Be patient. We will review all submitted pull requests, but our focus is on stability.. please don't be offended if we reject your PR, or it appears we're doing nothing with it! We'll get around to it.. From 282da1c2b642472d280f3e7f0599fc2549e9beeb Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Fri, 5 Feb 2016 12:22:23 -0500 Subject: [PATCH 08/10] Add to contributor info --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8fac7c45..1313f599 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,8 @@ -This is a basic checklist for now, We will update it in future. +This is a basic checklist for now, We will update it in the future. * Fork the repo and create your new branch based on the `development` branch. +* Commit Unix line endings +* If you want, try to keep to the theme of black holes/gravity. This can add some fun to your submission. * Submit Pull Requests to the development branch only. * Before Submitting your Pull Request, merge `development` with your new branch and fix any conflicts. (Make sure you don't break anything in development!) * Be patient. We will review all submitted pull requests, but our focus is on stability.. please don't be offended if we reject your PR, or it appears we're doing nothing with it! We'll get around to it.. From beb6b950f7580a7ca7a1c3ba2354968b26f8bbf0 Mon Sep 17 00:00:00 2001 From: Sergio G Date: Mon, 8 Feb 2016 22:26:41 +0100 Subject: [PATCH 09/10] Replaced 'sudo' with --- 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 11bdf0c5..abb47886 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -393,7 +393,7 @@ checkForDependencies() { fi echo ":::" echo -n "::: Checking apt-get for upgraded packages...." - updatesToInstall=$(sudo apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst) + updatesToInstall=$($SUDO apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst) echo " done!" echo ":::" if [[ $updatesToInstall -eq "0" ]]; then From b2fbf46e605c6f316a9e759a6694f23a8332393e Mon Sep 17 00:00:00 2001 From: Promofaux Date: Tue, 9 Feb 2016 20:43:45 +0000 Subject: [PATCH 10/10] Added more adlists to the defaults. By default we now block ~ 155,600 ad and tracker domains. Includes NoTrack's tracker list. --- adlists.default | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/adlists.default b/adlists.default index dd391357..c2385f7e 100644 --- a/adlists.default +++ b/adlists.default @@ -6,3 +6,12 @@ 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 +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 +