diff options
author | max.bra | 2019-09-21 12:45:50 +0200 |
---|---|---|
committer | max.bra | 2019-09-21 12:45:50 +0200 |
commit | f299b3e529f1f8d4b8ec97b1a84dcd6a65c07ec6 (patch) | |
tree | 160670f44b9a577e6cb538d0581099649e600c9a | |
parent | bfa3915562c47db01196367dad55a87130a1303c (diff) | |
download | aur-f299b3e529f1f8d4b8ec97b1a84dcd6a65c07ec6.tar.gz |
long forgotten version.patch: managed elsewhere
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 7 | ||||
-rw-r--r-- | arch-server-admin-4.3.patch | 509 | ||||
-rw-r--r-- | arch-server-core-4.3.2.patch | 398 | ||||
-rw-r--r-- | version.patch | 49 |
5 files changed, 911 insertions, 58 deletions
@@ -37,12 +37,11 @@ pkgbase = pi-hole-server source = pi-hole-logtruncate.service source = pi-hole-logtruncate.timer source = mimic_setupVars.conf.sh - source = version.patch source = piholeDebug.sh md5sums = 33ea26a46937a0b5d20037639eb0ee34 md5sums = 670e5c4c4ca0cba6f732bf622918784c - md5sums = 58747d9ed820aa68517cd3e14dd780e7 - md5sums = 0853836aa3ef5255840690d61805a2ee + md5sums = c6e8c9bea10309b0b2bcacfc2dd7c9a6 + md5sums = 42d5cc143db4ed4c3b68fd0fada60f93 md5sums = 4d9038588164bb9130c8ca11653f83f3 md5sums = 971cc2859672341d77f8deba702fb7f7 md5sums = b63fcf29c29796023a2677bcf2b369a7 @@ -52,7 +51,6 @@ pkgbase = pi-hole-server md5sums = 20c5b0c6b4e23e55b25ab6c28dda709d md5sums = 291d3c95e445fe65caf40c3605efd186 md5sums = c227ffa88ddebc34cb715b73640cd845 - md5sums = 4e65ef5a25a9a7358cba24450dbed7cc md5sums = d7b69ae51db0e8ac8e27f20a234eed85 pkgname = pi-hole-server @@ -36,14 +36,13 @@ source=(pihole-$pkgver.tar.gz::https://github.com/$_pkgname/$_pkgname/archive/v$ $_pkgname-logtruncate.service $_pkgname-logtruncate.timer mimic_setupVars.conf.sh - version.patch piholeDebug.sh ) md5sums=('33ea26a46937a0b5d20037639eb0ee34' '670e5c4c4ca0cba6f732bf622918784c' - '58747d9ed820aa68517cd3e14dd780e7' - '0853836aa3ef5255840690d61805a2ee' + 'c6e8c9bea10309b0b2bcacfc2dd7c9a6' + '42d5cc143db4ed4c3b68fd0fada60f93' '4d9038588164bb9130c8ca11653f83f3' '971cc2859672341d77f8deba702fb7f7' 'b63fcf29c29796023a2677bcf2b369a7' @@ -53,13 +52,11 @@ md5sums=('33ea26a46937a0b5d20037639eb0ee34' '20c5b0c6b4e23e55b25ab6c28dda709d' '291d3c95e445fe65caf40c3605efd186' 'c227ffa88ddebc34cb715b73640cd845' - '4e65ef5a25a9a7358cba24450dbed7cc' 'd7b69ae51db0e8ac8e27f20a234eed85') prepare() { cd "$srcdir"/"$_pkgname"-"$pkgver" patch -Np1 -i "$srcdir"/arch-server-core-$pkgver.patch - patch -p1 -i "$srcdir"/version.patch cd "$srcdir"/"$_wwwpkgname"-"$_wwwpkgver" patch -Np1 -i "$srcdir"/arch-server-admin-$_wwwpkgver.patch } diff --git a/arch-server-admin-4.3.patch b/arch-server-admin-4.3.patch new file mode 100644 index 000000000000..4e103bd3508d --- /dev/null +++ b/arch-server-admin-4.3.patch @@ -0,0 +1,509 @@ +diff -uprN AdminLTE-4.3/api.php AdminLTE-4.3.cust/api.php +--- AdminLTE-4.3/api.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/api.php 2019-09-21 12:37:48.785575171 +0200 +@@ -20,7 +20,7 @@ $data = array(); + // Common API functions + if (isset($_GET['status'])) + { +- $pistatus = exec('sudo pihole status web'); ++ $pistatus = exec('sudo /usr/bin/pihole status web'); + if ($pistatus == "1") + { + $data = array_merge($data, array("status" => "enabled")); +@@ -42,7 +42,7 @@ elseif (isset($_GET['enable']) && $auth) + // Skip token validation if explicit auth string is given + check_csrf($_GET['token']); + } +- exec('sudo pihole enable'); ++ exec('sudo /usr/bin/pihole enable'); + $data = array_merge($data, array("status" => "enabled")); + unlink("../custom_disable_timer"); + } +@@ -63,12 +63,12 @@ elseif (isset($_GET['disable']) && $auth + if($disable > 0) + { + $timestamp = time(); +- exec("sudo pihole disable ".$disable."s"); ++ exec("sudo /usr/bin/pihole disable ".$disable."s"); + file_put_contents("../custom_disable_timer",($timestamp+$disable)*1000); + } + else + { +- exec('sudo pihole disable'); ++ exec('sudo /usr/bin/pihole disable'); + unlink("../custom_disable_timer"); + } + $data = array_merge($data, array("status" => "disabled")); +diff -uprN AdminLTE-4.3/scripts/pi-hole/php/FTL.php AdminLTE-4.3.cust/scripts/pi-hole/php/FTL.php +--- AdminLTE-4.3/scripts/pi-hole/php/FTL.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/FTL.php 2019-09-21 12:37:48.758575272 +0200 +@@ -11,7 +11,7 @@ function connectFTL($address, $port=4711 + if($address == "127.0.0.1") + { + // Read port +- $portfile = file_get_contents("/var/run/pihole-FTL.port"); ++ $portfile = file_get_contents("/run/pihole-ftl/pihole-FTL.port"); + if(is_numeric($portfile)) + $port = intval($portfile); + } +diff -uprN AdminLTE-4.3/scripts/pi-hole/php/add.php AdminLTE-4.3.cust/scripts/pi-hole/php/add.php +--- AdminLTE-4.3/scripts/pi-hole/php/add.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/add.php 2019-09-21 12:37:48.798575123 +0200 +@@ -25,20 +25,20 @@ if($type !== "regex") { + switch($type) { + case "white": + if(!isset($_POST["auditlog"])) +- echo shell_exec("sudo pihole -w ${_POST['domain']}"); ++ echo shell_exec("sudo /usr/bin/pihole -w ${_POST['domain']}"); + else + { +- echo shell_exec("sudo pihole -w -n ${_POST['domain']}"); +- echo shell_exec("sudo pihole -a audit ${_POST['domain']}"); ++ echo shell_exec("sudo /usr/bin/pihole -w -n ${_POST['domain']}"); ++ echo shell_exec("sudo /usr/bin/pihole -a audit ${_POST['domain']}"); + } + break; + case "black": + if(!isset($_POST["auditlog"])) +- echo shell_exec("sudo pihole -b ${_POST['domain']}"); ++ echo shell_exec("sudo /usr/bin/pihole -b ${_POST['domain']}"); + else + { +- echo shell_exec("sudo pihole -b -n ${_POST['domain']}"); +- echo shell_exec("sudo pihole -a audit ${_POST['domain']}"); ++ echo shell_exec("sudo /usr/bin/pihole -b -n ${_POST['domain']}"); ++ echo shell_exec("sudo /usr/bin/pihole -a audit ${_POST['domain']}"); + } + break; + case "wild": +@@ -51,7 +51,7 @@ switch($type) { + add_regex($_POST['domain']); + break; + case "audit": +- echo exec("sudo pihole -a audit ${_POST['domain']}"); ++ echo exec("sudo /usr/bin/pihole -a audit ${_POST['domain']}"); + break; + } + +diff -uprN AdminLTE-4.3/scripts/pi-hole/php/footer.php AdminLTE-4.3.cust/scripts/pi-hole/php/footer.php +--- AdminLTE-4.3/scripts/pi-hole/php/footer.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/footer.php 2019-09-21 12:37:48.783575178 +0200 +@@ -52,15 +52,15 @@ + <b>Pi-hole Version </b> <?php + echo $core_current; + if(isset($core_commit)) { echo " (".$core_branch.", ".$core_commit.")"; } +- if($core_update){ ?> <a class="alert-link lookatme" href="https://github.com/pi-hole/pi-hole/releases" target="_blank">(Update available!)</a><?php } ?> ++ if($core_update){ ?> <a class="alert-link lookatme" href="https://aur.archlinux.org/packages/pi-hole-server" target="_blank">(Update available!)</a><?php } ?> + <b>Web Interface Version </b><?php + echo $web_current; + if(isset($web_commit)) { echo " (".$web_branch.", ".$web_commit.")"; } +- if($web_update){ ?> <a class="alert-link lookatme" href="https://github.com/pi-hole/AdminLTE/releases" target="_blank">(Update available!)</a><?php } ?> ++ if($web_update){ ?> <a class="alert-link lookatme" href="https://aur.archlinux.org/packages/pi-hole-server" target="_blank">(Update available!)</a><?php } ?> + <b>FTL Version </b> <?php + echo $FTL_current; + if(isset($FTL_commit)) { echo " (".$FTL_branch.", ".$FTL_commit.")"; } +- if($FTL_update){ ?> <a class="alert-link lookatme" href="https://github.com/pi-hole/FTL/releases" target="_blank">(Update available!)</a><?php } ?> ++ if($FTL_update){ ?> <a class="alert-link lookatme" href="https://aur.archlinux.org/packages/pi-hole-server" target="_blank">(Update available!)</a><?php } ?> + </div> + <div style="display: inline-block"><strong><a href="https://pi-hole.net/donate" target="_blank"><i class="fa fa-heart"></i> Donate</a></strong> if you found this useful.</div> + </footer> +diff -uprN AdminLTE-4.3/scripts/pi-hole/php/gravity.sh.php AdminLTE-4.3.cust/scripts/pi-hole/php/gravity.sh.php +--- AdminLTE-4.3/scripts/pi-hole/php/gravity.sh.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/gravity.sh.php 2019-09-21 12:37:48.800575115 +0200 +@@ -30,7 +30,7 @@ function echoEvent($datatext) { + echo "data: ".implode("\ndata: ", explode("\n",$datatext))."\n\n"; + } + +-$proc = popen("sudo pihole -g", 'r'); ++$proc = popen("sudo /usr/bin/pihole -g", 'r'); + while (!feof($proc)) { + echoEvent(fread($proc, 4096)); + } +diff -uprN AdminLTE-4.3/scripts/pi-hole/php/header.php AdminLTE-4.3.cust/scripts/pi-hole/php/header.php +--- AdminLTE-4.3/scripts/pi-hole/php/header.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/header.php 2019-09-21 12:37:48.788575160 +0200 +@@ -323,7 +323,7 @@ if($auth) { + <div class="pull-left info"> + <p>Status</p> + <?php +- $pistatus = exec('sudo pihole status web'); ++ $pistatus = exec('sudo /usr/bin/pihole status web'); + if ($pistatus == "1") { + echo '<a id="status"><i class="fa fa-circle" style="color:#7FFF00"></i> Active</a>'; + } elseif ($pistatus == "0") { +@@ -551,12 +551,6 @@ if($auth) { + <i class="fa fa-list-ul"></i> <span>Tail pihole-FTL.log</span> + </a> + </li> +- <!-- Generate debug log --> +- <li<?php if($scriptname === "debug.php"){ ?> class="active"<?php } ?>> +- <a href="debug.php"> +- <i class="fa fa-ambulance"></i> <span>Generate debug log</span> +- </a> +- </li> + </ul> + </li> + <!-- Network --> +diff -uprN AdminLTE-4.3/scripts/pi-hole/php/loginpage.php AdminLTE-4.3.cust/scripts/pi-hole/php/loginpage.php +--- AdminLTE-4.3/scripts/pi-hole/php/loginpage.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/loginpage.php 2019-09-21 12:37:48.802575108 +0200 +@@ -59,7 +59,7 @@ + After installing Pi-hole for the first time, a password is generated and displayed to the user. The + password cannot be retrieved later on, but it is possible to set a new password (or explicitly disable + the password by setting an empty password) using the command +- <pre>sudo pihole -a -p</pre> ++ <pre>sudo /usr/bin/pihole -a -p</pre> + </div> + </div> + </div> +diff -uprN AdminLTE-4.3/scripts/pi-hole/php/queryads.php AdminLTE-4.3.cust/scripts/pi-hole/php/queryads.php +--- AdminLTE-4.3/scripts/pi-hole/php/queryads.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/queryads.php 2019-09-21 12:37:48.790575152 +0200 +@@ -61,7 +61,7 @@ else + $exact = ""; + } + +-$proc = popen("sudo pihole -q -adlist ".$url." ".$exact, 'r'); ++$proc = popen("sudo /usr/bin/pihole -q -adlist ".$url." ".$exact, 'r'); + while (!feof($proc)) { + echoEvent(fread($proc, 4096)); + } +diff -uprN AdminLTE-4.3/scripts/pi-hole/php/savesettings.php AdminLTE-4.3.cust/scripts/pi-hole/php/savesettings.php +--- AdminLTE-4.3/scripts/pi-hole/php/savesettings.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/savesettings.php 2019-09-21 12:37:48.793575142 +0200 +@@ -331,13 +331,13 @@ function readAdlists() + // Fallback + $DNSinterface = "local"; + } +- exec("sudo pihole -a -i ".$DNSinterface." -web"); ++ exec("sudo /usr/bin/pihole -a -i ".$DNSinterface." -web"); + + // If there has been no error we can save the new DNS server IPs + if(!strlen($error)) + { + $IPs = implode (",", $DNSservers); +- $return = exec("sudo pihole -a setdns \"".$IPs."\" ".$extra); ++ $return = exec("sudo /usr/bin/pihole -a setdns \"".$IPs."\" ".$extra); + $success .= htmlspecialchars($return)."<br>"; + $success .= "The DNS settings have been updated (using ".$DNSservercount." DNS servers)"; + } +@@ -353,17 +353,17 @@ function readAdlists() + + if($_POST["action"] === "Disable") + { +- exec("sudo pihole -l off"); ++ exec("sudo /usr/bin/pihole -l off"); + $success .= "Logging has been disabled and logs have been flushed"; + } + elseif($_POST["action"] === "Disable-noflush") + { +- exec("sudo pihole -l off noflush"); ++ exec("sudo /usr/bin/pihole -l off noflush"); + $success .= "Logging has been disabled, your logs have <strong>not</strong> been flushed"; + } + else + { +- exec("sudo pihole -l on"); ++ exec("sudo /usr/bin/pihole -l on"); + $success .= "Logging has been enabled"; + } + +@@ -420,8 +420,8 @@ function readAdlists() + if(!strlen($error)) + { + // All entries are okay +- exec("sudo pihole -a setexcludedomains ".$domainlist); +- exec("sudo pihole -a setexcludeclients ".$clientlist); ++ exec("sudo /usr/bin/pihole -a setexcludedomains ".$domainlist); ++ exec("sudo /usr/bin/pihole -a setexcludeclients ".$clientlist); + $success .= "The API settings have been updated<br>"; + } + else +@@ -432,7 +432,7 @@ function readAdlists() + // Set query log options + if(isset($_POST["querylog-permitted"]) && isset($_POST["querylog-blocked"])) + { +- exec("sudo pihole -a setquerylog all"); ++ exec("sudo /usr/bin/pihole -a setquerylog all"); + if(!isset($_POST["privacyMode"])) + { + $success .= "All entries will be shown in Query Log"; +@@ -444,7 +444,7 @@ function readAdlists() + } + elseif(isset($_POST["querylog-permitted"])) + { +- exec("sudo pihole -a setquerylog permittedonly"); ++ exec("sudo /usr/bin/pihole -a setquerylog permittedonly"); + if(!isset($_POST["privacyMode"])) + { + $success .= "Only permitted will be shown in Query Log"; +@@ -456,24 +456,24 @@ function readAdlists() + } + elseif(isset($_POST["querylog-blocked"])) + { +- exec("sudo pihole -a setquerylog blockedonly"); ++ exec("sudo /usr/bin/pihole -a setquerylog blockedonly"); + $success .= "Only blocked entries will be shown in Query Log"; + } + else + { +- exec("sudo pihole -a setquerylog nothing"); ++ exec("sudo /usr/bin/pihole -a setquerylog nothing"); + $success .= "No entries will be shown in Query Log"; + } + + + if(isset($_POST["privacyMode"])) + { +- exec("sudo pihole -a privacymode true"); ++ exec("sudo /usr/bin/pihole -a privacymode true"); + $success .= " (privacy mode enabled)"; + } + else + { +- exec("sudo pihole -a privacymode false"); ++ exec("sudo /usr/bin/pihole -a privacymode false"); + } + + break; +@@ -481,15 +481,15 @@ function readAdlists() + case "webUI": + if($_POST["tempunit"] == "F") + { +- exec('sudo pihole -a -f'); ++ exec('sudo /usr/bin/pihole -a -f'); + } + elseif($_POST["tempunit"] == "K") + { +- exec('sudo pihole -a -k'); ++ exec('sudo /usr/bin/pihole -a -k'); + } + else + { +- exec('sudo pihole -a -c'); ++ exec('sudo /usr/bin/pihole -a -c'); + } + $adminemail = trim($_POST["adminemail"]); + if(strlen($adminemail) == 0 || !isset($adminemail)) +@@ -502,36 +502,36 @@ function readAdlists() + } + else + { +- exec('sudo pihole -a -e \''.$adminemail.'\''); ++ exec('sudo /usr/bin/pihole -a -e \''.$adminemail.'\''); + } + if(isset($_POST["boxedlayout"])) + { +- exec('sudo pihole -a layout boxed'); ++ exec('sudo /usr/bin/pihole -a layout boxed'); + } + else + { +- exec('sudo pihole -a layout traditional'); ++ exec('sudo /usr/bin/pihole -a layout traditional'); + } + $success .= "The webUI settings have been updated"; + break; + + case "poweroff": +- exec("sudo pihole -a poweroff"); ++ exec("sudo /usr/bin/pihole -a poweroff"); + $success = "The system will poweroff in 5 seconds..."; + break; + + case "reboot": +- exec("sudo pihole -a reboot"); ++ exec("sudo /usr/bin/pihole -a reboot"); + $success = "The system will reboot in 5 seconds..."; + break; + + case "restartdns": +- exec("sudo pihole -a restartdns"); ++ exec("sudo /usr/bin/pihole -a restartdns"); + $success = "The DNS server has been restarted"; + break; + + case "flushlogs": +- exec("sudo pihole -f"); ++ exec("sudo /usr/bin/pihole -f"); + $success = "The Pi-hole log file has been flushed"; + break; + +@@ -587,7 +587,7 @@ function readAdlists() + + if(!strlen($error)) + { +- exec("sudo pihole -a addstaticdhcp ".$mac." ".$ip." ".$hostname); ++ exec("sudo /usr/bin/pihole -a addstaticdhcp ".$mac." ".$ip." ".$hostname); + $success .= "A new static address has been added"; + } + break; +@@ -604,7 +604,7 @@ function readAdlists() + + if(!strlen($error)) + { +- exec("sudo pihole -a removestaticdhcp ".$mac); ++ exec("sudo /usr/bin/pihole -a removestaticdhcp ".$mac); + $success .= "The static address with MAC address ".htmlspecialchars($mac)." has been removed"; + } + break; +@@ -671,13 +671,13 @@ function readAdlists() + + if(!strlen($error)) + { +- exec("sudo pihole -a enabledhcp ".$from." ".$to." ".$router." ".$leasetime." ".$domain." ".$ipv6." ".$rapidcommit); ++ exec("sudo /usr/bin/pihole -a enabledhcp ".$from." ".$to." ".$router." ".$leasetime." ".$domain." ".$ipv6." ".$rapidcommit); + $success .= "The DHCP server has been activated ".htmlspecialchars($type); + } + } + else + { +- exec("sudo pihole -a disabledhcp"); ++ exec("sudo /usr/bin/pihole -a disabledhcp"); + $success = "The DHCP server has been deactivated"; + } + +@@ -689,18 +689,18 @@ function readAdlists() + if(isset($_POST["adlist-del-".$key])) + { + // Delete list +- exec("sudo pihole -a adlist del ".escapeshellcmd($value[1])); ++ exec("sudo /usr/bin/pihole -a adlist del ".escapeshellcmd($value[1])); + } + elseif(isset($_POST["adlist-enable-".$key]) && !$value[0]) + { + // Is not enabled, but should be +- exec("sudo pihole -a adlist enable ".escapeshellcmd($value[1])); ++ exec("sudo /usr/bin/pihole -a adlist enable ".escapeshellcmd($value[1])); + + } + elseif(!isset($_POST["adlist-enable-".$key]) && $value[0]) + { + // Is enabled, but shouldn't be +- exec("sudo pihole -a adlist disable ".escapeshellcmd($value[1])); ++ exec("sudo /usr/bin/pihole -a adlist disable ".escapeshellcmd($value[1])); + } + } + +@@ -709,7 +709,7 @@ function readAdlists() + $domains = array_filter(preg_split('/\r\n|[\r\n]/', $_POST["newuserlists"])); + foreach($domains as $domain) + { +- exec("sudo pihole -a adlist add ".escapeshellcmd($domain)); ++ exec("sudo /usr/bin/pihole -a adlist add ".escapeshellcmd($domain)); + } + } + +@@ -729,11 +729,11 @@ function readAdlists() + } + + // Store privacy level +- exec("sudo pihole -a privacylevel ".$level); ++ exec("sudo /usr/bin/pihole -a privacylevel ".$level); + + if($privacylevel > $level) + { +- exec("sudo pihole -a restartdns"); ++ exec("sudo /usr/bin/pihole -a restartdns"); + $success .= "The privacy level has been decreased and the DNS resolver has been restarted"; + } + elseif($privacylevel < $level) +diff -uprN AdminLTE-4.3/scripts/pi-hole/php/sub.php AdminLTE-4.3.cust/scripts/pi-hole/php/sub.php +--- AdminLTE-4.3/scripts/pi-hole/php/sub.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/sub.php 2019-09-21 12:37:48.795575134 +0200 +@@ -24,10 +24,10 @@ if($type !== "regex") { + + switch($type) { + case "white": +- exec("sudo pihole -w -q -d ${_POST['domain']}"); ++ exec("sudo /usr/bin/pihole -w -q -d ${_POST['domain']}"); + break; + case "black": +- exec("sudo pihole -b -q -d ${_POST['domain']}"); ++ exec("sudo /usr/bin/pihole -b -q -d ${_POST['domain']}"); + break; + case "regex": + if(($list = file_get_contents($regexfile)) === FALSE) +@@ -51,7 +51,7 @@ switch($type) { + // Send SIGHUP to pihole-FTL using a frontend command + // to force reloading of the regex domains + // This will also wipe the resolver's cache +- echo exec("sudo pihole restartdns reload"); ++ echo exec("sudo /usr/bin/pihole restartdns reload"); + } + break; + } +diff -uprN AdminLTE-4.3/scripts/pi-hole/php/tailLog.php AdminLTE-4.3.cust/scripts/pi-hole/php/tailLog.php +--- AdminLTE-4.3/scripts/pi-hole/php/tailLog.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/tailLog.php 2019-09-21 12:37:48.762575257 +0200 +@@ -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-4.3/scripts/pi-hole/php/update_checker.php AdminLTE-4.3.cust/scripts/pi-hole/php/update_checker.php +--- AdminLTE-4.3/scripts/pi-hole/php/update_checker.php 2019-05-18 22:08:56.000000000 +0200 ++++ AdminLTE-4.3.cust/scripts/pi-hole/php/update_checker.php 2019-09-21 12:37:48.774575212 +0200 +@@ -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 = "4.3.2"; + $core_update = false; + $web_branch = "master"; +- $web_current = "N/A"; ++ $web_current = "4.3"; + $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 = "4.3.2"; + $core_commit = $versions[0]; + } + else { +- $core_current = explode("-",$versions[0])[0]; ++ $core_current = "4.3.2"; + } + + /********** Get Pi-hole web branch / version / commit **********/ + $web_branch = $branches[1]; + if($web_branch !== "master") { +- $web_current = "vDev"; ++ $web_current = "4.3"; + $web_commit = $versions[1]; + } + else { +- $web_current = explode("-",$versions[1])[0]; ++ $web_current = "4.3"; + } + + /********** 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-4.3.2.patch b/arch-server-core-4.3.2.patch new file mode 100644 index 000000000000..202ac832d4a2 --- /dev/null +++ b/arch-server-core-4.3.2.patch @@ -0,0 +1,398 @@ +diff -uprN pi-hole-4.3.2/adlists.list pi-hole-4.3.2.cust/adlists.list +--- pi-hole-4.3.2/adlists.list 1970-01-01 01:00:00.000000000 +0100 ++++ pi-hole-4.3.2.cust/adlists.list 2019-09-21 12:37:48.803575104 +0200 +@@ -0,0 +1,7 @@ ++https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts ++https://mirror1.malwaredomains.com/files/justdomains ++http://sysctl.org/cameleon/hosts ++https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist ++https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt ++https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt ++https://hosts-file.net/ad_servers.txt +diff -uprN pi-hole-4.3.2/advanced/Scripts/chronometer.sh pi-hole-4.3.2.cust/advanced/Scripts/chronometer.sh +--- pi-hole-4.3.2/advanced/Scripts/chronometer.sh 2019-09-15 17:52:21.000000000 +0200 ++++ pi-hole-4.3.2.cust/advanced/Scripts/chronometer.sh 2019-09-21 12:37:48.751575298 +0200 +@@ -13,7 +13,7 @@ LC_NUMERIC=C + + # Retrieve stats from FTL engine + pihole-FTL() { +- ftl_port=$(cat /var/run/pihole-FTL.port 2> /dev/null) ++ ftl_port=$(cat /run/pihole-ftl/pihole-FTL.port 2> /dev/null) + if [[ -n "$ftl_port" ]]; then + # Open connection to FTL + exec 3<>"/dev/tcp/127.0.0.1/$ftl_port" +diff -uprN pi-hole-4.3.2/advanced/Scripts/piholeLogFlush.sh pi-hole-4.3.2.cust/advanced/Scripts/piholeLogFlush.sh +--- pi-hole-4.3.2/advanced/Scripts/piholeLogFlush.sh 2019-09-15 17:52:21.000000000 +0200 ++++ pi-hole-4.3.2.cust/advanced/Scripts/piholeLogFlush.sh 2019-09-21 12:37:48.749575306 +0200 +@@ -26,33 +26,33 @@ 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 /var/log/pihole.log /var/log/pihole.log.1 +- echo " " > /var/log/pihole.log ++ cp /run/log/pihole/pihole.log /run/log/pihole/pihole.log.1 ++ echo " " > /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 ++ echo " " > /run/log/pihole/pihole.log ++ if [ -f /run/log/pihole/pihole.log.1 ]; then ++ echo " " > /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) +@@ -63,6 +63,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-4.3.2/advanced/Scripts/version.sh pi-hole-4.3.2.cust/advanced/Scripts/version.sh +--- pi-hole-4.3.2/advanced/Scripts/version.sh 2019-09-15 17:52:21.000000000 +0200 ++++ pi-hole-4.3.2.cust/advanced/Scripts/version.sh 2019-09-21 12:37:48.776575205 +0200 +@@ -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 "4.3.2" + else +- echo "Untagged" ++ echo "4.3.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-4.3.2/advanced/Scripts/webpage.sh pi-hole-4.3.2.cust/advanced/Scripts/webpage.sh +--- pi-hole-4.3.2/advanced/Scripts/webpage.sh 2019-09-15 17:52:21.000000000 +0200 ++++ pi-hole-4.3.2.cust/advanced/Scripts/webpage.sh 2019-09-21 12:37:48.736575354 +0200 +@@ -16,7 +16,7 @@ readonly dhcpconfig="/etc/dnsmasq.d/02-p + readonly FTLconf="/etc/pihole/pihole-FTL.conf" + # 03 -> wildcards + readonly dhcpstaticconfig="/etc/dnsmasq.d/04-pihole-static-dhcp.conf" +-readonly PI_HOLE_BIN_DIR="/usr/local/bin" ++readonly PI_HOLE_BIN_DIR="/usr/bin" + + coltable="/opt/pihole/COL_TABLE" + if [[ -f ${coltable} ]]; then +diff -uprN pi-hole-4.3.2/advanced/Templates/logrotate pi-hole-4.3.2.cust/advanced/Templates/logrotate +--- pi-hole-4.3.2/advanced/Templates/logrotate 2019-09-15 17:52:21.000000000 +0200 ++++ pi-hole-4.3.2.cust/advanced/Templates/logrotate 2019-09-21 12:37:48.747575313 +0200 +@@ -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-4.3.2/advanced/Templates/pihole.sudo pi-hole-4.3.2.cust/advanced/Templates/pihole.sudo +--- pi-hole-4.3.2/advanced/Templates/pihole.sudo 2019-09-15 17:52:21.000000000 +0200 ++++ pi-hole-4.3.2.cust/advanced/Templates/pihole.sudo 2019-09-21 12:37:48.803575104 +0200 +@@ -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-4.3.2/advanced/dnsmasq.conf.original pi-hole-4.3.2.cust/advanced/dnsmasq.conf.original +--- pi-hole-4.3.2/advanced/dnsmasq.conf.original 2019-09-15 17:52:21.000000000 +0200 ++++ pi-hole-4.3.2.cust/advanced/dnsmasq.conf.original 2019-09-21 12:37:48.803575104 +0200 +@@ -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-4.3.2/dns-servers.conf pi-hole-4.3.2.cust/dns-servers.conf +--- pi-hole-4.3.2/dns-servers.conf 1970-01-01 01:00:00.000000000 +0100 ++++ pi-hole-4.3.2.cust/dns-servers.conf 2019-09-21 12:37:48.804575101 +0200 +@@ -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:0:ccc::2;2620:0:ccd::2 ++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-4.3.2/gravity.sh pi-hole-4.3.2.cust/gravity.sh +--- pi-hole-4.3.2/gravity.sh 2019-09-15 17:52:21.000000000 +0200 ++++ pi-hole-4.3.2.cust/gravity.sh 2019-09-21 12:37:48.731575373 +0200 +@@ -19,7 +19,7 @@ regexconverter="/opt/pihole/wildcard_reg + source "${regexconverter}" + + basename="pihole" +-PIHOLE_COMMAND="/usr/local/bin/${basename}" ++PIHOLE_COMMAND="/usr/bin/${basename}" + + piholeDir="/etc/${basename}" + +diff -uprN pi-hole-4.3.2/pihole pi-hole-4.3.2.cust/pihole +--- pi-hole-4.3.2/pihole 2019-09-15 17:52:21.000000000 +0200 ++++ pi-hole-4.3.2.cust/pihole 2019-09-21 12:37:48.738575347 +0200 +@@ -13,11 +13,10 @@ readonly PI_HOLE_SCRIPT_DIR="/opt/pihole + readonly gravitylist="/etc/pihole/gravity.list" + readonly blacklist="/etc/pihole/black.list" + +-# setupVars and PI_HOLE_BIN_DIR are not readonly here because in some funcitons (checkout), + # it 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}" +@@ -57,17 +56,6 @@ flushFunc() { + 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 $? +@@ -86,11 +74,6 @@ chronometerFunc() { + } + + +-uninstallFunc() { +- "${PI_HOLE_SCRIPT_DIR}"/uninstall.sh +- exit 0 +-} +- + versionFunc() { + shift + "${PI_HOLE_SCRIPT_DIR}"/version.sh "$@" +@@ -108,7 +91,7 @@ restartDNS() { + svc="killall -s SIGHUP ${resolver}" + else + # A full restart has been requested +- svc="service ${resolver} restart" ++ svc="systemctl restart ${resolver}" + fi + + # Print output to Terminal, but not to Web Admin +@@ -224,9 +207,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 +@@ -308,7 +291,7 @@ tailFunc() { + # Colour blocklist/blacklist/wildcard entries as red + # Colour A/AAAA/DHCP strings as white + # Colour 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,(.*(gravity.list|black.list|regex.list| config ).* is (0.0.0.0|::|NXDOMAIN|${IPV4_ADDRESS%/*}|${IPV6_ADDRESS:-NULL}).*),${COL_RED}&${COL_NC}," \ + -e "s,.*(query\\[A|DHCP).*,${COL_NC}&${COL_NC}," \ +@@ -316,59 +299,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 "$@" +@@ -391,7 +321,6 @@ Debugging Options: + -d, debug Start a debugging session + Add '-a' to enable automated debugging + -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: +@@ -405,18 +334,15 @@ 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 + Add '-h' for more info on disable usage + restartdns Restart Pi-hole subsystems +- checkout Switch Pi-hole subsystems to a different Github branch +- Add '-h' for more info on checkout usage"; ++"; + exit 0 + } + +@@ -447,23 +373,18 @@ case "${1}" in + "--regex" | "regex" ) 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 "$@";; + * ) helpFunc;; + esac diff --git a/version.patch b/version.patch deleted file mode 100644 index 4c703e796331..000000000000 --- a/version.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- pi-hole-4.0.a/advanced/Scripts/version.sh 2018-08-05 19:40:22.000000000 +0200 -+++ pi-hole-4.0/advanced/Scripts/version.sh 2018-08-24 15:28:44.141363877 +0200 -@@ -20,42 +20,16 @@ - 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 "4.2.1" - else -- echo "Untagged" -+ echo "4.2.1" - 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 - } - |