summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormax.bra2016-01-13 13:49:18 +0100
committermax.bra2016-01-13 13:49:18 +0100
commit797d3c71d934d27b98f4dad610df2a225b18e244 (patch)
tree2687367cb55a1be94c0666604efb609eb4fc6871
downloadaur-797d3c71d934d27b98f4dad610df2a225b18e244.tar.gz
Initial import. Version 2.2
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD51
-rw-r--r--blacklist.txt1
-rw-r--r--configuration56
-rw-r--r--dnsmasq.complete43
-rw-r--r--dnsmasq.include3
-rw-r--r--pi-hole-standalone.install15
-rw-r--r--pi-hole.cron3
-rw-r--r--whitelist.txt1
9 files changed, 204 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..6833610bb0c9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+# Generated by mksrcinfo v8
+# Wed Jan 13 12:48:46 UTC 2016
+pkgbase = pi-hole-standalone
+ pkgdesc = The Pi-hole is an advertising-aware DNS/Web server. Arch alteration for standalone PC.
+ pkgver = 2.2
+ pkgrel = 1
+ url = https://github.com/jacobsalmela/pi-hole
+ install = pi-hole-standalone.install
+ arch = any
+ license = GPL2
+ depends = cron
+ depends = dnsmasq
+ depends = openresolv
+ conflicts = pi-hole-server
+ source = https://github.com/jacobsalmela/pi-hole/archive/v2.2.tar.gz
+ source = configuration
+ source = dnsmasq.complete
+ source = dnsmasq.include
+ source = pi-hole.cron
+ source = whitelist.txt
+ source = blacklist.txt
+ md5sums = 8387d55bc37b661827ad614701157b19
+ md5sums = 8820584b1a9e0b49edcf9c06e1195553
+ md5sums = fa485f038d577c354068410ed1159d94
+ md5sums = 1b2e808b699a6b58647641f12379f65d
+ md5sums = a2d0530954e8eb19592f686e29c24c45
+ md5sums = 534de24fb56acfd3b451cf4b1b382218
+ md5sums = 534de24fb56acfd3b451cf4b1b382218
+
+pkgname = pi-hole-standalone
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d64e03d84460
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,51 @@
+# Maintainer: max.bra <max dot bra at alice dot it>
+
+pkgname=pi-hole-standalone
+_pkgname=pi-hole
+pkgver=2.2
+pkgrel=1
+pkgdesc='The Pi-hole is an advertising-aware DNS/Web server. Arch alteration for standalone PC.'
+arch=('any')
+license=('GPL2')
+url="https://github.com/jacobsalmela/pi-hole"
+depends=('cron' 'dnsmasq' 'openresolv')
+conflicts=('pi-hole-server')
+install=$pkgname.install
+
+source=(https://github.com/jacobsalmela/$_pkgname/archive/v$pkgver.tar.gz
+ configuration
+ dnsmasq.complete
+ dnsmasq.include
+ $_pkgname.cron
+ whitelist.txt
+ blacklist.txt)
+
+md5sums=('8387d55bc37b661827ad614701157b19'
+ '8820584b1a9e0b49edcf9c06e1195553'
+ 'fa485f038d577c354068410ed1159d94'
+ '1b2e808b699a6b58647641f12379f65d'
+ 'a2d0530954e8eb19592f686e29c24c45'
+ '534de24fb56acfd3b451cf4b1b382218'
+ '534de24fb56acfd3b451cf4b1b382218')
+
+prepare() {
+ # change local ip to unusable 0.0.0.0 (ref. http://dlaa.me/blog/post/skyhole)
+ sed -i '/^function gravity_reload() {/a sed -i "s/^[0-9\\.]\\+\\s/0.0.0.0 /g" /etc/pihole/gravity.list' "$srcdir"/$_pkgname-$pkgver/gravity.sh
+
+ # modify service management
+ sed -i 's|^ sudo service dnsmasq start| systemctl start dnsmasq|' "$srcdir"/$_pkgname-$pkgver/gravity.sh
+}
+
+package() {
+ cd "$srcdir"
+ install -Dm755 ./$_pkgname-$pkgver/gravity.sh "$pkgdir"/usr/bin/gravity.sh || return 1
+ install -Dm755 $_pkgname.cron "$pkgdir"/etc/cron.weekly/$_pkgname || return 1
+ install -dm777 "$pkgdir"/etc/pihole
+ install -dm755 "$pkgdir"/etc/pihole/configs
+ install -Dm644 whitelist.txt "$pkgdir"/etc/pihole/whitelist.txt || return 1
+ install -Dm644 blacklist.txt "$pkgdir"/etc/pihole/blacklist.txt || return 1
+ install -Dm644 dnsmasq.complete "$pkgdir"/etc/pihole/configs/dnsmasq.complete || return 1
+ install -Dm644 dnsmasq.include "$pkgdir"/etc/pihole/configs/dnsmasq.include || return 1
+ install -Dm644 configuration "$pkgdir"/usr/share/doc/pihole/configuration || return 1
+}
+
diff --git a/blacklist.txt b/blacklist.txt
new file mode 100644
index 000000000000..ba4561648acb
--- /dev/null
+++ b/blacklist.txt
@@ -0,0 +1 @@
+# one domain per line
diff --git a/configuration b/configuration
new file mode 100644
index 000000000000..b088d7383c8e
--- /dev/null
+++ b/configuration
@@ -0,0 +1,56 @@
+Pi-hole Archlinux configuration instructions
+Standalone version
+rev. 0.1
+
+Instructions below assume ArchLinux default system config files are untouched
+
+
+1) edit your /etc/resolvconf.conf and uncomment name_servers line (last line), update resolvconf:
+
+# sed -i 's|#name_servers=127.0.0.1|name_servers=127.0.0.1|' /etc/resolvconf.conf
+# resolvconf -u
+
+
+
+*** if you already use dnsmasq and it's functional
+
+2) copy pi-hole include config lines in right place
+
+# mkdir /etc/dnsmasq.d
+# cp /etc/pihole/configs/dnsmasq.include /etc/dnsmasq.d/pihole.conf
+
+3) edit your /etc/dnsmasq.conf to uncomment last line (including new pi-hole config lines)
+
+# sed -i 's|#conf-dir=/etc/dnsmasq.d/,\*.conf|conf-dir=/etc/dnsmasq.d/,\*.conf|' /etc/dnsmasq.conf
+
+*** end if
+
+
+
+*** if you installed dnsmasq with this package for the first time
+
+4) backup original dnsmasq config file and copy pi-hole one
+
+# cp /etc/dnsmasq.conf /etc/dnsmasq.orig
+# cp /etc/pihole/configs/dnsmasq.complete /etc/dnsmasq.conf
+
+*** end if
+
+
+
+5) enable and start dnsmasq service
+
+# systemctl enable dnsmasq.service
+# systemctl restart dnsmasq.service
+
+
+
+UNINSTALL steps
+
+# systemctl stop dnsmasq.service
+# systemctl disable dnsmasq.service
+# sed -i 's|name_servers=127.0.0.1|#name_servers=127.0.0.1|' /etc/resolvconf.conf
+# resolvconf -u
+# [ -f /etc/dnsmasq.d/pihole.conf ] && rm /etc/dnsmasq.d/pihole.conf
+# [ -f /etc/dnsmasq.orig ] && cp /etc/dnsmasq.orig /etc/dnsmasq.conf
+
diff --git a/dnsmasq.complete b/dnsmasq.complete
new file mode 100644
index 000000000000..e520fc63b25c
--- /dev/null
+++ b/dnsmasq.complete
@@ -0,0 +1,43 @@
+# If you want dnsmasq to read another file, as well as /etc/hosts, use
+# this.
+addn-hosts=/etc/pihole/gravity.list
+
+# The following two options make you a better netizen, since they
+# tell dnsmasq to filter out queries which the public DNS cannot
+# answer, and which load the servers (especially the root servers)
+# unnecessarily. If you have a dial-on-demand link they also stop
+# these requests from bringing up the link unnecessarily.
+
+# Never forward plain names (without a dot or domain part)
+domain-needed
+# Never forward addresses in the non-routed address spaces.
+bogus-priv
+
+# If you don't want dnsmasq to read /etc/resolv.conf or any other
+# file, getting its servers from this file instead (see below), then
+# uncomment this.
+no-resolv
+
+# Add other name servers here, with domain specs if they are for
+# non-public domains.
+server=8.8.8.8
+server=8.8.4.4
+
+# If you want dnsmasq to listen for DHCP and DNS requests only on
+# specified interfaces (and the loopback) give the name of the
+# interface (eg eth0) here.
+#interface=eth0
+# Or which to listen on by address (remember to include 127.0.0.1 if
+# you use this.)
+listen-address=127.0.0.1
+
+# Set the cachesize here.
+cache-size=10000
+
+# Normally responses which come from /etc/hosts and the DHCP lease
+# file have Time-To-Live set as zero, which conventionally means
+# do not cache further. If you are happy to trade lower load on the
+# server for potentially stale date, you can set a time-to-live (in
+# seconds) here.
+local-ttl=300
+
diff --git a/dnsmasq.include b/dnsmasq.include
new file mode 100644
index 000000000000..e37487f7cb79
--- /dev/null
+++ b/dnsmasq.include
@@ -0,0 +1,3 @@
+addn-hosts=/etc/pihole/gravity.list
+cache-size=10000
+
diff --git a/pi-hole-standalone.install b/pi-hole-standalone.install
new file mode 100644
index 000000000000..eeda1d717c98
--- /dev/null
+++ b/pi-hole-standalone.install
@@ -0,0 +1,15 @@
+post_install() {
+ cat <<- EOF
+ ==> please read configuration instructions at /usr/share/doc/pihole/configuration
+ ==> first install/update run...
+EOF
+ /usr/bin/gravity.sh > /dev/null
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ rm -R /etc/pihole/
+}
diff --git a/pi-hole.cron b/pi-hole.cron
new file mode 100644
index 000000000000..d909b7ffccd1
--- /dev/null
+++ b/pi-hole.cron
@@ -0,0 +1,3 @@
+#!/bin/bash
+/usr/bin/gravity.sh > /dev/null
+
diff --git a/whitelist.txt b/whitelist.txt
new file mode 100644
index 000000000000..ba4561648acb
--- /dev/null
+++ b/whitelist.txt
@@ -0,0 +1 @@
+# one domain per line