flutterhole icon indicating copy to clipboard operation
flutterhole copied to clipboard

Android: Flutterhole can see Pi-hole overall status, but cannot enable/disable, see clients over time, etc.

Open jdrch opened this issue 4 years ago • 11 comments

I have Pi-hole running on Debian Buster with the web UI working just fine. However, Flutterhole is unable to interact with it using the API key, even though it can see the overall stats. I've inserted screenshots below to show the difficulties:

Here's the API key entered just fine, which should work:

Screenshot_20190814-080648

This same API key works for Remote Switch for Pi-hole in both Firefox and Chrome, so I know that's not the issue.

The overall stats display just fine:

Screenshot_20190814-080748

However, the Clients and Domains tabs show "empty response":

Screenshot_20190814-080754

Screenshot_20190814-080802

I've also tried clearing Flutterhole's app data and setting it up from scratch, but have the same problem.

Lastly, what is the meaning of this Basic Authentication section of Settings? Pi-hole doesn't have username:

Screenshot_20190814-080916

Any ideas?

jdrch avatar Aug 14 '19 15:08 jdrch

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

http://pi.hole/admin/api.php?topItems&auth=<API_KEY>

A valid response should look something like this:

{
  "top_queries": {
    "www.google.com": 103,
    ...
  },
  "top_ads": {
    "www.google-analytics.com": 218,
    ...
  }
}

Also try out the latest beta version (build 477+), this version contains a fix for #56.

The basic authentication fields are used for HTTP authentication. So if you use basic auth on your web server, you can provide the credentials here. As far as I know, this isn't a feature of the default Pihole server, so unless you have a custom setup, you should not need it.

sterrenb avatar Aug 16 '19 14:08 sterrenb

I get a valid response in the format you specified.

jdrch avatar Aug 16 '19 15:08 jdrch

I have the exact same issue. Api response looks ok, but Flutter just shows an empty response.

pbinksma avatar Aug 26 '19 06:08 pbinksma

I hit this too. The cause for me is a newline character in the API page after the last letter, which is almost impossible to notice when Android selects the API key.

@sterrenburg you should trim the input if/until this is fixed in the interface.

XhmikosR avatar Dec 07 '19 07:12 XhmikosR

Wow, dude, brilliant. All I had to do is delete the last character of the API key and it worked again.

I think we should close this issue and file one to give the option of making the API key visible in Flutterhole.

Thanks so much!

On Sat, Dec 7, 2019, 01:07 XhmikosR [email protected] wrote:

I hit this too. The cause for me is a whitespace character in the API page after the last letter, which is almost impossible to notice when Android selects the API key.

@sterrenburg https://github.com/sterrenburg you should trim the input if/until this is fixed in the interface.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sterrenburg/flutterhole/issues/60?email_source=notifications&email_token=AAIB756UXZKPQIUCGX7OSATQXNDTRA5CNFSM4ILV63L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGF74UA#issuecomment-562822736, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIB753QWIW4F6E7PKINEDTQXNDTRANCNFSM4ILV63LQ .

jdrch avatar Dec 07 '19 12:12 jdrch

I have submitted https://github.com/pi-hole/AdminLTE/issues/1060 but I still think it's a good practice to trim any whitespace in the user input. Well, maybe not in all forms but you get the idea.

XhmikosR avatar Dec 07 '19 12:12 XhmikosR

Commented and liked your Pi-hole bug report.

On Sat, Dec 7, 2019 at 6:50 AM XhmikosR [email protected] wrote:

I have submitted pi-hole/AdminLTE#1060 https://github.com/pi-hole/AdminLTE/issues/1060 but I still think it's a good practice to trim any whitespace in the user input. Well, maybe not in all forms but you get the idea.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sterrenburg/flutterhole/issues/60?email_source=notifications&email_token=AAIB754P25X2O6FTQXHRHXDQXOL3FA5CNFSM4ILV63L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGGGHPA#issuecomment-562848700, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIB753AIWYJ65GE3BZPYCTQXOL3FANCNFSM4ILV63LQ .

jdrch avatar Dec 07 '19 15:12 jdrch

Sorry I meant to say https://github.com/pi-hole/AdminLTE/pull/1061 which fixes the issue for me by wrapping the token in code

XhmikosR avatar Dec 07 '19 15:12 XhmikosR

@XhmikosR "Make key visible" bug filed 👆

jdrch avatar Dec 07 '19 19:12 jdrch

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

http://pi.hole/admin/api.php?topItems&auth=<API_KEY>

A valid response should look something like this:

{
  "top_queries": {
    "www.google.com": 103,
    ...
  },
  "top_ads": {
    "www.google-analytics.com": 218,
    ...
  }
}

Also try out the latest beta version (build 477+), this version contains a fix for #56.

The basic authentication fields are used for HTTP authentication. So if you use basic auth on your web server, you can provide the credentials here. As far as I know, this isn't a feature of the default Pihole server, so unless you have a custom setup, you should not need it.

Do you have any tutorial on enabling HTTP authentication for PiHole?

p1r473 avatar May 19 '20 05:05 p1r473

Do you have any tutorial on enabling HTTP authentication for PiHole?

Basic Auth is not natively supported for Pi-hole, but the official documentation has some hints on how to configure NGINX.

sterrenb avatar May 19 '20 09:05 sterrenb