Skip to content

Commit

Permalink
Merge pull request #1704 from pi-hole/release/v5.3
Browse files Browse the repository at this point in the history
Pi-hole Web v5.3
  • Loading branch information
PromoFaux authored Jan 15, 2021
2 parents 780dff0 + 8dc3944 commit 3ff33a3
Show file tree
Hide file tree
Showing 21 changed files with 684 additions and 423 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
name: "Code Scanning - Action"
name: "CodeQL"

on:
push:
branches:
- master
- devel
- "!dependabot/**"
pull_request:
# The branches below must be a subset of the branches above
branches:
- master
- devel
schedule:
- cron: "0 0 * * 0"

jobs:
CodeQL-Build:
analyze:
name: Analyze
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: javascript
languages: "javascript"

- name: Autobuild
uses: github/codeql-action/autobuild@v1
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PHPStan

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run phpstan
run: composer run-script phpstan
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ test.html

# vim
*.swp

# Composer
/vendor/
36 changes: 5 additions & 31 deletions api_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,40 +120,14 @@ function resolveHostname($clientip, $printIP)
if(!is_bool($results))
while ($row = $results->fetchArray())
{
// Try to resolve host name of this client
$c = resolveHostname($row[3],false);

// Convert query type ID to name
// Names taken from FTL's query type names
switch($row[1]) {
case 1:
$query_type = "A";
break;
case 2:
$query_type = "AAAA";
break;
case 3:
$query_type = "ANY";
break;
case 4:
$query_type = "SRV";
break;
case 5:
$query_type = "SOA";
break;
case 6:
$query_type = "PTR";
break;
case 7:
$query_type = "TXT";
break;
case 8:
$query_type = "NAPTR";
break;
default:
$query_type = "UNKN";
break;
}
// array: time type domain client status upstream destination
$query_type = getQueryTypeStr($row[1]);

// Insert into array
// array: time type domain client status upstream destination
$allQueries[] = [$row[0], $query_type, utf8_encode(str_replace("~"," ",$row[2])), utf8_encode($c), $row[4], utf8_encode($row[5])];
}
}
Expand Down
2 changes: 1 addition & 1 deletion cname_records.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>
<div class="box-footer clearfix">
<strong>Note:</strong>
<p>The target of a <code>CNAME</code> must be a domain that the Pi-hole already has in its cache or is authoritative for. This is an universal limitation of <code>CNAME</code> records.</p>
<p>The target of a <code>CNAME</code> must be a domain that the Pi-hole already has in its cache or is authoritative for. This is a universal limitation of <code>CNAME</code> records.</p>
<p>The reason for this is that Pi-hole will not send additional queries upstream when serving <code>CNAME</code> replies. As consequence, if you set a target that isn't already known, the reply to the client may be incomplete. Pi-hole just returns the information it knows at the time of the query. This results in certain limitations for <code>CNAME</code> targets,
for instance, only <i>active</i> DHCP leases work as targets - mere DHCP <i>leases</i> aren't sufficient as they aren't (yet) valid DNS records.</p>
<p>Additionally, you can't <code>CNAME</code> external domains (<code>bing.com</code> to <code>google.com</code>) successfully as this could result in invalid SSL certificate errors when the target server does not serve content for the requested domain.</p>
Expand Down
19 changes: 19 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "pi-hole/adminlte",
"type": "project",
"description": "Pi-hole Dashboard for stats and more",
"require": {
"php": ">=5.4",
"phpstan/phpstan": "^0.12.42"
},
"license": "EUPL-1.2",
"minimum-stability": "stable",
"autoload": {
"files": [
"scripts/vendor/qrcode.php"
]
},
"scripts": {
"phpstan": "vendor/phpstan/phpstan/phpstan analyse -c phpstan.neon.dist"
}
}
81 changes: 81 additions & 0 deletions composer.lock

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

Loading

0 comments on commit 3ff33a3

Please sign in to comment.