diff options
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 7 | ||||
-rw-r--r-- | dnsmasq.local | 5 | ||||
-rw-r--r-- | pi-hole-server.install | 58 |
4 files changed, 5 insertions, 72 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Wed Jul 5 09:40:49 UTC 2017 +# Wed Jul 5 10:00:25 UTC 2017 pkgbase = pi-hole-server pkgdesc = The Pi-hole is an advertising-aware DNS/Web server. Arch adaptation for lan wide DNS server. pkgver = 3.1 - pkgrel = 11 + pkgrel = 12 url = https://github.com/pi-hole/pi-hole install = pi-hole-server.install arch = any @@ -22,13 +22,11 @@ pkgbase = pi-hole-server backup = etc/pihole/whitelist.txt backup = etc/pihole/blacklist.txt backup = etc/dnsmasq.d/01-pihole.conf - backup = etc/dnsmasq.d/02-pihole.conf source = pihole-3.1.tar.gz::https://github.com/pi-hole/pi-hole/archive/v3.1.tar.gz source = admin-3.1.tar.gz::https://github.com/pi-hole/AdminLTE/archive/v3.1.tar.gz source = configuration source = dnsmasq.main source = dnsmasq.include - source = dnsmasq.local source = lighttpd.conf source = nginx.pi-hole.conf source = pi-hole.tmpfile @@ -43,7 +41,6 @@ pkgbase = pi-hole-server md5sums = 3acf27ca01d931db363634dbfc95a061 md5sums = 3f1aeea43af0b192edb36b9e5484ff87 md5sums = 7ac346581ada71187b7fd18f164bbee9 - md5sums = 2d10140f19f54015e6ab2807267e8aaf md5sums = a8a64dc2ff89bb87d534c83189447abc md5sums = 9618204d16333873136e65f886db2ab3 md5sums = 990b8abd0bfbba23a7ce82c59f2e3d64 @@ -4,7 +4,7 @@ pkgname=pi-hole-server _pkgname=pi-hole pkgver=3.1 -pkgrel=11 +pkgrel=12 _wwwpkgname=AdminLTE _wwwpkgver=3.1 pkgdesc='The Pi-hole is an advertising-aware DNS/Web server. Arch adaptation for lan wide DNS server.' @@ -21,14 +21,13 @@ optdepends=( conflicts=('pi-hole-standalone') install=$pkgname.install backup=('etc/pihole/whitelist.txt' 'etc/pihole/blacklist.txt' -'etc/dnsmasq.d/01-pihole.conf' 'etc/dnsmasq.d/02-pihole.conf') +'etc/dnsmasq.d/01-pihole.conf') source=(pihole-$pkgver.tar.gz::https://github.com/$_pkgname/$_pkgname/archive/v$pkgver.tar.gz admin-$_wwwpkgver.tar.gz::https://github.com/$_pkgname/$_wwwpkgname/archive/v$_wwwpkgver.tar.gz configuration dnsmasq.main dnsmasq.include - dnsmasq.local lighttpd.conf nginx.pi-hole.conf $_pkgname.tmpfile @@ -44,7 +43,6 @@ md5sums=('e24ce6a12ee97cd7de2c5ab13af99511' '3acf27ca01d931db363634dbfc95a061' '3f1aeea43af0b192edb36b9e5484ff87' '7ac346581ada71187b7fd18f164bbee9' - '2d10140f19f54015e6ab2807267e8aaf' 'a8a64dc2ff89bb87d534c83189447abc' '9618204d16333873136e65f886db2ab3' '990b8abd0bfbba23a7ce82c59f2e3d64' @@ -301,7 +299,6 @@ package() { install -Dm644 configuration "$pkgdir"/usr/share/pihole/doc/configuration 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 dnsmasq.local "$pkgdir"/etc/dnsmasq.d/02-pihole.conf install -Dm644 lighttpd.conf "$pkgdir"/usr/share/pihole/configs/lighttpd.example.conf install -Dm644 nginx.pi-hole.conf "$pkgdir"/usr/share/pihole/configs/nginx.example.conf diff --git a/dnsmasq.local b/dnsmasq.local deleted file mode 100644 index 9303809460c1..000000000000 --- a/dnsmasq.local +++ /dev/null @@ -1,5 +0,0 @@ -address=/pi.hole/@IPv4@ -address=/pi.hole/@IPv6@ - -address=/@HOSTNAME@/@IPv4@ -address=/@HOSTNAME@/@IPv6@ diff --git a/pi-hole-server.install b/pi-hole-server.install index e778c69f434a..544ede6fad76 100644 --- a/pi-hole-server.install +++ b/pi-hole-server.install @@ -4,10 +4,6 @@ post_install() { chown -R http:http /srv/http/pihole /opt/pihole/mimic_setupVars.conf.sh - # sed magic to setup /etc/dnsmasq.d/02-pihole.conf and thus protect it from - # getting overwritten by package updates - _dnsmasq_address_setup - # update lists on first run pihole -g > /dev/null @@ -21,26 +17,7 @@ post_upgrade() { [ -e /etc/pihole/hosts ] && rm /etc/pihole/hosts [ -e /etc/pihole/.useIPv6 ] && rm /etc/pihole/.useIPv6 - # if we run _dnsmasq_address_setup now and if the user has modified - # /etc/dnsmasq.d/02-pihole.conf it will be overwritten - # - # pacman will install the sed magic version of this file as - # /etc/dnsmasq.d/02-pihole.pacnew which we do not want on the file system - # so short of changing $dnsmasq_pihole_conf in the _dnsmasq_address_setup - # function, let's just delete it in post_upgrade - # - # users will see pacman output indicating there is a pacnew but I don't - # know an elegant way to provide a script processed config file without - # installing it to a temp file and pointing the sed magic on that temp file - # yet having pacman keep it in the BACKUP array for management to keep it - # from getting overwritten on updates - [ -e /etc/dnsmasq.d/02-pihole.conf.pacnew ] && rm /etc/dnsmasq.d/02-pihole.conf.pacnew - - # maybe the KISS solution is simply not to provide - # /etc/dnsmasq.d/02-pihole.conf at all and let the user make it from the wiki - - # finally, this shouldn't be the case but keep pacman from throwing errors should - # none of the three checks be true + # keep pacman from throwing errors should none them be on the filesystem return 0 } @@ -49,36 +26,3 @@ post_remove() { # TODO - make this more intelligent to save *.pacsave.# where # is a number find /etc/pihole -type f ! -name '*.pacsave' ! -name 'pihole-FTL.conf' ! -name 'pihole-FTL.db' -delete } - -_dnsmasq_address_setup() { # official code here - . /etc/pihole/setupVars.conf - dnsmasq_pihole_conf=/etc/dnsmasq.d/02-pihole.conf - - if [[ -f /etc/hostname ]]; then - hostname=$(</etc/hostname) - elif [ -x "$(command -v hostname)" ]; then - hostname=$(hostname -f) - fi - - #Replace IPv4 and IPv6 tokens in 01-pihole.conf for pi.hole resolution. - if [[ "${IPV4_ADDRESS}" != "" ]]; then - tmp=${IPV4_ADDRESS%/*} - sed -i "s/@IPv4@/$tmp/" ${dnsmasq_pihole_conf} - else - sed -i '/^address=\/pi.hole\/@IPv4@/d' ${dnsmasq_pihole_conf} - sed -i '/^address=\/@HOSTNAME@\/@IPv4@/d' ${dnsmasq_pihole_conf} - fi - - if [[ "${IPV6_ADDRESS}" != "" ]]; then - sed -i "s/@IPv6@/$IPV6_ADDRESS/" ${dnsmasq_pihole_conf} - else - sed -i '/^address=\/pi.hole\/@IPv6@/d' ${dnsmasq_pihole_conf} - sed -i '/^address=\/@HOSTNAME@\/@IPv6@/d' ${dnsmasq_pihole_conf} - fi - - if [[ "${hostname}" != "" ]]; then - sed -i "s/@HOSTNAME@/$hostname/" ${dnsmasq_pihole_conf} - else - sed -i '/^address=\/@HOSTNAME@*/d' ${dnsmasq_pihole_conf} - fi -} |