Skip to content

Commit

Permalink
Merge pull request yubiuser#84 from yubiuser/development
Browse files Browse the repository at this point in the history
Release v2.6.5
  • Loading branch information
yubiuser committed Feb 9, 2024
2 parents a1ed479 + 3d6fbd7 commit cb0f043
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
-
name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Spell-Checking
uses: codespell-project/actions-codespell@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/editorconfig-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
name: editorconfig-checker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: editorconfig-checker/action-editorconfig-checker@main
- run: editorconfig-checker
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
# Required to access files of this repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Download Shellcheck and add it to the workflow path
- name: Download Shellcheck
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 yubiuser(Christian König)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## Maintenance mode

This repo is in maintenance mode: It's unlikely that I will add new features myself but are willing to accept external pull requests. There are several reasons for this decisions:

- When I released the first version 4 years ago, Pi-hole' blocking capabilities were more limited than today. It was way more simple to deduct from the `gravity` database which queries would have been blocked than it is today. Pi-hole's regex filtering could only be taken into account by parsing the output of the `pihole-FTL` regex engine - which is already kind of a hack. Adding all the code to apply the ABP-style filtering to the queries is out-of-scope (maybe even impossible in a shell script). So the gap between the filtering by Pi-hole and what's reported by the tool gets wider.
- The tool is quite slow and I'm not sure if this could be improved within the limits of a shell script.
- There is a lack of motivation and time to address the above issues.

I'll added a MIT licence so anyone who would like to continue to improve or use the tool should be able to do so.
If I would start fresh, I'll probably would use another language (maybe C, maybe GO) which would allow to implement/reuse `FTL`'s regex engine allowing to parse the regex domains and the ABP-style entries.



# Pihole Adlist Tool

This script tries to provide you with a bunch of information that enables you to decide which adlists you need based on your browsing behavior. It does that by matching your browsing history (FTL's querylog) with your current adlist configuration (gravity database) generating a list of domains that you have visited in the past and which would have been blocked if your current adlist configuration would have been in place back then.
Expand Down
6 changes: 3 additions & 3 deletions pihole_adlist_tool
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

PIHOLE_ADLIST_TOOL_VERSION="2.6.3"
PIHOLE_ADLIST_TOOL_VERSION="2.6.5"

# define path to pihole's databases and temporary database
TEMP_DB="/tmp/temp.db"
Expand Down Expand Up @@ -661,7 +661,7 @@ echo " [i] You have ${bold}$NUM_ADLISTS adlists${normal} configured ($NUM_ADLI
echo " [i] Your gravity.db contains ${bold}$NUM_GRAVITY_UNIQUE_DOMAINS unique domains${normal}"
echo " [i] Since $DATE_FIRST_ANALYZED ${bold}$NUM_DOMAINS_BLOCKED different domains${normal} from your adlists have been blocked ${bold}$HITS_TOTAL times${normal} in total"
echo " (blocked directly by gravity or during deep CNAME inspection)"
echo " [i] Using you current adlist configuration ${bold}$NUM_DOMAINS_BLOCKED_CURRENT domains${normal} would have been blocked ${bold}$HITS_TOTAL_CURRENT times${normal}"
echo " [i] Using your current adlist configuration ${bold}$NUM_DOMAINS_BLOCKED_CURRENT domains${normal} would have been blocked ${bold}$HITS_TOTAL_CURRENT times${normal}"

echo
echo
Expand Down Expand Up @@ -807,7 +807,7 @@ if [ "$FURTHER_ACTION" -eq 2 ]; then
then
sudo bash -c "PIHOLE_DOCKER=0; $SUDO_SQLITE; sqlite $GRAVITY 'UPDATE adlist SET enabled=1 where id=$adlist_id;'"
else
sqlite $GRAVITY "UPDATE adlist SET enabled=1 where id=$adlist_id;'"
sqlite $GRAVITY "UPDATE adlist SET enabled=1 where id=$adlist_id;"
fi
done

Expand Down

0 comments on commit cb0f043

Please sign in to comment.