DL6ER
3bb8050cf8
Remove extra system.hostname property from /api/sysinfo. It is already contained as system.uname.nodename of the very same API endpoint
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-14 20:36:49 +01:00
DL6ER
8541346fae
Add config getter and setter for the CLI
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-14 20:35:40 +01:00
DL6ER
7afd123530
Add system.hostname and ftl.{pid,%cpu,%mem} to /api/ftl/sysinfo
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-14 10:08:03 +01:00
DL6ER
4a033795c1
Add misc.temp.unit and move misc.temp_limit to misc.temp.limit
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-12 19:27:24 +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
8bbd49acf4
Modify /version to match the new /etc/pihole/versions file format
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-09 20:31:14 +01:00
DL6ER
d8e95f4e46
Add config.http.interface.boxed and config.http.interface.theme primed by setupVars.conf:WEBUIBOXEDLAYOUT and WEBTHEME, respectively
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-09 20:25:24 +01:00
DL6ER
64441ed6d8
Add config.misc.temp_limit setting primed by setupVars.conf:TEMPERATURE_LIMIT (if available) used to signal beyond which temperature the frontend should consider the temperature "hot"
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-09 20:19:59 +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
140a365806
Tests: Set api.pwhash and dns.blocking.mode using PATCH /api/config
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-08 21:29:55 +01:00
DL6ER
4abba45878
Add "uname" object to /ftl/sysinfo containing the nodename, domainname, architecture and other details from uname
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-08 21:29:55 +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
a9e93ba1f8
Calculate percentage of blocked queries only of there is at least one blocked query to prevent division-by-zero issues (leading to None)
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-08 19:04: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
b8354c515c
Fix debug flag parsing after changing from bit-wise flags to individual bools
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-07 20:08:38 +01:00
DL6ER
8efd253529
Merge remote-tracking branch 'origin/development' into new/http
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-07 18:37:13 +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
58fd9aaa36
Use table query_storage instead of view queries in all places (well, except one which will be covered at a later time)
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-03 22:11:53 +01:00
DL6ER
f2d68f20d7
Also verify endpoint structure: Query endpoints from FTL and check if all properties mentioned in the docs are present (and of correct type) and that there are no extra properties we forgot to document. Furthermore, also verify that the provided examples are of correct type, too.
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-03 21:51:13 +01:00
DL6ER
5019cc7ac7
Add /api/stats/database/summary documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-03 20:17:34 +01:00
DL6ER
9c19abb86d
Add /api/stats/query_types and /api/stats/database/query_types documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-03 20:06:52 +01:00
DL6ER
8588c5c62d
Add /api/stats/top_clients and /api/stats/database/top_clients documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-03 19:24:14 +01:00
DL6ER
0b3a5baa0b
Add /api/stats/top_domains and /api/stats/database/top_domains documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-03 19:11:02 +01:00
DL6ER
73c8783abc
Add /api/stats/recent_blocked documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-02 21:41:41 +01:00
DL6ER
ffacb1ad9e
Add /history/database/clients documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-02 21:37:17 +01:00
DL6ER
225187447f
Add /api/history/database documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-02 21:31:57 +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
60c09602ac
Remove /api/settings/web
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-02 20:58:33 +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
fa71150336
Order network devices descending by lastQuery
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-02 20:38:20 +01:00
DL6ER
507df1c157
Move /api/network to /api/ftl/network
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-02 20:37:50 +01:00
DL6ER
32279e0765
Also rename config options in test pihole-FTL.toml
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-02 20:08:45 +01:00
DL6ER
bd5519c6bf
Add API checking script
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-01 20:34:40 +01:00
DL6ER
3389b1f0c2
Add /api/ftl/config which can be used to retrieve the entire configuration of FTL. This endpoint only supports GET so far, however, we will add POST in the future so that configuration values can be changed through the API
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2023-01-01 18:19:36 +01:00
DL6ER
c39a6e4080
Add /api/ftl/interfaces documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-12-31 20:18:20 +01:00
DL6ER
8f418a7788
Add /api/ftl/gateway documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-12-31 13:26:19 +01:00
DL6ER
393792b606
Remove gateway object from /api/ftl/interfaces
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-12-31 13:22:02 +01:00
DL6ER
e776e0290a
Rename JSON macros
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-12-31 13:17:18 +01:00
DL6ER
ffbe2bd370
Move /api/endpoints to /api/ftl/endpoints and add /api/ftl/endpoints documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-12-31 13:11:52 +01:00
DL6ER
e9f5f667fa
Add /dns/port documentation
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-12-31 12:59:24 +01:00
DL6ER
23554c4241
Onlycompile outdated documentation file to speed-up the compilation process
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-12-31 10:23:06 +01:00
DL6ER
973df98b13
Add /api/endpoints
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-12-31 10:00:10 +01:00
DL6ER
615b8b6279
Work around long-standing bug in gcc 12.x reported in #1424
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-11-03 20:44:53 +01:00
DL6ER
bcdf65397d
Fix printed error message when binding fails
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-10-03 18:24:02 +02:00
DL6ER
b2c3d4725c
Fix audit log SQL query
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2022-10-01 13:27:00 +02:00
Christian König
597e98e773
Don't create FTL.port
...
Signed-off-by: Christian König <ckoenig@posteo.de >
2022-09-21 12:06:14 +02:00