Commit Graph
37 Commits
Author SHA1 Message Date
DL6ER ae5d6e2c19 Add /api/stats/summary documentation
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-30 14:00:54 +01:00
DL6ER f12aa58f3f Rename /api/adlists -> /api/lists
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-23 07:49:41 +01:00
DL6ER 98e74256ae Send domains/clients/groups/adlists counts in a new ftl object
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-22 11:47:57 +01:00
DL6ER 54e206a273 Shorten history JSON keys
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-22 10:28:27 +01:00
DL6ER f67becc3e1 Introduce new ftl_conn struct that makes it easier to share stuff across processing subroutines in the same thread.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-21 16:24:16 +01:00
DL6ER 15ba45e50f Extract payload only once
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-21 13:52:31 +01:00
DL6ER 5e1c75fb84 Include system object in /api/stats/summary to need one AJAX call less
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-20 11:12:47 +01:00
DL6ER 7acaeb72c7 Merge branch 'development' into new/http
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-19 15:35:46 +01:00
DL6ER c0505d7729 Improve format of overTime replies.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-16 16:07:26 +01:00
DL6ER 9966c84f54 Localhost should be able to request all ressources if this is set via a config option
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-15 19:18:08 +01:00
DL6ER a1ec17cca2 Require authentication for api_stats_query_types
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-11 20:02:06 +01:00
DL6ER f71aa9467b Merge branch 'development' into new/http
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-12-08 22:23:05 +01:00
DL6ER 07ea47a0e6 Merge branch 'development' into new/http
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-16 19:30:16 +01:00
DL6ER 2e8e7d1feb Add more API debugging output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-10-27 19:57:22 +01:00
DL6ER 0abcc246a5 Merge branch 'development' into new/http-ph7
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-10-26 12:38:55 +01:00
DL6ER 5375ea0a62 Return null for domain comment if this is what is stored in the database.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-06-17 23:18:34 +02:00
DL6ER 49dc3bfda0 Simplify request variable extraction
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-06-17 20:07:31 +02:00
DL6ER aa3f7443f9 Ensure we use the same reply type in /api/stats/summary as in /api/dns/status
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-06-17 20:07:31 +02:00
DL6ER 67a0395390 Redirect PH7 errors into pihole-FTL.log (instead of showing in the browser output) and define gethostname() PHP function.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-06-02 08:52:55 +02:00
DL6ER c92a0e4bc4 Generally assume authentication to ease the development phase until we are actually able to add authentication.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-29 20:54:30 +02:00
DL6ER 2c6e2ae41f Add NAPTR support for /api/stats/summary
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-29 00:42:35 +02:00
DL6ER 5d54d3412c Compute average response times for used upstream destinations.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:42:18 +02:00
DL6ER 7c97cb6631 Add /api/stats/database/summary
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:37:16 +02:00
DL6ER 429622d8e9 Add /api/stats/database/top_domains and /api/stats/database/top_blocked
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:37:16 +02:00
DL6ER 5d03136e39 Send 200 queries for the query log at once. With this, the clients will always have some pages of the table in their cache.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:28:30 +02:00
DL6ER 8742e140c0 Update user cookie when session is still running.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:28:30 +02:00
DL6ER 8ce1ac146e /api/stats/history: Only use cursor when it is a numeric value, skip if "null".
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:28:30 +02:00
DL6ER 5d61a0c22e Add NULL cursor in history result when privacy level is too high.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:28:30 +02:00
DL6ER e4c7cec349 Add FIFO buffer endpoint at /admin/api/ftl/dnsmasq_log. This is a FIFO buffer collecting and returning up to 32 messages from memory (compile-time option). The API endpoint can be continuously polled with the last returned ID to only show new messages that can be appended to a log on the web interface.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:26:54 +02:00
DL6ER 638ab2f933 Ensure minimum required data is sent by the API even when privacy levels are applied. Sending simply empty responses violates the expectations of the NG web interface.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:26:54 +02:00
DL6ER 440e4aaa84 Send JSON 404 error if an undefined path has been requested insode /api/... Elsewhere in the web interface we still send the usual 404 page.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:26:54 +02:00
DL6ER 07285934cd Add more convenience functions and return 400 Bad Request responses when invalid parameters are given to the /api/stats endpoints.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:26:54 +02:00
DL6ER fd96e3693f Remove deprecated feature to return forward destinations without sorting. This was never offered for any other type of data so it is mroe consistent to completely remove it.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:26:54 +02:00
DL6ER 1f78f2f276 Add new send_json_error() and send_json_unauthorized() routines everywhere we are sending an error.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:24:20 +02:00
DL6ER 3efb39c3af Rename api/http.{c,h} to api/http-common.{c,h}. Separate routing function into api/routes.c.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:24:20 +02:00
DL6ER 004fb93bbe Add authentication requirement for most API endpoints. Some endpoints are special, e.g., /api/status where GET is allowed for anyone, however, POST is only allowed for authenticated users.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:22:51 +02:00
DL6ER 9ec5e5388a Restructure files in /src/api
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:10:15 +02:00