-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Add whitelist regex support #612
Conversation
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…ands of messages during gravity import. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…piled. Signed-off-by: DL6ER <dl6er@dl6er.de>
…ex as well as gravity domains as expected. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…compare against the whitelist table but also evaluates possible whitelist regex filters. Signed-off-by: DL6ER <dl6er@dl6er.de>
…this routine is doing. Signed-off-by: DL6ER <dl6er@dl6er.de>
… them globally available. Signed-off-by: DL6ER <dl6er@dl6er.de>
…ilable. Remove log_regex() as it can easily be inlined. Signed-off-by: DL6ER <dl6er@dl6er.de>
Discourse feature request: Wildcard and regex support for whitelisting |
Signed-off-by: DL6ER <dl6er@dl6er.de>
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/filter-blocklist-on-update/21679/8 |
Is this a WIP? |
No, it is ready for review (and possible discussions based thereon). |
@DL6ER As this is ready to review, the core PR should also be made ready for review (un-draft). |
Signed-off-by: DL6ER <dl6er@dl6er.de>
…ing the latter to always end in _TABLE. Also remove code duplication by using a lookup array for the table names instead of using multiple select labels. Signed-off-by: DL6ER <dl6er@dl6er.de>
…able. Added documentation to in_whitelist() that explains the idea of the chosen implementation method. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…E option. We might want to separate this into DEBUG_GRAVITY_DATABASE in the future. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…This allows us to remove the error handler as it could never be executed. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Requested changes were made, will re-review once Core changes are finalized
…(). We always finalize the statement afterwards - whether or not we encountered an error before. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
By submitting this pull request, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your PR:
Please submit all pull requests against the
development
branch. Failure to do so will delay or deny your requestHow familiar are you with the codebase?:
10
Implement regex support for the whitelist. Just as with blacklists, whitelist regex support is intended for few, specialized filters. For mass-whitelisting, the known exact whitelisting should be used*.
Regex whitelist filter will affect the entire blocking Pi-hole is performing:
Using whitelist regex filters can slow down the startup process of FTL, however it can also result in improved performance when fewer blocking domains have to be imported.
Performance examples on a NanoPi NEO:
\.com$
, matching all.com
addresses):The used not-matching filters are long filters of medium complexity (containing a few character groups and alternations).
This pull request also adds eight new tests around blocking and whitelisting.
*) Pi-hole v5.0 ships with a massively improved exact whitelist performance. Up to millions of domains on the whitelist are now possible even on low-end hardware.