Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
dad6247
Merge pull request #4347 from pi-hole/development
PromoFaux Sep 29, 2021
b7bba6a
Validate when adding not when removing
yubiuser Oct 12, 2021
bc21a71
Add option to not reload
yubiuser Oct 12, 2021
a872fab
Validate on removal as well
yubiuser Oct 17, 2021
596689b
Validate host/domain of Local DNS records as well
yubiuser Oct 19, 2021
7cdd887
Merge pull request #4384 from pi-hole/tweak/local_dns_cname
DL6ER Oct 23, 2021
8713135
update tests: remove fedora 32, add fedora 34 (#4403)
bcambl Oct 23, 2021
b5e0f14
Merge pull request #4405 from pi-hole/development
PromoFaux Oct 23, 2021
c1eb35a
Add custom.list (Local DNS Records) to debug log
yubiuser Oct 26, 2021
c6da1a3
Fix documentation; add some missing zones
aviddiviner Oct 28, 2021
0c4e1b5
Merge pull request #4417 from aviddiviner/fix-rfc-config-docs
yubiuser Oct 28, 2021
e733553
Remove unused code from webpage.sh
yubiuser Nov 2, 2021
996f8ff
Recommend apt instead of apt-get if updating the package cache failed…
yubiuser Nov 4, 2021
ac4a975
Allow users to skip setting static IP adress (#4419)
yubiuser Nov 6, 2021
cedd1a2
unit test for umask problems in #3177 and #2730 (#3191)
pvogt09 Nov 11, 2021
cdd4d9e
Update the tests (#4427)
PromoFaux Nov 18, 2021
d85fee2
Merge pull request #4420 from pi-hole/clean/webpage.sh
DL6ER Nov 20, 2021
996a2c7
Use a fixed list height for network interface selection
MichaIng Nov 22, 2021
b750b01
Merge pull request #4434 from MichaIng/patch-1
yubiuser Nov 22, 2021
bc8150a
Clean up bash script formatting
jbzdarkid Nov 25, 2021
671fcaf
Merge pull request #4085 from jbzdarkid/patch-3
yubiuser Nov 26, 2021
14a379d
Fix generated /etc/os-release file in OS check test
MichaIng Nov 30, 2021
941f90d
Merge pull request #4443 from MichaIng/patch-1
yubiuser Nov 30, 2021
bfda52e
Fix number of invalid domains
yubiuser Dec 1, 2021
e485a7b
Some shellchecks in basic-install.sh (#4088)
ChillerDragon Dec 2, 2021
ba6d700
Fix `pihole -v` output if WebAdmin not installed (#4370)
subnut Dec 2, 2021
647ba6e
Rename variables to improve comprehensibility
yubiuser Dec 2, 2021
4c267f7
Merge pull request #4445 from pi-hole/fix/counting
DL6ER Dec 3, 2021
e243c56
Unblock adlist domain during gravity run in NODATA mode
yubiuser Dec 3, 2021
ae39e33
Use exec to run gravity script (#4449)
yubiuser Dec 4, 2021
b52a3a0
Add comment help text to list function
yubiuser Dec 6, 2021
8d6ce78
Allow qr code iframe
yubiuser Dec 10, 2021
2eff53b
Allow qr code iframe
yubiuser Dec 10, 2021
a3cc5df
Configure stale action (#4269)
dschaper Dec 16, 2021
28085cf
Merge iFrame exceptions
yubiuser Dec 17, 2021
a780fc5
Set DBFile permissions on creation.
dschaper Dec 20, 2021
76ae756
Check for DNS before run.
dschaper Dec 20, 2021
533a77d
Add database function failure guards.
dschaper Dec 20, 2021
ef0a22f
Merge pull request #4478 from pi-hole/fix/db_permission
DL6ER Dec 20, 2021
c0f454d
Add new interface listening option "bind" (#4476)
DL6ER Dec 20, 2021
3a67d1c
Merge pull request #4461 from pi-hole/qr_iframe
DL6ER Dec 20, 2021
31de661
Merge pull request #4414 from pi-hole/debug/custom.list
DL6ER Dec 21, 2021
669f1b0
Address reviewer's comment
yubiuser Dec 21, 2021
190ab79
Implement fully-automated gravity database recovery method.
DL6ER Aug 20, 2021
469c179
Return early from recovery routine when integrity checks didn't show …
DL6ER Sep 11, 2021
ab4bce4
Allow users to force recovery even when checks are okay using "pihole…
DL6ER Sep 11, 2021
b06efb6
Declare variables local
DL6ER Dec 21, 2021
39a66b6
Replace Contributing Guide by link to docs.pi-hole.net (#4433)
yubiuser Dec 21, 2021
7167e6d
Apply suggestions from code review
DL6ER Dec 21, 2021
db5e94b
use +short and omit obsolet awk
yubiuser Dec 21, 2021
54c5832
Merge pull request #4450 from pi-hole/unblock_NODATA
DL6ER Dec 21, 2021
ff4487f
Escape quotes
yubiuser Dec 21, 2021
1eb3117
Merge pull request #4455 from pi-hole/comment
DL6ER Dec 21, 2021
920cf6d
Check for updates on master based on tags not commits (#4475)
yubiuser Dec 22, 2021
2e1ce7f
Apply suggestions from code review
DL6ER Dec 22, 2021
d2a98ae
Document -r recover force case
DL6ER Dec 22, 2021
3d3bb45
Merge pull request #4288 from pi-hole/new/gravity_repair
DL6ER Dec 22, 2021
1b809e4
Merge pull request #4480 from pi-hole/development
PromoFaux Dec 22, 2021
ef30a85
Include port in status function
yubiuser Dec 26, 2021
9f0e0db
Fix analyse ports
yubiuser Dec 26, 2021
71ebd64
mend
yubiuser Dec 26, 2021
5ef731f
Fix indention
yubiuser Dec 28, 2021
4a2f4c1
Fix indention_2
yubiuser Dec 28, 2021
2a86941
Add netcat to dependencies
yubiuser Dec 28, 2021
5729f64
Fix missing fi
yubiuser Dec 28, 2021
f45248d
Use FTL's new dns-port API endpoint
yubiuser Dec 28, 2021
71ed842
Fixed path to 404 file when using custom.php (#4488)
Computroniks Dec 28, 2021
2b52f92
Inlcude port also in cli output
yubiuser Dec 28, 2021
bcb5915
Analyse port also on ports other than 53
yubiuser Dec 28, 2021
3989cc1
Remove double text output
yubiuser Dec 28, 2021
886f0c7
Merge pull request #4485 from pi-hole/tweak/web_status
DL6ER Dec 29, 2021
5bd7cc9
Replace `which` with `command -v` (#4499)
WaLLy3K Jan 1, 2022
0e359a6
Set dnsmasq interface listening by default to local (#4509)
yubiuser Jan 4, 2022
d605b4b
Merge pull request #4513 from pi-hole/master
PromoFaux Jan 4, 2022
241e53e
Skip debug upload question if called from web interface (#4494)
yubiuser Jan 4, 2022
c6a2a6f
Install pihole-FTL.conf template on fresh installation (#4496)
yubiuser Jan 4, 2022
7807a93
If PIHOLE_DOCKER_TAG is set, then include that info in the debug run …
PromoFaux Jan 4, 2022
5823f5e
Use ss instead of lsof (#4518)
DL6ER Jan 5, 2022
2ff10fc
Merge pull request #4514 from pi-hole/development
PromoFaux Jan 5, 2022
81698ef
Fix Pi-hole status in chronometer
yubiuser Jan 5, 2022
0124e49
Merge pull request #4521 from pi-hole/fix/chronometer
PromoFaux Jan 5, 2022
875ad04
Merge pull request #4522 from pi-hole/development
PromoFaux Jan 5, 2022
c208032
Install netcat-openbsd as dependency explicitly
MichaIng Jan 7, 2022
bfd9fe8
Remove debug from Stale
dschaper Jan 8, 2022
363e2f1
Merge pull request #4534 from pi-hole/meta/enable_stale
PromoFaux Jan 8, 2022
3097c8f
Skip the required ports check if installed in docker container. Unpri…
PromoFaux Jan 8, 2022
ce86157
Fix gravity in case there are no adlists at all or all are disabled (…
DL6ER Jan 8, 2022
7010ed4
Merge pull request #4532 from MichaIng/patch-1
PromoFaux Jan 8, 2022
1b0b24d
Merge pull request #4539 from pi-hole/master
PromoFaux Jan 8, 2022
a65a841
Remove oneline from ss call
yubiuser Jan 9, 2022
d5253f2
Merge pull request #4542 from pi-hole/remove_oneline
DL6ER Jan 9, 2022
b20b38d
Include ip addr show and ip route show for us to help with local-serv…
DL6ER Jan 9, 2022
ec3a5c2
Merge pull request #4543 from pi-hole/tweak/debug_ipaddr
DL6ER Jan 9, 2022
f124568
Add action to automatically sync master to dev when code is pushed to…
PromoFaux Jan 10, 2022
65a0424
Merge pull request #4548 from pi-hole/actions/sync-to-dev
PromoFaux Jan 11, 2022
a79c115
Merge pull request #4550 from pi-hole/master
PromoFaux Jan 11, 2022
3260cb4
ops per run -> 300 for stale
PromoFaux Jan 11, 2022
918f7a5
Merge pull request #4554 from pi-hole/master
PromoFaux Jan 11, 2022
ed6b852
use sed substitute instead of delete and append (#4555)
lschloetterer Jan 12, 2022
57ba60c
Change the exemption issue label pinned to internal for stale issues
yubiuser Jan 13, 2022
cdde832
Some use uppercase some don't...
yubiuser Jan 13, 2022
6ead24b
Move space into variable (#4562)
rdwebdesign Jan 14, 2022
3cd662e
Merge pull request #4558 from pi-hole/stale
PromoFaux Jan 16, 2022
e80a773
Merge pull request #4568 from pi-hole/master
PromoFaux Jan 16, 2022
7aa28e4
Do a full fetch
yubiuser Jan 22, 2022
bad6d8a
add parameter to set filename for teleporter
lschloetterer Jan 28, 2022
f0f5cc5
Use internal SQLite3 engine in more places in gravity.sh
DL6ER Jan 29, 2022
534f9a6
Copy database tables earlier into the new gravity database to avoid f…
DL6ER Jan 30, 2022
5bb79de
Clean possible leftovers in domainlist_by_group, adlist_by_group, and…
DL6ER Jan 30, 2022
8cbffa1
Replace remaining sqlite3 calls by calls to our embedded pihole-FTL s…
DL6ER Jan 30, 2022
1dd9d55
Replace value for BLOCKING_ENABLED (and QUERY_LOGGING, for consistenc…
PromoFaux Jan 30, 2022
2f4c4d9
Fix stale label to stale
yubiuser Jan 30, 2022
74d7d10
Orphans need to be deleted in the old database
DL6ER Jan 30, 2022
77e5121
Split new function out into a separte utility script and add a test f…
PromoFaux Jan 30, 2022
5d68dac
Merge pull request #4588 from pi-hole/stale
PromoFaux Jan 31, 2022
30ec1c9
Merge pull request #4593 from pi-hole/master
DL6ER Feb 1, 2022
e09dd56
Remove RPM package sqlite as well
DL6ER Feb 1, 2022
d956498
Merge pull request #4575 from pi-hole/fix/tag_update
DL6ER Feb 1, 2022
76d4e12
Merge pull request #4585 from pi-hole/tweak/sed-add-if-not-exists
DL6ER Feb 1, 2022
881d926
add hint for custom teleporter filename to help function
lschloetterer Feb 1, 2022
844c4dc
Merge pull request #4584 from pi-hole/fix/gravity_internal_sqlite3
DL6ER Feb 3, 2022
444526a
Switch from centos8 to centos8:stream base image for centos 8 tests
PromoFaux Feb 3, 2022
ee9f485
Merge pull request #4596 from pi-hole/long-live-centos8-stream
PromoFaux Feb 3, 2022
7c60ee8
Remove pihole-FTL.conf man page
yubiuser Dec 29, 2021
d7d8e97
Remove pihole-FTL.conf.5 from automated tests
yubiuser Dec 30, 2021
c3c5342
Fix reviewer's comment
yubiuser Feb 4, 2022
2a0bb5b
Create second entry for teleporter and adjust spacing
lschloetterer Feb 4, 2022
f342b2c
Merge pull request #4489 from pi-hole/tweak/manpages
PromoFaux Feb 4, 2022
2bd670a
Merge pull request #4582 from lschloetterer/patch-1
PromoFaux Feb 4, 2022
08999bf
Use case insensitive deletion when removing custom CNAME/DNS records …
PromoFaux Feb 4, 2022
e9250d6
Merge pull request #4598 from pi-hole/alt-4597
PromoFaux Feb 4, 2022
6ffa2ba
Merge pull request #4547 from pi-hole/development
PromoFaux Feb 12, 2022
9be5199
remove the CONTENT_COMPARISON setting (defaults to false)
PromoFaux Feb 20, 2022
899cac0
Ignore Documentation Needed label
PromoFaux Mar 5, 2022
2f38452
Wrap touch calls with if/then guards for Buster docker.
dschaper Mar 31, 2022
c2384ec
Change touch that would always fire to install.
dschaper Mar 31, 2022
d45c9fc
Final touch to install fix.
dschaper Apr 1, 2022
8a5c7de
Ensure existing files are proper owner and mode.
dschaper Mar 31, 2022
0f19299
Create empty files.
dschaper Apr 1, 2022
b714c45
Found it.
dschaper Apr 1, 2022
326cd6a
Merge pull request #4665 from pi-hole/fix/touch_guard
dschaper Apr 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
changelog:
exclude:
labels:
- internal
authors:
- dependabot
- github-actions
25 changes: 25 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Mark stale issues

on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write

steps:
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-close: 5
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.'
stale-issue-label: 'stale'
exempt-issue-labels: 'Internal, Fixed in next release, Bug: Confirmed, Documentation Needed'
exempt-all-issue-assignees: true
operations-per-run: 300
27 changes: 27 additions & 0 deletions .github/workflows/sync-back-to-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Sync Back to Development

on:
push:
branches:
- master

jobs:
sync-branches:
runs-on: ubuntu-latest
name: Syncing branches
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Opening pull request
id: pull
uses: tretuna/sync-branches@1.4.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FROM_BRANCH: 'master'
TO_BRANCH: 'development'
- name: Label the pull request to ignore for release note generation
uses: actions-ecosystem/action-add-labels@v1
with:
labels: internal
repo: ${{ github.repository }}
number: ${{ steps.pull.outputs.PULL_REQUEST_NUMBER }}
Comment on lines +10 to +27

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 4 months ago

To fix this problem, we should explicitly declare a permissions block. The best place is at the job level (under the sync-branches job in this workflow), defining only the permissions required. Since this workflow checks out code and creates pull requests, and labels PRs, the minimal required permissions are contents: read (for checkout) and pull-requests: write (to create and modify PRs and apply labels). No other write permissions appear necessary. The permissions block should be added as the first line inside the job definition, above runs-on. No special imports, definitions, or method changes are required. Only the YAML needs to be updated.


Suggested changeset 1
.github/workflows/sync-back-to-dev.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/sync-back-to-dev.yml b/.github/workflows/sync-back-to-dev.yml
--- a/.github/workflows/sync-back-to-dev.yml
+++ b/.github/workflows/sync-back-to-dev.yml
@@ -7,6 +7,9 @@
 
 jobs:
   sync-branches:
+    permissions:
+      contents: read
+      pull-requests: write
     runs-on: ubuntu-latest
     name: Syncing branches
     steps:
EOF
@@ -7,6 +7,9 @@

jobs:
sync-branches:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
name: Syncing branches
steps:
Copilot is powered by AI and may make mistakes. Always verify output.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ jobs:
needs: smoke-test
strategy:
matrix:
distro: [debian_9, debian_10, debian_11, ubuntu_16, ubuntu_18, ubuntu_20, ubuntu_21, centos_7, centos_8, fedora_32, fedora_33]
distro: [debian_9, debian_10, debian_11, ubuntu_16, ubuntu_18, ubuntu_20, ubuntu_21, centos_7, centos_8, fedora_33, fedora_34]
env:
DISTRO: ${{matrix.distro}}
steps:
-
name: Checkout repository
uses: actions/checkout@v2
-
name: Set up Python 3.7
name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8
-
name: Install dependencies
run: pip install -r test/requirements.txt
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ __pycache__
*.egg-info
.idea/
*.iml
.vscode/
107 changes: 1 addition & 106 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,111 +2,6 @@

Please read and understand the contribution guide before creating an issue or pull request.

## Etiquette
The guide can be found here: [https://docs.pi-hole.net/guides/github/contributing/](https://docs.pi-hole.net/guides/github/contributing/)

- Our goal for Pi-hole is **stability before features**. This means we focus on squashing critical bugs before adding new features. Often, we can do both in tandem, but bugs will take priority over a new feature.
- Pi-hole is open source and [powered by donations](https://pi-hole.net/donate/), and as such, we give our **free time** to build, maintain, and **provide user support** for this project. It would be extremely unfair for us to suffer abuse or anger for our hard work, so please take a moment to consider that.
- Please be considerate towards the developers and other users when raising issues or presenting pull requests.
- Respect our decision(s), and do not be upset or abusive if your submission is not used.

## Viability

When requesting or submitting new features, first consider whether it might be useful to others. Open source projects are used by many people, who may have entirely different needs to your own. Think about whether or not your feature is likely to be used by other users of the project.

## Procedure

**Before filing an issue:**

- Attempt to replicate and **document** the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.

**Before submitting a pull request:**

- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
- Read and understand the [DCO guidelines](https://docs.pi-hole.net/guides/github/contributing/) for the project.

## Technical Requirements

- Submit Pull Requests to the **development branch only**.
- Before Submitting your Pull Request, merge `development` with your new branch and fix any conflicts. (Make sure you don't break anything in development!)
- Please use the [Google Style Guide for Shell](https://google.github.io/styleguide/shell.xml) for your code submission styles.
- Commit Unix line endings.
- Please use the Pi-hole brand: **Pi-hole** (Take a special look at the capitalized 'P' and a low 'h' with a hyphen)
- (Optional fun) keep to the theme of Star Trek/black holes/gravity.

## Forking and Cloning from GitHub to GitHub

1. Fork <https://github.com/pi-hole/pi-hole/> to a repo under a namespace you control, or have permission to use, for example: `https://github.com/<your_namespace>/<your_repo_name>/`. You can do this from the github.com website.
2. Clone `https://github.com/<your_namespace>/<your_repo_name>/` with the tool of you choice.
3. To keep your fork in sync with our repo, add an upstream remote for pi-hole/pi-hole to your repo.

```bash
git remote add upstream https://github.com/pi-hole/pi-hole.git
```

4. Checkout the `development` branch from your fork `https://github.com/<your_namespace>/<your_repo_name>/`.
5. Create a topic/branch, based on the `development` branch code. *Bonus fun to keep to the theme of Star Trek/black holes/gravity.*
6. Make your changes and commit to your topic branch in your repo.
7. Rebase your commits and squash any insignificant commits. See the notes below for an example.
8. Merge `development` your branch and fix any conflicts.
9. Open a Pull Request to merge your topic branch into our repo's `development` branch.

- Keep in mind the technical requirements from above.

## Forking and Cloning from GitHub to other code hosting sites

- Forking is a GitHub concept and cannot be done from GitHub to other git-based code hosting sites. However, those sites may be able to mirror a GitHub repo.

1. To contribute from another code hosting site, you must first complete the steps above to fork our repo to a GitHub namespace you have permission to use, for example: `https://github.com/<your_namespace>/<your_repo_name>/`.
2. Create a repo in your code hosting site, for example: `https://gitlab.com/<your_namespace>/<your_repo_name>/`
3. Follow the instructions from your code hosting site to create a mirror between `https://github.com/<your_namespace>/<your_repo_name>/` and `https://gitlab.com/<your_namespace>/<your_repo_name>/`.
4. When you are ready to create a Pull Request (PR), follow the steps `(starting at step #6)` from [Forking and Cloning from GitHub to GitHub](#forking-and-cloning-from-github-to-github) and create the PR from `https://github.com/<your_namespace>/<your_repo_name>/`.

## Notes for squashing commits with rebase

- To rebase your commits and squash previous commits, you can use:

```bash
git rebase -i your_topic_branch~(number of commits to combine)
```

- For more details visit [gitready.com](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)

1. The following would combine the last four commits in the branch `mytopic`.

```bash
git rebase -i mytopic~4
```

2. An editor window opens with the most recent commits indicated: (edit the commands to the left of the commit ID)

```gitattributes
pick 9dff55b2 existing commit comments
squash ebb1a730 existing commit comments
squash 07cc5b50 existing commit comments
reword 9dff55b2 existing commit comments
```

3. Save and close the editor. The next editor window opens: (edit the new commit message). *If you select reword for a commit, an additional editor window will open for you to edit the comment.*

```bash
new commit comments
Signed-off-by: yourname <your email address>
```

4. Save and close the editor for the rebase process to execute. The terminal output should say something like the following:

```bash
Successfully rebased and updated refs/heads/mytopic.
```

5. Once you have a successful rebase, and before you sync your local clone, you have to force push origin to update your repo:

```bash
git push -f origin
```

6. Continue on from step #7 from [Forking and Cloning from GitHub to GitHub](#forking-and-cloning-from-github-to-github)
11 changes: 6 additions & 5 deletions advanced/06-rfc6761.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ server=/localhost/
server=/invalid/

# The same RFC requests something similar for
# 16.172.in-addr.arpa. 22.172.in-addr.arpa. 27.172.in-addr.arpa.
# 17.172.in-addr.arpa. 30.172.in-addr.arpa. 28.172.in-addr.arpa.
# 18.172.in-addr.arpa. 23.172.in-addr.arpa. 29.172.in-addr.arpa.
# 19.172.in-addr.arpa. 24.172.in-addr.arpa. 31.172.in-addr.arpa.
# 20.172.in-addr.arpa. 25.172.in-addr.arpa. 168.192.in-addr.arpa.
# 10.in-addr.arpa. 21.172.in-addr.arpa. 27.172.in-addr.arpa.
# 16.172.in-addr.arpa. 22.172.in-addr.arpa. 28.172.in-addr.arpa.
# 17.172.in-addr.arpa. 23.172.in-addr.arpa. 29.172.in-addr.arpa.
# 18.172.in-addr.arpa. 24.172.in-addr.arpa. 30.172.in-addr.arpa.
# 19.172.in-addr.arpa. 25.172.in-addr.arpa. 31.172.in-addr.arpa.
# 20.172.in-addr.arpa. 26.172.in-addr.arpa. 168.192.in-addr.arpa.
# Pi-hole implements this via the dnsmasq option "bogus-priv" (see
# 01-pihole.conf) because this also covers IPv6.

Expand Down
10 changes: 5 additions & 5 deletions advanced/Scripts/chronometer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ get_sys_stats() {
*) cpu_col="$COL_URG_RED";;
esac

# $COL_NC$COL_DARK_GRAY is needed for $COL_URG_RED
cpu_temp_str=" @ $cpu_col$cpu_temp$COL_NC$COL_DARK_GRAY"
# $COL_NC$COL_DARK_GRAY is needed for $COL_URG_RED
cpu_temp_str=" @ $cpu_col$cpu_temp$COL_NC$COL_DARK_GRAY"

elif [[ "$temp_unit" == "F" ]]; then
cpu_temp=$(printf "%.0ff\\n" "$(calcFunc "($(< $temp_file) / 1000) * 9 / 5 + 32")")
Expand All @@ -357,7 +357,7 @@ get_sys_stats() {
ram_used="${ram_raw[1]}"
ram_total="${ram_raw[2]}"

if [[ "$(pihole status web 2> /dev/null)" == "1" ]]; then
if [[ "$(pihole status web 2> /dev/null)" -ge "1" ]]; then
ph_status="${COL_LIGHT_GREEN}Active"
else
ph_status="${COL_LIGHT_RED}Offline"
Expand Down Expand Up @@ -445,7 +445,7 @@ get_strings() {
lan_info="Gateway: $net_gateway"
dhcp_info="$leased_str$ph_dhcp_num of $ph_dhcp_max"

ads_info="$total_str$ads_blocked_today of $dns_queries_today"
ads_info="$total_str$ads_blocked_today of $dns_queries_today"
dns_info="$dns_count DNS servers"

[[ "$recent_blocked" == "0" ]] && recent_blocked="${COL_LIGHT_RED}FTL offline${COL_NC}"
Expand Down Expand Up @@ -488,7 +488,7 @@ chronoFunc() {
${COL_LIGHT_RED}Press Ctrl-C to exit${COL_NC}
${COL_DARK_GRAY}$scr_line_str${COL_NC}"
else
echo -e "|¯¯¯(¯)_|¯|_ ___|¯|___$phc_ver_str\\n| ¯_/¯|_| ' \\/ _ \\ / -_)$lte_ver_str\\n|_| |_| |_||_\\___/_\\___|$ftl_ver_str\\n ${COL_DARK_GRAY}$scr_line_str${COL_NC}"
echo -e "|¯¯¯(¯)_|¯|_ ___|¯|___$phc_ver_str\\n| ¯_/¯|_| ' \\/ _ \\ / -_)$lte_ver_str\\n|_| |_| |_||_\\___/_\\___|$ftl_ver_str\\n ${COL_DARK_GRAY}$scr_line_str${COL_NC}"
fi

printFunc " Hostname: " "$sys_name" "$host_info"
Expand Down
38 changes: 19 additions & 19 deletions advanced/Scripts/database_migration/gravity-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ upgrade_gravityDB(){
auditFile="${piholeDir}/auditlog.list"

# Get database version
version="$(sqlite3 "${database}" "SELECT \"value\" FROM \"info\" WHERE \"property\" = 'version';")"
version="$(pihole-FTL sqlite3 "${database}" "SELECT \"value\" FROM \"info\" WHERE \"property\" = 'version';")"

if [[ "$version" == "1" ]]; then
# This migration script upgrades the gravity.db file by
# adding the domain_audit table
echo -e " ${INFO} Upgrading gravity database from version 1 to 2"
sqlite3 "${database}" < "${scriptPath}/1_to_2.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/1_to_2.sql"
version=2

# Store audit domains in database table
Expand All @@ -40,58 +40,58 @@ upgrade_gravityDB(){
# renaming the regex table to regex_blacklist, and
# creating a new regex_whitelist table + corresponding linking table and views
echo -e " ${INFO} Upgrading gravity database from version 2 to 3"
sqlite3 "${database}" < "${scriptPath}/2_to_3.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/2_to_3.sql"
version=3
fi
if [[ "$version" == "3" ]]; then
# This migration script unifies the formally separated domain
# lists into a single table with a UNIQUE domain constraint
echo -e " ${INFO} Upgrading gravity database from version 3 to 4"
sqlite3 "${database}" < "${scriptPath}/3_to_4.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/3_to_4.sql"
version=4
fi
if [[ "$version" == "4" ]]; then
# This migration script upgrades the gravity and list views
# implementing necessary changes for per-client blocking
echo -e " ${INFO} Upgrading gravity database from version 4 to 5"
sqlite3 "${database}" < "${scriptPath}/4_to_5.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/4_to_5.sql"
version=5
fi
if [[ "$version" == "5" ]]; then
# This migration script upgrades the adlist view
# to return an ID used in gravity.sh
echo -e " ${INFO} Upgrading gravity database from version 5 to 6"
sqlite3 "${database}" < "${scriptPath}/5_to_6.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/5_to_6.sql"
version=6
fi
if [[ "$version" == "6" ]]; then
# This migration script adds a special group with ID 0
# which is automatically associated to all clients not
# having their own group assignments
echo -e " ${INFO} Upgrading gravity database from version 6 to 7"
sqlite3 "${database}" < "${scriptPath}/6_to_7.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/6_to_7.sql"
version=7
fi
if [[ "$version" == "7" ]]; then
# This migration script recreated the group table
# to ensure uniqueness on the group name
# We also add date_added and date_modified columns
echo -e " ${INFO} Upgrading gravity database from version 7 to 8"
sqlite3 "${database}" < "${scriptPath}/7_to_8.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/7_to_8.sql"
version=8
fi
if [[ "$version" == "8" ]]; then
# This migration fixes some issues that were introduced
# in the previous migration script.
echo -e " ${INFO} Upgrading gravity database from version 8 to 9"
sqlite3 "${database}" < "${scriptPath}/8_to_9.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/8_to_9.sql"
version=9
fi
if [[ "$version" == "9" ]]; then
# This migration drops unused tables and creates triggers to remove
# obsolete groups assignments when the linked items are deleted
echo -e " ${INFO} Upgrading gravity database from version 9 to 10"
sqlite3 "${database}" < "${scriptPath}/9_to_10.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/9_to_10.sql"
version=10
fi
if [[ "$version" == "10" ]]; then
Expand All @@ -101,31 +101,31 @@ upgrade_gravityDB(){
# to keep the copying process generic (needs the same columns in both the
# source and the destination databases).
echo -e " ${INFO} Upgrading gravity database from version 10 to 11"
sqlite3 "${database}" < "${scriptPath}/10_to_11.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/10_to_11.sql"
version=11
fi
if [[ "$version" == "11" ]]; then
# Rename group 0 from "Unassociated" to "Default"
echo -e " ${INFO} Upgrading gravity database from version 11 to 12"
sqlite3 "${database}" < "${scriptPath}/11_to_12.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/11_to_12.sql"
version=12
fi
if [[ "$version" == "12" ]]; then
# Add column date_updated to adlist table
echo -e " ${INFO} Upgrading gravity database from version 12 to 13"
sqlite3 "${database}" < "${scriptPath}/12_to_13.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/12_to_13.sql"
version=13
fi
if [[ "$version" == "13" ]]; then
# Add columns number and status to adlist table
echo -e " ${INFO} Upgrading gravity database from version 13 to 14"
sqlite3 "${database}" < "${scriptPath}/13_to_14.sql"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/13_to_14.sql"
version=14
fi
if [[ "$version" == "14" ]]; then
# Changes the vw_adlist created in 5_to_6
echo -e " ${INFO} Upgrading gravity database from version 14 to 15"
sqlite3 "${database}" < "${scriptPath}/14_to_15.sql"
version=15
fi
# Changes the vw_adlist created in 5_to_6
echo -e " ${INFO} Upgrading gravity database from version 14 to 15"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/14_to_15.sql"
version=15
fi
}
Loading
Loading