1
0
mirror of https://github.com/moparisthebest/pi-hole synced 2024-12-21 14:48:50 -05:00

preparing files for merge and for testing automated install

I haven't merged anything before, so hopefully, I won't mess it up too
bad!
This commit is contained in:
jacobsalmela 2015-06-16 11:15:15 -05:00
parent 655a584941
commit fd2b24f2a0
7 changed files with 53 additions and 22 deletions

View File

@ -15,13 +15,13 @@ On a clean installation of Raspbian, you can run this command to **auto-install
```curl -s "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/automated%20install/basic-install.sh" | bash```
## Gravity
The [gravity.sh](https://github.com/jacobsalmela/pi-hole/blob/master/gravity.sh) does most of the magic. The script pulls in ad domains from many sources and compiles them into a single list of [over 900,000 entries](http://jacobsalmela.com/blocking-ads-from-120000-domains/).
### How It Works
A technical and detailed description can be found [here](http://jacobsalmela.com/block-millions-ads-network-wide-with-a-raspberry-pi-hole-2-0)!
The [gravity.sh](https://github.com/jacobsalmela/pi-hole/blob/master/gravity.sh) does most of the magic. The script pulls in ad domains from many sources and compiles them into a single list of [over 900,000 entries](http://jacobsalmela.com/block-millions-ads-network-wide-with-a-raspberry-pi-hole-2-0).
## Whitelist and blacklist
You can add a `whitelist.txt` or `blacklist.txt` in `/etc/pihole/` and the script will apply those files automatically.
### How It Works
A technical and detailed description can be found [here](http://jacobsalmela.com/block-millions-ads-network-wide-with-a-raspberry-pi-hole-2-0)!
## Other Operating Systems
This script will work for other UNIX-like systems with some slight **modifications**. As long as you can install `dnsmasq` and a Webserver, it should work OK. The automated install only works for a clean install of Raspiban right now since that is how the project originated.

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Infinite loop that can be used to display ad domains on a Pi touch screen
# It will continually display ads that are blocked in real time on the screen
# Continually watch the log file and display ad domains that are blocked being blocked
# Set the pi user to log in automatically and add run this script from .bashrc
clear
echo ""
@ -13,10 +13,7 @@ echo " Internet Ads "
echo ""
echo " http://pi-hole.net"
echo ""
echo " Pi-hole IP: $(ifconfig eth0 | awk '/inet addr/ {print $2}' | cut -d':' -f2)"
echo ""
echo "Ads blocked will show up once"
echo "you set your DNS server."
echo ""
echo " $(ifconfig eth0 | awk '/inet addr/ {print $2}' | cut -d':' -f2)"
sleep 7
# Look for only the entries that contain /etc/hosts, indicating the domain was found to be an advertisement
tail -f /var/log/daemon.log | awk '/\/etc\/hosts/ {if ($7 != "address" && $7 != "name" && $7 != "/etc/hosts") print $7; else;}'

View File

@ -1,5 +1,4 @@
<html>
<body>
<div style="height:1px; width:1px;"><img src="25Bytes.gif" height="1" width="1"></img></div>
</body>
</html>

View File

@ -1,13 +1,10 @@
server.modules = (
"mod_expire",
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_auth",
"mod_rewrite"
)
server.document-root = "/var/www"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
@ -15,26 +12,26 @@ server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
# default listening port for IPv6 falls back to the IPv4 port
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"
# Set access to 1 day for better query performance when the list gets so large
# http://jacobsalmela.com/raspberry-pi-block-ads-adtrap/#comment-2013820434
$HTTP["url"] =~ "^/pihole/" {
expire.url = ("" => "access plus 1 days")
}
# Rewrites all URLs to the /var/www/pihole/index.html
$HTTP["host"] =~ ".*" {
url.rewrite = (".*" => "pihole/index.html")

View File

@ -53,7 +53,7 @@ sudo curl -o /var/www/pihole/index.html "https://raw.githubusercontent.com/jacob
echo "Locating the Pi-hole..."
sudo curl -o /usr/local/bin/gravity.sh "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/gravity.sh"
sudo curl -o /usr/local/bin/chronometer.sh "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/chronometer.sh"
sudo curl -o /usr/local/bin/chronometer.sh "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/scripts/chronometer.sh"
sudo chmod 755 /usr/local/bin/gravity.sh
sudo chmod 755 /usr/local/bin/chronometer.sh

View File

@ -0,0 +1,32 @@
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_rewrite"
)
server.document-root = "/var/www"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
# default listening port for IPv6 falls back to the IPv4 port
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" {
url.redirect = ( ".*" => "http://192.168.1.101:8200/MediaItems/19.mov")
}

View File

@ -0,0 +1,6 @@
media_dir=V,/var/lib/minidlna/videos/
port=8200
friendly_name=pihole
serial=12345678
model_number=1
inotify=yes