diff --git a/.codespellignore b/.codespellignore new file mode 100644 index 0000000..d6744d0 --- /dev/null +++ b/.codespellignore @@ -0,0 +1 @@ +ro diff --git a/.github/dependabot.yml b/.github/dependabot.yml index df412cc..fc3c226 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,3 +6,4 @@ updates: interval: weekly day: saturday time: "10:00" + target-branch: development diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 8c38ef2..be1403a 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -24,3 +24,4 @@ jobs: with: check_filenames: true check_hidden: true + ignore_words_file: .codespellignore diff --git a/README.md b/README.md index 1260c0b..90454a1 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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. ``` --- diff --git a/pihole_adlist_tool b/pihole_adlist_tool index bcab713..30dc780 100755 --- a/pihole_adlist_tool +++ b/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" @@ -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 @@ -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';") @@ -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