This commit is contained in:
Adam Warner
2022-09-19 11:00:06 +01:00
committed by GitHub
11 changed files with 74 additions and 74 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
issues: write
steps:
- uses: actions/stale@v5.1.1
- uses: actions/stale@v5.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
+2 -2
View File
@@ -11,7 +11,7 @@
<br>
<br>
<a href="https://pi-hole.net/">
<img src="https://pi-hole.github.io/graphics/Screenshots/pihole-dashboard.png" alt="Pi-hole Web interface">
<img src="https://pi-hole.github.io/graphics/Screenshots/pihole_dashboard_v5.png" alt="Pi-hole Web interface">
</a>
</p>
@@ -112,7 +112,7 @@ While we are primarily reachable on our <a href="https://discourse.pi-hole.net/"
## Password protection
<p align="center">
<img src="https://pi-hole.github.io/graphics/Screenshots/password-protection.png" height="400" alt="Password protection">
<img src="https://pi-hole.github.io/graphics/Screenshots/password_protection_v5.png" alt="Password protection">
</p>
## Detailed graphs and doughnut charts
+6 -5
View File
@@ -76,17 +76,18 @@ if (isset($_GET['getAllQueries']) && $auth) {
$dbquery .= ' status, reply_type, reply_time, dnssec';
$dbquery .= ' FROM query_storage q';
$dbquery .= ' WHERE timestamp >= :from AND timestamp <= :until ';
if (isset($_GET['types'])) {
$types = $_GET['types'];
if (preg_match('/^[0-9]+(?:,[0-9]+)*$/', $types) === 1) {
if (isset($_GET['status'])) {
// if some query status should be excluded
$excludedStatus = $_GET['status'];
if (preg_match('/^[0-9]+(?:,[0-9]+)*$/', $excludedStatus) === 1) {
// Append selector to DB query. The used regex ensures
// that only numbers, separated by commas are accepted
// to avoid code injection and other malicious things
// We accept only valid lists like "1,2,3"
// We reject ",2,3", "1,2," and similar arguments
$dbquery .= 'AND status IN ('.$types.') ';
$dbquery .= 'AND status NOT IN ('.$excludedStatus.') ';
} else {
exit('Error. Selector types specified using an invalid format.');
exit('Error. Selector status specified using an invalid format.');
}
}
$dbquery .= 'ORDER BY timestamp ASC';
+23 -17
View File
@@ -287,13 +287,13 @@
}
},
"autoprefixer": {
"version": "10.4.8",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.8.tgz",
"integrity": "sha512-75Jr6Q/XpTqEf6D2ltS5uMewJIx5irCU1oBYJrWjFenq/m12WRRrz6g15L1EIoYvPLXTbEry7rDOwrcYNj77xw==",
"version": "10.4.11",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.11.tgz",
"integrity": "sha512-5lHp6DgRodxlBLSkzHOTcufWFflH1ewfy2hvFQyjrblBFlP/0Yh4O/Wrg4ow8WRlN3AAUFFLAQwX8hTptzqVHg==",
"dev": true,
"requires": {
"browserslist": "^4.21.3",
"caniuse-lite": "^1.0.30001373",
"caniuse-lite": "^1.0.30001399",
"fraction.js": "^4.2.0",
"normalize-range": "^0.1.2",
"picocolors": "^1.0.0",
@@ -301,21 +301,27 @@
},
"dependencies": {
"browserslist": {
"version": "4.21.3",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.3.tgz",
"integrity": "sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ==",
"version": "4.21.4",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz",
"integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001370",
"electron-to-chromium": "^1.4.202",
"caniuse-lite": "^1.0.30001400",
"electron-to-chromium": "^1.4.251",
"node-releases": "^2.0.6",
"update-browserslist-db": "^1.0.5"
"update-browserslist-db": "^1.0.9"
}
},
"caniuse-lite": {
"version": "1.0.30001402",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001402.tgz",
"integrity": "sha512-Mx4MlhXO5NwuvXGgVb+hg65HZ+bhUYsz8QtDGDo2QmaJS2GBX47Xfi2koL86lc8K+l+htXeTEB/Aeqvezoo6Ew==",
"dev": true
},
"electron-to-chromium": {
"version": "1.4.206",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.206.tgz",
"integrity": "sha512-h+Fadt1gIaQ06JaIiyqPsBjJ08fV5Q7md+V8bUvQW/9OvXfL2LRICTz2EcnnCP7QzrFTS6/27MRV6Bl9Yn97zA==",
"version": "1.4.254",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.254.tgz",
"integrity": "sha512-Sh/7YsHqQYkA6ZHuHMy24e6TE4eX6KZVsZb9E/DvU1nQRIrH4BflO/4k+83tfdYvDl+MObvlqHPRICzEdC9c6Q==",
"dev": true
},
"node-releases": {
@@ -2503,7 +2509,7 @@
"normalize-range": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz",
"integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=",
"integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==",
"dev": true
},
"npm-run-path": {
@@ -3360,9 +3366,9 @@
"dev": true
},
"update-browserslist-db": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz",
"integrity": "sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q==",
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.9.tgz",
"integrity": "sha512-/xsqn21EGVdXI3EXSum1Yckj3ZVZugqyOZQ/CxYPBD/R+ko9NSUScf8tFF4dOKY+2pvSSJA/S+5B8s4Zr4kyvg==",
"dev": true,
"requires": {
"escalade": "^3.1.1",
+1 -1
View File
@@ -24,7 +24,7 @@
"testpr": "npm run prettier:fix && git diff --ws-error-highlight=all --color=always --exit-code && npm run xo"
},
"devDependencies": {
"autoprefixer": "^10.4.8",
"autoprefixer": "^10.4.11",
"eslint-plugin-compat": "^4.0.2",
"postcss": "^8.4.16",
"postcss-cli": "^10.0.0",
+35 -36
View File
@@ -111,63 +111,63 @@ function handleAjaxError(xhr, textStatus) {
tableApi.draw();
}
function getQueryTypes() {
var queryType = [];
if ($("#type_gravity").prop("checked")) {
queryType.push(1);
function excludeStatusTypes() {
var statusType = [];
if ($("#type_gravity").prop("checked") === false) {
statusType.push(1);
}
if ($("#type_forwarded").prop("checked")) {
queryType.push([2, 14]);
if ($("#type_forwarded").prop("checked") === false) {
statusType.push([2, 14]);
}
if ($("#type_cached").prop("checked")) {
queryType.push(3);
if ($("#type_cached").prop("checked") === false) {
statusType.push(3);
}
if ($("#type_regex").prop("checked")) {
queryType.push(4);
if ($("#type_regex").prop("checked") === false) {
statusType.push(4);
}
if ($("#type_blacklist").prop("checked")) {
queryType.push(5);
if ($("#type_blacklist").prop("checked") === false) {
statusType.push(5);
}
if ($("#type_external").prop("checked")) {
if ($("#type_external").prop("checked") === false) {
// Multiple IDs correspond to this status
// We request queries with all of them
queryType.push([6, 7, 8]);
statusType.push([6, 7, 8]);
}
if ($("#type_gravity_CNAME").prop("checked")) {
queryType.push(9);
if ($("#type_gravity_CNAME").prop("checked") === false) {
statusType.push(9);
}
if ($("#type_regex_CNAME").prop("checked")) {
queryType.push(10);
if ($("#type_regex_CNAME").prop("checked") === false) {
statusType.push(10);
}
if ($("#type_blacklist_CNAME").prop("checked")) {
queryType.push(11);
if ($("#type_blacklist_CNAME").prop("checked") === false) {
statusType.push(11);
}
if ($("#type_retried").prop("checked")) {
if ($("#type_retried").prop("checked") === false) {
// Multiple IDs correspond to this status
// We request queries with all of them
queryType.push([12, 13]);
statusType.push([12, 13]);
}
// 14 is defined above
if ($("#type_dbbusy").prop("checked")) {
queryType.push(15);
if ($("#type_dbbusy").prop("checked") === false) {
statusType.push(15);
}
if ($("#type_special_domain").prop("checked")) {
queryType.push(16);
if ($("#type_special_domain").prop("checked") === false) {
statusType.push(16);
}
return queryType.join(",");
return statusType.join(",");
}
var reloadCallback = function () {
@@ -203,10 +203,10 @@ function refreshTableData() {
timeoutWarning.show();
reloadBox.hide();
var APIstring = "api_db.php?getAllQueries&from=" + from + "&until=" + until;
// Check if query type filtering is enabled
var queryType = getQueryTypes();
if (queryType !== "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16") {
APIstring += "&types=" + queryType;
// If status types should be excluded ("unchecked") we add them to the query
var statusType = excludeStatusTypes();
if (statusType.length > 0) {
APIstring += "&status=" + statusType;
}
statistics = [0, 0, 0];
@@ -218,11 +218,10 @@ $(function () {
? "api_db.php?getAllQueries&from=" + from + "&until=" + until
: "api_db.php?getAllQueries=empty";
// Check if query type filtering is enabled
var queryType = getQueryTypes();
if (queryType !== 63) {
// 63 (0b00111111) = all possible query types are selected
APIstring += "&types=" + queryType;
// If status types should be excluded ("unchecked") we add them to the query
var statusType = excludeStatusTypes();
if (statusType.length > 0) {
APIstring += "&status=" + statusType;
}
tableApi = $("#all-queries").DataTable({
+1 -1
View File
@@ -596,7 +596,7 @@ if ($_POST['action'] == 'get_groups') {
continue;
}
if ($_POST['type'] != '2' && $_POST['type'] != '3') {
if (isset($_POST['type']) && $_POST['type'] != '2' && $_POST['type'] != '3') {
// If not adding a RegEx....
$input = $domain;
// Convert domain name to IDNA ASCII form for international domains
+5 -1
View File
@@ -59,7 +59,11 @@ if (!is_readable($versionsfile)) {
}
// Get Pi-hole Docker Tag, if available
$docker_current = htmlspecialchars(getenv('PIHOLE_DOCKER_TAG'));
if (isset($versions['DOCKER_VERSION'])) {
$docker_current = $versions['DOCKER_VERSION'];
} else {
$docker_current = '';
}
// Get data from GitHub
$core_latest = $versions['GITHUB_CORE_VERSION'];
-3
View File
@@ -554,9 +554,6 @@ fieldset[disabled] .form-control {
background-color: #367fa9 !important;
border: 1px solid #367fa9;
}
input[type="password"]::-webkit-credentials-auto-fill-button {
background: #bfc5ca;
}
input[type="password"]::-webkit-caps-lock-indicator {
filter: invert(100%);
}
-3
View File
@@ -3653,9 +3653,6 @@ a:focus {
.register-box-body .form-control-feedback {
color: rgb(157, 148, 136);
}
input[type="password"]::-webkit-credentials-auto-fill-button {
background: #b1aca3;
}
input[type="password"]::-webkit-caps-lock-indicator {
filter: invert(100%);
}
-4
View File
@@ -1853,10 +1853,6 @@ input[type="number"]::-webkit-outer-spin-button {
margin: 0;
}
input[type="password"]::-webkit-credentials-auto-fill-button {
background: white;
}
input[type="password"]::-webkit-caps-lock-indicator {
filter: invert(100%);
}