Expected Behaviour:
On Pi-hole V4, it was possible to interact with the black- and whitelists using requests like:
http://pi.hole/admin/api.php?list=white&auth=my_token
This returned a JSON representation of your current whitelist. Similar operations were possible for adding/removing from lists.
Actual Behaviour:
Since Pi-hole V5.0.0, the endpoints seem to crash the web server via a HTTP 500 status code. The endpoint is used in the app for Pi-hole I am maintaining. More users are reporting similar errors. This issue is tracked on the FlutterHole GitHub page.
My question: do other users have a working endpoint on their V5 Pi-hole? If not, would it be possible to get it working in V5?
I am aware that a new API is being built, but for now I am curious if the old API is just broken for me or others as well.
FlutterHole white-/blacklisting issue:
opened 02:31PM - 14 May 20 UTC
closed 04:44PM - 22 Aug 20 UTC
Blocking
beta 5
feature
Since V5 fetching the whitelist with the old format throws a server error:
-… `{{ base_url }}?list=white&auth={{ auth }}`
- `{{ base_url }}?list=black&auth={{ auth }}`
These return a 500 status on my local Pi. Not sure if the API changed or my Pihole installation is funky.
The V5 dashboard seems to get its data `http://pi.hole/admin/scripts/pi-hole/php/groups.php` with some url encoded form data.
If anyone manages to query their Pi properly, please let me know!
New Pi-hole API issue:
pi-hole:development
← pi-hole:new/http
opened 12:13PM - 21 Nov 19 UTC
**By submitting this pull request, I confirm the following (please check boxes, … eg [X]) _Failure to fill the template will close your PR_:**
***Please submit all pull requests against the `development` branch. Failure to do so will delay or deny your request***
- [X] I have read and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md).
- [X] I have checked that [another pull request](https://github.com/pi-hole/FTL/pulls) for this purpose does not exist.
- [X] I have considered, and confirmed that this submission will be valuable to others.
- [X] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
- [X] I give this submission freely, and claim no ownership to its content.
**How familiar are you with the codebase?:**
## 10
---
This PR adds a fully-fledged HTTP server and JSON API to FTL.
It will replace `lighttpd` and serve both the API and the [NG web interface](https://github.com/pi-hole/web).
More detail is to be added here once this feature advances further.
Debug Token:
Not applicable
DL6ER
May 22, 2020, 7:21pm
2
Yes, this is a bug already being reported here:
opened 04:21PM - 15 May 20 UTC
closed 09:35PM - 15 Jul 20 UTC
Bugfix in progress
- [X] I have read and understood the [contributors guide](https://github.com/pi-… hole/pi-hole/blob/master/CONTRIBUTING.md).
- [X] The issue I am reporting can be *replicated*.
- [X] The issue I am reporting isn't a duplicate (see [FAQs](https://github.com/pi-hole/pi-hole/wiki/FAQs), [closed issues](https://github.com/pi-hole/pi-hole/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), and [open issues](https://github.com/pi-hole/pi-hole/issues)).
**How familiar are you with the the source code relevant to this issue?:**
8, I can read/write PHP
---
**Expected behaviour:**
Domains are removed from the whitelist/blacklist when making a POST to admin/api.php?list=black&sub=domain.com
admin/api.php?list=black&add=domain.com works fine
**Actual behaviour:**
Domains are not added to blacklist when making a POST to admin/api.php?list=black&sub=domain.com
**Steps to reproduce:**
do a POST to admin/api.php?list=black&add=domain.com
Check blacklist: domain is added : OK
do a POST to admin/api.php?list=black&sub=domain.com
Check blacklist : domain is still there NOK
**Troubleshooting undertaken, and/or other relevant information:**
Opened api.php to see what it refers to
It refers to add.php and sub.php
add.php is available but sub.php is missing.
1 Like
DL6ER
June 3, 2020, 9:34am
4
This will be resolved in Pi-hole v5.1.
Check out the following PR for details on what we did:
pi-hole:devel
← pi-hole:new/api_add_sub_get_lists
opened 04:39PM - 26 May 20 UTC
**By submitting this pull request, I confirm the following:**
- [X] I have r… ead and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md), as well as this entire template.
- [X] I have made only one major change in my proposed changes.
- [X] I have commented my proposed changes within the code.
- [X] I have tested my proposed changes, and have included unit tests where possible.
- [X] I am willing to help maintain this change if there are issues with it later.
- [X] I give this submission freely and claim no ownership.
- [X] It is compatible with the [EUPL 1.2 license](https://opensource.org/licenses/EUPL-1.1)
- [X] I have squashed any insignificant commits. ([`git rebase`](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
---
**What does this PR aim to accomplish?:**
- Fix #1297
- Finally get rid of the remaining `add.php` and use the `groups.php` routines for everything (eases maintenance).
**How does this PR accomplish the above?:**
Add API endpoints `api.php?list=black&add=domain.com` like commands where `add=domain` and `sub=domain` can be used to manage the lists. A simple `api.php?list=black` will simply list all blacklisted domains.
`list` can be `black`, `white`, `regex_white` and `regex_black`.
**What documentation changes (if any) are needed to support this PR?:**
None
system
Closed
June 24, 2020, 12:35pm
7
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.