Commit Graph

10 Commits

Author SHA1 Message Date
DL6ER 92ec8e8d70 Update civetweb v1.12 -> v1.13 (and simplify auth-cookie handling)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-06 12:59:01 +01:00
DL6ER a292c8f67f Improve database statistics endpoint
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 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 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 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 88d982a78f Add /api/settings/ftldb
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:17:46 +02:00
DL6ER 0a3424bcff Add simple /api/auth implementation. Currently, all passwords are accepted and a login session is valid for 5 minutes.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-27 00:14:46 +02:00