3701 Commits

Author SHA1 Message Date
DL6ER 950fc60ed3 Limit app password permissions by default. Add new app_sudo mode for users to remove this new limitation if they really need to
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-14 19:10:58 +02:00
DL6ER 5a6a212980 Add special handling for systems without password in the password checking short-circuiting
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-13 20:28:37 +02:00
DL6ER e05d931412 Spellchecking
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-13 06:31:44 +02:00
DL6ER 3ae3afa1b5 Fix harmless incorrect warning when generating HTML regex messages
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-13 06:30:43 +02:00
DL6ER e70c364af4 Add message table entries for selected NTP warnings/errors
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-13 06:26:28 +02:00
DL6ER 126d4d87ce Mark timer thread as running
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-12 18:21:46 +02:00
DL6ER 2516dcf3e2 Always join threads if they have ever been started to avoid resource leaking
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-11 04:23:52 +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 9bc0d4c25d Fix root delay/dispersion debug printing
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-11 04:18:55 +02:00
DL6ER ec6750d42f Make definition of __USE_MISC conditional
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-10 20:06:41 +02:00
DL6ER b8eee89e07 Do not detach threads because we want to join them during shutdown
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-10 19:35:40 +02:00
DL6ER d737bf524c Determine root dispersion and error based on our own most recent time synchronization as described by RFC 5905, Scn. 4 (page 9)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-10 17:23:58 +02:00
DL6ER fcc0a5ab2f Use "fresh" sockets for NTP client requests to avoid reusing the same ephermal port for mulitple requests
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-10 17:18:41 +02:00
DL6ER 27db8a43ce Copy root delay/dispersion errors from upstream server (after first upstream NTP synchronization)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-10 17:12:09 +02:00
DL6ER a05bf8dd24 Improve shutdown sequence of threads
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-10 16:57:11 +02:00
DL6ER 791e3a8097 Add RTC synchronization
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-07 20:01:04 +02:00
DL6ER fb0b06e21a Merge branch 'new/ntp' of github.com:pi-hole/FTL into new/ntp 2024-06-07 18:53:24 +02:00
DL6ER 671771ceb0 Improve NTP synchronization by rejecting synchronization if the standard deviation of the time offset or round-trip delay is larger than 1 second. This ensures the time cannot go off even in cases where the network connectivity is really bad
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-07 18:50:14 +02:00
DL6ER 93f751f90a Use adjtimex instead of adjtime as the latter uses the former (see http://git.musl-libc.org/cgit/musl/tree/src/linux/adjtime.c and https://codebrowser.dev/glibc/glibc/time/adjtime.c.html). Also add comment from man rtc(4) about how RTCs are updated at the same time
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-07 18:49:11 +02:00
DL6ER 2406e1a70e Check if the newly set password is the same as the old one
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-06 20:42:06 +02:00
DL6ER f9eea51dbd Ensure we also recalculate te checksum of the config file when in read-only mode
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-06 20:25:59 +02:00
DL6ER 44d57e5b37 Add checking of return status of sqlite3_open_v2 to ensure we are not trying to use the database when it failed to open
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-06 16:17:01 +02:00
Dominik 08f2e37d9f Apply suggestions from code review
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
2024-06-06 08:54:31 +02:00
DL6ER d923904291 Tweak config option description
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-06 07:36:38 +02:00
DL6ER ee8f9899dd Add NTP settings category to the API and create all threads in detached mode
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-06 07:21:37 +02:00
DL6ER 85fdaffa0f Merge branch 'development-v6' into new/misc_readOnly
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-06 06:17:34 +02:00
DL6ER f088b79e8f Exit synchronization early if no trimmed time offest average is avalable, print progress only when printing to the CLI, and increase delay between successive NTP requests to 0.5 seconds
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-06 06:13:52 +02:00
Adam Warner 61826a41e1 Merge pull request #1883 from pi-hole/tweak/remove_expert_flag
Remove (undocumented) advanced flag in details config output
2024-06-05 21:11:54 +01:00
DL6ER 2269caeb9a Make NTP sync thread cancelable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-04 23:56:11 +02:00
DL6ER a872c03091 Fix formating error
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-04 23:48:44 +02:00
DL6ER 3971e67849 Add NTP background synchronization
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-04 23:32:07 +02:00
DL6ER 12758da50b Use David L. Mills' clock adjustment algorithm (RFC 5905) for gradual clock adjustments if the deviation is small
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-04 17:53:53 +02:00
DL6ER de45ba840a Add CAP_SYS_TIME to required capabilities to set the system time without being root
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-04 13:17:09 +02:00
DL6ER 10e4c732f2 Use trimmed mean to compute time offset to exclude outliers where packets traveled unusual paths
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-04 13:15:38 +02:00
DL6ER 7c0d7e87e8 Add debug.ntp flag
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-04 07:55:06 +02:00
DL6ER d8469bd9b9 Merge branch 'development-v6' into new/ntp 2024-06-04 07:04:31 +02:00
Dominik a72440292c Merge pull request #1987 from pi-hole/tweak/cert_no_tls
Skip certificate domain check when TLS is not actually used
2024-06-03 22:48:39 +02:00
Dominik a564e329f4 Merge pull request #1990 from pi-hole/fix/long_dns_names
Fix possible heap-corruption bug
2024-06-03 22:39:36 +02:00
DL6ER af0468eb36 Fix very long DNS names (>64 bytes) potentially crashing the internal name resolving mechanism, the new limit is 256 bytes with proper boundary checking
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-03 13:29:06 +02:00
Dominik b20d80f740 Merge pull request #1989 from pi-hole/fix/regex_diagnosis
Fix incorrect unification of regex warnings
2024-06-03 13:08:22 +02:00
DL6ER 189979284f Store correct database ID when issuing a warning
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-03 11:46:39 +02:00
DL6ER f2c14cce25 Fix incorrect unification of regex warnings
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-03 09:48:13 +02:00
Dominik d3437814cc Merge pull request #1986 from pi-hole/fix/retry_truncated
Internal name resolution over UDP with fallback to TCP
2024-06-02 21:14:53 +02:00
DL6ER 5b9df02372 Add missing newlines in dnsmasq config
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-02 20:07:41 +02:00
DL6ER d3439593a1 Default to resolve internal PTRs using UDP, fall back to TCP for individual queries on UDP truncation (commonly seen in conjunction with DNSSEC)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-02 19:55:28 +02:00
DL6ER 3d2fd6d6a2 Add new misc.readOnly config option to force the configuration to be read-only. It can only be modified through the config file but neither the API nor the CLI as long as read-only mode is enabled
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-02 12:27:20 +02:00
DL6ER 58c59a0aef Skip certificate domain check when TLS is not actually used even if a certificate is available
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-02 11:56:53 +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 f8990e769a Average over up to eight successive NTP queries to reduce total time error during synchronization
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-02 07:31:55 +02:00
DL6ER 79c966e2e6 Reduce code duplication
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-02 07:24:05 +02:00