From 4e07ae24f10137fa3137d32da2144fd1bc16f218 Mon Sep 17 00:00:00 2001 From: Matthias rank Date: Tue, 12 May 2020 22:24:45 +0200 Subject: [PATCH 01/24] Added support for CNAME records add/remove Signed-off-by: Matthias rank --- cname_records.php | 96 +++++++++++++++++++ scripts/pi-hole/js/customcname.js | 116 +++++++++++++++++++++++ scripts/pi-hole/php/customcname.php | 141 ++++++++++++++++++++++++++++ scripts/pi-hole/php/header.php | 23 ++++- 4 files changed, 372 insertions(+), 4 deletions(-) create mode 100644 cname_records.php create mode 100644 scripts/pi-hole/js/customcname.js create mode 100644 scripts/pi-hole/php/customcname.php diff --git a/cname_records.php b/cname_records.php new file mode 100644 index 00000000..e6f98197 --- /dev/null +++ b/cname_records.php @@ -0,0 +1,96 @@ + + + + + + +
+
+
+ +
+

+ Add a new CNAME record +

+
+ +
+
+
+ + +
+
+ + +
+
+
+ +
+
+
+ + + + + + +
+
+
+
+

+ List of local CNAME records +

+
+ +
+ + + + + + + + +
DomainTargetAction
+ +
+ +
+ +
+
+ + + + diff --git a/scripts/pi-hole/js/customcname.js b/scripts/pi-hole/js/customcname.js new file mode 100644 index 00000000..49aebab2 --- /dev/null +++ b/scripts/pi-hole/js/customcname.js @@ -0,0 +1,116 @@ +/* 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. + * + * This file is copyright under the latest version of the EUPL. + * Please see LICENSE file for your rights under this license. */ + +var table; + +function showAlert(type, message) { + var alertElement = null; + var messageElement = null; + + switch (type) { + case "info": + alertElement = $("#alInfo"); + break; + case "success": + alertElement = $("#alSuccess"); + break; + case "warning": + alertElement = $("#alWarning"); + messageElement = $("#warn"); + break; + case "error": + alertElement = $("#alFailure"); + messageElement = $("#err"); + break; + default: + return; + } + + if (messageElement !== null) messageElement.html(message); + + alertElement.fadeIn(200); + alertElement.delay(8000).fadeOut(2000); +} + +$(document).ready(function () { + $("#btnAdd").on("click", addCustomCNAME); + + table = $("#customCNAMETable").DataTable({ + ajax: "scripts/pi-hole/php/customcname.php?action=get", + columns: [{}, {}, { orderable: false, searchable: false }], + columnDefs: [ + { + targets: 2, + render: function (data, type, row) { + return ( + '" + ); + } + } + ], + drawCallback: function () { + $(".deleteCustomCNAME").on("click", deleteCustomCNAME); + } + }); + // Disable autocorrect in the search box + var input = document.querySelector("input[type=search]"); + input.setAttribute("autocomplete", "off"); + input.setAttribute("autocorrect", "off"); + input.setAttribute("autocapitalize", "off"); + input.setAttribute("spellcheck", false); +}); + +function addCustomCNAME() { + var target = $("#target").val(); + var domain = $("#domain").val(); + + showAlert("info"); + $.ajax({ + url: "scripts/pi-hole/php/customcname.php", + method: "post", + dataType: "json", + data: { action: "add", target: target, domain: domain }, + success: function (response) { + if (response.success) { + showAlert("success"); + table.ajax.reload(); + } else showAlert("error", response.message); + }, + error: function () { + showAlert("error", "Error while adding this custom CNAME record"); + } + }); +} + +function deleteCustomCNAME() { + var target = $(this).attr("data-target"); + var domain = $(this).attr("data-domain"); + + showAlert("info"); + $.ajax({ + url: "scripts/pi-hole/php/customcname.php", + method: "post", + dataType: "json", + data: { action: "delete", domain: domain, target: target }, + success: function (response) { + if (response.success) { + showAlert("success"); + table.ajax.reload(); + } else showAlert("error", response.message); + }, + error: function (jqXHR, exception) { + showAlert("error", "Error while deleting this custom CNAME record"); + console.log(exception); + } + }); +} diff --git a/scripts/pi-hole/php/customcname.php b/scripts/pi-hole/php/customcname.php new file mode 100644 index 00000000..fcc5e862 --- /dev/null +++ b/scripts/pi-hole/php/customcname.php @@ -0,0 +1,141 @@ +domain, $entry->target ]; + + return [ "data" => $data ]; + } + + function getCustomCNAMEEntries() + { + global $customCNAMEFile; + + $entries = []; + + $handle = fopen($customCNAMEFile, "r"); + if ($handle) + { + while (($line = fgets($handle)) !== false) { + $line = str_replace("cname=","", $line); + $line = str_replace("\r","", $line); + $line = str_replace("\n","", $line); + $explodedLine = explode (",", $line); + + if (count($explodedLine) <= 1) + continue; + + $data = new \stdClass(); + $data->domains = array_slice($explodedLine, 0, -1); + $data->domain = implode(",", $data->domains); + $data->target = $explodedLine[count($explodedLine)-1]; + $entries[] = $data; + } + + fclose($handle); + } + + return $entries; + } + + function addCustomCNAMEEntry() + { + try + { + $target = !empty($_REQUEST['target']) ? $_REQUEST['target']: ""; + $domain = !empty($_REQUEST['domain']) ? $_REQUEST['domain']: ""; + + if (empty($target)) + return errorJsonResponse("Target must be set"); + + if (empty($domain)) + return errorJsonResponse("Domain must be set"); + + // Check if each submitted domain is valid + $domains = array_map('trim', explode(",", $domain)); + foreach ($domains as $d) { + if (!is_valid_domain_name($d)) + return errorJsonResponse("Domain '$d' is not valid"); + } + + $existingEntries = getCustomCNAMEEntries(); + + // Check if a record for one of the domains already exists + foreach ($existingEntries as $entry) + foreach ($domains as $d) + if (in_array($d, $entry->domains)) + return errorJsonResponse("There is already a CNAME record for '$d'"); + + exec("sudo pihole -a addcustomcname ".$domain." ".$target); + + return successJsonResponse(); + } + catch (\Exception $ex) + { + return errorJsonResponse($ex->getMessage()); + } + } + + function deleteCustomCNAMEEntry() + { + try + { + $target = !empty($_REQUEST['target']) ? $_REQUEST['target']: ""; + $domain = !empty($_REQUEST['domain']) ? $_REQUEST['domain']: ""; + + if (empty($target)) + return errorJsonResponse("Target must be set"); + + if (empty($domain)) + return errorJsonResponse("Domain must be set"); + + $existingEntries = getCustomCNAMEEntries(); + + $found = false; + foreach ($existingEntries as $entry) + if ($entry->domain == $domain) + if ($entry->target == $target) { + $found = true; + break; + } + + if (!$found) + return errorJsonResponse("This domain/ip association does not exist"); + + exec("sudo pihole -a removecustomcname ".$domain." ".$target); + + return successJsonResponse(); + } + catch (\Exception $ex) + { + return errorJsonResponse($ex->getMessage()); + } + } + + function successJsonResponse($message = "") + { + return [ "success" => true, "message" => $message ]; + } + + function errorJsonResponse($message = "") + { + return [ "success" => false, "message" => $message ]; + } +?> diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index 38f920aa..96a88465 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -608,10 +608,25 @@ if($auth) { - class="active"> - - Local DNS Records - +
  • active"> + + + + + Local DNS + +
  • Date: Fri, 15 May 2020 10:09:15 +0200 Subject: [PATCH 02/24] Removed already defined functions Signed-off-by: Matthias Rank --- scripts/pi-hole/php/customcname.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scripts/pi-hole/php/customcname.php b/scripts/pi-hole/php/customcname.php index fcc5e862..62857206 100644 --- a/scripts/pi-hole/php/customcname.php +++ b/scripts/pi-hole/php/customcname.php @@ -128,14 +128,4 @@ return errorJsonResponse($ex->getMessage()); } } - - function successJsonResponse($message = "") - { - return [ "success" => true, "message" => $message ]; - } - - function errorJsonResponse($message = "") - { - return [ "success" => false, "message" => $message ]; - } ?> From 212da94228ece54a4b98d0d3b32c7abfacaee227 Mon Sep 17 00:00:00 2001 From: Matthias rank Date: Thu, 21 May 2020 14:48:13 +0200 Subject: [PATCH 03/24] Added token verification Moved CNAME functions to func.php Added teleporter support Fixed CNAME and DNS file declaration (filename was declarated in seperate file, therefore trying to read those files from func.php failed) Fixed error and success response functions in func.php (calling addCustomDNSEntry and addCustomCNAMEEntry repeatedly from teleporter failed because of error function defined inside of those functions) Signed-off-by: Matthias Rank --- scripts/pi-hole/js/customcname.js | 11 +- scripts/pi-hole/php/customcname.php | 132 ++---------------- scripts/pi-hole/php/customdns.php | 2 - scripts/pi-hole/php/func.php | 205 ++++++++++++++++++++++++---- scripts/pi-hole/php/teleporter.php | 28 ++++ settings.php | 5 + 6 files changed, 228 insertions(+), 155 deletions(-) diff --git a/scripts/pi-hole/js/customcname.js b/scripts/pi-hole/js/customcname.js index 49aebab2..b28f8c43 100644 --- a/scripts/pi-hole/js/customcname.js +++ b/scripts/pi-hole/js/customcname.js @@ -6,6 +6,7 @@ * Please see LICENSE file for your rights under this license. */ var table; +var token = $("#token").text(); function showAlert(type, message) { var alertElement = null; @@ -40,7 +41,11 @@ $(document).ready(function () { $("#btnAdd").on("click", addCustomCNAME); table = $("#customCNAMETable").DataTable({ - ajax: "scripts/pi-hole/php/customcname.php?action=get", + ajax: { + url: "scripts/pi-hole/php/customcname.php", + data: { action: "get", token: token }, + type: "POST" + }, columns: [{}, {}, { orderable: false, searchable: false }], columnDefs: [ { @@ -79,7 +84,7 @@ function addCustomCNAME() { url: "scripts/pi-hole/php/customcname.php", method: "post", dataType: "json", - data: { action: "add", target: target, domain: domain }, + data: { action: "add", target: target, domain: domain, token: token }, success: function (response) { if (response.success) { showAlert("success"); @@ -101,7 +106,7 @@ function deleteCustomCNAME() { url: "scripts/pi-hole/php/customcname.php", method: "post", dataType: "json", - data: { action: "delete", domain: domain, target: target }, + data: { action: "delete", domain: domain, target: target, token: token }, success: function (response) { if (response.success) { showAlert("success"); diff --git a/scripts/pi-hole/php/customcname.php b/scripts/pi-hole/php/customcname.php index 62857206..e2af5341 100644 --- a/scripts/pi-hole/php/customcname.php +++ b/scripts/pi-hole/php/customcname.php @@ -2,130 +2,22 @@ require_once "func.php"; - $customCNAMEFile = "/etc/dnsmasq.d/05-pihole-custom-cname.conf"; + require_once('auth.php'); + + // Authentication checks + if (isset($_POST['token'])) { + check_cors(); + check_csrf($_POST['token']); + } else { + log_and_die('Not allowed (login session invalid or expired, please relogin on the Pi-hole dashboard)!'); + } switch ($_REQUEST['action']) { - case 'get': echo json_encode(echoCustomCNAMEEntries()); break; - case 'add': echo json_encode(addCustomCNAMEEntry()); break; - case 'delete': echo json_encode(deleteCustomCNAMEEntry()); break; + case 'get': echo json_encode(echoCustomCNAMEEntries()); break; + case 'add': echo json_encode(addCustomCNAMEEntry()); break; + case 'delete': echo json_encode(deleteCustomCNAMEEntry()); break; default: die("Wrong action"); } - - function echoCustomCNAMEEntries() - { - $entries = getCustomCNAMEEntries(); - - $data = []; - foreach ($entries as $entry) - $data[] = [ $entry->domain, $entry->target ]; - - return [ "data" => $data ]; - } - - function getCustomCNAMEEntries() - { - global $customCNAMEFile; - - $entries = []; - - $handle = fopen($customCNAMEFile, "r"); - if ($handle) - { - while (($line = fgets($handle)) !== false) { - $line = str_replace("cname=","", $line); - $line = str_replace("\r","", $line); - $line = str_replace("\n","", $line); - $explodedLine = explode (",", $line); - - if (count($explodedLine) <= 1) - continue; - - $data = new \stdClass(); - $data->domains = array_slice($explodedLine, 0, -1); - $data->domain = implode(",", $data->domains); - $data->target = $explodedLine[count($explodedLine)-1]; - $entries[] = $data; - } - - fclose($handle); - } - - return $entries; - } - - function addCustomCNAMEEntry() - { - try - { - $target = !empty($_REQUEST['target']) ? $_REQUEST['target']: ""; - $domain = !empty($_REQUEST['domain']) ? $_REQUEST['domain']: ""; - - if (empty($target)) - return errorJsonResponse("Target must be set"); - - if (empty($domain)) - return errorJsonResponse("Domain must be set"); - - // Check if each submitted domain is valid - $domains = array_map('trim', explode(",", $domain)); - foreach ($domains as $d) { - if (!is_valid_domain_name($d)) - return errorJsonResponse("Domain '$d' is not valid"); - } - - $existingEntries = getCustomCNAMEEntries(); - - // Check if a record for one of the domains already exists - foreach ($existingEntries as $entry) - foreach ($domains as $d) - if (in_array($d, $entry->domains)) - return errorJsonResponse("There is already a CNAME record for '$d'"); - - exec("sudo pihole -a addcustomcname ".$domain." ".$target); - - return successJsonResponse(); - } - catch (\Exception $ex) - { - return errorJsonResponse($ex->getMessage()); - } - } - - function deleteCustomCNAMEEntry() - { - try - { - $target = !empty($_REQUEST['target']) ? $_REQUEST['target']: ""; - $domain = !empty($_REQUEST['domain']) ? $_REQUEST['domain']: ""; - - if (empty($target)) - return errorJsonResponse("Target must be set"); - - if (empty($domain)) - return errorJsonResponse("Domain must be set"); - - $existingEntries = getCustomCNAMEEntries(); - - $found = false; - foreach ($existingEntries as $entry) - if ($entry->domain == $domain) - if ($entry->target == $target) { - $found = true; - break; - } - - if (!$found) - return errorJsonResponse("This domain/ip association does not exist"); - - exec("sudo pihole -a removecustomcname ".$domain." ".$target); - - return successJsonResponse(); - } - catch (\Exception $ex) - { - return errorJsonResponse($ex->getMessage()); - } - } ?> diff --git a/scripts/pi-hole/php/customdns.php b/scripts/pi-hole/php/customdns.php index a27f1e2b..45de52bd 100644 --- a/scripts/pi-hole/php/customdns.php +++ b/scripts/pi-hole/php/customdns.php @@ -2,8 +2,6 @@ require_once "func.php"; - $customDNSFile = "/etc/pihole/custom.list"; - switch ($_REQUEST['action']) { case 'get': echo json_encode(echoCustomDNSEntries()); break; diff --git a/scripts/pi-hole/php/func.php b/scripts/pi-hole/php/func.php index ebd100c0..9c426f4f 100644 --- a/scripts/pi-hole/php/func.php +++ b/scripts/pi-hole/php/func.php @@ -81,6 +81,9 @@ function pihole_execute($argument_string, $error_on_failure = true) { return $output; } +// Custom DNS +$customDNSFile = "/etc/pihole/custom.list"; + function echoCustomDNSEntries() { $entries = getCustomDNSEntries(); @@ -121,19 +124,8 @@ function getCustomDNSEntries() return $entries; } -function addCustomDNSEntry($ip="", $domain="", $json_reply=true) +function addCustomDNSEntry($ip="", $domain="", $json=true) { - function error($msg) - { - global $json_reply; - if($json_reply) - return errorJsonResponse($msg); - else { - echo $msg."
    "; - return false; - } - } - try { if(isset($_REQUEST['ip'])) @@ -143,18 +135,18 @@ function addCustomDNSEntry($ip="", $domain="", $json_reply=true) $domain = $_REQUEST['domain']; if (empty($ip)) - return error("IP must be set"); + return returnError("IP must be set", $json); $ipType = get_ip_type($ip); if (!$ipType) - return error("IP must be valid"); + return returnError("IP must be valid", $json); if (empty($domain)) - return error("Domain must be set"); + return returnError("Domain must be set", $json); if (!is_valid_domain_name($domain)) - return error("Domain must be valid"); + return returnError("Domain must be valid", $json); // Only check for duplicates if adding new records from the web UI (not through Teleporter) if(isset($_REQUEST['ip']) || isset($_REQUEST['domain'])) @@ -162,17 +154,17 @@ function addCustomDNSEntry($ip="", $domain="", $json_reply=true) $existingEntries = getCustomDNSEntries(); foreach ($existingEntries as $entry) if ($entry->domain == $domain && get_ip_type($entry->ip) == $ipType) - return error("This domain already has a custom DNS entry for an IPv" . $ipType); + return returnError("This domain already has a custom DNS entry for an IPv" . $ipType, $json); } // Add record pihole_execute("-a addcustomdns ".$ip." ".$domain); - return $json_reply ? successJsonResponse() : true; + return returnSuccess("", $json); } catch (\Exception $ex) { - return error($ex->getMessage()); + return error($ex->getMessage(), $json); } } @@ -184,10 +176,10 @@ function deleteCustomDNSEntry() $domain = !empty($_REQUEST['domain']) ? $_REQUEST['domain']: ""; if (empty($ip)) - return errorJsonResponse("IP must be set"); + return returnError("IP must be set"); if (empty($domain)) - return errorJsonResponse("Domain must be set"); + return returnError("Domain must be set"); $existingEntries = getCustomDNSEntries(); @@ -200,15 +192,15 @@ function deleteCustomDNSEntry() } if (!$found) - return errorJsonResponse("This domain/ip association does not exist"); + return returnError("This domain/ip association does not exist"); pihole_execute("-a removecustomdns ".$ip." ".$domain); - return successJsonResponse(); + return returnSuccess(); } catch (\Exception $ex) { - return errorJsonResponse($ex->getMessage()); + return returnError($ex->getMessage()); } } @@ -235,23 +227,176 @@ function deleteAllCustomDNSEntries() } catch (\Exception $ex) { - return errorJsonResponse($ex->getMessage()); + return returnError($ex->getMessage()); } fclose($handle); } - return successJsonResponse(); + return returnSuccess(); } -function successJsonResponse($message = "") +// CNAME +$customCNAMEFile = "/etc/dnsmasq.d/05-pihole-custom-cname.conf"; + +function echoCustomCNAMEEntries() { - return [ "success" => true, "message" => $message ]; + $entries = getCustomCNAMEEntries(); + + $data = []; + foreach ($entries as $entry) + $data[] = [ $entry->domain, $entry->target ]; + + return [ "data" => $data ]; } -function errorJsonResponse($message = "") +function getCustomCNAMEEntries() { - return [ "success" => false, "message" => $message ]; + global $customCNAMEFile; + + $entries = []; + + if (!file_exists($customCNAMEFile)) return $entries; + + $handle = fopen($customCNAMEFile, "r"); + if ($handle) + { + while (($line = fgets($handle)) !== false) { + $line = str_replace("cname=","", $line); + $line = str_replace("\r","", $line); + $line = str_replace("\n","", $line); + $explodedLine = explode (",", $line); + + if (count($explodedLine) <= 1) + continue; + + $data = new \stdClass(); + $data->domains = array_slice($explodedLine, 0, -1); + $data->domain = implode(",", $data->domains); + $data->target = $explodedLine[count($explodedLine)-1]; + $entries[] = $data; + } + + fclose($handle); + } + + return $entries; +} + +function addCustomCNAMEEntry($domain="", $target="", $json=true) +{ + try + { + if(isset($_REQUEST['domain'])) + $domain = $_REQUEST['domain']; + + if(isset($_REQUEST['target'])) + $target = $_REQUEST['target']; + + if (empty($domain)) + return returnError("Domain must be set", $json); + + if (empty($target)) + return returnError("Target must be set", $json); + + // Check if each submitted domain is valid + $domains = array_map('trim', explode(",", $domain)); + foreach ($domains as $d) { + if (!is_valid_domain_name($d)) + return returnError("Domain '$d' is not valid", $json); + } + + $existingEntries = getCustomCNAMEEntries(); + + // Check if a record for one of the domains already exists + foreach ($existingEntries as $entry) + foreach ($domains as $d) + if (in_array($d, $entry->domains)) + return returnError("There is already a CNAME record for '$d'", $json); + + pihole_execute("-a addcustomcname ".$domain." ".$target); + + return returnSuccess("", $json); + } + catch (\Exception $ex) + { + return returnError($ex->getMessage(), $json); + } +} + +function deleteCustomCNAMEEntry() +{ + try + { + $target = !empty($_REQUEST['target']) ? $_REQUEST['target']: ""; + $domain = !empty($_REQUEST['domain']) ? $_REQUEST['domain']: ""; + + if (empty($target)) + return returnError("Target must be set"); + + if (empty($domain)) + return returnError("Domain must be set"); + + $existingEntries = getCustomCNAMEEntries(); + + $found = false; + foreach ($existingEntries as $entry) + if ($entry->domain == $domain) + if ($entry->target == $target) { + $found = true; + break; + } + + if (!$found) + return returnError("This domain/ip association does not exist"); + + pihole_execute("-a removecustomcname ".$domain." ".$target); + + return returnSuccess(); + } + catch (\Exception $ex) + { + return returnError($ex->getMessage()); + } +} + +function deleteAllCustomCNAMEEntries() +{ + try + { + $existingEntries = getCustomCNAMEEntries(); + + foreach ($existingEntries as $entry) { + pihole_execute("-a removecustomcname ".$entry->domain." ".$entry->target); + } + + } + catch (\Exception $ex) + { + return returnError($ex->getMessage()); + } + + return returnSuccess(); +} + +function returnSuccess($message = "", $json = true) +{ + if ($json) { + return [ "success" => true, "message" => $message ]; + } else { + echo $msg."
    "; + return true; + } +} + +function returnError($message = "", $json = true) +{ + if ($json) { + return [ "success" => false, "message" => $message ]; + } else { + echo $msg."
    "; + return false; + } } ?> diff --git a/scripts/pi-hole/php/teleporter.php b/scripts/pi-hole/php/teleporter.php index 5c75580a..a9a06692 100644 --- a/scripts/pi-hole/php/teleporter.php +++ b/scripts/pi-hole/php/teleporter.php @@ -523,6 +523,34 @@ if(isset($_POST["action"])) $importedsomething = true; } } + + if(isset($_POST["localcnamerecords"]) && $file->getFilename() === "05-pihole-custom-cname.conf") + { + if($flushtables) { + // Defined in func.php included via auth.php + deleteAllCustomCNAMEEntries(); + } + + $num = 0; + $localcnamerecords = process_file(file_get_contents($file)); + foreach($localcnamerecords as $record) { + $line = str_replace("cname=","", $record); + $line = str_replace("\r","", $line); + $line = str_replace("\n","", $line); + $explodedLine = explode (",", $line); + + $domain = implode(",", array_slice($explodedLine, 0, -1)); + $target = $explodedLine[count($explodedLine)-1]; + + if(addCustomCNAMEEntry($domain, $target, false)) + $num++; + } + + echo "Processed local CNAME records (".$num." entries)
    \n"; + if($num > 0) { + $importedsomething = true; + } + } } if($importedsomething) diff --git a/settings.php b/settings.php index bbf45513..775a1069 100644 --- a/settings.php +++ b/settings.php @@ -1153,6 +1153,11 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists" checked> Local DNS Records +
    + +
    From 773fed0f214616bbc55ee2b3dd70797bccbb9bbc Mon Sep 17 00:00:00 2001 From: Matthias rank Date: Sun, 21 Jun 2020 13:46:00 +0200 Subject: [PATCH 04/24] Incorporate upstream changes Signed-off-by: Matthias Rank --- cname_records.php | 19 ++++++++++--------- scripts/pi-hole/js/customcname.js | 16 +++++++++------- scripts/pi-hole/php/customcname.php | 5 ++++- scripts/pi-hole/php/customdns.php | 2 -- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/cname_records.php b/cname_records.php index e6f98197..c90f7f51 100644 --- a/cname_records.php +++ b/cname_records.php @@ -30,35 +30,35 @@
    - +
    - +
    - + diff --git a/scripts/pi-hole/php/customdns.php b/scripts/pi-hole/php/customdns.php index b61eed4e..196ca281 100644 --- a/scripts/pi-hole/php/customdns.php +++ b/scripts/pi-hole/php/customdns.php @@ -2,8 +2,6 @@ require_once "func.php"; - $customDNSFile = "/etc/pihole/custom.list"; - require_once('auth.php'); // Authentication checks From 018d047de70ef59ae062ccefddb0edacf2908e9a Mon Sep 17 00:00:00 2001 From: yubiuser Date: Thu, 16 Jul 2020 23:39:53 +0200 Subject: [PATCH 05/24] Remove duplicated sidebar entry for Local DNS Records Signed-off-by: yubiuser --- scripts/pi-hole/php/header.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index 48336c8d..7cf4d378 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -454,12 +454,6 @@ if($auth) { Blacklist - - class="active"> - - Local DNS Records - -
  • active"> From 495a96a16ecda392bbbc4cde77a211e5c9cdc23d Mon Sep 17 00:00:00 2001 From: yubiuser Date: Fri, 17 Jul 2020 00:04:37 +0200 Subject: [PATCH 06/24] Show date and time FTL started in settings page Signed-off-by: yubiuser --- settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.php b/settings.php index 5f25b0b7..f4104cb3 100644 --- a/settings.php +++ b/settings.php @@ -318,7 +318,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "adlists", " Time FTL started: - + User / Group: From 658033143ee3118714365eafa406c4fbdac57b23 Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Thu, 16 Jul 2020 09:30:43 -0500 Subject: [PATCH 07/24] Remove duplicate DNSSEC explanation Signed-off-by: Michael Stanclift --- settings.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/settings.php b/settings.php index 5f25b0b7..bc494cf0 100644 --- a/settings.php +++ b/settings.php @@ -976,15 +976,6 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "adlists", " when enabling DNSSEC. A DNSSEC resolver test can be found here.

    -

    Validate DNS replies and cache DNSSEC data. When forwarding DNS - queries, Pi-hole requests the DNSSEC records needed to validate - the replies. If a domain fails validation or the upstream does not - support DNSSEC, this setting can cause issues resolving domains. - Use Google, Cloudflare, DNS.WATCH, Quad9, or another DNS - server which supports DNSSEC when activating DNSSEC. Note that - the size of your log might increase significantly - when enabling DNSSEC. A DNSSEC resolver test can be found - here.


    Conditional forwarding

    If not configured as your DHCP server, Pi-hole typically won't be able to From 1fce1f6fa0ae565e620d093cca075aff07e1734d Mon Sep 17 00:00:00 2001 From: yubiuser Date: Sat, 18 Jul 2020 05:51:49 +0200 Subject: [PATCH 08/24] Fix sidebar animation angle for Local DNS Records (#1507) Signed-off-by: yubiuser --- scripts/pi-hole/php/header.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index 7cf4d378..2f5305f5 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -598,10 +598,10 @@ if($auth) {

  • active"> + Local DNS - - - Local DNS + +