FTL icon indicating copy to clipboard operation
FTL copied to clipboard

"Advanced filtering" -> "Upstream" - no content

Open AS98765 opened this issue 11 months ago • 6 comments

Versions

  • Pi-hole: v6.0.6
  • Web: v6.1
  • FTL: v6.1

Platform

  • OS and version: Raspberry Pi OS (Debian Bookworm)
  • Platform: Raspberry Pi

Expected behavior

Content after selection.

Actual behavior / bug

Server “fritz.box#53” as an example appears when clicked in the “Dashboard” in “Advanced filtering” -> “Upstream” as IP. Many entries are listed.

If “fritz.box" is selected directly in ‘Advanced filtering’ -> ‘Upstream’, the list is empty.

The same applies to “dns.sse.cisco.com”. fd00::xxx#53 is not even available/ selectable, as described in #3442.

Steps to reproduce

n/a

Debug Token

n/a

Screenshots

Image

Image

Image

Additional context

n/a

AS98765 avatar May 05 '25 14:05 AS98765

Try it with fritz.box*

yubiuser avatar May 05 '25 14:05 yubiuser

I think FTL should do kind of a wildcard filtering by default. This would also solve what I described here: https://github.com/pi-hole/web/issues/3406#issuecomment-2819408151

yubiuser avatar May 05 '25 14:05 yubiuser

Try it with fritz.box*

"No results found"

AS98765 avatar May 05 '25 14:05 AS98765

I think FTL should do kind of a wildcard filtering by default.

The problem is that LIKE %% cannot use the b-tree index in an efficient way. Exact string matching is so much faster. Anyway, FTL does handle wildcard matching, the problem here is rather that we do not search the hostnames associated with the upstream servers but only IP addresses. This is the case because we do not store the host names in the SQLite3 database at all.

I think we need to change the suggested upstreams to show IP addresses, only, to at least get some consistency here. Implementing storing the names alongside the addresses needs database modifications which is a bit more work that I can spare right now. Sorry for that. That is not at all saying this will never come - just not today/-night.

DL6ER avatar May 05 '25 19:05 DL6ER

@AS98765 Please try running

sudo pihole checkout ftl tweak/suggest_upstream_ips

and see if the situation improves for you.

DL6ER avatar May 05 '25 20:05 DL6ER

I think we need to change the suggested upstreams to show IP addresses, only, to at least get some consistency here.

While this will 'fix' the issue, I suspect this might not the best user-friendly solution. They are used to see the host names. Can we suggest IP but add the hostname for displaying only (maybe in parenthesis)?


I tried the branch and it actually does not work, because it only suggests the IP, missing the port.

yubiuser avatar May 06 '25 16:05 yubiuser

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

github-actions[bot] avatar Jun 06 '25 08:06 github-actions[bot]

@yubiuser Please try again, it now looks like this

Image

edit just for clarification: the multi-line ones belong together, e.g.,

Image


Using names for filtering directly would be much more work as we do not store them in the database right now. We'd need to amend the forward_by_id table by the name only then we could modify the search string from f.forward=... to f.forward=... OR f.fname=....

DL6ER avatar Jun 19 '25 11:06 DL6ER

I think the selection from the advanced filtering menu is fine now.


I've just noted three (related) issues:

  1. On the dashboard, different upstream IPs with the same name are now displayed by name only. One cannot distinguish by IP anymore (select both google IPv4 upstreams, both will be shown as dns.google)
  2. Clicking on one of the dns.google links on the dashboard does link to always 8.8.8.8#53 but never 8.8.4.4#53. See the video

Image

  1. If one comes from the dashboard, the the filter does not pre-select the existing entry in the drop-down but creates a new one.

Image

yubiuser avatar Jun 21 '25 06:06 yubiuser

@yubiuser

About your comments above:

  1. On the dashboard, different upstream IPs with the same name are now displayed by name only. One cannot distinguish by IP anymore (select both google IPv4 upstreams, both will be shown as dns.google)
  2. Clicking on one of the dns.google links on the dashboard does link to always 8.8.8.8#53 but never 8.8.4.4#53

I think the Query Log fliter is working, but the chart legend link is broken.

Right after I added the 2 google IPs, the chart legend was showing IPs (with correct links and the Query Log filter was correctly selected):

8.8.8.8#53 ---> Link to queries?upstream=8.8.8.8%2353 (correct)
8.8.4.4#53 ---> Link to queries?upstream=8.8.4.4%2353 (correct)

After a few seconds, the name of the second IP was resolved and this was shown (Query Log filter was correctly selected again):

8.8.8.8#53    ---> Link to queries?upstream=8.8.8.8%2353 (correct)
dns.google#53 ---> Link to queries?upstream=8.8.4.4%2353 (correct)

After a while, the name of the other IP was also resolved, but now the links were wrong:

dns.google#53 ---> Link to queries?upstream=8.8.4.4%2353 (WRONG!)
dns.google#53 ---> Link to queries?upstream=8.8.4.4%2353 (correct)

The issue is here:

https://github.com/pi-hole/web/blob/d799d39d258fe5c57e4d08a7384ec74c1b044611/scripts/js/index.js#L251-L255

The second dns.google overwrites the IP and both links will point to the same upstream.

rdwebdesign avatar Aug 26 '25 01:08 rdwebdesign

@rdwebdesign Could you fix this on the web side of things? Is this fix otherwise ready? Sorry, I lost overview over this issue after so long time has passed...

DL6ER avatar Sep 15 '25 09:09 DL6ER

I also lost track. But I think the FTL part was fine otherwise. But I would re-test once with web being also fixed.

yubiuser avatar Sep 15 '25 09:09 yubiuser

I need to test this PR again and check what is broken and what is working.

I will try this later, after work.

rdwebdesign avatar Sep 15 '25 16:09 rdwebdesign

@DL6ER @yubiuser

Please check https://github.com/pi-hole/web/pull/3606

rdwebdesign avatar Sep 16 '25 02:09 rdwebdesign

Should be fixed with https://github.com/pi-hole/FTL/releases/tag/v6.3

yubiuser avatar Oct 26 '25 14:10 yubiuser