Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pfBlockerNG: Support AdBlock Whitelists with wildcards #1302

Closed

Conversation

andrebrait
Copy link

Creating this draft PR for early commenting

So far, I've tested it for Unbound mode. Likely needs some small adjustments for Python mode. I'll be testing it soon.

I need some special help with testing it and with the log message formatting. I'm not very happy with how it looks right now, but I whipped this together somewhat quickly, so beauty wasn't my priority.


Add support for AdBlock-style exclusions/whitelisting for pfBlockerNG.

While it already supported AdBlock-style blacklists (minus wildcards), whitelists weren't a thing. This PR adds support for them (including wildcards, since there's not much complexity in doing that) through filtering out the domain lists, exactly like what it does with user-defined whitelists, but expanding that to use Regular Expressions, allowing it to support wildcard entries.

Missing yet:

  • Testing this on Python Mode

Next changes I plan on making, assuming this PR turns out ok:

  • Wildcard support for Blacklists (Python mode only)

@andrebrait
Copy link
Author

andrebrait commented Oct 5, 2023

I caught an issue with the Python mode yesterday. Fixing it later today.

EDIT: fixed in 8042e88

* Use less memory, write whitelist to disk right away
* Fix regular expression conversion to disallow matching limiter chars
* Do not recreate whitelist file for each alias
* Use a dedicated log file for whitelisting results
* Restrict detailed view on whitelisted domains to log file
* Make the new file visible via the Logs page
@andrebrait andrebrait marked this pull request as ready for review October 5, 2023 16:28
@andrebrait andrebrait closed this Oct 6, 2023
@andrebrait
Copy link
Author

Closed this one as I'll be sending a more complete one instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant