Skip to content
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

Use FTL's API endpoint to get Pi-hole's status #209

Merged
merged 1 commit into from Apr 2, 2022
Merged

Conversation

yubiuser
Copy link
Member

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes, and have included unit tests where possible.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)

Please make sure you Sign Off all commits. Pi-hole enforces the DCO.


What does this PR aim to accomplish?:
Instead of using pihole status web to get the Pi-hole status, use the native FTL API endpoints >stats and >dns-port (pi-hole/FTL#1264) to determine Pi-hole's current status.
Drawback of pihole status web is that it needs sudo powers to run the function. Calling the endpoints directly does not require elevated privileges.

The logic is now the following (mimicy of pihole status web): If no FTL PID is found or the DNS part if Pi-hole is disabled, the status is "DNS offline". If this is not the case, everything depends on status returned by >stats. It can either be "enabled", "disabled" (blocking off) or "unknown".

Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser yubiuser requested a review from a team March 25, 2022 16:28
@yubiuser yubiuser merged commit c37e80b into development Apr 2, 2022
@yubiuser yubiuser deleted the dns-port branch April 2, 2022 18:14
@yubiuser yubiuser mentioned this pull request May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants