AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

Prioritize custom rules over other rules

Open devipasigner opened this issue 3 years ago • 8 comments

Prerequisites

  • [X] I have checked the Wiki and Discussions and found no answer

  • [X] I have searched other issues and found no duplicates

  • [X] I want to request a feature or enhancement and not ask a question

Description

What problem are you trying to solve?

I have a whitelist that allows graph.instagram.com using the rule '@@|*graph.instagram.com^' but I want to block it while still keeping the whitelist. However even if I add '||graph.instagram.com^$important' to my custom filtering rules it is not prioritized. Anything with the $important flag in custom filtering rules should be prioritized. image

devipasigner avatar Dec 26 '22 20:12 devipasigner

Following, as my custom important blocking rules are overridden by whitelist important rules, but I'm certain that it should be the other way around. Custom rules should have the most power, especially if they are marked as important.

xJayMorex avatar Dec 30 '22 21:12 xJayMorex

I noticed that as well, you would have of thought custom filtering rules would have priority over allowlists, I found a workaround you can use DNS rewrites and rewrite the domain to 0.0.0.0.

Ry3nlNaToR avatar Mar 18 '23 21:03 Ry3nlNaToR

Apologies for a lack of response.

This is actually what @xJayMorex is talking about. The allowlist rules basically have a higher priority. As a workaround, you can completely exclude the rule from the allowlist engine by using the badfilter modifier. To do that, put a rule like this into a local allowlist:

@@|*graph.instagram.com^$badfilter

ainar-g avatar Mar 20 '23 14:03 ainar-g

As a workaround, you can completely exclude the rule from the allowlist engine by using the badfilter modifier

Didn't know there was a modifier to disable rules I will use that method instead, am currently using DNS rewrites to 0.0.0.0 to block domains listed in Allowlist.

Ry3nlNaToR avatar Mar 20 '23 14:03 Ry3nlNaToR

Any updates on the issue @ainar-g? It's been a year now and surely it can't be this much effort...

Also, the badfilter workaround doesn't work (for allow list items marked important?).

xJayMorex avatar Jan 27 '24 15:01 xJayMorex

No updates. We are considering this for v0.108 branch, but it is not likely to enter v0.107, as that would be a breaking change.

Also, the badfilter workaround doesn't work (for allow list items marked important?).

If you are sure about that, please file a separate bug report.

ainar-g avatar Jan 29 '24 12:01 ainar-g