Skip to content

Commit

Permalink
v5.15.1 (#2363)
Browse files Browse the repository at this point in the history
  • Loading branch information
PromoFaux committed Sep 19, 2022
2 parents 4d12ee7 + 8c8cdd0 commit b110ecc
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -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>

Expand Down Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions api_db.php
Expand Up @@ -76,17 +76,18 @@
$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';
Expand Down
40 changes: 23 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down
71 changes: 35 additions & 36 deletions scripts/pi-hole/js/db_queries.js
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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];
Expand All @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/php/groups.php
Expand Up @@ -596,7 +596,7 @@ function verify_ID_array($arr)
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
Expand Down
6 changes: 5 additions & 1 deletion scripts/pi-hole/php/update_checker.php
Expand Up @@ -59,7 +59,11 @@ function checkUpdate($currentVersion, $latestVersion)
}

// 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'];
Expand Down
3 changes: 0 additions & 3 deletions style/themes/default-dark.css
Expand Up @@ -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%);
}
Expand Down
3 changes: 0 additions & 3 deletions style/themes/default-darker.css
Expand Up @@ -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%);
}
Expand Down
4 changes: 0 additions & 4 deletions style/themes/lcars.css
Expand Up @@ -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%);
}
Expand Down

0 comments on commit b110ecc

Please sign in to comment.