From bacded47d21f04d93b5d52ccebb9a7464e4fa5e5 Mon Sep 17 00:00:00 2001
From: yubiuser
Date: Sun, 4 Jul 2021 20:06:08 +0200
Subject: [PATCH 001/393] Remove adlists tab from settings page
Signed-off-by: yubiuser
---
scripts/pi-hole/js/settings.js | 3 ++-
settings.php | 20 +-------------------
2 files changed, 3 insertions(+), 20 deletions(-)
diff --git a/scripts/pi-hole/js/settings.js b/scripts/pi-hole/js/settings.js
index 02f5b5a281..dd40734806 100644
--- a/scripts/pi-hole/js/settings.js
+++ b/scripts/pi-hole/js/settings.js
@@ -121,7 +121,8 @@ $(".confirm-disablelogging-noflush").confirm({
});
$(".api-token").confirm({
- text: "Make sure that nobody else can scan this code around you. They will have full access to the API without having to know the password. Note that the generation of the QR code will take some time.",
+ text:
+ "Make sure that nobody else can scan this code around you. They will have full access to the API without having to know the password. Note that the generation of the QR code will take some time.",
title: "Confirmation required",
confirm: function () {
window.open("scripts/pi-hole/php/api_token.php");
diff --git a/settings.php b/settings.php
index a59fe423f0..1790503f29 100644
--- a/settings.php
+++ b/settings.php
@@ -219,7 +219,7 @@
?>
class="active">
" role="tab" data-toggle="tab">System
-
When there is a Pi-hole domain set and this box is
ticked, this asks FTL that this domain is purely
local and FTL may answer queries from /etc/hosts or DHCP leases
- but should never forward queries on that domain to any upstream servers.
+ but should never forward queries on that domain to any upstream servers.
+ If Conditional Fowarding is enabled, unticking this box may cause a partial
+ DNS loop under certain circumstances (e.g. if a client would send TLD DNSSEC queries).
checked>
@@ -953,6 +955,8 @@ function convertseconds($argument)
devices ending in your local domain name will not leave your network, however, this is optional.
The local domain name must match the domain name specified
in your DHCP server for this to work. You can likely find it within the DHCP settings.
+
Enabling Conditional Fowarding will also forward all hostnames (i.e., non-FQDNs) to the router
+ when "Never forward non-FQDNs" is not enable.
checked>
From 8940e79f070a52bd404c43d2ecc7720a33cb01a8 Mon Sep 17 00:00:00 2001
From: DL6ER
Date: Fri, 10 Sep 2021 09:20:01 +0200
Subject: [PATCH 012/393] Fix typo
Co-authored-by: XhmikosR
---
settings.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/settings.php b/settings.php
index 67420e9c02..074bb02f8d 100644
--- a/settings.php
+++ b/settings.php
@@ -956,7 +956,7 @@ function convertseconds($argument)
The local domain name must match the domain name specified
in your DHCP server for this to work. You can likely find it within the DHCP settings.
Enabling Conditional Fowarding will also forward all hostnames (i.e., non-FQDNs) to the router
- when "Never forward non-FQDNs" is not enable.
+ when "Never forward non-FQDNs" is not enabled.
checked>
From cf8602eedd4a31eadb72372fc878c12d342f8600 Mon Sep 17 00:00:00 2001
From: Adam Warner
Date: Sat, 11 Sep 2021 19:34:32 +0100
Subject: [PATCH 013/393] set httponly to true when calling setcookie. the
ini_set option above doesn't actually seem to do anything... (but not
removing it just in case
Signed-off-by: Adam Warner
---
scripts/pi-hole/php/password.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/pi-hole/php/password.php b/scripts/pi-hole/php/password.php
index 01e7efd699..91888a0b80 100644
--- a/scripts/pi-hole/php/password.php
+++ b/scripts/pi-hole/php/password.php
@@ -50,7 +50,8 @@
{
$auth = true;
// Refresh cookie with new expiry
- setcookie('persistentlogin', $pwhash, time()+60*60*24*7);
+ // setcookie( $name, $value, $expire, $path, $domain, $secure, $httponly )
+ setcookie('persistentlogin', $pwhash, time()+60*60*24*7, null, null, null, true );
}
else
{
@@ -79,7 +80,8 @@
// Set persistent cookie if selected
if (isset($_POST['persistentlogin']))
{
- setcookie('persistentlogin', $pwhash, time()+60*60*24*7);
+ // setcookie( $name, $value, $expire, $path, $domain, $secure, $httponly )
+ setcookie('persistentlogin', $pwhash, time()+60*60*24*7, null, null, null, true );
}
header('Location: index.php');
exit();
From 25df78337800e62117dbf1b7a1565bc449331307 Mon Sep 17 00:00:00 2001
From: Adam Warner
Date: Sat, 11 Sep 2021 20:03:05 +0100
Subject: [PATCH 014/393] Apply htmlentities in a couple of places to prevent
xss
Co-authored-by: wtwver
Signed-off-by: Adam Warner
---
scripts/pi-hole/php/func.php | 1 +
settings.php | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/pi-hole/php/func.php b/scripts/pi-hole/php/func.php
index 12e410618f..4d79872b13 100644
--- a/scripts/pi-hole/php/func.php
+++ b/scripts/pi-hole/php/func.php
@@ -472,6 +472,7 @@ function returnSuccess($message = "", $json = true)
function returnError($message = "", $json = true)
{
+ $message = htmlentities($message) ;
if ($json) {
return [ "success" => false, "message" => $message ];
} else {
diff --git a/settings.php b/settings.php
index d08d17fb3e..a3ce919a32 100644
--- a/settings.php
+++ b/settings.php
@@ -41,7 +41,7 @@
diff --git a/scripts/pi-hole/js/messages.js b/scripts/pi-hole/js/messages.js
index 2f1aca3db6..97c4446fb8 100644
--- a/scripts/pi-hole/js/messages.js
+++ b/scripts/pi-hole/js/messages.js
@@ -77,17 +77,6 @@ function renderMessage(data, type, row) {
case "DNSMASQ_CONFIG":
return "FTL failed to start due to " + row.message;
- case "RATE_LIMIT":
- return (
- "Client " +
- row.message +
- " has been rate-limited (current config allows up to " +
- parseInt(row.blob1, 10) +
- " queries in " +
- parseInt(row.blob2, 10) +
- " seconds)"
- );
-
default:
return "Unknown message type
" + JSON.stringify(row) + "
";
}
@@ -112,7 +101,23 @@ $(function () {
{ data: "blob3", visible: false },
{ data: "blob4", visible: false },
{ data: "blob5", visible: false },
+ { data: null, width: "80px", orderable: false },
],
+ drawCallback: function () {
+ $('button[id^="deleteMessage_"]').on("click", deleteMessage);
+ // Remove visible dropdown to prevent orphaning
+ $("body > .bootstrap-select.dropdown").remove();
+ },
+ rowCallback: function (row, data) {
+ $(row).attr("data-id", data.id);
+ var button =
+ '";
+ $("td:eq(3)", row).html(button);
+ },
dom:
"<'row'<'col-sm-4'l><'col-sm-8'f>>" +
"<'row'<'col-sm-12'<'table-responsive'tr>>>" +
@@ -148,3 +153,31 @@ $(function () {
},
});
});
+
+function deleteMessage() {
+ var tr = $(this).closest("tr");
+ var id = tr.attr("data-id");
+
+ utils.disableAll();
+ utils.showAlert("info", "", "Deleting message # ",id);
+ $.ajax({
+ url: "scripts/pi-hole/php/message.php",
+ method: "post",
+ dataType: "json",
+ data: { action: "delete_message", id: id, token: token },
+ success: function (response) {
+ utils.enableAll();
+ if (response.success) {
+ utils.showAlert("success", "far fa-trash-alt", "Successfully deleted message # ", id);
+ table.row(tr).remove().draw(false).ajax.reload(null, false);
+ } else {
+ utils.showAlert("error", "", "Error while deleting message with ID " + id, response.message);
+ }
+ },
+ error: function (jqXHR, exception) {
+ utils.enableAll();
+ utils.showAlert("error", "", "Error while deleting message with ID " + id, jqXHR.responseText);
+ console.log(exception); // eslint-disable-line no-console
+ }
+ });
+};
diff --git a/scripts/pi-hole/php/message.php b/scripts/pi-hole/php/message.php
new file mode 100644
index 0000000000..cfbb89a68d
--- /dev/null
+++ b/scripts/pi-hole/php/message.php
@@ -0,0 +1,74 @@
+
+ true, 'message' => $message));
+}
+
+function JSON_error($message = null)
+{
+ header('Content-type: application/json');
+ $response = array('success' => false, 'message' => $message);
+ if (isset($_POST['action'])) {
+ array_push($response, array('action' => $_POST['action']));
+ }
+ echo json_encode($response);
+}
+
+if ($_POST['action'] == 'delete_message') {
+// Delete message identified by ID
+ try {
+ $db->query('BEGIN TRANSACTION;');
+
+ $stmt = $db->prepare('DELETE FROM message WHERE id=:id');
+ if (!$stmt) {
+ throw new Exception('While preparing message statement: ' . $db->lastErrorMsg());
+ }
+
+ if (!$stmt->bindValue(':id', intval($_POST['id']), SQLITE3_INTEGER)) {
+ throw new Exception('While binding id to message statement: ' . $db->lastErrorMsg());
+ }
+
+ if (!$stmt->execute()) {
+ throw new Exception('While executing message statement: ' . $db->lastErrorMsg());
+ }
+
+ if(!$db->query('COMMIT;')) {
+ throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ }
+
+ $reload = true;
+ JSON_success();
+ } catch (\Exception $ex) {
+ JSON_error($ex->getMessage());
+ }
+} else {
+ log_and_die('Requested action not supported!');
+}
From 29fbb3379ff9de0b0801184c1828c3e864e7ff67 Mon Sep 17 00:00:00 2001
From: yubiuser
Date: Sun, 8 Aug 2021 22:21:48 +0200
Subject: [PATCH 026/393] Fix prettier
Signed-off-by: yubiuser
---
scripts/pi-hole/js/messages.js | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/scripts/pi-hole/js/messages.js b/scripts/pi-hole/js/messages.js
index 97c4446fb8..3a5a332b95 100644
--- a/scripts/pi-hole/js/messages.js
+++ b/scripts/pi-hole/js/messages.js
@@ -111,11 +111,11 @@ $(function () {
rowCallback: function (row, data) {
$(row).attr("data-id", data.id);
var button =
- '";
+ '";
$("td:eq(3)", row).html(button);
},
dom:
@@ -159,7 +159,7 @@ function deleteMessage() {
var id = tr.attr("data-id");
utils.disableAll();
- utils.showAlert("info", "", "Deleting message # ",id);
+ utils.showAlert("info", "", "Deleting message # ", id);
$.ajax({
url: "scripts/pi-hole/php/message.php",
method: "post",
@@ -171,13 +171,23 @@ function deleteMessage() {
utils.showAlert("success", "far fa-trash-alt", "Successfully deleted message # ", id);
table.row(tr).remove().draw(false).ajax.reload(null, false);
} else {
- utils.showAlert("error", "", "Error while deleting message with ID " + id, response.message);
+ utils.showAlert(
+ "error",
+ "",
+ "Error while deleting message with ID " + id,
+ response.message
+ );
}
},
error: function (jqXHR, exception) {
utils.enableAll();
- utils.showAlert("error", "", "Error while deleting message with ID " + id, jqXHR.responseText);
+ utils.showAlert(
+ "error",
+ "",
+ "Error while deleting message with ID " + id,
+ jqXHR.responseText
+ );
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
-};
+}
From 4faa77da394b1a069ee5438aa4c629f373dd7f6a Mon Sep 17 00:00:00 2001
From: DL6ER
Date: Fri, 6 Aug 2021 21:35:41 +0200
Subject: [PATCH 027/393] Add interpretation for Pi-hole message type
RATE_LIMIT
Signed-off-by: DL6ER
---
scripts/pi-hole/js/messages.js | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/scripts/pi-hole/js/messages.js b/scripts/pi-hole/js/messages.js
index 3a5a332b95..2f83613947 100644
--- a/scripts/pi-hole/js/messages.js
+++ b/scripts/pi-hole/js/messages.js
@@ -77,6 +77,17 @@ function renderMessage(data, type, row) {
case "DNSMASQ_CONFIG":
return "FTL failed to start due to " + row.message;
+ case "RATE_LIMIT":
+ return (
+ "Client " +
+ row.message +
+ " has been rate-limited (current config allows up to " +
+ parseInt(row.blob1, 10) +
+ " queries in " +
+ parseInt(row.blob2, 10) +
+ " seconds)"
+ );
+
default:
return "Unknown message type
" + JSON.stringify(row) + "
";
}
From 086a8dabbb57f0d3ef0572ea536cac7b593b7fc6 Mon Sep 17 00:00:00 2001
From: yubiuser
Date: Sun, 8 Aug 2021 22:37:22 +0200
Subject: [PATCH 028/393] Fix xo
Signed-off-by: yubiuser
---
scripts/pi-hole/js/messages.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/pi-hole/js/messages.js b/scripts/pi-hole/js/messages.js
index 2f83613947..c0672e7ef1 100644
--- a/scripts/pi-hole/js/messages.js
+++ b/scripts/pi-hole/js/messages.js
@@ -6,7 +6,7 @@
* Please see LICENSE file for your rights under this license. */
/* global utils:false */
-
+var table;
var token = $("#token").text();
function renderTimestamp(data, type) {
@@ -94,7 +94,7 @@ function renderMessage(data, type, row) {
}
$(function () {
- $("#messagesTable").DataTable({
+ table = $("#messagesTable").DataTable({
ajax: {
url: "api_db.php?messages",
data: { token: token },
From e0ba6ded2a192d4229de3100621ac2dd2387ca12 Mon Sep 17 00:00:00 2001
From: yubiuser
Date: Mon, 9 Aug 2021 19:49:11 +0200
Subject: [PATCH 029/393] Address review comments
Signed-off-by: yubiuser
---
scripts/pi-hole/js/messages.js | 2 +-
scripts/pi-hole/php/message.php | 6 +-----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/scripts/pi-hole/js/messages.js b/scripts/pi-hole/js/messages.js
index c0672e7ef1..1d72bb952a 100644
--- a/scripts/pi-hole/js/messages.js
+++ b/scripts/pi-hole/js/messages.js
@@ -170,7 +170,7 @@ function deleteMessage() {
var id = tr.attr("data-id");
utils.disableAll();
- utils.showAlert("info", "", "Deleting message # ", id);
+ utils.showAlert("info", "", "Deleting message with ID " + parseInt(id, 10), "...");
$.ajax({
url: "scripts/pi-hole/php/message.php",
method: "post",
diff --git a/scripts/pi-hole/php/message.php b/scripts/pi-hole/php/message.php
index cfbb89a68d..9a653a0ec2 100644
--- a/scripts/pi-hole/php/message.php
+++ b/scripts/pi-hole/php/message.php
@@ -42,10 +42,9 @@ function JSON_error($message = null)
echo json_encode($response);
}
-if ($_POST['action'] == 'delete_message') {
+if ($_POST['action'] == 'delete_message' && isset($_POST['id'])) {
// Delete message identified by ID
try {
- $db->query('BEGIN TRANSACTION;');
$stmt = $db->prepare('DELETE FROM message WHERE id=:id');
if (!$stmt) {
@@ -60,9 +59,6 @@ function JSON_error($message = null)
throw new Exception('While executing message statement: ' . $db->lastErrorMsg());
}
- if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
- }
$reload = true;
JSON_success();
From 1dacdbabc08d9477be66e9f14ab9439786557aac Mon Sep 17 00:00:00 2001
From: yubiuser
Date: Sun, 12 Sep 2021 23:07:21 +0200
Subject: [PATCH 030/393] Clarify that never forward non-FQDN only applies to A
and AAAA queries
Signed-off-by: yubiuser
---
settings.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/settings.php b/settings.php
index cc8f9c4f47..df07599267 100644
--- a/settings.php
+++ b/settings.php
@@ -882,7 +882,7 @@ function convertseconds($argument)
checked>
-
+
When there is a Pi-hole domain set and this box is
ticked, this asks FTL that this domain is purely
local and FTL may answer queries from /etc/hosts or DHCP leases
From 7517028c64783d75e1598fb16bb3a808aa8d9255 Mon Sep 17 00:00:00 2001
From: a1346054 <36859588+a1346054@users.noreply.github.com>
Date: Wed, 15 Sep 2021 20:25:00 +0000
Subject: [PATCH 031/393] Add final newline
Signed-off-by: a1346054 <36859588+a1346054@users.noreply.github.com>
---
scripts/pi-hole/php/database.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/pi-hole/php/database.php b/scripts/pi-hole/php/database.php
index 46b7decea4..234d9c2bea 100644
--- a/scripts/pi-hole/php/database.php
+++ b/scripts/pi-hole/php/database.php
@@ -318,4 +318,4 @@ class ListType{
const regex_whitelist = 2;
const regex_blacklist = 3;
}
-}
\ No newline at end of file
+}
From a8ab8c811fb32c2df1791b25a10426a74fd049f2 Mon Sep 17 00:00:00 2001
From: a1346054 <36859588+a1346054@users.noreply.github.com>
Date: Wed, 15 Sep 2021 21:03:42 +0000
Subject: [PATCH 032/393] Use english name for control key
Signed-off-by: a1346054 <36859588+a1346054@users.noreply.github.com>
---
scripts/pi-hole/js/footer.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js
index c14495bd51..a590e5704f 100644
--- a/scripts/pi-hole/js/footer.js
+++ b/scripts/pi-hole/js/footer.js
@@ -293,7 +293,7 @@ if (sessionvalidity > 0) {
document.getElementById("sessiontimer").style.display = "none";
}
-// Handle Strg + Enter button on Login page
+// Handle Ctrl + Enter button on Login page
$(document).keypress(function (e) {
if ((e.keyCode === 10 || e.keyCode === 13) && e.ctrlKey && $("#loginpw").is(":focus")) {
$("#loginform").attr("action", "settings.php");
From 48c63c0a0be85a2ae94732498e5149d32e8f2836 Mon Sep 17 00:00:00 2001
From: a1346054 <36859588+a1346054@users.noreply.github.com>
Date: Wed, 15 Sep 2021 20:34:05 +0000
Subject: [PATCH 033/393] Fix spelling
Signed-off-by: a1346054 <36859588+a1346054@users.noreply.github.com>
---
groups-clients.php | 2 +-
scripts/pi-hole/js/groups-clients.js | 2 +-
scripts/pi-hole/js/ip-address-sorting.js | 2 +-
scripts/pi-hole/js/network.js | 4 ++--
scripts/pi-hole/js/queries.js | 4 ++--
scripts/pi-hole/php/database.php | 4 ++--
scripts/pi-hole/php/groups.php | 26 ++++++++++++------------
scripts/pi-hole/php/savesettings.php | 2 +-
scripts/pi-hole/php/teleporter.php | 2 +-
settings.php | 10 ++++-----
10 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/groups-clients.php b/groups-clients.php
index c17137814c..e562013802 100644
--- a/groups-clients.php
+++ b/groups-clients.php
@@ -44,7 +44,7 @@
IP subnets (CIDR notation, like 192.168.2.0/24),
their MAC addresses (like 12:34:56:78:9A:BC),
by their hostnames (like localhost), or by the interface they are connected to (prefaced with a colon, like :eth0).
-
Note that client recognition by IP addresses (incl. subnet ranges) are prefered over MAC address, host name or interface recognition as
+
Note that client recognition by IP addresses (incl. subnet ranges) are preferred over MAC address, host name or interface recognition as
the two latter will only be available after some time.
Furthermore, MAC address recognition only works for devices at most one networking hop away from your Pi-hole.
diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js
index c97d88c1d9..07432638c7 100644
--- a/scripts/pi-hole/js/groups-clients.js
+++ b/scripts/pi-hole/js/groups-clients.js
@@ -276,7 +276,7 @@ function addClient() {
// - IPv4 address (with and without CIDR)
// - IPv6 address (with and without CIDR)
// - MAC address (in the form AA:BB:CC:DD:EE:FF)
- // - host name (arbitrary form, we're only checking against some reserved charaters)
+ // - host name (arbitrary form, we're only checking against some reserved characters)
if (utils.validateIPv4CIDR(ip) || utils.validateIPv6CIDR(ip) || utils.validateMAC(ip)) {
// Convert input to upper case (important for MAC addresses)
ip = ip.toUpperCase();
diff --git a/scripts/pi-hole/js/ip-address-sorting.js b/scripts/pi-hole/js/ip-address-sorting.js
index e4f487b484..2770717e42 100644
--- a/scripts/pi-hole/js/ip-address-sorting.js
+++ b/scripts/pi-hole/js/ip-address-sorting.js
@@ -13,7 +13,7 @@
$.extend($.fn.dataTableExt.oSort, {
"ip-address-pre": function (a) {
// Skip empty fields (IP address might have expired or
- // reassigned to a differenct device)
+ // reassigned to a different device)
if (!a || a.length === 0) {
return Infinity;
}
diff --git a/scripts/pi-hole/js/network.js b/scripts/pi-hole/js/network.js
index 23e2792606..53c6bdac8a 100644
--- a/scripts/pi-hole/js/network.js
+++ b/scripts/pi-hole/js/network.js
@@ -20,9 +20,9 @@ function handleAjaxError(xhr, textStatus) {
if (textStatus === "timeout") {
alert("The server took too long to send the data.");
} else if (xhr.responseText.indexOf("Connection refused") !== -1) {
- alert("An error occured while loading the data: Connection refused. Is FTL running?");
+ alert("An error occurred while loading the data: Connection refused. Is FTL running?");
} else {
- alert("An unknown error occured while loading the data.\n" + xhr.responseText);
+ alert("An unknown error occurred while loading the data.\n" + xhr.responseText);
}
$("#network-entries_processing").hide();
diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js
index d52f95b1fc..758ec35f3a 100644
--- a/scripts/pi-hole/js/queries.js
+++ b/scripts/pi-hole/js/queries.js
@@ -32,9 +32,9 @@ function handleAjaxError(xhr, textStatus) {
if (textStatus === "timeout") {
alert("The server took too long to send the data.");
} else if (xhr.responseText.indexOf("Connection refused") !== -1) {
- alert("An error occured while loading the data: Connection refused. Is FTL running?");
+ alert("An error occurred while loading the data: Connection refused. Is FTL running?");
} else {
- alert("An unknown error occured while loading the data.\n" + xhr.responseText);
+ alert("An unknown error occurred while loading the data.\n" + xhr.responseText);
}
$("#all-queries_processing").hide();
diff --git a/scripts/pi-hole/php/database.php b/scripts/pi-hole/php/database.php
index 234d9c2bea..ee9cff6903 100644
--- a/scripts/pi-hole/php/database.php
+++ b/scripts/pi-hole/php/database.php
@@ -128,7 +128,7 @@ function add_to_table($db, $table, $domains, $comment=null, $wildcardstyle=false
}
$initialcount = intval($db->querySingle($countquery));
- // Prepare INSERT SQLite statememt
+ // Prepare INSERT SQLite statement
$bindcomment = false;
if($table === "domain_audit") {
$querystr = "INSERT OR IGNORE INTO $table ($field) VALUES (:$field);";
@@ -251,7 +251,7 @@ function remove_from_table($db, $table, $domains, $returnnum=false, $type=-1)
}
$initialcount = intval($db->querySingle($countquery));
- // Prepare SQLite statememt
+ // Prepare SQLite statement
if($type === -1)
{
$querystr = "DELETE FROM $table WHERE domain = :domain AND type = $type;";
diff --git a/scripts/pi-hole/php/groups.php b/scripts/pi-hole/php/groups.php
index 49a8d51c07..c7d61d8118 100644
--- a/scripts/pi-hole/php/groups.php
+++ b/scripts/pi-hole/php/groups.php
@@ -440,7 +440,7 @@ function JSON_error($message = null)
}
}
if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ throw new Exception('While committing changes to the database: ' . $db->lastErrorMsg());
}
$reload = true;
@@ -479,7 +479,7 @@ function JSON_error($message = null)
throw new Exception('While executing client statement: ' . $db->lastErrorMsg());
}
if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ throw new Exception('While committing changes to the database: ' . $db->lastErrorMsg());
}
$reload = true;
@@ -533,7 +533,7 @@ function JSON_error($message = null)
}
// If conversion failed, try with the (deprecated!) IDNA 2003 variant
- // We have to check for its existance as support of this variant is
+ // We have to check for its existence as support of this variant is
// scheduled for removal with PHP 8.0
// see https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003
if ($utf8_domain === false && defined("INTL_IDNA_VARIANT_2003")) {
@@ -546,7 +546,7 @@ function JSON_error($message = null)
$res['domain'] = $utf8_domain.' ('.$res['domain'].')';
}
}
- // Prevent domain and comment fields from returning any arbitary javascript code which could be executed on the browser.
+ // Prevent domain and comment fields from returning any arbitrary javascript code which could be executed on the browser.
$res['domain'] = htmlentities($res['domain']);
$res['comment'] = htmlentities($res['comment']);
array_push($data, $res);
@@ -715,7 +715,7 @@ function JSON_error($message = null)
// Then update the record with a new comment (and modification date
// due to the trigger event) We are not using REPLACE INTO to avoid
- // the initial DELETE event (loosing group assignments in case an
+ // the initial DELETE event (losing group assignments in case an
// entry did already exist).
if (!$update_stmt->execute()) {
throw new Exception('While executing UPDATE: ' . $db->lastErrorMsg() . ' '.
@@ -725,7 +725,7 @@ function JSON_error($message = null)
}
if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ throw new Exception('While committing changes to the database: ' . $db->lastErrorMsg());
}
$after = intval($db->querySingle("SELECT COUNT(*) FROM domainlist;"));
@@ -824,7 +824,7 @@ function JSON_error($message = null)
}
if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ throw new Exception('While committing changes to the database: ' . $db->lastErrorMsg());
}
$reload = true;
@@ -864,7 +864,7 @@ function JSON_error($message = null)
}
if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ throw new Exception('While committing changes to the database: ' . $db->lastErrorMsg());
}
$reload = true;
@@ -912,7 +912,7 @@ function JSON_error($message = null)
}
if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ throw new Exception('While committing changes to the database: ' . $db->lastErrorMsg());
}
$reload = true;
@@ -999,7 +999,7 @@ function JSON_error($message = null)
}
if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ throw new Exception('While committing changes to the database: ' . $db->lastErrorMsg());
}
$reload = true;
@@ -1079,7 +1079,7 @@ function JSON_error($message = null)
}
if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ throw new Exception('While committing changes to the database: ' . $db->lastErrorMsg());
}
$reload = true;
@@ -1119,7 +1119,7 @@ function JSON_error($message = null)
}
if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ throw new Exception('While committing changes to the database: ' . $db->lastErrorMsg());
}
$reload = true;
@@ -1161,7 +1161,7 @@ function JSON_error($message = null)
}
if(!$db->query('COMMIT;')) {
- throw new Exception('While commiting changes to the database: ' . $db->lastErrorMsg());
+ throw new Exception('While committing changes to the database: ' . $db->lastErrorMsg());
}
$after = intval($db->querySingle("SELECT COUNT(*) FROM domain_audit;"));
diff --git a/scripts/pi-hole/php/savesettings.php b/scripts/pi-hole/php/savesettings.php
index e987e27f55..d2a602b708 100644
--- a/scripts/pi-hole/php/savesettings.php
+++ b/scripts/pi-hole/php/savesettings.php
@@ -13,7 +13,7 @@
die("Direct access to this script is forbidden!");
}
-// Check for existance of variable
+// Check for existence of variable
// and test it only if it exists
function istrue(&$argument) {
if(isset($argument))
diff --git a/scripts/pi-hole/php/teleporter.php b/scripts/pi-hole/php/teleporter.php
index 5f105109cd..4fc4fc3fa8 100644
--- a/scripts/pi-hole/php/teleporter.php
+++ b/scripts/pi-hole/php/teleporter.php
@@ -157,7 +157,7 @@ function archive_restore_table($file, $table, $flush=false)
$field = "domain";
}
- // Prepare SQLite statememt
+ // Prepare SQLite statement
$stmt = $db->prepare($sql);
// Return early if we fail to prepare the SQLite statement
diff --git a/settings.php b/settings.php
index df07599267..5889524825 100644
--- a/settings.php
+++ b/settings.php
@@ -171,14 +171,14 @@
$excludedDomains = [];
}
-// Exluded clients in API Query Log call
+// Excluded clients in API Query Log call
if (isset($setupVars["API_EXCLUDE_CLIENTS"])) {
$excludedClients = explode(",", $setupVars["API_EXCLUDE_CLIENTS"]);
} else {
$excludedClients = [];
}
-// Exluded clients
+// Excluded clients
if (isset($setupVars["API_QUERY_LOG_SHOW"])) {
$queryLog = $setupVars["API_QUERY_LOG_SHOW"];
} else {
@@ -389,7 +389,7 @@ function get_FTL_data($arg)
} else {
$DHCP = false;
}
- // Read setings from config file
+ // Read settings from config file
if (isset($setupVars["DHCP_START"])) {
$DHCPstart = $setupVars["DHCP_START"];
} else {
@@ -887,7 +887,7 @@ function convertseconds($argument)
ticked, this asks FTL that this domain is purely
local and FTL may answer queries from /etc/hosts or DHCP leases
but should never forward queries on that domain to any upstream servers.
- If Conditional Fowarding is enabled, unticking this box may cause a partial
+ If Conditional Forwarding is enabled, unticking this box may cause a partial
DNS loop under certain circumstances (e.g. if a client would send TLD DNSSEC queries).
@@ -937,7 +937,7 @@ function convertseconds($argument)
devices ending in your local domain name will not leave your network, however, this is optional.
The local domain name must match the domain name specified
in your DHCP server for this to work. You can likely find it within the DHCP settings.
-
Enabling Conditional Fowarding will also forward all hostnames (i.e., non-FQDNs) to the router
+
Enabling Conditional Forwarding will also forward all hostnames (i.e., non-FQDNs) to the router
when "Never forward non-FQDNs" is not enabled.
class="active">
diff --git a/scripts/pi-hole/php/password.php b/scripts/pi-hole/php/password.php
index 91888a0b80..7391a31170 100644
--- a/scripts/pi-hole/php/password.php
+++ b/scripts/pi-hole/php/password.php
@@ -11,7 +11,7 @@
// Start a new PHP session (or continue an existing one)
// Prevents javascript XSS attacks aimed to steal the session ID
ini_set('session.cookie_httponly', 1);
- // Prevent Session ID from being passed through URLs
+ // Prevent Session ID from being passed through URLs
ini_set('session.use_only_cookies', 1);
session_start();
diff --git a/scripts/pi-hole/php/teleporter.php b/scripts/pi-hole/php/teleporter.php
index 4fc4fc3fa8..123c3f0a9c 100644
--- a/scripts/pi-hole/php/teleporter.php
+++ b/scripts/pi-hole/php/teleporter.php
@@ -538,7 +538,7 @@ function process_file($contents)
$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];
diff --git a/settings.php b/settings.php
index 5889524825..fda6f167bf 100644
--- a/settings.php
+++ b/settings.php
@@ -916,7 +916,7 @@ function convertseconds($argument)
Conditional forwarding
-
If not configured as your DHCP server, Pi-hole typically won't be able to
+
If not configured as your DHCP server, Pi-hole typically won't be able to
determine the names of devices on your local network. As a
result, tables such as Top Clients will only show IP addresses.
One solution for this is to configure Pi-hole to forward these
From 2d41191ac3dcdd37a2dfbb6715616463fd57c2e7 Mon Sep 17 00:00:00 2001
From: yubiuser
Date: Tue, 21 Sep 2021 09:25:31 +0200
Subject: [PATCH 035/393] Lift prefix limitaion for --rev-server
Signed-off-by: yubiuser
---
scripts/pi-hole/php/func.php | 12 ++++--------
scripts/pi-hole/php/savesettings.php | 3 +--
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/scripts/pi-hole/php/func.php b/scripts/pi-hole/php/func.php
index 4d79872b13..40f907455c 100644
--- a/scripts/pi-hole/php/func.php
+++ b/scripts/pi-hole/php/func.php
@@ -54,19 +54,15 @@ function validCIDRIP($address){
if($isIPv6) {
// One IPv6 element is 16bit: 0000 - FFFF
$v6elem = "[0-9A-Fa-f]{1,4}";
- // CIDR for IPv6 is any multiple of 4 from 4 up to 128 bit
- $v6cidr = "(4";
- for ($i=8; $i <= 128; $i+=4) {
- $v6cidr .= "|$i";
- }
- $v6cidr .= ")";
+ // dnsmasq allows arbitrary prefix-length since https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=35f93081dc9a52e64ac3b7196ad1f5c1106f8932
+ $v6cidr = "([1-128])";
$validator = "/^(((?:$v6elem))((?::$v6elem))*::((?:$v6elem))((?::$v6elem))*|((?:$v6elem))((?::$v6elem)){7})\/$v6cidr$/";
return preg_match($validator, $address);
} else {
// One IPv4 element is 8bit: 0 - 256
$v4elem = "(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)";
- // Note that rev-server accepts only /8, /16, /24, and /32
- $allowedv4cidr = "(8|16|24|32)";
+ // dnsmasq allows arbitrary prefix-length
+ $allowedv4cidr = "([1-32])";
$validator = "/^$v4elem\.$v4elem\.$v4elem\.$v4elem\/$allowedv4cidr$/";
return preg_match($validator, $address);
}
diff --git a/scripts/pi-hole/php/savesettings.php b/scripts/pi-hole/php/savesettings.php
index e987e27f55..d6605dd0c9 100644
--- a/scripts/pi-hole/php/savesettings.php
+++ b/scripts/pi-hole/php/savesettings.php
@@ -293,8 +293,7 @@ function addStaticDHCPLease($mac, $ip, $hostname) {
if (!validCIDRIP($cidr))
{
$error .= "Conditional forwarding subnet (\"".htmlspecialchars($cidr)."\") is invalid! ".
- "This field requires CIDR notation for local subnets (e.g., 192.168.0.0/16). ".
- "Please use only subnets /8, /16, /24, and /32. ";
+ "This field requires CIDR notation for local subnets (e.g., 192.168.0.0/16). ";
}
// Validate target IP
From e3a69aff6a3d8080e3580cf71b333f0d0e48d74a Mon Sep 17 00:00:00 2001
From: Adam Warner
Date: Tue, 21 Sep 2021 17:39:49 +0100
Subject: [PATCH 036/393] Add background colors on Query log + switchable text
coloring (as before) (#1893)
* Add subtle background colour to the rows depending on query status
* Do the same for long term query log (and also apply changes missed on last release
* Add per-browser setting for Query Log colorization
Signed-off-by: DL6ER
Co-authored-by: DL6ER
---
scripts/pi-hole/js/db_queries.js | 72 +++++++++++++++++---------------
scripts/pi-hole/js/queries.js | 18 +++++++-
scripts/pi-hole/js/settings.js | 18 ++++++++
settings.php | 8 ++++
style/pi-hole.css | 8 ++++
5 files changed, 88 insertions(+), 36 deletions(-)
diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js
index 3e20638ce1..8f42cb9175 100644
--- a/scripts/pi-hole/js/db_queries.js
+++ b/scripts/pi-hole/js/db_queries.js
@@ -202,96 +202,100 @@ $(function () {
rowCallback: function (row, data) {
var fieldtext,
buttontext = "",
- color;
+ blocked = true;
switch (data[4]) {
case 1:
- color = "red";
- fieldtext = "Blocked (gravity)";
+ fieldtext = "Blocked (gravity)";
buttontext =
'';
+ blocked = true;
break;
case 2:
- color = "green";
fieldtext =
- "OK (forwarded to " +
+ "OK (forwarded to " +
(data.length > 5 && data[5] !== "N/A" ? data[5] : "") +
")";
buttontext =
'';
break;
case 3:
- color = "green";
- fieldtext = "OK (cached)";
+ fieldtext = "OK (cache)";
buttontext =
'';
break;
case 4:
- color = "red";
- fieldtext = "Blocked (regex blacklist)";
+ fieldtext = "Blocked (regex blacklist)";
buttontext =
'';
+ blocked = true;
break;
case 5:
- color = "red";
- fieldtext = "Blocked (exact blacklist)";
+ fieldtext = "Blocked (exact blacklist)";
buttontext =
'';
+ blocked = true;
break;
case 6:
- color = "red";
- fieldtext = "Blocked (external, IP)";
+ fieldtext = "Blocked (external, IP)";
+ blocked = true;
break;
case 7:
- color = "red";
- fieldtext = "Blocked (external, NULL)";
+ fieldtext =
+ "Blocked (external, NULL)";
+ blocked = true;
break;
case 8:
- color = "red";
- fieldtext = "Blocked (external, NXRA)";
+ fieldtext =
+ "Blocked (external, NXRA)";
+ blocked = true;
break;
case 9:
- color = "red";
- fieldtext = "Blocked (gravity, CNAME)";
+ fieldtext = "Blocked (gravity, CNAME)";
buttontext =
'';
+ blocked = true;
break;
case 10:
- color = "red";
- fieldtext = "Blocked (regex blacklist, CNAME)";
+ fieldtext =
+ "Blocked (regex blacklist, CNAME)";
buttontext =
'';
+ blocked = true;
break;
case 11:
- color = "red";
- fieldtext = "Blocked (exact blacklist, CNAME)";
+ fieldtext =
+ "Blocked (exact blacklist, CNAME)";
+ blocked = true;
buttontext =
'';
+ blocked = true;
break;
case 12:
- color = "green";
- fieldtext = "Retried";
+ fieldtext = "Retried";
break;
case 13:
- color = "green";
- fieldtext = "Retried (ignored)";
- buttontext = "";
+ fieldtext = "Retried (ignored)";
break;
case 14:
- color = "green";
- fieldtext = "OK (already forwarded)";
+ fieldtext =
+ "OK (already forwarded)";
buttontext =
'';
break;
case 15:
- color = "text-orange";
- fieldtext = "Blocked (database is busy)";
+ fieldtext =
+ "Blocked (database is busy)";
+ blocked = true;
break;
default:
- color = "black";
fieldtext = "Unknown";
}
- $(row).css("color", color);
+ $(row).addClass(blocked === true ? "blocked-row" : "allowed-row");
+ if (localStorage.getItem("colorfulQueryLog_chkbox") === "true") {
+ $(row).addClass(blocked === true ? "text-red" : "text-green");
+ }
+
$("td:eq(4)", row).html(fieldtext);
$("td:eq(5)", row).html(buttontext);
diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js
index d52f95b1fc..7606bd3f1b 100644
--- a/scripts/pi-hole/js/queries.js
+++ b/scripts/pi-hole/js/queries.js
@@ -111,6 +111,7 @@ $(function () {
// Query status
var fieldtext,
buttontext = "",
+ blocked = false,
isCNAME = false,
regexLink = false;
@@ -119,6 +120,7 @@ $(function () {
fieldtext = "Blocked (gravity)";
buttontext =
'';
+ blocked = true;
break;
case "2":
fieldtext =
@@ -140,7 +142,7 @@ $(function () {
break;
case "4":
fieldtext = "Blocked (regex blacklist)";
-
+ blocked = true;
if (data.length > 9 && data[9] > 0) {
regexLink = true;
}
@@ -150,25 +152,30 @@ $(function () {
break;
case "5":
fieldtext = "Blocked (exact blacklist)";
+ blocked = true;
buttontext =
'';
break;
case "6":
fieldtext = "Blocked (external, IP)";
+ blocked = true;
buttontext = "";
break;
case "7":
fieldtext =
"Blocked (external, NULL)";
+ blocked = true;
buttontext = "";
break;
case "8":
fieldtext =
"Blocked (external, NXRA)";
+ blocked = true;
buttontext = "";
break;
case "9":
fieldtext = "Blocked (gravity, CNAME)";
+ blocked = true;
buttontext =
'';
isCNAME = true;
@@ -188,6 +195,7 @@ $(function () {
case "11":
fieldtext =
"Blocked (exact blacklist, CNAME)";
+ blocked = true;
buttontext =
'';
isCNAME = true;
@@ -207,7 +215,8 @@ $(function () {
break;
case "15":
fieldtext =
- "Blocked (database is busy)";
+ "Blocked (database is busy)";
+ blocked = true;
break;
default:
fieldtext = "Unknown (" + parseInt(data[4], 10) + ")";
@@ -221,6 +230,11 @@ $(function () {
fieldtext += '';
+ $(row).addClass(blocked === true ? "blocked-row" : "allowed-row");
+ if (localStorage.getItem("colorfulQueryLog_chkbox") === "true") {
+ $(row).addClass(blocked === true ? "text-red" : "text-green");
+ }
+
$("td:eq(4)", row).html(fieldtext);
$("td:eq(6)", row).html(buttontext);
diff --git a/scripts/pi-hole/js/settings.js b/scripts/pi-hole/js/settings.js
index 02f5b5a281..e3f6a971c9 100644
--- a/scripts/pi-hole/js/settings.js
+++ b/scripts/pi-hole/js/settings.js
@@ -284,6 +284,24 @@ $(function () {
});
});
+$(function () {
+ var colorfulQueryLog = $("#colorfulQueryLog");
+ var chkboxData = localStorage.getItem("colorfulQueryLog_chkbox");
+
+ if (chkboxData !== null) {
+ // Restore checkbox state
+ colorfulQueryLog.prop("checked", chkboxData === "true");
+ } else {
+ // Initialize checkbox
+ colorfulQueryLog.prop("checked", false);
+ localStorage.setItem("colorfulQueryLog_chkbox", false);
+ }
+
+ colorfulQueryLog.click(function () {
+ localStorage.setItem("colorfulQueryLog_chkbox", colorfulQueryLog.prop("checked"));
+ });
+});
+
// Delete dynamic DHCP lease
$('button[id="removedynamic"]').on("click", function () {
var tr = $(this).closest("tr");
diff --git a/settings.php b/settings.php
index df07599267..641895f348 100644
--- a/settings.php
+++ b/settings.php
@@ -1171,6 +1171,14 @@ function convertseconds($argument)
+
+
+
+
+
+
+
+
diff --git a/style/pi-hole.css b/style/pi-hole.css
index b19e65ba51..fc02a660cd 100644
--- a/style/pi-hole.css
+++ b/style/pi-hole.css
@@ -358,3 +358,11 @@ td.details-control {
.dataTables-child td {
padding: 2px 5px;
}
+
+.blocked-row {
+ background-color: rgb(229, 83, 75, 0.1) !important;
+}
+
+.allowed-row {
+ background-color: rgb(70, 149, 74, 0.1) !important;
+}
From 7f13dda4a886bc974cac212302b17366578a0b37 Mon Sep 17 00:00:00 2001
From: yubiuser
Date: Tue, 21 Sep 2021 19:59:24 +0200
Subject: [PATCH 037/393] Fix regex
Signed-off-by: yubiuser
---
scripts/pi-hole/php/func.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/pi-hole/php/func.php b/scripts/pi-hole/php/func.php
index 40f907455c..9dca2046a5 100644
--- a/scripts/pi-hole/php/func.php
+++ b/scripts/pi-hole/php/func.php
@@ -55,14 +55,14 @@ function validCIDRIP($address){
// One IPv6 element is 16bit: 0000 - FFFF
$v6elem = "[0-9A-Fa-f]{1,4}";
// dnsmasq allows arbitrary prefix-length since https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=35f93081dc9a52e64ac3b7196ad1f5c1106f8932
- $v6cidr = "([1-128])";
+ $v6cidr = "([1-9]|[1-9][0-9]|1[01][0-9]|12[0-8])";
$validator = "/^(((?:$v6elem))((?::$v6elem))*::((?:$v6elem))((?::$v6elem))*|((?:$v6elem))((?::$v6elem)){7})\/$v6cidr$/";
return preg_match($validator, $address);
} else {
// One IPv4 element is 8bit: 0 - 256
$v4elem = "(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)";
// dnsmasq allows arbitrary prefix-length
- $allowedv4cidr = "([1-32])";
+ $allowedv4cidr = "(([1-9]|[12][0-9]|3[0-2]))";
$validator = "/^$v4elem\.$v4elem\.$v4elem\.$v4elem\/$allowedv4cidr$/";
return preg_match($validator, $address);
}
From 9944ce0cb1a5c699f6da851dd341723f2903f775 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 25 Sep 2021 10:05:20 +0000
Subject: [PATCH 038/393] Bump postcss from 8.3.6 to 8.3.8
Bumps [postcss](https://github.com/postcss/postcss) from 8.3.6 to 8.3.8.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.3.6...8.3.8)
---
updated-dependencies:
- dependency-name: postcss
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
package-lock.json | 16 +++++++++++-----
package.json | 2 +-
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 510de30424..3f4cfffed6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3136,6 +3136,12 @@
"integrity": "sha512-0ZIR9PasPxGXmRsEF8jsDzndzHDj7tIav+JUmvIFB/WHswliFnquxECT/De7GR4yg99ky/NlRKJT82G1y271bw==",
"dev": true
},
+ "nanocolors": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.2.3.tgz",
+ "integrity": "sha512-RxGTOApG8prHMA08UBMOT6qYzcBBW2EMBv7SRBqoXg/Dqp6G3yT7kLy1tpFuYLO+5h7eajmdiIHJA8oewN58XQ==",
+ "dev": true
+ },
"nanoid": {
"version": "3.1.25",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz",
@@ -3456,13 +3462,13 @@
"dev": true
},
"postcss": {
- "version": "8.3.6",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz",
- "integrity": "sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==",
+ "version": "8.3.8",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.8.tgz",
+ "integrity": "sha512-GT5bTjjZnwDifajzczOC+r3FI3Cu+PgPvrsjhQdRqa2kTJ4968/X9CUce9xttIB0xOs5c6xf0TCWZo/y9lF6bA==",
"dev": true,
"requires": {
- "colorette": "^1.2.2",
- "nanoid": "^3.1.23",
+ "nanocolors": "^0.2.2",
+ "nanoid": "^3.1.25",
"source-map-js": "^0.6.2"
}
},
diff --git a/package.json b/package.json
index fabb4be7eb..a1aed6f07e 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"devDependencies": {
"autoprefixer": "^10.3.4",
"eslint-plugin-compat": "^3.13.0",
- "postcss": "^8.3.6",
+ "postcss": "^8.3.8",
"postcss-cli": "^8.3.1",
"prettier": "2.4.0",
"xo": "^0.44.0"
From 695ed2603a652bdb623231d652df7ae9d08fb372 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 29 Sep 2021 20:13:49 +0000
Subject: [PATCH 039/393] Bump autoprefixer from 10.3.4 to 10.3.6
Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.3.4 to 10.3.6.
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.3.4...10.3.6)
---
updated-dependencies:
- dependency-name: autoprefixer
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
package-lock.json | 59 ++++++++++++++++++++++++++++++++++++++++++-----
package.json | 2 +-
2 files changed, 54 insertions(+), 7 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 3f4cfffed6..46b00f90ea 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -701,17 +701,64 @@
"dev": true
},
"autoprefixer": {
- "version": "10.3.4",
- "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.3.4.tgz",
- "integrity": "sha512-EKjKDXOq7ug+jagLzmnoTRpTT0q1KVzEJqrJd0hCBa7FiG0WbFOBCcJCy2QkW1OckpO3qgttA1aWjVbeIPAecw==",
+ "version": "10.3.6",
+ "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.3.6.tgz",
+ "integrity": "sha512-3bDjTfF0MfZntwVCSd18XAT2Zndufh3Mep+mafbzdIQEeWbncVRUVDjH8/EPANV9Hq40seJ24QcYAyhUsFz7gQ==",
"dev": true,
"requires": {
- "browserslist": "^4.16.8",
- "caniuse-lite": "^1.0.30001252",
- "colorette": "^1.3.0",
+ "browserslist": "^4.17.1",
+ "caniuse-lite": "^1.0.30001260",
"fraction.js": "^4.1.1",
+ "nanocolors": "^0.2.8",
"normalize-range": "^0.1.2",
"postcss-value-parser": "^4.1.0"
+ },
+ "dependencies": {
+ "browserslist": {
+ "version": "4.17.1",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.1.tgz",
+ "integrity": "sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ==",
+ "dev": true,
+ "requires": {
+ "caniuse-lite": "^1.0.30001259",
+ "electron-to-chromium": "^1.3.846",
+ "escalade": "^3.1.1",
+ "nanocolors": "^0.1.5",
+ "node-releases": "^1.1.76"
+ },
+ "dependencies": {
+ "nanocolors": {
+ "version": "0.1.12",
+ "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.1.12.tgz",
+ "integrity": "sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==",
+ "dev": true
+ }
+ }
+ },
+ "caniuse-lite": {
+ "version": "1.0.30001261",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001261.tgz",
+ "integrity": "sha512-vM8D9Uvp7bHIN0fZ2KQ4wnmYFpJo/Etb4Vwsuc+ka0tfGDHvOPrFm6S/7CCNLSOkAUjenT2HnUPESdOIL91FaA==",
+ "dev": true
+ },
+ "electron-to-chromium": {
+ "version": "1.3.853",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.853.tgz",
+ "integrity": "sha512-W4U8n+U8I5/SUaFcqZgbKRmYZwcyEIQVBDf+j5QQK6xChjXnQD+wj248eGR9X4u+dDmDR//8vIfbu4PrdBBIoQ==",
+ "dev": true
+ },
+ "nanocolors": {
+ "version": "0.2.12",
+ "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.2.12.tgz",
+ "integrity": "sha512-SFNdALvzW+rVlzqexid6epYdt8H9Zol7xDoQarioEFcFN0JHo4CYNztAxmtfgGTVRCmFlEOqqhBpoFGKqSAMug==",
+ "dev": true
+ },
+ "node-releases": {
+ "version": "1.1.76",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.76.tgz",
+ "integrity": "sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA==",
+ "dev": true
+ }
}
},
"balanced-match": {
diff --git a/package.json b/package.json
index a1aed6f07e..9da79f515a 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"test": "npm run prettier:check && npm run xo"
},
"devDependencies": {
- "autoprefixer": "^10.3.4",
+ "autoprefixer": "^10.3.6",
"eslint-plugin-compat": "^3.13.0",
"postcss": "^8.3.8",
"postcss-cli": "^8.3.1",
From 8c493a9abe6ab10000175aa33b55cce990c96f74 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 29 Sep 2021 20:17:24 +0000
Subject: [PATCH 040/393] Bump prettier from 2.4.0 to 2.4.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.4.0...2.4.1)
---
updated-dependencies:
- dependency-name: prettier
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
package-lock.json | 6 +++---
package.json | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 46b00f90ea..feb31a1cf5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3577,9 +3577,9 @@
"dev": true
},
"prettier": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.0.tgz",
- "integrity": "sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==",
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz",
+ "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==",
"dev": true
},
"prettier-linter-helpers": {
diff --git a/package.json b/package.json
index 9da79f515a..4796eace8c 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,7 @@
"eslint-plugin-compat": "^3.13.0",
"postcss": "^8.3.8",
"postcss-cli": "^8.3.1",
- "prettier": "2.4.0",
+ "prettier": "2.4.1",
"xo": "^0.44.0"
},
"browserslist": [
From 28b7e853737825b6462ac53f5677d146f86445fa Mon Sep 17 00:00:00 2001
From: Lion Ralfs
Date: Sat, 2 Oct 2021 15:31:41 +0200
Subject: [PATCH 041/393] fix: exclude status checkboxes from being treated as
iCheck elements
Signed-off-by: Lion Ralfs
---
scripts/pi-hole/js/footer.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js
index a590e5704f..ad8c114e4f 100644
--- a/scripts/pi-hole/js/footer.js
+++ b/scripts/pi-hole/js/footer.js
@@ -137,8 +137,9 @@ function initCheckboxRadioStyle() {
function applyCheckboxRadioStyle(style) {
boxsheet.attr("href", getCheckboxURL(style));
- // Get all radio/checkboxes for theming, with the exception of the two radio buttons on the custom disable timer
- var sel = $("input[type='radio'],input[type='checkbox']").not("#selSec").not("#selMin");
+ // Get all radio/checkboxes for theming, with the exception of the two radio buttons on the custom disable timer,
+ // as well as every element with an id that starts with "status_"
+ var sel = $("input[type='radio'],input[type='checkbox']").not("#selSec").not("#selMin").not('[id^=status_]');
sel.parent().removeClass();
sel.parent().addClass("icheck-" + style);
}
From 1ac7e1b50a211c3fd60e7d2952af93f6e40f5cfb Mon Sep 17 00:00:00 2001
From: RD WebDesign
Date: Mon, 4 Oct 2021 17:22:38 -0300
Subject: [PATCH 042/393] Dashboard icons - send to back and fixing position
when scaled up (#1915)
* Dashboard icons - send to back and fixing position when scaled up
Signed-off-by: rdwebdesign
---
style/pi-hole.css | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/style/pi-hole.css b/style/pi-hole.css
index fc02a660cd..729ba5d971 100644
--- a/style/pi-hole.css
+++ b/style/pi-hole.css
@@ -329,6 +329,17 @@
.box,
.small-box {
border-radius: 10px;
+ z-index: 0; /* fix the small-box z-index (related to '.small-box .icon') */
+}
+
+.small-box .icon {
+ z-index: -1; /* sends the icon behind the text */
+}
+
+/*** Icons grow on hover, but remain centered ***/
+.small-box:hover .icon {
+ font-size: 90px; /* keep the same font-size, to avoid shifting the position */
+ transform: scale(106%);
}
.list-status-0 {
From 57bf116e470ec413d0c58971b32ccaa39910d763 Mon Sep 17 00:00:00 2001
From: yubiuser
Date: Mon, 4 Oct 2021 22:30:21 +0200
Subject: [PATCH 043/393] Unescape German umlauts (#1914)
* Unescape German umlauts
Signed-off-by: Yubiuser
---
scripts/pi-hole/js/utils.js | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/scripts/pi-hole/js/utils.js b/scripts/pi-hole/js/utils.js
index cad119759e..dffbb1b2f6 100644
--- a/scripts/pi-hole/js/utils.js
+++ b/scripts/pi-hole/js/utils.js
@@ -31,13 +31,23 @@ function unescapeHtml(text) {
">": ">",
""": '"',
"'": "'",
+ "Ü": "Ü",
+ "ü": "ü",
+ "Ä": "Ä",
+ "ä": "ä",
+ "Ö": "Ö",
+ "ö": "ö",
+ "ß": "ß",
};
if (text === null) return null;
- return text.replace(/&(?:amp|lt|gt|quot|#039);/g, function (m) {
- return map[m];
- });
+ return text.replace(
+ /&(?:amp|lt|gt|quot|#039|Uuml|uuml|Auml|auml|Ouml|ouml|szlig);/g,
+ function (m) {
+ return map[m];
+ }
+ );
}
// Helper function for converting Objects to Arrays after sorting the keys
From 8062eae6f1b8d79971dda63bfa66f8f6995ac804 Mon Sep 17 00:00:00 2001
From: yubiuser
Date: Mon, 4 Oct 2021 22:35:46 +0200
Subject: [PATCH 044/393] Add note to query log that `pi.hole` queries are not
logged (#1913)
* Add note to query log that pi.hole is never logged
Signed-off-by: yubiuser
---
queries.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/queries.php b/queries.php
index b22c195436..1349d2abed 100644
--- a/queries.php
+++ b/queries.php
@@ -158,6 +158,7 @@
+
Note: Queries for pi.hole and the hostname are never logged.
Filtering options:
Click a value in a column to add/remove that value to/from the filter
- 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
+
+ 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
+