diff options
author | max.bra | 2017-12-11 22:38:47 +0100 |
---|---|---|
committer | max.bra | 2017-12-11 22:38:47 +0100 |
commit | 3e4b5cefb79f5555f05f2f6b10a18277c92b3f70 (patch) | |
tree | 9dfd920f5b2c3fd5e3e89e72918328e9bbf1f919 | |
parent | bc3596453508eb80044f505f7c34327feb7fdffc (diff) | |
download | aur-3e4b5cefb79f5555f05f2f6b10a18277c92b3f70.tar.gz |
issue 1806 and pihole etc dir ownership
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 7 | ||||
-rw-r--r-- | lighttpd.conf | 97 | ||||
-rw-r--r-- | pi-hole-server.install | 4 |
4 files changed, 109 insertions, 3 deletions
@@ -1,7 +1,7 @@ pkgbase = pi-hole-server pkgdesc = The Pi-hole is an advertising-aware DNS/Web server. Arch adaptation for lan wide DNS server. pkgver = 3.2 - pkgrel = 1 + pkgrel = 2 url = https://github.com/pi-hole/pi-hole install = pi-hole-server.install arch = any @@ -34,6 +34,7 @@ pkgbase = pi-hole-server source = pi-hole-logtruncate.timer source = mimic_setupVars.conf.sh source = version.patch + source = https://github.com/pi-hole/pi-hole/commit/80e17ab72180f15ac4d5ff0044d4e8eafd95bc29.patch md5sums = 12b29c41a1e8e2892da2684fea566ebb md5sums = 70309212a3c77bfed2112c4f2f4f4e24 md5sums = 3f1aeea43af0b192edb36b9e5484ff87 @@ -47,6 +48,7 @@ pkgbase = pi-hole-server md5sums = 291d3c95e445fe65caf40c3605efd186 md5sums = c227ffa88ddebc34cb715b73640cd845 md5sums = 93fe5e50cf3fcb08b24cf29b0cace85b + md5sums = cc37c7f1fc27c9246b442f0464fc1886 pkgname = pi-hole-server @@ -4,7 +4,7 @@ pkgname=pi-hole-server _pkgname=pi-hole pkgver=3.2 -pkgrel=1 +pkgrel=2 _wwwpkgname=AdminLTE _wwwpkgver=3.2 pkgdesc='The Pi-hole is an advertising-aware DNS/Web server. Arch adaptation for lan wide DNS server.' @@ -36,6 +36,7 @@ source=(pihole-$pkgver.tar.gz::https://github.com/$_pkgname/$_pkgname/archive/v$ $_pkgname-logtruncate.timer mimic_setupVars.conf.sh version.patch + https://github.com/pi-hole/pi-hole/commit/80e17ab72180f15ac4d5ff0044d4e8eafd95bc29.patch ) md5sums=('12b29c41a1e8e2892da2684fea566ebb' @@ -50,7 +51,8 @@ md5sums=('12b29c41a1e8e2892da2684fea566ebb' '94d5aa0e8aa3d4170bcea71078a9da25' '291d3c95e445fe65caf40c3605efd186' 'c227ffa88ddebc34cb715b73640cd845' - '93fe5e50cf3fcb08b24cf29b0cace85b') + '93fe5e50cf3fcb08b24cf29b0cace85b' + 'cc37c7f1fc27c9246b442f0464fc1886') prepare() { _ssc="/tmp/sedcontrol" @@ -204,6 +206,7 @@ prepare() { cd "$srcdir"/"$_pkgname"-"$pkgver" patch -p1 -i "$srcdir"/version.patch + patch -p1 -i "$srcdir"/80e17ab72180f15ac4d5ff0044d4e8eafd95bc29.patch cd "$srcdir" sed -n "/{{corever}}/w $_ssc" "$srcdir"/$_pkgname-$pkgver/advanced/Scripts/version.sh diff --git a/lighttpd.conf b/lighttpd.conf new file mode 100644 index 000000000000..b3b9a18b72cd --- /dev/null +++ b/lighttpd.conf @@ -0,0 +1,97 @@ +# Pi-hole: A black hole for Internet advertisements +# (c) 2017 Pi-hole, LLC (https://pi-hole.net) +# Network-wide ad blocking via your own hardware. +# +# lighttpd config for Pi-hole +# +# This file is copyright under the latest version of the EUPL. +# Please see LICENSE file for your rights under this license. + + + +############################################################################### +# FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE. # +# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE # +# # +# CHANGES SHOULD BE MADE IN A SEPERATE CONFIG FILE: # +# /etc/lighttpd/external.conf # +############################################################################### + +server.modules = ( + "mod_access", + "mod_accesslog", + "mod_expire", + "mod_compress", + "mod_redirect", + "mod_setenv", + "mod_rewrite", + "mod_fastcgi" +) + +mimetype.assign = ( + ".html" => "text/html", + ".txt" => "text/plain", + ".css" => "text/css", + ".js" => "application/x-javascript", + ".jpg" => "image/jpeg", + ".jpeg" => "image/jpeg", + ".gif" => "image/gif", + ".png" => "image/png", + ".svg" => "image/svg+xml", # thanks to nikke + "" => "application/octet-stream" + ) + +fastcgi.server = ( + ".php" => ( + "localhost" => ( + "bin-path" => "/usr/bin/php-cgi -d session.save_path=/run/pihole", + "socket" => "/tmp/php-fastcgi.sock", + "broken-scriptfilename" => "enable", + "max-procs" => 4, + "bin-environment" => ( + "PHP_FCGI_CHILDREN" => "1" # default value + ) + ) + ) +) + +server.document-root = "/srv/http/pihole" +server.error-handler-404 = "/pihole/index.php" +server.username = "http" +server.groupname = "http" +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" ) + +# If the URL starts with /admin, it is the Web interface +$HTTP["url"] =~ "^/admin/" { + # Create a response header for debugging using curl -I + setenv.add-response-header = ( + "X-Pi-hole" => "The Pi-hole Web interface is working!", + "X-Frame-Options" => "DENY" + ) +} + +# Rewite js requests, must be out of $HTTP block due to bug #2526 +url.rewrite = ( "^(?!/admin/).*\.js$" => "pihole/index.js" ) + +# If the URL does not start with /admin, then it is a query for an ad domain +$HTTP["url"] =~ "^(?!/admin)/.*" { + # Create a response header for debugging using curl -I + setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." ) +} + +# Entering just "pi.hole" into a browser redirects to "pi.hole/admin/" +$HTTP["host"] == "pi.hole" { + $HTTP["url"] == "/" { + url.redirect = ( "" => "/admin/" ) + } +} + +# Add user chosen options held in external file +include_shell "cat external.conf 2>/dev/null" diff --git a/pi-hole-server.install b/pi-hole-server.install index e95eb7398684..439188c2752c 100644 --- a/pi-hole-server.install +++ b/pi-hole-server.install @@ -6,6 +6,7 @@ post_install() { 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 + chown -R pihole:pihole /etc/pihole /opt/pihole/mimic_setupVars.conf.sh # update lists on first run @@ -21,6 +22,9 @@ post_upgrade() { [ -e /etc/pihole/hosts ] && rm /etc/pihole/hosts [ -e /etc/pihole/.useIPv6 ] && rm /etc/pihole/.useIPv6 + # update owner of existing dir + chown -R pihole:pihole /etc/pihole + warning # keep pacman from throwing errors should none them be on the filesystem |