wtfutil / wtf

The personal information dashboard for your terminal
http://wtfutil.com
Mozilla Public License 2.0
15.69k stars 800 forks source link

pihole: Use API url with Token #1614

Closed elulcao closed 7 months ago

elulcao commented 12 months ago

Use API url with Token, this change is based on the recommendation posted here. Pihole must be password protected and 3rd party apps must use a token.

Not using the token will return an empty response object that triggers the error failed to retrieve status: check provided api URL and token json: cannot unmarshal array into Go value of type pihole.Status

Using the correct token will allow the response to include the correct status Status ENABLED

eg:

curl http://pi.hole/admin/api.php?status&auth=${TOKEN}
{"status":"enabled"}

Verification:

senorprogrammer commented 7 months ago

Thanks!