diff options
author | max.bra | 2017-07-05 23:24:47 +0200 |
---|---|---|
committer | max.bra | 2017-07-05 23:24:47 +0200 |
commit | 98427f15154ba32666839292b7cb161c23df41de (patch) | |
tree | c3fb7e6d73a0277aef764d0682b5bd7887e08a27 | |
parent | 550b58ef389d0821b28c2e0b24982d7a96f4d170 (diff) | |
download | aur-98427f15154ba32666839292b7cb161c23df41de.tar.gz |
alignment with server package
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | PKGBUILD | 26 | ||||
-rw-r--r-- | blacklist.txt | 0 | ||||
-rw-r--r-- | configuration | 64 | ||||
-rw-r--r-- | dnsmasq.include | 3 | ||||
-rw-r--r-- | pi-hole-standalone.install | 31 | ||||
-rw-r--r-- | whitelist.txt | 0 |
7 files changed, 32 insertions, 103 deletions
@@ -1,7 +1,7 @@ pkgbase = pi-hole-standalone pkgdesc = The Pi-hole is an advertising-aware DNS/Web server. Arch alteration for standalone PC. pkgver = 3.1 - pkgrel = 1 + pkgrel = 2 url = https://github.com/pi-hole/pi-hole install = pi-hole-standalone.install arch = any @@ -12,23 +12,18 @@ pkgbase = pi-hole-standalone conflicts = pi-hole-server backup = etc/pihole/whitelist.txt backup = etc/pihole/blacklist.txt + backup = etc/dnsmasq.d/01-pihole.conf source = https://github.com/pi-hole/pi-hole/archive/v3.1.tar.gz - source = configuration source = dnsmasq.main source = dnsmasq.include source = pi-hole-gravity.service source = pi-hole-gravity.timer - source = whitelist.txt - source = blacklist.txt source = mimic_setupVars.conf.sh md5sums = e24ce6a12ee97cd7de2c5ab13af99511 - md5sums = 630a24a3ca258005d11c4a59659f76ed md5sums = b955136ef15be29a468e8d9f85f24b8c - md5sums = 796a8c6321e671af80fe884948e466f1 + md5sums = 0bab89977a2d4357ec8befb4ff85ee3d md5sums = 047f13d4ac97877f724f87b002aaee63 md5sums = d42a864f88299998f8233c0bc0dd093d - md5sums = d41d8cd98f00b204e9800998ecf8427e - md5sums = d41d8cd98f00b204e9800998ecf8427e md5sums = e3bb1980b565e4d504e0235353f2b2dc pkgname = pi-hole-standalone @@ -3,7 +3,7 @@ pkgname=pi-hole-standalone _pkgname=pi-hole pkgver=3.1 -pkgrel=1 +pkgrel=2 pkgdesc='The Pi-hole is an advertising-aware DNS/Web server. Arch alteration for standalone PC.' arch=('any') license=('EUPL-1.1') @@ -11,26 +11,21 @@ url="https://github.com/pi-hole/pi-hole" depends=('dnsmasq' 'openresolv' 'net-tools') conflicts=('pi-hole-server') install=$pkgname.install -backup=('etc/pihole/whitelist.txt' 'etc/pihole/blacklist.txt') +backup=('etc/pihole/whitelist.txt' 'etc/pihole/blacklist.txt' +'etc/dnsmasq.d/01-pihole.conf') source=(https://github.com/$_pkgname/$_pkgname/archive/v$pkgver.tar.gz - configuration dnsmasq.main dnsmasq.include $_pkgname-gravity.service $_pkgname-gravity.timer - whitelist.txt - blacklist.txt mimic_setupVars.conf.sh) md5sums=('e24ce6a12ee97cd7de2c5ab13af99511' - '630a24a3ca258005d11c4a59659f76ed' 'b955136ef15be29a468e8d9f85f24b8c' - '796a8c6321e671af80fe884948e466f1' + '0bab89977a2d4357ec8befb4ff85ee3d' '047f13d4ac97877f724f87b002aaee63' 'd42a864f88299998f8233c0bc0dd093d' - 'd41d8cd98f00b204e9800998ecf8427e' - 'd41d8cd98f00b204e9800998ecf8427e' 'e3bb1980b565e4d504e0235353f2b2dc') prepare() { @@ -180,15 +175,14 @@ package() { install -dm755 "$pkgdir/usr/lib/systemd/system/multi-user.target.wants" install -Dm644 "$_pkgname-gravity.timer" "$pkgdir/usr/lib/systemd/system/$_pkgname-gravity.timer" install -Dm644 "$_pkgname-gravity.service" $pkgdir/usr/lib/systemd/system/$_pkgname-gravity.service - ln -s ../$_pkgname-gravity.timer "$pkgdir/usr/lib/systemd/system/multi-user.target.wants/$_pkgname-gravity.timer" + ln -s $_pkgname-gravity.timer "$pkgdir/usr/lib/systemd/system/multi-user.target.wants/$_pkgname-gravity.timer" - install -dm777 "$pkgdir"/etc/pihole - install -dm755 "$pkgdir"/etc/pihole/configs + install -dm755 "$pkgdir"/etc/pihole + install -dm755 "$pkgdir"/usr/share/pihole/configs install -Dm644 $_pkgname-$pkgver/adlists.default "$pkgdir"/etc/pihole/adlists.default - install -Dm644 whitelist.txt "$pkgdir"/etc/pihole/whitelist.txt - install -Dm644 blacklist.txt "$pkgdir"/etc/pihole/blacklist.txt - install -Dm644 dnsmasq.main "$pkgdir"/etc/pihole/configs/dnsmasq.main + install -Dm644 /dev/null "$pkgdir"/etc/pihole/whitelist.txt + install -Dm644 /dev/null "$pkgdir"/etc/pihole/blacklist.txt + install -Dm644 dnsmasq.main "$pkgdir"/usr/share/pihole/configs/dnsmasq.example.conf install -Dm644 dnsmasq.include "$pkgdir"/etc/dnsmasq.d/01-pihole.conf - install -Dm644 configuration "$pkgdir"/usr/share/doc/pihole/configuration } diff --git a/blacklist.txt b/blacklist.txt deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/blacklist.txt +++ /dev/null diff --git a/configuration b/configuration deleted file mode 100644 index 0ef56a17292d..000000000000 --- a/configuration +++ /dev/null @@ -1,64 +0,0 @@ -Pi-hole Archlinux configuration instructions -Standalone version -rev. 0.4 - -It is possible to add custom ad-list server in /etc/pihole/adlists.list - -Instructions below assume ArchLinux default system config files are untouched - - -A) First install steps - - 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) 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 - - 3) backup original dnsmasq config file and copy pi-hole one - - # cp /etc/dnsmasq.conf /etc/dnsmasq.orig - # cp /etc/pihole/configs/dnsmasq.main /etc/dnsmasq.conf - - *** end if - - - 4) enable and start dnsmasq service - - # systemctl reenable dnsmasq.service - # systemctl restart dnsmasq.service - - -B) Upgrade steps - - *** if updating you see a post install message like this: " ==> ver. -some version-: dnsmasq conf file is changed, please follow upgrade steps " - - 1) update dnsmasq conf file - - # [ -f /etc/dnsmasq.orig ] && cp /etc/pihole/configs/dnsmasq.complete /etc/dnsmasq.conf - - 2) manage and restart dnsmasq service - - # systemctl reenable dnsmasq.service - # systemctl restart dnsmasq.service - - *** end if - - -C) 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.orig ] && cp /etc/dnsmasq.orig /etc/dnsmasq.conf - diff --git a/dnsmasq.include b/dnsmasq.include index 8dc7584136f3..60672ad5377f 100644 --- a/dnsmasq.include +++ b/dnsmasq.include @@ -22,8 +22,9 @@ addn-hosts=/etc/pihole/gravity.list addn-hosts=/etc/pihole/local.list +addn-hosts=/etc/pihole/black.list domain-needed +localise-queries bogus-priv no-resolv cache-size=10000 - diff --git a/pi-hole-standalone.install b/pi-hole-standalone.install index a9512ee1d5a3..49f11bfb792f 100644 --- a/pi-hole-standalone.install +++ b/pi-hole-standalone.install @@ -1,25 +1,28 @@ post_install() { - echo -e "\e[1;33m==>\e[0m Please read configuration instructions at /usr/share/doc/pihole/configuration" - echo -e "\e[1;33m==>\e[0m or ArchWiki page at \e[1;36mhttps://wiki.archlinux.org/index.php/Pi-hole\e[0m" -# echo -e "\e[1;33m==>\e[0m Pay attention: this package now manage all dnsmasq.d include files" -# echo -e "\e[1;33m==>\e[0m Please follow configuration upgrade steps" - echo -e "\e[1;33m==>\e[0m Neutrino emissions detected..." - touch /etc/dnsmasq.d/02-pihole-dhcp.conf - touch /etc/dnsmasq.d/03-pihole-wildcard.conf + echo -e "\e[1;33m==>\e[0m Read setup instructions at \e[1;36mhttps://wiki.archlinux.org/index.php/Pi-hole\e[0m" + echo -e "\e[1;33m==>\e[0m Generating initial block list, please wait...\e[0m" + chown -R http:http /srv/http/pihole /opt/pihole/mimic_setupVars.conf.sh - /usr/bin/pihole updateGravity > /dev/null - /usr/bin/pihole -a setdns 8.8.8.8 8.8.4.4 > /dev/null + + # update lists on first run + pihole -g > /dev/null + + # setup dns server which by definition modifies /etc/dnsmasq.d/01-pihole.conf + # and thus protects it from getting overwritten by package updates + /usr/bin/pihole -a setdns 8.8.8.8,8.8.4.4 > /dev/null } post_upgrade() { + # clean old/unused/deprecated files [ -e /etc/pihole/hosts ] && rm /etc/pihole/hosts [ -e /etc/pihole/.useIPv6 ] && rm /etc/pihole/.useIPv6 - post_install $1 + + # keep pacman from throwing errors should none them be on the filesystem + return 0 } post_remove() { - rm -R /etc/pihole/ - [ -e /run/log/pihole.log ] && rm /run/log/pihole.log - [ -e /etc/dnsmasq.d/02-pihole-dhcp.conf ] && rm /etc/dnsmasq.d/02-pihole-dhcp.conf - [ -e /etc/dnsmasq.d/03-pihole-wildcard.conf ] && rm /etc/dnsmasq.d/03-pihole-wildcard.conf + # delete all temp files except those modified the user + # TODO - make this more intelligent to save *.pacsave.# where # is a number + find /etc/pihole -type f ! -name '*.pacsave' -delete } diff --git a/whitelist.txt b/whitelist.txt deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/whitelist.txt +++ /dev/null |