sterrenb / flutterhole

A third party Android application for the Pi-Hole® dashboard.
https://play.google.com/store/apps/details?id=sterrenburg.github.flutterhole
MIT License
400 stars 27 forks source link

Can't view client or domains without API token #56

Closed derekslenk closed 5 years ago

derekslenk commented 5 years ago

I don't have a password on my local pihole instances. The summary view of each of my piholes works fine, however, clicking on clients or domains returns "API token is empty".

However, since I have no password, I cannot generate an API token.

I am on version 2.1.1+476

sterrenb commented 5 years ago

Hi, the requests that FlutterHole sends for the client & domain pages require authentication on my end (without it, the Pihole server always returns an empty response).

So, if the API token is not set, the app doesn't even attempt to send the request.

Can you report whether the following returns a valid response or an empty response (e.g. []):

http://pi.hole/admin/api.php?topItems

A valid response should look something like this:

{
  "top_queries": {
    "www.google.com": 103,
    ...
  },
  "top_ads": {
    "www.google-analytics.com": 218,
    ...
  }
}
derekslenk commented 5 years ago

I get a valid response:


seven@borgcube:~$ curl -v pi.hole/admin/api.php?topItems
*   Trying 2601:404:c680:3ee1:20c:29ff:fe3e:de62...
* TCP_NODELAY set
* Connected to pi.hole (2601:404:c680:3ee1:20c:29ff:fe3e:de62) port 80 (#0)
> GET /admin/api.php?topItems HTTP/1.1
> Host: pi.hole
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Pi-hole: The Pi-hole Web interface is working!
< X-Frame-Options: DENY
< Content-type: application/json
< Set-Cookie: PHPSESSID=div8ds63n4uo56bk9fug5dlds3; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Content-Length: 616
< Date: Fri, 09 Aug 2019 19:20:23 GMT
< Server: lighttpd/1.4.45
<
{
  "top_queries": {
    "registry-1.docker.io": 76782,
    "auth.docker.io": 32106,
    "www.google.com": 11128,
    "connectivitycheck.gstatic.com": 10784,
    "wpad.lan": 2024,
    "e12930.ksd.akamaiedge.net": 1452,
    "api.weather.com": 1443,
    "clients4.google.com": 1247,
    "epg.provider.plex.tv": 1096,
    "plex.tv": 847
  },
  "top_ads": {
    "log-ingestion.samsungacr.com": 1396,
    "heartbeat.dm.origin.com": 796,
    "telemetry-in.battle.net": 779,
    "activity.windows.com": 558,
    "fs.microsoft.com": 278,
    "watson.telemetry.microsoft.com": 214,
    "device-metrics-us.amazon.com": 143,
    "browser.pipe.aria.microsoft.com": 112,
    "tsfe.trafficshaping.dsp.mp.microsoft.com": 68,
    "vortex.data.microsoft.com": 53
  }
}
sterrenb commented 5 years ago

The latest beta release should help your use case. Please update and let me know what happens!

derekslenk commented 5 years ago

The latest beta release should help your use case. Please update and let me know what happens!

Updated on my Android to the beta version (2.1.2+477) and can confirm the clients and domains tab are populating with the proper data.