Commit Graph

102 Commits

Author SHA1 Message Date
DL6ER 1ccfd9a081 Ensure the API does not try to create DNS cache records for queries that don't have one
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-20 15:27:38 +02:00
DL6ER 15942b17ce Store domainlist IDs for blocked/permitted queries
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-19 19:44:11 +02:00
Adam Warner 35bd9a63d1 [skip ci] a couple of spelling changes
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-08-17 21:51:37 +01:00
DL6ER 3ecb14640c Major rewrite of the socket processing routines. Before, we launched a new thread for each incoming connection (more than 40 threads were never allowed). This could potentially be used to DoS FTL by opening and closing telnet sessions in very quick succession. The new behavior is to, instead, launch five (compile-time setting) threads per type (5 for telnet IPv4, 5 for telnet IPv6, and 5 for Unix socket communication) and let them handle incoming connections in a FIFO manner. If too many requests are sent to FTL at once, they will simply have to wait until they are accepted.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-07-30 18:34:43 +02:00
DL6ER 5a095b1cb1 Ensure errno value is restored on return of syscall functions.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-07-30 13:53:32 +02:00
DL6ER 1f1e739008 Simplify telnet routines and add more debug logging and error handling to the existing code
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-06-29 21:46:49 +02:00
DL6ER 17b0a59fc6 Also include IPv4+v6 addresses in >interfaces
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-06-17 11:14:36 +02:00
DL6ER 25ecf054c5 Don't include hardware address
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-06-16 22:54:16 +02:00
DL6ER 65d8133cc4 Add API endpoint ">interfaces"
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-06-16 22:53:48 +02:00
DL6ER 315e8e72d1 Spin-off default gateway detection into its own function
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-06-16 14:42:54 +02:00
DL6ER b0d9244eba Only consider routes which are UP and whose destinations are a gateway. If multiple match, ensure we're reporting the one with minimum metric value.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-06-07 07:52:34 +02:00
DL6ER a7cfb546f2 Add API endpoint ">gateway" that return the IP address and interface of the default gateway
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-06-06 12:37:30 +02:00
DL6ER 379d138caf The number of queries we are computing percentages against can be larger than the total number of queries. This can, e.g., happen when all-servers is in use as this generates more than one upstream query for every processed downstreadm query.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-05-21 22:51:19 +02:00
DL6ER f4a14eb495 Also always send all information for Client activity over last 24 hours API call
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-05-01 20:17:16 +02:00
DL6ER 16e38bef2a Do not try to reduce timespan but always return all overtime data when requested
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-05-01 15:04:25 +02:00
Adam Warner 671a438c4d Fix some spellings, ignore others
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-22 18:26:31 +01:00
DL6ER a24e187486 Add individual reply counters as well as their sum to the API + ensure we subtract from the previous reply counter when setting a new status
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-03-26 13:22:51 +01:00
DL6ER da62df2fa6 Fix how we compute the total number of DNS packets (not queries)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-02-18 12:33:05 +01:00
Christian König 1e880d3c80 penny-pitchy
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-02-12 13:21:05 +01:00
Christian König 7417a83a10 Rename upstream blocklist to blocked
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-02-12 10:08:23 +01:00
DL6ER 67da1a96e1 Add >maxlogage telnet API endpoint
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-02-01 09:46:05 +01:00
DL6ER 6a11211d01 Add Query Log filtering for new virtual other upstream
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-01-21 04:39:53 +01:00
DL6ER 14db6b47a4 Add others section to upstream servers pie chart
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-01-21 04:39:49 +01:00
DL6ER bbc89ceb3b Add others section to upstream servers pie chart
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-01-19 20:03:27 +01:00
DL6ER 6ecc1cf069 Return DNS port on ">dns-port" telnet command
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-12-28 11:16:13 +01:00
DL6ER 5617eed52d Overwrite reply and reply time if they don't make sense for this query
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-10-14 20:57:24 +02:00
DL6ER 6f6c3f014c Don't return reply type for partially forwarded queries we never receive an answer to
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-10-14 20:57:24 +02:00
DL6ER c5e05a5880 Improve response time calculation. We are interested in the time it takes until we have everything we need to serve content. Typically, this is the first reply (either from cache or from upstream), but sometimes it is a later reply (e.g. when content can only partially be served from cache and needs extra forwarding).
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-10-14 20:57:24 +02:00
DL6ER b15a32e5e2 Improve empty domain name handling
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-09-27 12:25:41 +02:00
DL6ER d2862f619f Merge branch 'development' into update/dnsmasq
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-09-27 11:53:56 +02:00
DL6ER ac0346b9e2 Improvements based on static-analysis of source code
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-09-23 20:24:57 +02:00
DL6ER 0afc7ca910 Required FTL changes due to the preceding dnsmasq commit.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-09-12 16:15:33 +02:00
DL6ER f73c9d2907 Remove redundant upstream->count
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-08-22 11:58:51 +02:00
DL6ER f11cd729a1 Hide "unknown" EDE in API
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-07-03 09:31:06 +02:00
DL6ER f0f6b1de6f Further reduce memory footprint of FTL by about 12%. We don't store the char pointer of the extended DNS errors because we can get this at any time.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-07-02 18:02:21 +02:00
DL6ER 4f8a9db506 Include EDE in telnet API getAllQueries
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-06-28 20:35:02 +02:00
DL6ER 67ca8f7992 Merge branch 'development' into update/dnsmasq-v2.85
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-04-11 10:14:18 +02:00
DL6ER de7c2919c9 Simplify status and reply type handling in FTL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-04-06 20:01:47 +02:00
DL6ER 8e7e27d9e5 Ensure FTL can be compiled from source archives offered by GitHub for each release
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-03-27 12:35:14 +00:00
DL6ER 0795cf6209 Open individual database connections where we need them. Do not use global pointers anywhere. This may mean we have more than one connection open at the sae time. SQLite3 will take care of thread-safety.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-03-20 20:21:09 +00:00
Fabian Preuß d984aab66e Don't display unrelated CNAME queries when filtering for specific domain
Signed-off-by: Fabian Preuß <preuss_fabian@gmx.de>
2021-01-23 21:55:27 +01:00
DL6ER 471fbf7b62 Use blocked property in API code. Make query->upstreamID = -1 the new default to differentiate easily what was forwarded (ID will be >= 0) and what not (ID == -1). Store the upstream server also for other query types that were forwarded (like queries blocked during CNAME inspection).
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-18 15:19:50 +01:00
DL6ER deae66ba58 Optimize datastructures using bitfields and item re-arrangement (to minimize padding). This reduces the size of query, client, and regex records by 8 bytes per item. Note that this optimization was done on x86_64 and may not apply for other architectures (32bit architectures already used less padding).
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-17 13:06:16 +01:00
DL6ER 00492c1192 Merge pull request #1013 from pi-hole/new/OTHER_types
Implement support for displaying exact type instead of just "OTHER"
2021-01-15 18:23:33 +01:00
Fabian Preuß 1f7a1ddd60 Don't show retried queries when filtering for blocked queries.
Signed-off-by: Fabian Preuß <preuss_fabian@gmx.de>
2021-01-15 15:34:31 +01:00
DL6ER ee971091b4 Only return regex index when allowed by privacy settings. This may leak information, otherwise.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-08 19:22:38 +01:00
DL6ER a33c9d337e Implement support for displaying exact type instead of the catch-them-all category OTHER. The OTHER category is still used when it comes to computing statistics to ensure your chart's legend does not explode.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-03 22:10:09 +01:00
DL6ER 51bbaad6ea Add new query types SVCB and HTTPS
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-12-31 10:33:28 +01:00
Fabian Preuß 1b7bad88bb Added missing NS query type to getQueryTypes()
Signed-off-by: Fabian Preuß <preuss_fabian@gmx.de>
2020-12-27 04:43:13 +01:00
Adam Warner 7f82b16902 Merge pull request #934 from pi-hole/fix/getClientsOverTime_only_Active
Skip clients with no active counts at all (may be old IPv6 addresses)
2020-11-28 16:38:51 +00:00