Skip to content

Commit

Permalink
Merge pull request yubiuser#57 from yubiuser/development
Browse files Browse the repository at this point in the history
Release v2.6.3
  • Loading branch information
yubiuser committed Oct 8, 2022
2 parents f3e1519 + 785016f commit df0d444
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
1 change: 1 addition & 0 deletions .codespellignore
@@ -0,0 +1 @@
ro
1 change: 1 addition & 0 deletions .github/dependabot.yml
Expand Up @@ -6,3 +6,4 @@ updates:
interval: weekly
day: saturday
time: "10:00"
target-branch: development
1 change: 1 addition & 0 deletions .github/workflows/codespell.yml
Expand Up @@ -24,3 +24,4 @@ jobs:
with:
check_filenames: true
check_hidden: true
ignore_words_file: .codespellignore
25 changes: 16 additions & 9 deletions README.md
Expand Up @@ -17,7 +17,7 @@ The final output is a table of all your adlists with the corresponding number of
- adlist table
id, status, total domains on adlist, covered domains, hits, unique covered domains, address
- the sum of unique covered domains
- optional: list of unique coverd domains with adlist_id, address
- optional: list of unique covered domains with adlist_id, address
- optional: analyse regex blacklist (will be disabled when running Pi-hole in Docker Container!)

As domains usually appear on more then one adlist I introduce the concept of ***unique covered domains***. Those are domains that have been visited, would have been blocked and appear on just one adlist. This might help you to value your adlists not just by how many domains are covered but also what would happen if you disable this adlist.
Expand Down Expand Up @@ -64,15 +64,22 @@ On my [NanoPi NeoPlus2](http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO_Pl
```bash
pihole_adlist_tool [options]

options:
-d [Num] Consider the last [Num] days (Default: 30). Enter 0 for all-time analysis.
-t [Num] Show top blocked domains. [Num] defines the number to show.
-s [total/domains/hits/unique] Set sorting order to total domains, domains covered, hits covered or unique covered domains DESC. (Default sorting: id ASC)
-u Show covered unique domains
-a Run in 'automatic mode'. No user input is required at all, assuming default choice would be to leave everything untouched.
le_adlist_tool's version.
-h Show this help dialog
Options:
-d [Num] Consider the last [Num] days (Default: 30). Enter 0 for all-time analysis.

-t [Num] Show top blocked domains. [Num] defines the number to show.

-s [total/covered/hits/unique] Set sorting order to total (total domains) covered (domains covered), hits (hits covered) or unique (covered unique domains) DESC. (Default sorting: id ASC).

-u Show covered unique domains.

-a Run in 'automatic mode'. No user input is required at all, assuming default choice would be to leave everything untouched.

-r Analyse RegEx as well. Depending on the amount of domains and RegEx this might take a while. Please note: Can only be used, if Pi-hole is NOT running in a Docker Container!

-v Display pihole_adlist_tool's version.
-h Show this help dialog.
```
---
Expand Down
8 changes: 4 additions & 4 deletions pihole_adlist_tool
@@ -1,6 +1,6 @@
#!/bin/bash

PIHOLE_ADLIST_TOOL_VERSION="2.6.2"
PIHOLE_ADLIST_TOOL_VERSION="2.6.3"

# define path to pihole's databases and temporary database
TEMP_DB="/tmp/temp.db"
Expand Down Expand Up @@ -952,7 +952,7 @@ if [ "$REGEX_MODE" -eq 1 ];
# table regex_black contains all blacklisted RegEx from gravity.db
# table all_domains contains all domains (in the selected time period) from the pihole-FTL.db (including domains from CNAME inspection)
# table domain_by_regex contains all domains and the blocking RegEx
# table domainlist_regex contains all exact domains that are on the personal black/whitelist and coverd by RegEx as well
# table domainlist_regex contains all exact domains that are on the personal black/whitelist and covered by RegEx as well

# 1.) copy blacklisted RegEx info from gravity database
# 2.) copy distinct domains from pihole-FTL.db
Expand Down Expand Up @@ -1025,7 +1025,7 @@ EOF
# the number of different domains that would have been blocked by RegEx with the current RegEx configuration
sqlite $TEMP_DB "INSERT INTO info (property, value) Select 'NUM_DOMAINS_BLOCKED_BY_REGEX', COUNT (distinct domain) FROM domain_by_regex JOIN regex_black ON regex_id=id where enabled=1 ;"

# the number of domainlist domains coverd by RegEx
# the number of domainlist domains covered by RegEx
sqlite $TEMP_DB "INSERT INTO info (property, value) Select 'DOMAINLIST_REGEX', COUNT(distinct domain) FROM domainlist_regex;"

NUM_ALL_DOMAINS=$(sqlite $TEMP_DB "SELECT value FROM info where property='NUM_ALL_DOMAINS';")
Expand Down Expand Up @@ -1056,7 +1056,7 @@ EOF
echo
echo
echo " [i] ${bold}You hit a special case${normal}"
echo " Your personal domainlist (black- and whitelist) contains at least one domain that is also coverd by at least"
echo " Your personal domainlist (black- and whitelist) contains at least one domain that is also covered by at least"
echo " one of your RegEx (black- and whitelist)"
echo
echo
Expand Down

0 comments on commit df0d444

Please sign in to comment.