118 Commits

Author SHA1 Message Date
DL6ER c12c47cf58 Add EDE 15 from upstream => Blocked detection + new query type representing this
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-14 10:17:20 +02:00
DL6ER 68a14bf12c Use total number of *configured* (= existing) cores rather then the number of available (= online and assigned) cores when computing the CPU utilization of the system
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-02 06:58:57 +02:00
DL6ER 070544bde1 Implement DNS caching for queries blocked upstream (NXDOMAIN + no RA, 0.0.0.0/::, and known Umbrella IP blocking pages) accompanied with suitable CI testing. This change improves handling of externally blocked queries in two ways:
1. Once we know the domain is externally blocked, we don't forward it again for the same client (it is currently forwarded each time)
2. We can recognize cache content with the specified addresses/flags as being upstream blocked and don't return them as "OK (cached)" through the API/in the database

Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-21 20:14:51 +02:00
DL6ER a04303ae23 Ensure NTP servers are properly terminated when FTL is shutting down and remove obsolete variable thread_running[] (it is only ever set but never read)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-01 16:22:18 +02:00
DL6ER 90ba90a0c7 Pre-define thread names so they can always be shown during shutdown, even if a thread was never started, remove unused CONF_READER thread slot
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-11 04:20:04 +02:00
DL6ER 14ea246f9a Always include timezone in human-readable timestamps
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-02 10:19:26 +02:00
DL6ER 306710e74a Add timezone information where this is appropriate. We do not include this in the log files to not needlessly change for format. Open for discussion
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-05-30 19:53:53 +02:00
DL6ER 54fe14f1bf Include forwarded queries in /api/history and count stale-cache queries as cached queries
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-02-11 20:35:15 +01:00
DL6ER 8ec30408c8 Remove unused upstream recycle check
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-24 21:44:35 +01:00
DL6ER 3084b1c507 Also log number of DNS cache records after history import
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-24 21:38:45 +01:00
DL6ER 5c95d26305 Simplify recycler debug summary
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-24 11:46:40 +01:00
DL6ER a5d1d4477b Move debug messages meant for debug.status from debug.gc over
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-24 11:42:04 +01:00
DL6ER bb23ef090a DNS cache entries were never recycled, possibly causing incorrect blocking of certain domain/client/type combinations
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-24 10:37:20 +01:00
DL6ER 21d393b4be Ensure CPU usage check is really run only every ten seconds
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-04 23:20:13 +01:00
DL6ER 56fd63b9d8 Use resource details obtained from kernel to compute a ten minute average of FTL's CPU utilization
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-03 21:08:27 +01:00
DL6ER f89f207246 Never recycle alias-clients
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-01 12:30:22 +01:00
DL6ER 392b39e0d0 Minor tweak ensuring we also decommission UNKNOWN queries properly when they expire
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-29 21:25:44 +01:00
DL6ER 2755763803 Merge branch 'development-v6' into new/recycle
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-28 15:55:30 +01:00
DL6ER 34e44f2453 Set imported database query IDs to counter value and fix GC pointer magic (update comment to explain better what happens here)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-28 15:44:58 +01:00
DL6ER 399ca11038 Add extra debug statements
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-26 21:44:55 +01:00
DL6ER f4798929e1 Only reload pihole.toml if the content changed
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-22 23:01:19 +01:00
DL6ER 08245ce21a Merge branch 'fix/numbers' into new/recycle 2023-11-04 08:04:01 +01:00
DL6ER 0b4abb2bd3 Optimize status and reply handling in the code. Add status object to /api/stats/summary
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-26 19:13:57 +02:00
DL6ER 1dc4449a34 Improve recycler reporting
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-23 21:47:36 +02:00
DL6ER 2aff05c78a Reuse existing shared clients, domains, and cache memory slots which are not referenced by any active query within the past 24 hours. Furthermore, always scan the shared strings and reuse them before allocating new memory with the same content
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-23 18:13:12 +02:00
DL6ER c3a0e9aec1 Restart FTL when privacy lever is decreased but not when it is increased
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-19 19:33:55 +02:00
DL6ER cb33ed3d54 We do not need to invalidate web sessions on CLI changes as we are not serving the web interface in this case
Signed-off-by: Dominik Derigs <dl6er@dl6er.de>
2023-09-04 21:45:38 +02:00
DL6ER 8468e342ce Fix off-by-one mistake in query type counters
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-06-03 13:00:13 +02:00
DL6ER 3b404ff9a0 Add /api/actions/flush/logs
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-05-24 20:39:18 +02:00
DL6ER 21ac19bf22 Merge remote-tracking branch 'origin/development' into new/http
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-05-23 20:08:39 +02:00
DL6ER 51ca8f369b Do not log running out of disk space when the disk occupation is > 100%. We are seeing this with docker deployments on macOS hosts. It is a band-aid fix, however, it also seem to be the only thing we can do given that docker didn't fix this in nearly two years now.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-05-07 22:11:35 +02:00
DL6ER 7359b496ff Move database.maxHistory to webserver.api.maxHistory
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-04-25 22:26:25 +02:00
DL6ER 4ee054b962 Only warn once about disk shortage in case database and log file are on the same device (e.g. both on / )
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-02-06 21:16:23 +01:00
DL6ER d7da3f7996 Improve disk shortage warning to point out more precisely which filesystem is getting full. We do this by mentioning the mountpoint instead of the filename
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-02-06 21:12:47 +01:00
DL6ER 54beca32db Reload config on change of pihole.toml. This is done using an inotify watcher on /etc/pihole. This also means that there is no need to send SIGHUP to FTL after a config change, this is triggered internally.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-01-30 19:05:19 +01:00
DL6ER 8753a8d69b Add more compiler warnings and fix a few things they pointed out worth improving/being more explicit about. This adds GCC-12 compatibility out of the box.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-01-29 18:12:19 +01:00
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 13168c377b Add GET /api/teleporter
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-01-23 21:56:11 +01:00
DL6ER bd266d6589 Further improvements for check_space()
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-01-20 04:39:31 +01:00
DL6ER ea8ef2aa1b Fix incorrect union member being used in check_space()
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-01-20 04:32:24 +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 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 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 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 a9ea62a3fc Merge branch 'development' into new/http
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-12-30 15:12:14 +01:00
DL6ER 7ecd358f96 Allow FTL to analyze stale cache replies. They are assigned to a new query type (17)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-11-09 20:09:48 +01:00
yubiuser 8750bf59bd No intermediate variables
Co-authored-by: DL6ER <DL6ER@users.noreply.github.com>
Signed-off-by: yubiuser <ckoenig@posteo.de>
2022-09-18 08:58:33 +02:00
Christian König 2cd071547d Only log disk space warning when usage increased
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-09-17 19:36:57 +02:00
DL6ER 26ccee3f4c Merge branch 'development' into new/http
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-06-29 11:12:59 +02:00
DL6ER 316e523d51 Adjust expected struct sizes now that we have fewer overtime slots by defauls
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-05-19 19:25:30 +02:00