diff options
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 12 | ||||
-rw-r--r-- | arch-server-admin-5.2-174678982.patch | 143 | ||||
-rw-r--r-- | arch-server-admin-5.2-762241987.patch | 143 | ||||
-rw-r--r-- | arch-server-core-5.2-174678982.patch | 413 | ||||
-rw-r--r-- | arch-server-core-5.2-762241987.patch | 413 |
6 files changed, 1127 insertions, 15 deletions
@@ -1,6 +1,6 @@ pkgbase = pi-hole-server pkgdesc = The Pi-hole is an advertising-aware DNS/Web server. Arch adaptation for lan wide DNS server. - pkgver = 5.1.2 + pkgver = 5.2 pkgrel = 1 url = https://github.com/pi-hole/pi-hole install = pi-hole-server.install @@ -23,10 +23,10 @@ pkgbase = pi-hole-server backup = etc/dnsmasq.d/01-pihole.conf backup = etc/pihole/adlists.list backup = etc/dnsmasq.conf - source = pi-hole-server-core-5.1.2.tar.gz::https://github.com/pi-hole/pi-hole/archive/v5.1.2.tar.gz - source = pi-hole-server-admin-5.1.1.tar.gz::https://github.com/pi-hole/AdminLTE/archive/v5.1.1.tar.gz - source = arch-server-core-5.1.2-080184655.patch::https://raw.githubusercontent.com/max72bra/pi-hole-server-archlinux-customization/master/arch-server-core-5.1.2.patch - source = arch-server-admin-5.1.1-080184655.patch::https://raw.githubusercontent.com/max72bra/pi-hole-server-archlinux-customization/master/arch-server-admin-5.1.1.patch + source = pi-hole-server-core-5.2.tar.gz::https://github.com/pi-hole/pi-hole/archive/v5.2.tar.gz + source = pi-hole-server-admin-5.2.tar.gz::https://github.com/pi-hole/AdminLTE/archive/v5.2.tar.gz + source = arch-server-core-5.2-678162770.patch::https://raw.githubusercontent.com/max72bra/pi-hole-server-archlinux-customization/master/arch-server-core-5.2.patch + source = arch-server-admin-5.2-678162770.patch::https://raw.githubusercontent.com/max72bra/pi-hole-server-archlinux-customization/master/arch-server-admin-5.2.patch source = dnsmasq.include source = lighttpd.pi-hole.conf source = nginx.pi-hole.conf @@ -38,10 +38,10 @@ pkgbase = pi-hole-server source = mimic_setupVars.conf.sh source = mimic_basic-install.sh source = piholeDebug.sh - md5sums = 53c2e69e58b5494dfc251aca1148fee2 - md5sums = 6f550cdbe4369541978d90388a2a8e69 - md5sums = 339e27a954d78d1c6dc56a0dad7f3500 - md5sums = e36da1ca29db91f0bb5fb0d8736b3e1f + md5sums = 0c83daab89ba781840d903eefc559bb4 + md5sums = 2369f3010eb8e692f57d509f3ade77d0 + md5sums = 21d41b525f4be76c245fc9e5ac736131 + md5sums = a1e886646f5a5f721288f8eafecc288f md5sums = 62ab22d82267f30bd1a75773a1de79c8 md5sums = 971cc2859672341d77f8deba702fb7f7 md5sums = b63fcf29c29796023a2677bcf2b369a7 @@ -3,10 +3,10 @@ pkgname=pi-hole-server _pkgname=pi-hole -pkgver=5.1.2 +pkgver=5.2 pkgrel=1 _wwwpkgname=AdminLTE -_wwwpkgver=5.1.1 +_wwwpkgver=5.2 _now=`date +%N` pkgdesc='The Pi-hole is an advertising-aware DNS/Web server. Arch adaptation for lan wide DNS server.' arch=('any') @@ -41,10 +41,10 @@ source=($pkgname-core-$pkgver.tar.gz::https://github.com/$_pkgname/$_pkgname/arc piholeDebug.sh ) -md5sums=('53c2e69e58b5494dfc251aca1148fee2' - '6f550cdbe4369541978d90388a2a8e69' - '339e27a954d78d1c6dc56a0dad7f3500' - 'e36da1ca29db91f0bb5fb0d8736b3e1f' +md5sums=('0c83daab89ba781840d903eefc559bb4' + '2369f3010eb8e692f57d509f3ade77d0' + '21d41b525f4be76c245fc9e5ac736131' + 'a1e886646f5a5f721288f8eafecc288f' '62ab22d82267f30bd1a75773a1de79c8' '971cc2859672341d77f8deba702fb7f7' 'b63fcf29c29796023a2677bcf2b369a7' diff --git a/arch-server-admin-5.2-174678982.patch b/arch-server-admin-5.2-174678982.patch new file mode 100644 index 000000000000..9c209f3780a1 --- /dev/null +++ b/arch-server-admin-5.2-174678982.patch @@ -0,0 +1,143 @@ +diff -uprN AdminLTE-5.2/scripts/pi-hole/php/footer.php AdminLTE-5.2.cust/scripts/pi-hole/php/footer.php +--- AdminLTE-5.2/scripts/pi-hole/php/footer.php 2020-11-28 20:04:59.000000000 +0100 ++++ AdminLTE-5.2.cust/scripts/pi-hole/php/footer.php 2020-11-29 09:41:12.704917336 +0100 +@@ -55,9 +55,9 @@ + $webUrl = $githubBaseUrl . "/AdminLTE"; + $ftlUrl = $githubBaseUrl . "/FTL"; + +- $coreReleasesUrl = $coreUrl . "/releases"; +- $webReleasesUrl = $webUrl . "/releases"; +- $ftlReleasesUrl = $ftlUrl . "/releases"; ++ $coreReleasesUrl = "https://aur.archlinux.org/packages/pi-hole-server"; ++ $webReleasesUrl = "https://aur.archlinux.org/packages/pi-hole-server"; ++ $ftlReleasesUrl = "https://aur.archlinux.org/packages/pi-hole-ftl"; + ?> + <footer class="main-footer"> + <div class="row row-centered text-center"> +@@ -78,18 +78,18 @@ + <ul class="list-inline"> + <li> + <strong>Pi-hole</strong> +- <a href="<?php echo $coreReleasesUrl . "/" . $core_current; ?>" rel="noopener" target="_blank"><?php echo $core_current; ?></a> +- <?php if ($core_update) { ?> · <a class="lookatme" href="<?php echo $coreReleasesUrl . "/latest"; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> ++ <a href="<?php echo $coreReleasesUrl; ?>" rel="noopener" target="_blank"><?php echo $core_current; ?></a> ++ <?php if ($core_update) { ?> · <a class="lookatme" href="<?php echo $coreReleasesUrl; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> + </li> + <li> + <strong>Web Interface</strong> +- <a href="<?php echo $webReleasesUrl . "/" . $web_current; ?>" rel="noopener" target="_blank"><?php echo $web_current; ?></a> +- <?php if ($web_update) { ?> · <a class="lookatme" href="<?php echo $webReleasesUrl . "/latest"; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> ++ <a href="<?php echo $webReleasesUrl; ?>" rel="noopener" target="_blank"><?php echo $web_current; ?></a> ++ <?php if ($web_update) { ?> · <a class="lookatme" href="<?php echo $webReleasesUrl; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> + </li> + <li> + <strong>FTL</strong> +- <a href="<?php echo $ftlReleasesUrl . "/" . $FTL_current; ?>" rel="noopener" target="_blank"><?php echo $FTL_current; ?></a> +- <?php if ($FTL_update) { ?> · <a class="lookatme" href="<?php echo $ftlReleasesUrl . "/latest"; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> ++ <a href="<?php echo $ftlReleasesUrl; ?>" rel="noopener" target="_blank"><?php echo $FTL_current; ?></a> ++ <?php if ($FTL_update) { ?> · <a class="lookatme" href="<?php echo $ftlReleasesUrl; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> + </li> + </ul> + <?php } ?> +diff -uprN AdminLTE-5.2/scripts/pi-hole/php/func.php AdminLTE-5.2.cust/scripts/pi-hole/php/func.php +--- AdminLTE-5.2/scripts/pi-hole/php/func.php 2020-11-28 20:04:59.000000000 +0100 ++++ AdminLTE-5.2.cust/scripts/pi-hole/php/func.php 2020-11-29 09:41:12.706917334 +0100 +@@ -72,7 +72,7 @@ function pihole_execute($argument_string + $escaped = escapeshellcmd($argument_string); + $output = null; + $return_status = -1; +- $command = "sudo pihole " . $escaped; ++ $command = "sudo /usr/bin/pihole " . $escaped; + exec($command, $output, $return_status); + if($return_status !== 0) + { +diff -uprN AdminLTE-5.2/scripts/pi-hole/php/header.php AdminLTE-5.2.cust/scripts/pi-hole/php/header.php +--- AdminLTE-5.2/scripts/pi-hole/php/header.php 2020-11-28 20:04:59.000000000 +0100 ++++ AdminLTE-5.2.cust/scripts/pi-hole/php/header.php 2020-11-29 09:41:12.670917364 +0100 +@@ -580,12 +580,6 @@ if($auth) { + <i class="fa fa-list-ul"></i> Tail pihole-FTL.log + </a> + </li> +- <!-- Generate debug log --> +- <li<?php if($scriptname === "debug.php"){ ?> class="active"<?php } ?>> +- <a href="debug.php"> +- <i class="fa fa-ambulance"></i> Generate debug log +- </a> +- </li> + <!-- Network --> + <li<?php if($scriptname === "network.php"){ ?> class="active"<?php } ?>> + <a href="network.php"> +diff -uprN AdminLTE-5.2/scripts/pi-hole/php/tailLog.php AdminLTE-5.2.cust/scripts/pi-hole/php/tailLog.php +--- AdminLTE-5.2/scripts/pi-hole/php/tailLog.php 2020-11-28 20:04:59.000000000 +0100 ++++ AdminLTE-5.2.cust/scripts/pi-hole/php/tailLog.php 2020-11-29 09:41:12.674917361 +0100 +@@ -14,11 +14,11 @@ if(!$auth) die("Not authorized"); + // files as large as the pihole.log + if(isset($_GET["FTL"])) + { +- $file = fopen("/var/log/pihole-FTL.log","r"); ++ $file = fopen("/run/log/pihole-ftl/pihole-FTL.log","r"); + } + else + { +- $file = fopen("/var/log/pihole.log","r"); ++ $file = fopen("/run/log/pihole/pihole.log","r"); + } + + if(!$file) +diff -uprN AdminLTE-5.2/scripts/pi-hole/php/update_checker.php AdminLTE-5.2.cust/scripts/pi-hole/php/update_checker.php +--- AdminLTE-5.2/scripts/pi-hole/php/update_checker.php 2020-11-28 20:04:59.000000000 +0100 ++++ AdminLTE-5.2.cust/scripts/pi-hole/php/update_checker.php 2020-11-29 09:41:12.686917351 +0100 +@@ -7,12 +7,12 @@ $GitHubVersions = "/etc/pihole/GitHubVer + if(!is_readable($localversions) || !is_readable($localbranches) || !is_readable($GitHubVersions)) + { + $core_branch = "master"; +- $core_current = "N/A"; ++ $core_current = "5.2"; + $core_update = false; + $web_branch = "master"; +- $web_current = "N/A"; ++ $web_current = "5.2"; + $web_update = false; +- $FTL_current = "N/A"; ++ $FTL_current = exec("pihole-FTL version"); + $FTL_update = false; + } + else +@@ -25,31 +25,31 @@ else + // Check if on a dev branch + $core_branch = $branches[0]; + if($core_branch !== "master") { +- $core_current = "vDev"; ++ $core_current = "5.2"; + $core_commit = $versions[0]; + } + else { +- $core_current = explode("-",$versions[0])[0]; ++ $core_current = "5.2"; + } + + /********** Get Pi-hole web branch / version / commit **********/ + $web_branch = $branches[1]; + if($web_branch !== "master") { +- $web_current = "vDev"; ++ $web_current = "5.2"; + $web_commit = $versions[1]; + } + else { +- $web_current = explode("-",$versions[1])[0]; ++ $web_current = "5.2"; + } + + /********** Get Pi-hole FTL (not a git repository) **********/ + $FTL_branch = $branches[2]; + if(substr($versions[2], 0, 4) === "vDev") { +- $FTL_current = "vDev"; ++ $FTL_current = exec("pihole-FTL version"); + $FTL_commit = $versions[2]; + } + else { +- $FTL_current = $versions[2]; ++ $FTL_current = exec("pihole-FTL version"); + } + + // Get data from GitHub diff --git a/arch-server-admin-5.2-762241987.patch b/arch-server-admin-5.2-762241987.patch new file mode 100644 index 000000000000..9c209f3780a1 --- /dev/null +++ b/arch-server-admin-5.2-762241987.patch @@ -0,0 +1,143 @@ +diff -uprN AdminLTE-5.2/scripts/pi-hole/php/footer.php AdminLTE-5.2.cust/scripts/pi-hole/php/footer.php +--- AdminLTE-5.2/scripts/pi-hole/php/footer.php 2020-11-28 20:04:59.000000000 +0100 ++++ AdminLTE-5.2.cust/scripts/pi-hole/php/footer.php 2020-11-29 09:41:12.704917336 +0100 +@@ -55,9 +55,9 @@ + $webUrl = $githubBaseUrl . "/AdminLTE"; + $ftlUrl = $githubBaseUrl . "/FTL"; + +- $coreReleasesUrl = $coreUrl . "/releases"; +- $webReleasesUrl = $webUrl . "/releases"; +- $ftlReleasesUrl = $ftlUrl . "/releases"; ++ $coreReleasesUrl = "https://aur.archlinux.org/packages/pi-hole-server"; ++ $webReleasesUrl = "https://aur.archlinux.org/packages/pi-hole-server"; ++ $ftlReleasesUrl = "https://aur.archlinux.org/packages/pi-hole-ftl"; + ?> + <footer class="main-footer"> + <div class="row row-centered text-center"> +@@ -78,18 +78,18 @@ + <ul class="list-inline"> + <li> + <strong>Pi-hole</strong> +- <a href="<?php echo $coreReleasesUrl . "/" . $core_current; ?>" rel="noopener" target="_blank"><?php echo $core_current; ?></a> +- <?php if ($core_update) { ?> · <a class="lookatme" href="<?php echo $coreReleasesUrl . "/latest"; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> ++ <a href="<?php echo $coreReleasesUrl; ?>" rel="noopener" target="_blank"><?php echo $core_current; ?></a> ++ <?php if ($core_update) { ?> · <a class="lookatme" href="<?php echo $coreReleasesUrl; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> + </li> + <li> + <strong>Web Interface</strong> +- <a href="<?php echo $webReleasesUrl . "/" . $web_current; ?>" rel="noopener" target="_blank"><?php echo $web_current; ?></a> +- <?php if ($web_update) { ?> · <a class="lookatme" href="<?php echo $webReleasesUrl . "/latest"; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> ++ <a href="<?php echo $webReleasesUrl; ?>" rel="noopener" target="_blank"><?php echo $web_current; ?></a> ++ <?php if ($web_update) { ?> · <a class="lookatme" href="<?php echo $webReleasesUrl; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> + </li> + <li> + <strong>FTL</strong> +- <a href="<?php echo $ftlReleasesUrl . "/" . $FTL_current; ?>" rel="noopener" target="_blank"><?php echo $FTL_current; ?></a> +- <?php if ($FTL_update) { ?> · <a class="lookatme" href="<?php echo $ftlReleasesUrl . "/latest"; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> ++ <a href="<?php echo $ftlReleasesUrl; ?>" rel="noopener" target="_blank"><?php echo $FTL_current; ?></a> ++ <?php if ($FTL_update) { ?> · <a class="lookatme" href="<?php echo $ftlReleasesUrl; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?> + </li> + </ul> + <?php } ?> +diff -uprN AdminLTE-5.2/scripts/pi-hole/php/func.php AdminLTE-5.2.cust/scripts/pi-hole/php/func.php +--- AdminLTE-5.2/scripts/pi-hole/php/func.php 2020-11-28 20:04:59.000000000 +0100 ++++ AdminLTE-5.2.cust/scripts/pi-hole/php/func.php 2020-11-29 09:41:12.706917334 +0100 +@@ -72,7 +72,7 @@ function pihole_execute($argument_string + $escaped = escapeshellcmd($argument_string); + $output = null; + $return_status = -1; +- $command = "sudo pihole " . $escaped; ++ $command = "sudo /usr/bin/pihole " . $escaped; + exec($command, $output, $return_status); + if($return_status !== 0) + { +diff -uprN AdminLTE-5.2/scripts/pi-hole/php/header.php AdminLTE-5.2.cust/scripts/pi-hole/php/header.php +--- AdminLTE-5.2/scripts/pi-hole/php/header.php 2020-11-28 20:04:59.000000000 +0100 ++++ AdminLTE-5.2.cust/scripts/pi-hole/php/header.php 2020-11-29 09:41:12.670917364 +0100 +@@ -580,12 +580,6 @@ if($auth) { + <i class="fa fa-list-ul"></i> Tail pihole-FTL.log + </a> + </li> +- <!-- Generate debug log --> +- <li<?php if($scriptname === "debug.php"){ ?> class="active"<?php } ?>> +- <a href="debug.php"> +- <i class="fa fa-ambulance"></i> Generate debug log +- </a> +- </li> + <!-- Network --> + <li<?php if($scriptname === "network.php"){ ?> class="active"<?php } ?>> + <a href="network.php"> +diff -uprN AdminLTE-5.2/scripts/pi-hole/php/tailLog.php AdminLTE-5.2.cust/scripts/pi-hole/php/tailLog.php +--- AdminLTE-5.2/scripts/pi-hole/php/tailLog.php 2020-11-28 20:04:59.000000000 +0100 ++++ AdminLTE-5.2.cust/scripts/pi-hole/php/tailLog.php 2020-11-29 09:41:12.674917361 +0100 +@@ -14,11 +14,11 @@ if(!$auth) die("Not authorized"); + // files as large as the pihole.log + if(isset($_GET["FTL"])) + { +- $file = fopen("/var/log/pihole-FTL.log","r"); ++ $file = fopen("/run/log/pihole-ftl/pihole-FTL.log","r"); + } + else + { +- $file = fopen("/var/log/pihole.log","r"); ++ $file = fopen("/run/log/pihole/pihole.log","r"); + } + + if(!$file) +diff -uprN AdminLTE-5.2/scripts/pi-hole/php/update_checker.php AdminLTE-5.2.cust/scripts/pi-hole/php/update_checker.php +--- AdminLTE-5.2/scripts/pi-hole/php/update_checker.php 2020-11-28 20:04:59.000000000 +0100 ++++ AdminLTE-5.2.cust/scripts/pi-hole/php/update_checker.php 2020-11-29 09:41:12.686917351 +0100 +@@ -7,12 +7,12 @@ $GitHubVersions = "/etc/pihole/GitHubVer + if(!is_readable($localversions) || !is_readable($localbranches) || !is_readable($GitHubVersions)) + { + $core_branch = "master"; +- $core_current = "N/A"; ++ $core_current = "5.2"; + $core_update = false; + $web_branch = "master"; +- $web_current = "N/A"; ++ $web_current = "5.2"; + $web_update = false; +- $FTL_current = "N/A"; ++ $FTL_current = exec("pihole-FTL version"); + $FTL_update = false; + } + else +@@ -25,31 +25,31 @@ else + // Check if on a dev branch + $core_branch = $branches[0]; + if($core_branch !== "master") { +- $core_current = "vDev"; ++ $core_current = "5.2"; + $core_commit = $versions[0]; + } + else { +- $core_current = explode("-",$versions[0])[0]; ++ $core_current = "5.2"; + } + + /********** Get Pi-hole web branch / version / commit **********/ + $web_branch = $branches[1]; + if($web_branch !== "master") { +- $web_current = "vDev"; ++ $web_current = "5.2"; + $web_commit = $versions[1]; + } + else { +- $web_current = explode("-",$versions[1])[0]; ++ $web_current = "5.2"; + } + + /********** Get Pi-hole FTL (not a git repository) **********/ + $FTL_branch = $branches[2]; + if(substr($versions[2], 0, 4) === "vDev") { +- $FTL_current = "vDev"; ++ $FTL_current = exec("pihole-FTL version"); + $FTL_commit = $versions[2]; + } + else { +- $FTL_current = $versions[2]; ++ $FTL_current = exec("pihole-FTL version"); + } + + // Get data from GitHub diff --git a/arch-server-core-5.2-174678982.patch b/arch-server-core-5.2-174678982.patch new file mode 100644 index 000000000000..9e5b717d22d6 --- /dev/null +++ b/arch-server-core-5.2-174678982.patch @@ -0,0 +1,413 @@ +diff -uprN pi-hole-5.2/adlists.list pi-hole-5.2.cust/adlists.list +--- pi-hole-5.2/adlists.list 1970-01-01 01:00:00.000000000 +0100 ++++ pi-hole-5.2.cust/adlists.list 2020-11-29 09:41:12.706917334 +0100 +@@ -0,0 +1,4 @@ ++https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts ++https://mirror1.malwaredomains.com/files/justdomains ++https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt ++https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt +diff -uprN pi-hole-5.2/advanced/Scripts/pihole-reenable.sh pi-hole-5.2.cust/advanced/Scripts/pihole-reenable.sh +--- pi-hole-5.2/advanced/Scripts/pihole-reenable.sh 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Scripts/pihole-reenable.sh 2020-11-29 09:41:12.653917378 +0100 +@@ -17,7 +17,7 @@ + # This ensures that pihole ends up in the correct state after a sequence of + # commands suchs as: `pihole disable 30s; pihole enable; pihole disable` + +-readonly PI_HOLE_BIN_DIR="/usr/local/bin" ++readonly PI_HOLE_BIN_DIR="/usr/bin" + + sleep "${1}" + "${PI_HOLE_BIN_DIR}"/pihole enable +diff -uprN pi-hole-5.2/advanced/Scripts/piholeLogFlush.sh pi-hole-5.2.cust/advanced/Scripts/piholeLogFlush.sh +--- pi-hole-5.2/advanced/Scripts/piholeLogFlush.sh 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Scripts/piholeLogFlush.sh 2020-11-29 09:41:12.664917369 +0100 +@@ -26,35 +26,35 @@ if [ -z "$DBFILE" ]; then + fi + + if [[ "$@" != *"quiet"* ]]; then +- echo -ne " ${INFO} Flushing /var/log/pihole.log ..." ++ echo -ne " ${INFO} Flushing /run/log/pihole/pihole.log ..." + fi + if [[ "$@" == *"once"* ]]; then + # Nightly logrotation +- if command -v /usr/sbin/logrotate >/dev/null; then ++ if command -v /usr/bin/logrotate >/dev/null; then + # Logrotate once +- /usr/sbin/logrotate --force /etc/pihole/logrotate ++ /usr/bin/logrotate --force /etc/pihole/logrotate + else + # Copy pihole.log over to pihole.log.1 + # and empty out pihole.log + # Note that moving the file is not an option, as + # dnsmasq would happily continue writing into the + # moved file (it will have the same file handler) +- cp -p /var/log/pihole.log /var/log/pihole.log.1 +- echo " " > /var/log/pihole.log +- chmod 644 /var/log/pihole.log ++ cp -p /run/log/pihole/pihole.log /run/log/pihole/pihole.log.1 ++ echo " " > /run/log/pihole/pihole.log ++ chmod 644 /run/log/pihole/pihole.log + fi + else + # Manual flushing +- if command -v /usr/sbin/logrotate >/dev/null; then ++ if command -v /usr/bin/logrotate >/dev/null; then + # Logrotate twice to move all data out of sight of FTL +- /usr/sbin/logrotate --force /etc/pihole/logrotate; sleep 3 +- /usr/sbin/logrotate --force /etc/pihole/logrotate ++ /usr/bin/logrotate --force /etc/pihole/logrotate; sleep 3 ++ /usr/bin/logrotate --force /etc/pihole/logrotate + else + # Flush both pihole.log and pihole.log.1 (if existing) +- echo " " > /var/log/pihole.log +- if [ -f /var/log/pihole.log.1 ]; then +- echo " " > /var/log/pihole.log.1 +- chmod 644 /var/log/pihole.log.1 ++ echo " " > /run/log/pihole/pihole.log ++ if [ -f /run/log/pihole/pihole.log.1 ]; then ++ echo " " > /run/log/pihole/pihole.log.1 ++ chmod 644 /run/log/pihole/pihole.log.1 + fi + fi + # Delete most recent 24 hours from FTL's database, leave even older data intact (don't wipe out all history) +@@ -65,6 +65,6 @@ else + fi + + if [[ "$@" != *"quiet"* ]]; then +- echo -e "${OVER} ${TICK} Flushed /var/log/pihole.log" ++ echo -e "${OVER} ${TICK} Flushed /run/log/pihole/pihole.log" + echo -e " ${TICK} Deleted ${deleted} queries from database" + fi +diff -uprN pi-hole-5.2/advanced/Scripts/version.sh pi-hole-5.2.cust/advanced/Scripts/version.sh +--- pi-hole-5.2/advanced/Scripts/version.sh 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Scripts/version.sh 2020-11-29 09:41:12.687917350 +0100 +@@ -11,7 +11,7 @@ + # Variables + DEFAULT="-1" + COREGITDIR="/etc/.pihole/" +-WEBGITDIR="/var/www/html/admin/" ++WEBGITDIR="/srv/http/pihole/admin/" + + getLocalVersion() { + # FTL requires a different method +@@ -20,42 +20,16 @@ getLocalVersion() { + return 0 + fi + +- # Get the tagged version of the local repository +- local directory="${1}" +- local version +- +- cd "${directory}" 2> /dev/null || { echo "${DEFAULT}"; return 1; } +- version=$(git describe --tags --always || echo "$DEFAULT") +- if [[ "${version}" =~ ^v ]]; then +- echo "${version}" +- elif [[ "${version}" == "${DEFAULT}" ]]; then +- echo "ERROR" +- return 1 ++ if [[ "$1" == "pi-hole" ]]; then ++ echo "5.2" + else +- echo "Untagged" ++ echo "5.2" + fi + return 0 + } + + getLocalHash() { +- # Local FTL hash does not exist on filesystem +- if [[ "$1" == "FTL" ]]; then +- echo "N/A" +- return 0 +- fi +- +- # Get the short hash of the local repository +- local directory="${1}" +- local hash +- +- cd "${directory}" 2> /dev/null || { echo "${DEFAULT}"; return 1; } +- hash=$(git rev-parse --short HEAD || echo "$DEFAULT") +- if [[ "${hash}" == "${DEFAULT}" ]]; then +- echo "ERROR" +- return 1 +- else +- echo "${hash}" +- fi ++ echo "N/A" + return 0 + } + +diff -uprN pi-hole-5.2/advanced/Scripts/webpage.sh pi-hole-5.2.cust/advanced/Scripts/webpage.sh +--- pi-hole-5.2/advanced/Scripts/webpage.sh 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Scripts/webpage.sh 2020-11-29 09:41:12.667917366 +0100 +@@ -24,7 +24,7 @@ readonly gravityDBfile="/etc/pihole/grav + readonly PI_HOLE_FILES_DIR="/etc/.pihole" + # shellcheck disable=SC2034 # used in basic-install + PH_TEST="true" +-source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" ++source "/opt/pihole/basic-install.sh" + + coltable="/opt/pihole/COL_TABLE" + if [[ -f ${coltable} ]]; then +diff -uprN pi-hole-5.2/advanced/Templates/logrotate pi-hole-5.2.cust/advanced/Templates/logrotate +--- pi-hole-5.2/advanced/Templates/logrotate 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Templates/logrotate 2020-11-29 09:41:12.662917371 +0100 +@@ -1,4 +1,4 @@ +-/var/log/pihole.log { ++/run/log/pihole/pihole.log { + # su # + daily + copytruncate +@@ -9,7 +9,7 @@ + nomail + } + +-/var/log/pihole-FTL.log { ++/run/log/pihole-ftl/pihole-FTL.log { + # su # + weekly + copytruncate +diff -uprN pi-hole-5.2/advanced/Templates/pihole.sudo pi-hole-5.2.cust/advanced/Templates/pihole.sudo +--- pi-hole-5.2/advanced/Templates/pihole.sudo 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Templates/pihole.sudo 2020-11-29 09:41:12.706917334 +0100 +@@ -7,3 +7,4 @@ + # This file is copyright under the latest version of the EUPL. + # Please see LICENSE file for your rights under this license. + # ++http ALL=NOPASSWD: /usr/bin/pihole +diff -uprN pi-hole-5.2/advanced/dnsmasq.conf.original pi-hole-5.2.cust/advanced/dnsmasq.conf.original +--- pi-hole-5.2/advanced/dnsmasq.conf.original 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/dnsmasq.conf.original 2020-11-29 09:41:12.706917334 +0100 +@@ -646,3 +646,4 @@ + + # Include all files in a directory which end in .conf + #conf-dir=/etc/dnsmasq.d/*.conf ++conf-dir=/etc/dnsmasq.d/,*.conf +diff -uprN pi-hole-5.2/dns-servers.conf pi-hole-5.2.cust/dns-servers.conf +--- pi-hole-5.2/dns-servers.conf 1970-01-01 01:00:00.000000000 +0100 ++++ pi-hole-5.2.cust/dns-servers.conf 2020-11-29 09:41:12.707917334 +0100 +@@ -0,0 +1,9 @@ ++Google (ECS);8.8.8.8;8.8.4.4;2001:4860:4860:0:0:0:0:8888;2001:4860:4860:0:0:0:0:8844 ++OpenDNS (ECS);208.67.222.222;208.67.220.220;2620:119:35::35;2620:119:53::53 ++Level3;4.2.2.1;4.2.2.2;; ++Comodo;8.26.56.26;8.20.247.20;; ++DNS.WATCH;84.200.69.80;84.200.70.40;2001:1608:10:25:0:0:1c04:b12f;2001:1608:10:25:0:0:9249:d69b ++Quad9 (filtered, DNSSEC);9.9.9.9;149.112.112.112;2620:fe::fe;2620:fe::9 ++Quad9 (unfiltered, no DNSSEC);9.9.9.10;149.112.112.10;2620:fe::10;2620:fe::fe:10 ++Quad9 (filtered + ECS);9.9.9.11;149.112.112.11;2620:fe::11; ++Cloudflare;1.1.1.1;1.0.0.1;2606:4700:4700::1111;2606:4700:4700::1001 +diff -uprN pi-hole-5.2/gravity.sh pi-hole-5.2.cust/gravity.sh +--- pi-hole-5.2/gravity.sh 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/gravity.sh 2020-11-29 09:41:12.648917382 +0100 +@@ -18,10 +18,10 @@ source "${coltable}" + regexconverter="/opt/pihole/wildcard_regex_converter.sh" + source "${regexconverter}" + # shellcheck disable=SC1091 +-source "/etc/.pihole/advanced/Scripts/database_migration/gravity-db.sh" ++source "/opt/pihole/database_migration/gravity-db.sh" + + basename="pihole" +-PIHOLE_COMMAND="/usr/local/bin/${basename}" ++PIHOLE_COMMAND="/usr/bin/${basename}" + + piholeDir="/etc/${basename}" + +@@ -37,8 +37,8 @@ VPNList="/etc/openvpn/ipp.txt" + piholeGitDir="/etc/.pihole" + gravityDBfile="${piholeDir}/gravity.db" + gravityTEMPfile="${piholeDir}/gravity_temp.db" +-gravityDBschema="${piholeGitDir}/advanced/Templates/gravity.db.sql" +-gravityDBcopy="${piholeGitDir}/advanced/Templates/gravity_copy.sql" ++gravityDBschema="/opt/pihole/gravity.db.sql" ++gravityDBcopy="/opt/pihole/gravity_copy.sql" + + domainsExtension="domains" + +diff -uprN pi-hole-5.2/pihole pi-hole-5.2.cust/pihole +--- pi-hole-5.2/pihole 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/pihole 2020-11-29 09:41:12.655917377 +0100 +@@ -15,7 +15,7 @@ readonly PI_HOLE_SCRIPT_DIR="/opt/pihole + # they might get set again when the installer is sourced. This causes an + # error due to modifying a readonly variable. + setupVars="/etc/pihole/setupVars.conf" +-PI_HOLE_BIN_DIR="/usr/local/bin" ++PI_HOLE_BIN_DIR="/usr/bin" + + readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE" + source "${colfile}" +@@ -58,17 +58,6 @@ arpFunc() { + exit 0 + } + +-updatePiholeFunc() { +- shift +- "${PI_HOLE_SCRIPT_DIR}"/update.sh "$@" +- exit 0 +-} +- +-reconfigurePiholeFunc() { +- /etc/.pihole/automated\ install/basic-install.sh --reconfigure +- exit 0; +-} +- + updateGravityFunc() { + "${PI_HOLE_SCRIPT_DIR}"/gravity.sh "$@" + exit $? +@@ -87,11 +76,6 @@ chronometerFunc() { + } + + +-uninstallFunc() { +- "${PI_HOLE_SCRIPT_DIR}"/uninstall.sh +- exit 0 +-} +- + versionFunc() { + shift + "${PI_HOLE_SCRIPT_DIR}"/version.sh "$@" +@@ -117,7 +101,7 @@ restartDNS() { + str="Flushing DNS cache" + else + # A full restart has been requested +- svc="service pihole-FTL restart" ++ svc="systemctl restart pihole-FTL" + str="Restarting DNS server" + fi + +@@ -220,9 +204,9 @@ Example: 'pihole logging on' + Specify whether the Pi-hole log should be used + + Options: +- on Enable the Pi-hole log at /var/log/pihole.log +- off Disable and flush the Pi-hole log at /var/log/pihole.log +- off noflush Disable the Pi-hole log at /var/log/pihole.log" ++ on Enable the Pi-hole log at /run/log/pihole/pihole.log ++ off Disable and flush the Pi-hole log at /run/log/pihole/pihole.log ++ off noflush Disable the Pi-hole log at /run/log/pihole/pihole.log" + exit 0 + elif [[ "${1}" == "off" ]]; then + # Disable logging +@@ -335,7 +319,7 @@ tailFunc() { + # Color blocklist/blacklist/wildcard entries as red + # Color A/AAAA/DHCP strings as white + # Color everything else as gray +- tail -f /var/log/pihole.log | sed -E \ ++ tail -f /run/log/pihole/pihole.log | sed -E \ + -e "s,($(date +'%b %d ')| dnsmasq\[[0-9]*\]),,g" \ + -e "s,(.*(blacklisted |gravity blocked ).* is (0.0.0.0|::|NXDOMAIN|${IPV4_ADDRESS%/*}|${IPV6_ADDRESS:-NULL}).*),${COL_RED}&${COL_NC}," \ + -e "s,.*(query\\[A|DHCP).*,${COL_NC}&${COL_NC}," \ +@@ -343,59 +327,6 @@ tailFunc() { + exit 0 + } + +-piholeCheckoutFunc() { +- if [[ "$2" == "-h" ]] || [[ "$2" == "--help" ]]; then +- echo "Usage: pihole checkout [repo] [branch] +-Example: 'pihole checkout master' or 'pihole checkout core dev' +-Switch Pi-hole subsystems to a different GitHub branch +- +-Repositories: +- core [branch] Change the branch of Pi-hole's core subsystem +- web [branch] Change the branch of Web Interface subsystem +- ftl [branch] Change the branch of Pi-hole's FTL subsystem +- +-Branches: +- master Update subsystems to the latest stable release +- dev Update subsystems to the latest development release +- branchname Update subsystems to the specified branchname" +- exit 0 +- fi +- +- source "${PI_HOLE_SCRIPT_DIR}"/piholeCheckout.sh +- shift +- checkout "$@" +-} +- +-tricorderFunc() { +- if [[ ! -p "/dev/stdin" ]]; then +- echo -e " ${INFO} Please do not call Tricorder directly" +- exit 1 +- fi +- +- if ! (echo > /dev/tcp/tricorder.pi-hole.net/9998) >/dev/null 2>&1; then +- echo -e " ${CROSS} Unable to connect to Pi-hole's Tricorder server" +- exit 1 +- fi +- +- if command -v openssl &> /dev/null; then +- openssl s_client -quiet -connect tricorder.pi-hole.net:9998 2> /dev/null < /dev/stdin +- exit "$?" +- else +- echo -e " ${INFO} ${COL_YELLOW}Security Notice${COL_NC}: ${COL_WHITE}openssl${COL_NC} is not installed +- Your debug log will be transmitted unencrypted via plain-text +- There is a possibility that this could be intercepted by a third party +- If you wish to cancel, press Ctrl-C to exit within 10 seconds" +- secs="10" +- while [[ "$secs" -gt "0" ]]; do +- echo -ne "." +- sleep 1 +- : $((secs--)) +- done +- echo " " +- nc tricorder.pi-hole.net 9999 < /dev/stdin +- exit "$?" +- fi +-} + + updateCheckFunc() { + "${PI_HOLE_SCRIPT_DIR}"/updatecheck.sh "$@" +@@ -418,9 +349,7 @@ Whitelist/Blacklist Options: + + Debugging Options: + -d, debug Start a debugging session +- Add '-a' to automatically upload the log to tricorder.pi-hole.net + -f, flush Flush the Pi-hole log +- -r, reconfigure Reconfigure or Repair Pi-hole subsystems + -t, tail View the live output of the Pi-hole log + + Options: +@@ -434,11 +363,9 @@ Options: + Add '-h' for more info on logging usage + -q, query Query the adlists for a specified domain + Add '-h' for more info on query usage +- -up, updatePihole Update Pi-hole subsystems + Add '--check-only' to exit script before update is performed. + -v, version Show installed versions of Pi-hole, Web Interface & FTL + Add '-h' for more info on version usage +- uninstall Uninstall Pi-hole from your system + status Display the running status of Pi-hole subsystems + enable Enable Pi-hole subsystems + disable Disable Pi-hole subsystems +@@ -446,8 +373,6 @@ Options: + restartdns Full restart Pi-hole subsystems + Add 'reload' to update the lists and flush the cache without restarting the DNS server + Add 'reload-lists' to only update the lists WITHOUT flushing the cache or restarting the DNS server +- checkout Switch Pi-hole subsystems to a different GitHub branch +- Add '-h' for more info on checkout usage + arpflush Flush information stored in Pi-hole's network tables"; + exit 0 + } +@@ -481,23 +406,18 @@ case "${1}" in + "--white-wild" | "white-wild" ) listFunc "$@";; + "-d" | "debug" ) debugFunc "$@";; + "-f" | "flush" ) flushFunc "$@";; +- "-up" | "updatePihole" ) updatePiholeFunc "$@";; +- "-r" | "reconfigure" ) reconfigurePiholeFunc;; + "-g" | "updateGravity" ) updateGravityFunc "$@";; + "-c" | "chronometer" ) chronometerFunc "$@";; + "-h" | "help" ) helpFunc;; + "-v" | "version" ) versionFunc "$@";; + "-q" | "query" ) queryFunc "$@";; + "-l" | "logging" ) piholeLogging "$@";; +- "uninstall" ) uninstallFunc;; + "enable" ) piholeEnable 1;; + "disable" ) piholeEnable 0 "$2";; + "status" ) statusFunc "$2";; + "restartdns" ) restartDNS "$2";; + "-a" | "admin" ) webpageFunc "$@";; + "-t" | "tail" ) tailFunc;; +- "checkout" ) piholeCheckoutFunc "$@";; +- "tricorder" ) tricorderFunc;; + "updatechecker" ) updateCheckFunc "$@";; + "arpflush" ) arpFunc "$@";; + * ) helpFunc;; diff --git a/arch-server-core-5.2-762241987.patch b/arch-server-core-5.2-762241987.patch new file mode 100644 index 000000000000..9e5b717d22d6 --- /dev/null +++ b/arch-server-core-5.2-762241987.patch @@ -0,0 +1,413 @@ +diff -uprN pi-hole-5.2/adlists.list pi-hole-5.2.cust/adlists.list +--- pi-hole-5.2/adlists.list 1970-01-01 01:00:00.000000000 +0100 ++++ pi-hole-5.2.cust/adlists.list 2020-11-29 09:41:12.706917334 +0100 +@@ -0,0 +1,4 @@ ++https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts ++https://mirror1.malwaredomains.com/files/justdomains ++https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt ++https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt +diff -uprN pi-hole-5.2/advanced/Scripts/pihole-reenable.sh pi-hole-5.2.cust/advanced/Scripts/pihole-reenable.sh +--- pi-hole-5.2/advanced/Scripts/pihole-reenable.sh 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Scripts/pihole-reenable.sh 2020-11-29 09:41:12.653917378 +0100 +@@ -17,7 +17,7 @@ + # This ensures that pihole ends up in the correct state after a sequence of + # commands suchs as: `pihole disable 30s; pihole enable; pihole disable` + +-readonly PI_HOLE_BIN_DIR="/usr/local/bin" ++readonly PI_HOLE_BIN_DIR="/usr/bin" + + sleep "${1}" + "${PI_HOLE_BIN_DIR}"/pihole enable +diff -uprN pi-hole-5.2/advanced/Scripts/piholeLogFlush.sh pi-hole-5.2.cust/advanced/Scripts/piholeLogFlush.sh +--- pi-hole-5.2/advanced/Scripts/piholeLogFlush.sh 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Scripts/piholeLogFlush.sh 2020-11-29 09:41:12.664917369 +0100 +@@ -26,35 +26,35 @@ if [ -z "$DBFILE" ]; then + fi + + if [[ "$@" != *"quiet"* ]]; then +- echo -ne " ${INFO} Flushing /var/log/pihole.log ..." ++ echo -ne " ${INFO} Flushing /run/log/pihole/pihole.log ..." + fi + if [[ "$@" == *"once"* ]]; then + # Nightly logrotation +- if command -v /usr/sbin/logrotate >/dev/null; then ++ if command -v /usr/bin/logrotate >/dev/null; then + # Logrotate once +- /usr/sbin/logrotate --force /etc/pihole/logrotate ++ /usr/bin/logrotate --force /etc/pihole/logrotate + else + # Copy pihole.log over to pihole.log.1 + # and empty out pihole.log + # Note that moving the file is not an option, as + # dnsmasq would happily continue writing into the + # moved file (it will have the same file handler) +- cp -p /var/log/pihole.log /var/log/pihole.log.1 +- echo " " > /var/log/pihole.log +- chmod 644 /var/log/pihole.log ++ cp -p /run/log/pihole/pihole.log /run/log/pihole/pihole.log.1 ++ echo " " > /run/log/pihole/pihole.log ++ chmod 644 /run/log/pihole/pihole.log + fi + else + # Manual flushing +- if command -v /usr/sbin/logrotate >/dev/null; then ++ if command -v /usr/bin/logrotate >/dev/null; then + # Logrotate twice to move all data out of sight of FTL +- /usr/sbin/logrotate --force /etc/pihole/logrotate; sleep 3 +- /usr/sbin/logrotate --force /etc/pihole/logrotate ++ /usr/bin/logrotate --force /etc/pihole/logrotate; sleep 3 ++ /usr/bin/logrotate --force /etc/pihole/logrotate + else + # Flush both pihole.log and pihole.log.1 (if existing) +- echo " " > /var/log/pihole.log +- if [ -f /var/log/pihole.log.1 ]; then +- echo " " > /var/log/pihole.log.1 +- chmod 644 /var/log/pihole.log.1 ++ echo " " > /run/log/pihole/pihole.log ++ if [ -f /run/log/pihole/pihole.log.1 ]; then ++ echo " " > /run/log/pihole/pihole.log.1 ++ chmod 644 /run/log/pihole/pihole.log.1 + fi + fi + # Delete most recent 24 hours from FTL's database, leave even older data intact (don't wipe out all history) +@@ -65,6 +65,6 @@ else + fi + + if [[ "$@" != *"quiet"* ]]; then +- echo -e "${OVER} ${TICK} Flushed /var/log/pihole.log" ++ echo -e "${OVER} ${TICK} Flushed /run/log/pihole/pihole.log" + echo -e " ${TICK} Deleted ${deleted} queries from database" + fi +diff -uprN pi-hole-5.2/advanced/Scripts/version.sh pi-hole-5.2.cust/advanced/Scripts/version.sh +--- pi-hole-5.2/advanced/Scripts/version.sh 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Scripts/version.sh 2020-11-29 09:41:12.687917350 +0100 +@@ -11,7 +11,7 @@ + # Variables + DEFAULT="-1" + COREGITDIR="/etc/.pihole/" +-WEBGITDIR="/var/www/html/admin/" ++WEBGITDIR="/srv/http/pihole/admin/" + + getLocalVersion() { + # FTL requires a different method +@@ -20,42 +20,16 @@ getLocalVersion() { + return 0 + fi + +- # Get the tagged version of the local repository +- local directory="${1}" +- local version +- +- cd "${directory}" 2> /dev/null || { echo "${DEFAULT}"; return 1; } +- version=$(git describe --tags --always || echo "$DEFAULT") +- if [[ "${version}" =~ ^v ]]; then +- echo "${version}" +- elif [[ "${version}" == "${DEFAULT}" ]]; then +- echo "ERROR" +- return 1 ++ if [[ "$1" == "pi-hole" ]]; then ++ echo "5.2" + else +- echo "Untagged" ++ echo "5.2" + fi + return 0 + } + + getLocalHash() { +- # Local FTL hash does not exist on filesystem +- if [[ "$1" == "FTL" ]]; then +- echo "N/A" +- return 0 +- fi +- +- # Get the short hash of the local repository +- local directory="${1}" +- local hash +- +- cd "${directory}" 2> /dev/null || { echo "${DEFAULT}"; return 1; } +- hash=$(git rev-parse --short HEAD || echo "$DEFAULT") +- if [[ "${hash}" == "${DEFAULT}" ]]; then +- echo "ERROR" +- return 1 +- else +- echo "${hash}" +- fi ++ echo "N/A" + return 0 + } + +diff -uprN pi-hole-5.2/advanced/Scripts/webpage.sh pi-hole-5.2.cust/advanced/Scripts/webpage.sh +--- pi-hole-5.2/advanced/Scripts/webpage.sh 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Scripts/webpage.sh 2020-11-29 09:41:12.667917366 +0100 +@@ -24,7 +24,7 @@ readonly gravityDBfile="/etc/pihole/grav + readonly PI_HOLE_FILES_DIR="/etc/.pihole" + # shellcheck disable=SC2034 # used in basic-install + PH_TEST="true" +-source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" ++source "/opt/pihole/basic-install.sh" + + coltable="/opt/pihole/COL_TABLE" + if [[ -f ${coltable} ]]; then +diff -uprN pi-hole-5.2/advanced/Templates/logrotate pi-hole-5.2.cust/advanced/Templates/logrotate +--- pi-hole-5.2/advanced/Templates/logrotate 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Templates/logrotate 2020-11-29 09:41:12.662917371 +0100 +@@ -1,4 +1,4 @@ +-/var/log/pihole.log { ++/run/log/pihole/pihole.log { + # su # + daily + copytruncate +@@ -9,7 +9,7 @@ + nomail + } + +-/var/log/pihole-FTL.log { ++/run/log/pihole-ftl/pihole-FTL.log { + # su # + weekly + copytruncate +diff -uprN pi-hole-5.2/advanced/Templates/pihole.sudo pi-hole-5.2.cust/advanced/Templates/pihole.sudo +--- pi-hole-5.2/advanced/Templates/pihole.sudo 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/Templates/pihole.sudo 2020-11-29 09:41:12.706917334 +0100 +@@ -7,3 +7,4 @@ + # This file is copyright under the latest version of the EUPL. + # Please see LICENSE file for your rights under this license. + # ++http ALL=NOPASSWD: /usr/bin/pihole +diff -uprN pi-hole-5.2/advanced/dnsmasq.conf.original pi-hole-5.2.cust/advanced/dnsmasq.conf.original +--- pi-hole-5.2/advanced/dnsmasq.conf.original 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/advanced/dnsmasq.conf.original 2020-11-29 09:41:12.706917334 +0100 +@@ -646,3 +646,4 @@ + + # Include all files in a directory which end in .conf + #conf-dir=/etc/dnsmasq.d/*.conf ++conf-dir=/etc/dnsmasq.d/,*.conf +diff -uprN pi-hole-5.2/dns-servers.conf pi-hole-5.2.cust/dns-servers.conf +--- pi-hole-5.2/dns-servers.conf 1970-01-01 01:00:00.000000000 +0100 ++++ pi-hole-5.2.cust/dns-servers.conf 2020-11-29 09:41:12.707917334 +0100 +@@ -0,0 +1,9 @@ ++Google (ECS);8.8.8.8;8.8.4.4;2001:4860:4860:0:0:0:0:8888;2001:4860:4860:0:0:0:0:8844 ++OpenDNS (ECS);208.67.222.222;208.67.220.220;2620:119:35::35;2620:119:53::53 ++Level3;4.2.2.1;4.2.2.2;; ++Comodo;8.26.56.26;8.20.247.20;; ++DNS.WATCH;84.200.69.80;84.200.70.40;2001:1608:10:25:0:0:1c04:b12f;2001:1608:10:25:0:0:9249:d69b ++Quad9 (filtered, DNSSEC);9.9.9.9;149.112.112.112;2620:fe::fe;2620:fe::9 ++Quad9 (unfiltered, no DNSSEC);9.9.9.10;149.112.112.10;2620:fe::10;2620:fe::fe:10 ++Quad9 (filtered + ECS);9.9.9.11;149.112.112.11;2620:fe::11; ++Cloudflare;1.1.1.1;1.0.0.1;2606:4700:4700::1111;2606:4700:4700::1001 +diff -uprN pi-hole-5.2/gravity.sh pi-hole-5.2.cust/gravity.sh +--- pi-hole-5.2/gravity.sh 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/gravity.sh 2020-11-29 09:41:12.648917382 +0100 +@@ -18,10 +18,10 @@ source "${coltable}" + regexconverter="/opt/pihole/wildcard_regex_converter.sh" + source "${regexconverter}" + # shellcheck disable=SC1091 +-source "/etc/.pihole/advanced/Scripts/database_migration/gravity-db.sh" ++source "/opt/pihole/database_migration/gravity-db.sh" + + basename="pihole" +-PIHOLE_COMMAND="/usr/local/bin/${basename}" ++PIHOLE_COMMAND="/usr/bin/${basename}" + + piholeDir="/etc/${basename}" + +@@ -37,8 +37,8 @@ VPNList="/etc/openvpn/ipp.txt" + piholeGitDir="/etc/.pihole" + gravityDBfile="${piholeDir}/gravity.db" + gravityTEMPfile="${piholeDir}/gravity_temp.db" +-gravityDBschema="${piholeGitDir}/advanced/Templates/gravity.db.sql" +-gravityDBcopy="${piholeGitDir}/advanced/Templates/gravity_copy.sql" ++gravityDBschema="/opt/pihole/gravity.db.sql" ++gravityDBcopy="/opt/pihole/gravity_copy.sql" + + domainsExtension="domains" + +diff -uprN pi-hole-5.2/pihole pi-hole-5.2.cust/pihole +--- pi-hole-5.2/pihole 2020-11-28 20:05:01.000000000 +0100 ++++ pi-hole-5.2.cust/pihole 2020-11-29 09:41:12.655917377 +0100 +@@ -15,7 +15,7 @@ readonly PI_HOLE_SCRIPT_DIR="/opt/pihole + # they might get set again when the installer is sourced. This causes an + # error due to modifying a readonly variable. + setupVars="/etc/pihole/setupVars.conf" +-PI_HOLE_BIN_DIR="/usr/local/bin" ++PI_HOLE_BIN_DIR="/usr/bin" + + readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE" + source "${colfile}" +@@ -58,17 +58,6 @@ arpFunc() { + exit 0 + } + +-updatePiholeFunc() { +- shift +- "${PI_HOLE_SCRIPT_DIR}"/update.sh "$@" +- exit 0 +-} +- +-reconfigurePiholeFunc() { +- /etc/.pihole/automated\ install/basic-install.sh --reconfigure +- exit 0; +-} +- + updateGravityFunc() { + "${PI_HOLE_SCRIPT_DIR}"/gravity.sh "$@" + exit $? +@@ -87,11 +76,6 @@ chronometerFunc() { + } + + +-uninstallFunc() { +- "${PI_HOLE_SCRIPT_DIR}"/uninstall.sh +- exit 0 +-} +- + versionFunc() { + shift + "${PI_HOLE_SCRIPT_DIR}"/version.sh "$@" +@@ -117,7 +101,7 @@ restartDNS() { + str="Flushing DNS cache" + else + # A full restart has been requested +- svc="service pihole-FTL restart" ++ svc="systemctl restart pihole-FTL" + str="Restarting DNS server" + fi + +@@ -220,9 +204,9 @@ Example: 'pihole logging on' + Specify whether the Pi-hole log should be used + + Options: +- on Enable the Pi-hole log at /var/log/pihole.log +- off Disable and flush the Pi-hole log at /var/log/pihole.log +- off noflush Disable the Pi-hole log at /var/log/pihole.log" ++ on Enable the Pi-hole log at /run/log/pihole/pihole.log ++ off Disable and flush the Pi-hole log at /run/log/pihole/pihole.log ++ off noflush Disable the Pi-hole log at /run/log/pihole/pihole.log" + exit 0 + elif [[ "${1}" == "off" ]]; then + # Disable logging +@@ -335,7 +319,7 @@ tailFunc() { + # Color blocklist/blacklist/wildcard entries as red + # Color A/AAAA/DHCP strings as white + # Color everything else as gray +- tail -f /var/log/pihole.log | sed -E \ ++ tail -f /run/log/pihole/pihole.log | sed -E \ + -e "s,($(date +'%b %d ')| dnsmasq\[[0-9]*\]),,g" \ + -e "s,(.*(blacklisted |gravity blocked ).* is (0.0.0.0|::|NXDOMAIN|${IPV4_ADDRESS%/*}|${IPV6_ADDRESS:-NULL}).*),${COL_RED}&${COL_NC}," \ + -e "s,.*(query\\[A|DHCP).*,${COL_NC}&${COL_NC}," \ +@@ -343,59 +327,6 @@ tailFunc() { + exit 0 + } + +-piholeCheckoutFunc() { +- if [[ "$2" == "-h" ]] || [[ "$2" == "--help" ]]; then +- echo "Usage: pihole checkout [repo] [branch] +-Example: 'pihole checkout master' or 'pihole checkout core dev' +-Switch Pi-hole subsystems to a different GitHub branch +- +-Repositories: +- core [branch] Change the branch of Pi-hole's core subsystem +- web [branch] Change the branch of Web Interface subsystem +- ftl [branch] Change the branch of Pi-hole's FTL subsystem +- +-Branches: +- master Update subsystems to the latest stable release +- dev Update subsystems to the latest development release +- branchname Update subsystems to the specified branchname" +- exit 0 +- fi +- +- source "${PI_HOLE_SCRIPT_DIR}"/piholeCheckout.sh +- shift +- checkout "$@" +-} +- +-tricorderFunc() { +- if [[ ! -p "/dev/stdin" ]]; then +- echo -e " ${INFO} Please do not call Tricorder directly" +- exit 1 +- fi +- +- if ! (echo > /dev/tcp/tricorder.pi-hole.net/9998) >/dev/null 2>&1; then +- echo -e " ${CROSS} Unable to connect to Pi-hole's Tricorder server" +- exit 1 +- fi +- +- if command -v openssl &> /dev/null; then +- openssl s_client -quiet -connect tricorder.pi-hole.net:9998 2> /dev/null < /dev/stdin +- exit "$?" +- else +- echo -e " ${INFO} ${COL_YELLOW}Security Notice${COL_NC}: ${COL_WHITE}openssl${COL_NC} is not installed +- Your debug log will be transmitted unencrypted via plain-text +- There is a possibility that this could be intercepted by a third party +- If you wish to cancel, press Ctrl-C to exit within 10 seconds" +- secs="10" +- while [[ "$secs" -gt "0" ]]; do +- echo -ne "." +- sleep 1 +- : $((secs--)) +- done +- echo " " +- nc tricorder.pi-hole.net 9999 < /dev/stdin +- exit "$?" +- fi +-} + + updateCheckFunc() { + "${PI_HOLE_SCRIPT_DIR}"/updatecheck.sh "$@" +@@ -418,9 +349,7 @@ Whitelist/Blacklist Options: + + Debugging Options: + -d, debug Start a debugging session +- Add '-a' to automatically upload the log to tricorder.pi-hole.net + -f, flush Flush the Pi-hole log +- -r, reconfigure Reconfigure or Repair Pi-hole subsystems + -t, tail View the live output of the Pi-hole log + + Options: +@@ -434,11 +363,9 @@ Options: + Add '-h' for more info on logging usage + -q, query Query the adlists for a specified domain + Add '-h' for more info on query usage +- -up, updatePihole Update Pi-hole subsystems + Add '--check-only' to exit script before update is performed. + -v, version Show installed versions of Pi-hole, Web Interface & FTL + Add '-h' for more info on version usage +- uninstall Uninstall Pi-hole from your system + status Display the running status of Pi-hole subsystems + enable Enable Pi-hole subsystems + disable Disable Pi-hole subsystems +@@ -446,8 +373,6 @@ Options: + restartdns Full restart Pi-hole subsystems + Add 'reload' to update the lists and flush the cache without restarting the DNS server + Add 'reload-lists' to only update the lists WITHOUT flushing the cache or restarting the DNS server +- checkout Switch Pi-hole subsystems to a different GitHub branch +- Add '-h' for more info on checkout usage + arpflush Flush information stored in Pi-hole's network tables"; + exit 0 + } +@@ -481,23 +406,18 @@ case "${1}" in + "--white-wild" | "white-wild" ) listFunc "$@";; + "-d" | "debug" ) debugFunc "$@";; + "-f" | "flush" ) flushFunc "$@";; +- "-up" | "updatePihole" ) updatePiholeFunc "$@";; +- "-r" | "reconfigure" ) reconfigurePiholeFunc;; + "-g" | "updateGravity" ) updateGravityFunc "$@";; + "-c" | "chronometer" ) chronometerFunc "$@";; + "-h" | "help" ) helpFunc;; + "-v" | "version" ) versionFunc "$@";; + "-q" | "query" ) queryFunc "$@";; + "-l" | "logging" ) piholeLogging "$@";; +- "uninstall" ) uninstallFunc;; + "enable" ) piholeEnable 1;; + "disable" ) piholeEnable 0 "$2";; + "status" ) statusFunc "$2";; + "restartdns" ) restartDNS "$2";; + "-a" | "admin" ) webpageFunc "$@";; + "-t" | "tail" ) tailFunc;; +- "checkout" ) piholeCheckoutFunc "$@";; +- "tricorder" ) tricorderFunc;; + "updatechecker" ) updateCheckFunc "$@";; + "arpflush" ) arpFunc "$@";; + * ) helpFunc;; |