Comments (4)
You discovered one issue (total_domains being empty): pi-hole/FTL#1573
The rest is a feature request and I'm not sure if there is a feasible way to solve it: ABP style domains are handled as a special kind of "RegEX" within FTL and I'm not sure if there is good way to handle them within bash
. And even if I find a way to treat them as bash RegEx it will be painfully slow on lists like https://big.oisd.nl/
to check every domain queries against all adlist entries. (This is the reason why RegEx checking is not enabled by default).
from pihole_adlist_tool.
Hi! I would also find it very helpful to use ABP-style lists with Pi-hole. The list I'm looking at is effectively just a list of domains, but in ABP format: https://v.firebog.net/hosts/Admiral.txt
Examples:
||2znp09oa.com^
||2znp09oa.com^
||35.186.219.42^
||35.186.249.84^
||35.190.48.184^
||35.190.58.50^
||35.190.62.199^
I was able to get the domains recognized by adding:
-e 's/^\|\|(.*)\^$/\1/' \
To this sed
command (currently around line 658 in /opt/pihole/gravity.sh):
# 2) Remove carriage returns
# 3) Remove lines starting with ! (ABP Comments)
# 4) Remove lines starting with [ (ABP Header)
# 5) Remove lines containing ABP extended CSS selectors ("##", "#!#", "#@#", "#?#") preceded by a letter
# 6) Remove comments (text starting with "#", include possible spaces before the hash sign)
# 7) Remove leading tabs, spaces, etc. (Also removes leading IP addresses)
# 8) Convert from ABP format: ||some.domain.here^ --> some.domain.here
# 9) Remove empty lines
sed -i -r \
-e 's/\r$//' \
-e 's/\s*!.*//g' \
-e 's/\s*\[.*//g' \
-e '/[a-z]\#[$?@]{0,1}\#/d' \
-e 's/\s*#.*//g' \
-e 's/^.*\s+//g' \
-e 's/^\|\|(.*)\^$/\1/' \
-e '/^$/d' "${destination}"
(Note the above snippet has the new expression and a matching comment.)
This doesn't solve the full problem of handling fancy ABP patterns, but it might be worth adding to take advantage of the many hosts- / domains-only lists out there.
Happy to open a PR for this, but honestly, it took me long enough to even find your Github org, and I still haven't figured out exactly where gravity.sh
lives in your various repos...
Current versions:
- Pi-hole v5.17.1
- FTL v5.23
- Web Interface v5.20.1
Thanks again!
from pihole_adlist_tool.
I'm not sure what you try to archieve with this RegEx and if this should improve gravit.sh
within Pi-hole or my adlist tool. You can find gravity.sh
here: https://github.com/pi-hole/pi-hole/blob/master/gravity.sh
from pihole_adlist_tool.
@yubiuser Ah, I might have misfired -- Sorry for the noise. I'll make this suggestion over in the pi-hole repo.
Thanks for the redirect!
from pihole_adlist_tool.
Related Issues (20)
- Regex analysis not supported on docker HOT 2
- Receiving an error "database disk image is malformed" HOT 1
- Starting with version 2.4.0, you get multiple 'environment: line 5: docker: command not found' messages HOT 3
- "SUDO_SQLITE: command not found" HOT 3
- Does regex checking account for Filter Lists? HOT 2
- Regex Mode does not work in docker HOT 2
- Wrong detection of PIHOLE_DOCKER?! HOT 8
- Shellcheck is complaining a lot about pihole_adlist_tool HOT 1
- Installation HOT 3
- Question HOT 3
- Can't read /etc/pihole/pihole-FTL.db HOT 5
- Running tool outside the Docker-container throws some errors HOT 7
- Error: stepping, database is locked HOT 1
- Possibility to Deactivate redundant Blocklists HOT 7
- Add assigned group(s) for adlist in result HOT 3
- Instructions HOT 2
- Parse error near line 14: no such column: additional_info HOT 12
- Please add a licence HOT 1
- List the domains which generated a hit HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pihole_adlist_tool.