DL6ER
48fc06d46b
Add POST /api/teleporter to upload and install backed up configuration
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-25 21:51:12 +01:00
DL6ER
6afab76dcc
Give hint about where the JSON parser failed when passing invalid JSON.
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-23 21:26:11 +01:00
DL6ER
88e8ab9fd5
!!! BREAKING CHANGE !!! Redesign TOML config structure
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-22 12:32:10 +01:00
DL6ER
aeb61a3026
Add HTTP OPTIONS method processing. Using something like "curl -X OPTIONS -I pi.hole:8080/api/... will return an Allow header specifying which endpoint supports which method.
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-21 12:53:04 +01:00
DL6ER
88e57ef9e3
Manage custom.list through the universal /config/dns/hosts instead of its own interface. This reduces code duplication.
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-20 18:32:21 +01:00
DL6ER
91f2645ace
Also allow all IPv6 addresses in default webserver ACL
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-20 04:59:43 +01:00
DL6ER
1ae49c7baf
Add /api/logs/{ftl,http,ph7}
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-18 04:22:50 +01:00
DL6ER
5e96022e63
Group endpoints in /api/ftl/endpoints by supported methods
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-16 21:11:57 +01:00
DL6ER
49d2967cb9
Fix more substantial memory leak in the JSON formatter
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-15 21:47:03 +01:00
DL6ER
c33e089179
Spawn number of webserver threads porportional to the number of online CPUs. The rule is (2*nprocs if nprocs < 8 else 16)
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-15 21:35:31 +01:00
DL6ER
2411818ecc
Add null values to /api/version if corresponding lines are not present in /etc/pihole/versions
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-15 13:30:23 +01:00
DL6ER
41ebe5ec51
!!! BREAKING CHANGE !!! Create new dnsmasq config file and test it.
...
This needs a manual removal of /etc/dnsmasq.d/01-pihole.conf and /etc/dnsmasq.d/02-pihole-dhcp.conf (if existing).
Furthermore, we need a new symlink /etc/pihole/01-pihole.conf -> /etc/dnsmasq.d/01-pihole.conf
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-12 18:12:41 +01:00
DL6ER
70127edd52
Add config.dnsmasq and routines to write dnsmasq config files
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-11 20:14:46 +01:00
DL6ER
999a9735cb
Do not store the payload on the stack but allocate heap memory for it. Using dozens of KB for each API connection is dangerous, hundreds of KB large payloads is surely a very bad idea. (rmemeber, the answer to how-much-it-too-much is the rather vague: too much is when the stack overflows)
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-09 20:08:39 +01:00
DL6ER
f199ac2f08
Automatically migrate the API password hash and the lists of clients and domains to be excluded from setupVars.conf
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-08 21:21:38 +01:00
DL6ER
448550fd9a
Add PATCH /config which allows modifying all FTL config values. Changed values go into effect *immediately* and the config file is updated.
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-08 20:55:31 +01:00
DL6ER
4ac52263e9
Implement login for python API checking script
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-08 16:04:26 +01:00
DL6ER
3c5c1d52b7
Transform log_debug() into a function-like macro to save some time when we are not in debugging mode (the function is not called in this case)
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-08 09:55:51 +01:00
DL6ER
e145d20d28
Rewrite the entire config-related code to allow for changing data without having to restart. Hereby, we greatly reduce code duplication in the TOML routines so we won't have to touch tme in the future when adding additional options.
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-07 18:06:41 +01:00
DL6ER
c7803df604
Add /api/stats/upstreams and /api/stats/database/upstreams documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-02 21:19:11 +01:00
DL6ER
4936e0688f
Add documentation for /api/queries/suggestions
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-02 21:08:01 +01:00
DL6ER
8df3500c83
Move /api/ftl/gateway -> /api/network/gateway, /api/ftl/interfaces -> /api/network/interfaces, /api/ftl/network -> /api/network/devices, and /api/ftl/config -> /api/config and add documentation for /api/network/devices
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-02 20:52:13 +01:00
DL6ER
e776e0290a
Rename JSON macros
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-12-31 13:17:18 +01:00
DL6ER
973df98b13
Add /api/endpoints
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-12-31 10:00:10 +01:00
DL6ER
55bf825a81
Implement TOML config file reader/writer and a converter of the pre-v6.0 config file format.
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-06-10 12:11:25 +02:00
DL6ER
82e9a316da
Update embedded civetweb 1.13 -> 1.14
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-06-08 09:57:18 +02:00
DL6ER
d3b8b20bea
Use specific log routines in webserver/*.c
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-05-27 13:10:26 +02:00
DL6ER
e35cc1021c
Use specific log routines in hooks/extract_question_flags.c
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-05-27 12:54:33 +02:00
DL6ER
94a98d6804
Finish Query Log server-side pagination implementation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-05-26 09:28:47 +02:00
DL6ER
5cca7f2ebe
Split monolothic dnsmasq_interface.c file into individual hook units.
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-05-25 12:32:49 +02:00
DL6ER
ba0af27fb5
Implement Query Log server-side processing
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-03-02 15:17:54 +01:00
DL6ER
01bb3bce23
Make domain hosting the web interface customizable through the settings (for modifying the auto-redirect to admin/)
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-02-13 18:58:56 +01:00
DL6ER
339749da3f
Change timestamps from integer to double for (up to) nanosecond accuracy.
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-02-03 12:37:59 +01:00
DL6ER
195dc3cb9a
Rename routes.{c,g} -> api.{c,h} and reduce locking where this is not needed to gain more speed for the API
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-02-02 12:21:36 +01:00
DL6ER
dfc9dac166
Add OpenAPI schema validation (npm test)
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-02-01 12:03:20 +01:00
DL6ER
891c96a43e
Fix regex-test mode
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-31 16:51:59 +01:00
DL6ER
d1269c0a8a
Move /api/stats/history to /api/history/queries
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-30 16:13:31 +01:00
DL6ER
73b3d680ca
Improve error reporting for missing/incorrect sets of payload/URI arguments
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-26 17:46:11 +01:00
DL6ER
c1f29ed978
Improving error reporting of the API
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-26 17:46:11 +01:00
DL6ER
fa4c194045
Improve URI matching algorithm
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-26 17:46:11 +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
5c3a2b509c
Implement changing group assignments through the API
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-20 16:36:02 +01:00
DL6ER
b08954aec7
http_get_payload(): Extract body payload also for PUT and PATCH
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-20 11:51:23 +01:00
DL6ER
e1922ad1ff
Get memory details directly from the kernel as we cannot rely on the information provided by sysinfo() [there sin't anything we need to compute the proper amount of used = unclaimable memory]
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-16 12:22:13 +01:00
DL6ER
8fa055122e
Use payload in form-format when adding/modifying lists
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-15 19:18:08 +01:00
DL6ER
2af933ce88
Implement login as POST to /api/auth, logout as DELETE to /api/auth
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-15 19:18:08 +01:00
DL6ER
b95559bc28
Increase web service thread count to 16
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-11 20:02:30 +01:00
DL6ER
c8d2e74bfb
Implement challenge-response authentication
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-11 19:47:26 +01:00
DL6ER
8e83082636
Merge branch 'development' into new/http
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-01-02 11:36:59 +01:00