pi-hole / pi-hole

A black hole for Internet advertisements
https://pi-hole.net
Other
48.62k stars 2.67k forks source link

Gui and CLI behave not the same REGEX #5786

Open ugurtu opened 6 hours ago

ugurtu commented 6 hours ago

Versions

Platform

Expected behavior

If REGEX is disabled, I would expect, that pihole -q would also behave the same.

Actual behavior / bug

If regex is disabled, pihole -q blocks query, but the GUI does not block it anymore!

Steps to reproduce

Steps to reproduce the behavior:

  1. Add regex
  2. Disable regex
  3. Open terminal and run pihole -q
  4. pihole -q says it is blocked, but in GUI it is not blocked!

Debug Token

https://tricorder.pi-hole.net/BmefEgI0/

rdwebdesign commented 6 hours ago

Please, include a debug log:

Using the command line:

Using the web interface:

ugurtu commented 6 hours ago

Here you go I just uploaded it, the debug token is now present in my edited issue

rdwebdesign commented 4 hours ago

I tested using the same regex found in your debug log:

Exactly the same output in both cases. Internally Tools > Search Adlists uses pihole -q.

NOTE:

I think I understand your confusion.

  1. pihole -q says it is blocked, but in GUI it is not blocked!

pihole -q doesn't really check if a domain is blocked or allowed. It's just a search tool.

It just says if a domain or regex is found in the database, but in Pi-hole v5 pihole -q doesn't check if the entry is enabled or disabled.

In Pi-hole v6 (already in development), the function will return only enabled entries.