Commit Graph

1000 Commits

Author SHA1 Message Date
DL6ER e62e58619e Do not take the not-filtered shortcut if one of the magic upstream={blocklist,cache} is selected. This is currently broken as detection of ongoing filtering is through variable bindung to the SQL string. However, these two special upstreams work by using the IN operator which does not support binding to a prepared statement.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-26 19:25:04 +02:00
DL6ER 92e259021e Disentangle info/ftl : ftl.database.domains from newly added ftl.database.regex
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-25 10:05:50 +02:00
DL6ER bf5ec1417c Restrict permissions to owner read/write only when creating a new file
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-16 13:53:15 +02:00
Dominik 031c4668c0 Merge pull request #2062 from pi-hole/new/edns_reasoning
Improve EDNS handling
2024-09-14 21:39:28 +02:00
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 d67d13303d Add downstream EDE info for synthesized replies
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-14 10:17:14 +02:00
DL6ER 850d263ec3 Check and create v6 migration directory before trying to move/write files there. This involves config migrations but also Teleporter importing
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-13 15:56:25 +02:00
DL6ER db0054bdb6 Restart FTL after successful Teleporter import and provide more detailed log messages. Also reduce code duplication by defining a common restart_ftl() routine
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-12 21:41:11 +02:00
DL6ER 7b60775fdc Add missing import instruction for CNAME records file (if present in the archive)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-11 21:22:29 +02:00
DL6ER b7dfdb4ef8 Add new queries per second (QPS) metric exposed via GET /api/stats/summary as .queries.frequency and /api/info/ftl as .query_frequency. The QPS value is averaged over 30 seconds
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-07 11:20:44 +02:00
Dominik e5a24bdd09 Merge pull request #2042 from pi-hole/tweak/verbose_migration
Make v5 -> v6 migration verbose
2024-09-02 21:42:03 +02:00
Dominik 11d6c79a0f Merge pull request #2047 from pi-hole/tweak/nprocs_conf
Fix CPU % calculation
2024-09-02 09:59:37 +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 0fa865a29e Add GET /api/stats/summary -> .gravity.last_update timestamp exposing the last gravity update via the API
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-02 06:49:53 +02:00
Dominik ee9ca39150 Merge pull request #2030 from pi-hole/new/cache_upstream_replies
Implement DNS caching for queries blocked upstream
2024-08-27 06:32:56 +02:00
DL6ER 42b626f36c Rename dns.cache.upstreamTTL -> dns.cache.upstreamBlockedTTL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-26 21:40:27 +02:00
DL6ER c98f1cf0be Avoid (unlikely) memory leaking and ensure we properly reset the config type to a non-allocated type after free'ing.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-26 19:49:49 +02:00
DL6ER 267d150ac7 Make v5 -> v6 migration verbose by default (not only when debug.config = false). This will happen only once and may greatly ease debugging in case unintended side-effects (most often it will by typos in the old setupVars.conf)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-25 19:22:41 +02:00
DL6ER af1c5b3039 Add new config option dns.cache.upstreamTTL (defaulting to one day) for configuring how long relpies from upstream are cached
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-21 20:18:59 +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 f2ae6db391 Add further API debugging to top_client generation and fix an incorrect condition that skipped all clients without a name
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-13 16:52:11 +02:00
DL6ER 23c2607165 Add new GET /api/padd endpoint
Build, Test, Deploy / smoke-tests (push) Has been cancelled
Codespell / spell-check (push) Has been cancelled
Check for merge conflicts / merge-conflict (push) Has been cancelled
API validation / Node (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-386, , linux/386) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64, , linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64-clang, clang, linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-riscv64, , linux/riscv64) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-arm64, linux/arm64/v8) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv6, linux/arm/v6) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv7, linux/arm/v7) (push) Has been cancelled
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-05 22:06:53 +02:00
DL6ER 1b2ce29454 Fix value overflow in get_top_upstreams() due to in_port_t being an unsigned 16 bit integer where we need a signed data type. This is a regression of #2001
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-03 22:40:19 +02:00
DL6ER 64144a960c Add session.x_forwarded_for property to API sessions
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-24 08:39:44 +02:00
DL6ER d6bf943be2 Remove webserver.tls.rev_server config option
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-24 08:39:41 +02:00
DL6ER f07d902802 Merge branch 'development-v6' into tweak/api_network_info
Build, Test, Deploy / smoke-tests (push) Has been cancelled
Codespell / spell-check (push) Has been cancelled
Check for merge conflicts / merge-conflict (push) Has been cancelled
API validation / Node (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-386, , linux/386) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64, , linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64-clang, clang, linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-riscv64, , linux/riscv64) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-arm64, linux/arm64/v8) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv6, linux/arm/v6) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv7, linux/arm/v7) (push) Has been cancelled
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-19 09:47:18 +02:00
Dominik 10e98d1d81 Merge pull request #2001 from pi-hole/tweak/top_suggests
Build, Test, Deploy / smoke-tests (push) Has been cancelled
Codespell / spell-check (push) Has been cancelled
Check for merge conflicts / merge-conflict (push) Has been cancelled
API validation / Node (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-386, , linux/386) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64, , linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64-clang, clang, linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-riscv64, , linux/riscv64) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-arm64, linux/arm64/v8) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv6, linux/arm/v6) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv7, linux/arm/v7) (push) Has been cancelled
Improve Query Log suggestions
2024-07-19 08:00:39 +02:00
Dominik 1dbd9556ce Merge pull request #2011 from pi-hole/tweak/blocking_timer
Build, Test, Deploy / smoke-tests (push) Waiting to run
Build, Test, Deploy / gha (pihole-FTL-386, , linux/386) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-amd64, , linux/amd64) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-amd64-clang, clang, linux/amd64) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-riscv64, , linux/riscv64) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-arm64, linux/arm64/v8) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-armv6, linux/arm/v6) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-armv7, linux/arm/v7) (push) Blocked by required conditions
Codespell / spell-check (push) Waiting to run
Check for merge conflicts / merge-conflict (push) Waiting to run
API validation / Node (push) Waiting to run
Fix blocking timer
2024-07-18 18:16:06 +02:00
DL6ER 0a971d39b8 Remove duplicates from client name suggestions
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-18 16:55:17 +02:00
DL6ER 5fdfeb9ef6 Add blocked domains in Query Log suggestions
Build, Test, Deploy / smoke-tests (push) Has been cancelled
Codespell / spell-check (push) Has been cancelled
Check for merge conflicts / merge-conflict (push) Has been cancelled
API validation / Node (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-386, , linux/386) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64, , linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64-clang, clang, linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-riscv64, , linux/riscv64) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-arm64, linux/arm64/v8) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv6, linux/arm/v6) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv7, linux/arm/v7) (push) Has been cancelled
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-16 12:14:06 +02:00
DL6ER bf1355c8ce Increase speed of the /api/stats/* endpoints by reducing the use of shared memory locks. This is possible at the costs of a few bytes extra memory (at most a few KB) as we collect all data only once and don't need to get object poiters twice.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-16 12:14:06 +02:00
DL6ER 94dceae419 Only add non-empty TOP replies
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-16 12:14:06 +02:00
DL6ER d01809a1a7 Sort only once for TOP clients
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-16 12:14:06 +02:00
DL6ER af7ea105eb Implement actual TOP suggestions for the Query Log
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-16 12:14:06 +02:00
DL6ER d39703b9a1 Restart timer if set even if no blocking mode change was requested. This allows users to extend a temporary state, e.g. by running another "pihole disable 5m" shortly before the previous cacall reaches timeout. Previously, calling "pihoe disable 1m" would make the change permanent which seems undesirable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-16 12:13:03 +02:00
DL6ER b75db0e4c7 Merge branch 'development-v6' into tweak/ntp_delay
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-16 09:48:26 +02:00
DL6ER 66b7fdf1cc Add link-netnsid and address types
Build, Test, Deploy / smoke-tests (push) Has been cancelled
Codespell / spell-check (push) Has been cancelled
Check for merge conflicts / merge-conflict (push) Has been cancelled
API validation / Node (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-386, , linux/386) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64, , linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64-clang, clang, linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-riscv64, , linux/riscv64) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-arm64, linux/arm64/v8) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv6, linux/arm/v6) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv7, linux/arm/v7) (push) Has been cancelled
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-15 07:32:33 +02:00
DL6ER 7c42a785cc Report cstamp/tstamp in wall_clock time
Build, Test, Deploy / smoke-tests (push) Waiting to run
Build, Test, Deploy / gha (pihole-FTL-386, , linux/386) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-amd64, , linux/amd64) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-amd64-clang, clang, linux/amd64) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-riscv64, , linux/riscv64) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-arm64, linux/arm64/v8) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-armv6, linux/arm/v6) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-armv7, linux/arm/v7) (push) Blocked by required conditions
Codespell / spell-check (push) Waiting to run
Check for merge conflicts / merge-conflict (push) Waiting to run
API validation / Node (push) Waiting to run
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-14 22:45:57 +02:00
DL6ER c284d6447e Move netlink under tools/
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-14 15:51:33 +02:00
DL6ER 35166fd00c Fix a small bug in the API response verifier and ensure we always favor using 64 bit interface statistics if available. The reason is that the legacy statistics use 32 bit conters which overflow every 4 GB of interface traffic
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-14 15:45:29 +02:00
DL6ER 6cf1a6774e Add netlink implementation
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-09 21:57:45 +02:00
DL6ER 172eaa52b9 Parse additional kernel info to get more IPv6 address details and laso parse IPv6 routing table
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-08 22:48:12 +02:00
DL6ER 73d5827e90 Log API warnings caused by send_json_error() only if debug.api is true
Build, Test, Deploy / smoke-tests (push) Has been cancelled
Codespell / spell-check (push) Has been cancelled
Check for merge conflicts / merge-conflict (push) Has been cancelled
API validation / Node (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-386, , linux/386) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64, , linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-amd64-clang, clang, linux/amd64) (push) Has been cancelled
Build, Test, Deploy / gha (pihole-FTL-riscv64, , linux/riscv64) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-arm64, linux/arm64/v8) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv6, linux/arm/v6) (push) Has been cancelled
Build, Test, Deploy / self-hosted (pihole-FTL-armv7, linux/arm/v7) (push) Has been cancelled
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-02 03:40:31 +02:00
DL6ER c846b21876 Add new ntp.sync.active boolean to ease disabling of the NTP client. Also move all the RTC properties inside ntp.sync because this is where they apply and where RTC sync can be disabled
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-01 20:22:03 +02:00
DL6ER 630b3582f7 Merge branch 'development-v6' into new/cli_pw 2024-06-29 21:53:32 +02:00
DL6ER ab52ea063c Merge branch 'development-v6' into new/ntp
Build, Test, Deploy / smoke-tests (push) Waiting to run
Build, Test, Deploy / gha (pihole-FTL-386, , linux/386) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-amd64, , linux/amd64) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-amd64-clang, clang, linux/amd64) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-riscv64, , linux/riscv64) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-arm64, linux/arm64/v8) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-armv6, linux/arm/v6) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-armv7, linux/arm/v7) (push) Blocked by required conditions
Codespell / spell-check (push) Waiting to run
Check for merge conflicts / merge-conflict (push) Waiting to run
API validation / Node (push) Waiting to run
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-25 15:13:37 +02:00
Dominik 96f7dff669 Merge pull request #1988 from pi-hole/new/misc_readOnly
Build, Test, Deploy / smoke-tests (push) Waiting to run
Build, Test, Deploy / gha (pihole-FTL-386, , linux/386) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-amd64, , linux/amd64) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-amd64-clang, clang, linux/amd64) (push) Blocked by required conditions
Build, Test, Deploy / gha (pihole-FTL-riscv64, , linux/riscv64) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-arm64, linux/arm64/v8) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-armv6, linux/arm/v6) (push) Blocked by required conditions
Build, Test, Deploy / self-hosted (pihole-FTL-armv7, linux/arm/v7) (push) Blocked by required conditions
Codespell / spell-check (push) Waiting to run
Check for merge conflicts / merge-conflict (push) Waiting to run
API validation / Node (push) Waiting to run
Add read-only config option
2024-06-25 14:32:13 +02:00
DL6ER 069cc309b0 Remove webserver.api.localAPIauth option
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-19 22:07:18 +02:00
DL6ER b74696fc77 Remove webserver.api.searchAPIauth option
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-19 22:05:49 +02:00
DL6ER 784e119892 Add CLI password generation
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-19 22:01:13 +02:00