Skip to content

pihole: Use API url with Token #1614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

elulcao
Copy link
Contributor

@elulcao elulcao commented Aug 27, 2023

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:

  • make test
  • make && ./bin/wtfutil

@senorprogrammer senorprogrammer merged commit 8c89cf8 into wtfutil:master Jan 18, 2024
@senorprogrammer
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants