yubiuser / pihole_adlist_tool

A tool to analyse how your pihole adlists cover you browsing behavior
MIT License
541 stars 32 forks source link

Docker compability #17

Closed simphide closed 3 years ago

simphide commented 3 years ago

The newest version doesn't work with docker anymore...

Can you add docker support again? Thank you!

yubiuser commented 3 years ago

Docker was never supported. I don't run pihole in Docker, so I have no way of testing the script. What is the error you get?

simphide commented 3 years ago

Then docker was at least unofficially supported...

It's not able to look the DNSMASQ Version up (since pihole-FTL is only available inside of the container)

yubiuser commented 3 years ago

I've pushed a workaround that might work.

Please try pihole_adlist_tool_docker from https://github.com/yubiuser/pihole_adlist_tool/tree/new/docker

simphide commented 3 years ago

Besides the error: "grep: /etc/pihole/list*: No such file or directory" it seems to work!

yubiuser commented 3 years ago

Ah thanks. That was a real bug. I forgot this absolute path, it's now replaced by $PIHOLE_ROOT.

Please check again.

simphide commented 3 years ago

Looks good now!

Logs ```bash simon@homeserver:~$ ./analyze_pihole_blocklists.sh *** Pihole Adlist Tool *** ++++++++ Info ++++++++ [i] PIHOLE_DNSMASQ_VERSION: [i] SQLITE_VERSION: [i] DAYS_REQUESTED: 30 [i] TOP: Not shown [i] SORT_ORDER: id ASC [i] UNIQUE: Not shown ++++++++++++++++++++++ Would you like to analyze your current adlist configuration or first enable all adlists (current can be restored later)? 1) Current adlist configuration 2) Enable all adlists (runs pihole -g) Please select: 1 [i] Keeping current adlist configuration [i] Calculating..... [i] This might take some time - please be patient. [i] You have 33 adlists configured (33 enabled) [i] Your gravity.db contains 270635 unique domains [i] Since 06.01.2021 10:32:15 516 different domains from your adlists have been blocked 129753 times in total (blocked directly by gravity or during deep CNAME inspection) [i] Using you current adlist configuration 501 domains would have been blocked 131069 times [i] Adlist coverage id enabled total_domains domains_covered hits_covered unique_domains_covered address ---------- ---------- ------------- --------------- ------------ ---------------------- ---------------------------------------------------------------- 1 1 60414 347 111429 22 https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts 8 1 73 https://raw.githubusercontent.com/FadeMind/hosts.extras/master/a 9 1 775 22 2382 2 https://v.firebog.net/hosts/static/w3kbl.txt 10 1 9210 251 104951 https://adaway.org/hosts.txt 11 1 39372 95 9059 13 https://v.firebog.net/hosts/AdguardDNS.txt 12 1 42296 285 99403 35 https://raw.githubusercontent.com/anudeepND/blacklist/master/ads 13 1 12566 7 2251 1 https://v.firebog.net/hosts/Easylist.txt 14 1 3574 35 1211 https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&s 15 1 10 https://raw.githubusercontent.com/FadeMind/hosts.extras/master/U 16 1 18587 266 108543 22 https://raw.githubusercontent.com/bigdargon/hostsVN/master/hosts 17 1 3022 50 2404 1 https://v.firebog.net/hosts/Easyprivacy.txt 18 1 3670 14 5545 https://v.firebog.net/hosts/Prigent-Ads.txt 19 1 14771 42 72966 5 https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack 20 1 1286 2 3 https://raw.githubusercontent.com/FadeMind/hosts.extras/master/a 21 1 378 18 5999 11 https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/ma 23 1 56977 22 152 11 https://hostfiles.frogeye.fr/firstparty-trackers-hosts.txt 24 1 320 1 4 https://raw.githubusercontent.com/DandelionSprout/adfilt/master/ 25 1 307 https://osint.digitalside.it/Threat-Intel/lists/latestdomains.tx 26 1 2735 7 517 https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising 28 1 3196 https://mirror.cedia.org.ec/malwaredomains/immortal_domains.txt 30 1 2046 https://bitbucket.org/ethanr/dns-blacklists/raw/8575c9f96e5b4a13 31 1 21355 https://phishing.army/download/phishing_army_blocklist_extended. 32 1 412 https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack 33 1 19218 https://v.firebog.net/hosts/Shalla-mal.txt 34 1 8085 https://raw.githubusercontent.com/Spam404/lists/master/main-blac 35 1 2565 6 681 https://raw.githubusercontent.com/FadeMind/hosts.extras/master/a 36 1 1159 https://urlhaus.abuse.ch/downloads/hostfile/ 37 1 3553 https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser 71 1 662 https://v.firebog.net/hosts/Admiral.txt 72 1 8674 2 17 2 https://v.firebog.net/hosts/Prigent-Crypto.txt 73 1 4182 28 2296 5 https://raw.githubusercontent.com/Kees1958/W3C_annual_most_used_ 74 1 2701 7 517 https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt 75 1 16487 https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/mas [i] Domains from disabled adlists are not stored in gravity's database. If you want to include them in the analysis, run this script again and select 'Enable all adlists' As the same domains usually appears on more than one adlist the sum of covered domains from this table is greater than the number of calculated blocked domains shown above [i] In total your adlists contain 130 visited (covered) unique domains - meaning those domains are contained only in a single adlist. Would you like to ... 1) Keep your current adlist configuration 2) Enable only adlists with covered unique domains 3) Enable the minimal number of adlists that cover all domains that would have been blocked Please select: 1 [i] Keeping current adlist configuration [i] Removing temporary database... [✓] Temporary database removed```
yubiuser commented 3 years ago

Thanks for testing.

yubiuser commented 3 years ago

@simphide

I created a new version which will improve docker support a lot. See https://github.com/yubiuser/pihole_adlist_tool/pull/23. Feedback would be appreciated.

simphide commented 3 years ago

Thank you very much! Sadly I am currently unable to test the changes since I don't have access to my home server... I hope I can give you feedback in mid April...!

yubiuser commented 3 years ago

Great. Waiting for your feedback then :)

yubiuser commented 3 years ago

@simphide Did you have time to test?

simphide commented 3 years ago

Hi, sorry not yet - everything delayed a little. I hope I can give you feedback in the beginning of May!

simphide commented 3 years ago

Your script works for Pi-hole docker! Thank you