]>
git.ipfire.org Git - dbl.git/log
Michael Tremer [Sun, 11 Jan 2026 12:26:59 +0000 (12:26 +0000)]
Rename the whole project to "IPFire DBL"
DNS is not strictly true since we are using the domain lists in other
places now, too. Therefore I prefer the more generic term.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 9 Jan 2026 17:48:56 +0000 (17:48 +0000)]
domains: Prevent SQLModel from throwing away my rows
The ID is not necessarily unique, so we have to add more attributes to
the primary key of the VIEW.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 9 Jan 2026 17:33:48 +0000 (17:33 +0000)]
lists: Show any removals of domains
This was because of an invalid SQL comparison.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 9 Jan 2026 17:14:20 +0000 (17:14 +0000)]
systemd: Add timers to send notifications
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 9 Jan 2026 17:02:37 +0000 (17:02 +0000)]
api: Add a middleware to correctly close database sessions
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 9 Jan 2026 16:34:08 +0000 (16:34 +0000)]
reports: Send an email to the reporter when a report is being opened
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 9 Jan 2026 16:18:56 +0000 (16:18 +0000)]
reports: Send an email after a report has been reviewed
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 9 Jan 2026 15:59:33 +0000 (15:59 +0000)]
reports: Send am email to moderators if there are pending reports
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 9 Jan 2026 15:57:40 +0000 (15:57 +0000)]
users: Add a simple system to access users and groups
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 9 Jan 2026 13:52:51 +0000 (13:52 +0000)]
lists: Store stats about subsumed lists
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 9 Jan 2026 10:47:47 +0000 (10:47 +0000)]
lists: Optimize the lists
This is a quick solution to find any listed subdomains. Those don't have
to be exported if we already have the parent domain listed. This will
decrease the size of the lists.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Thu, 8 Jan 2026 15:17:22 +0000 (15:17 +0000)]
lists: Remove the replaced Suricata exporters
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Thu, 8 Jan 2026 11:28:29 +0000 (11:28 +0000)]
checker: Move check results into the main domains table
This will save us some time when composing the final lists as we are
getting rid of a join. As we are storing one row for each domain in each
table it makes sense to store this all together.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Thu, 8 Jan 2026 11:05:46 +0000 (11:05 +0000)]
checker: Be more efficient when fetching domains
We used to fetch domains that need to be checked in batches, but that
causes a lot of database load and does not keep the resolver busy.
This patch changes this so that we once fetch a large iterator from the
database which we will iteratively feed into the pool.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Thu, 8 Jan 2026 11:05:19 +0000 (11:05 +0000)]
lists: Remove some debugging code
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Thu, 8 Jan 2026 11:04:37 +0000 (11:04 +0000)]
checker: Don't follow CNAMEs any more
If we get a CNAME response, the domain exists. Maybe the target does
not, but that could change at any time.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Thu, 8 Jan 2026 10:27:51 +0000 (10:27 +0000)]
checker: Accept empty responses
When we are querying for something.example.org, we will get the SOA of
example.org. dnspython still considers this a NoAnswer, but actually
this is good enough to tell us that the domain is alive.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Thu, 8 Jan 2026 10:27:29 +0000 (10:27 +0000)]
checker: Log the result of any queries
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Thu, 8 Jan 2026 10:26:49 +0000 (10:26 +0000)]
checker: Allow passing some domains for manual checking
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 7 Jan 2026 16:34:20 +0000 (16:34 +0000)]
domains: Realise the history as a view
This avoids creating yet another complicated query and we can have a
model so that accessing attributes becomes easier.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 7 Jan 2026 15:10:13 +0000 (15:10 +0000)]
db: Create an index to make domain history searches faster
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 7 Jan 2026 15:07:55 +0000 (15:07 +0000)]
API: Add an endpoint to check the history of a domain on a list
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 7 Jan 2026 15:07:36 +0000 (15:07 +0000)]
API: Add a simple endpoint to check where a domain is being listed
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 7 Jan 2026 13:38:26 +0000 (13:38 +0000)]
api: Add a systemd unit file for the API service
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 7 Jan 2026 11:11:17 +0000 (11:11 +0000)]
lists: Add a priority which is exported to Suricata
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 7 Jan 2026 11:10:39 +0000 (11:10 +0000)]
exporters: Generate unique SIDs for all Suricata rules
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 7 Jan 2026 10:45:51 +0000 (10:45 +0000)]
exporters: Compose Suricata ruleset from a dict
This makes it slightly easier to swap out some fields where needed than
manipulating a really large string.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 6 Jan 2026 18:27:04 +0000 (18:27 +0000)]
exporters: Refactor Suricata rules
Exporting everything as a single rule is completely blowing up Suricata.
It was always going to be a tight game, but a lot of the tooling even
breaks down due to the large size of the rule files.
This is my less preferred option because it isn't easily possible for
users to enable/disable any individual domains, but at least this
performs well.
There are now only single rules for each list that enable/disable
filtering for the different protocols and there is one large list of
domains for each list. This is being parsed as a dataset which should be
the most efficient approach in terms of performance and memory usage.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 6 Jan 2026 11:43:00 +0000 (11:43 +0000)]
reports: Update stats immediately after closing a report
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 6 Jan 2026 11:25:12 +0000 (11:25 +0000)]
sources: Initialize all stats with zero
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 6 Jan 2026 11:22:39 +0000 (11:22 +0000)]
sources: Store false-positives
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 18:31:37 +0000 (18:31 +0000)]
exporters: Use the tarball exporter to write Suricata rules
That way, we will always compress them as they are rather large to be
downloaded as plaintext.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 18:21:38 +0000 (18:21 +0000)]
exporters: Create a nested directory exporter
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 18:21:21 +0000 (18:21 +0000)]
dnsbl: Fix the history output on the console
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 17:32:42 +0000 (17:32 +0000)]
exporter: Attempt to remove code duplication in the exporters
This will also export a unified tarball of all Suricata rules.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 15:42:24 +0000 (15:42 +0000)]
exporters: Compute Suricata SIDs by a hash
This function is not perfect, but substantially faster when writing out
the list. We will have some somewhat-stable hash here which will always
return the same result per domain unless there has already been a small
collision.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 15:06:20 +0000 (15:06 +0000)]
Revert "lists: Export domains with a global, unique ID for each domain"
This reverts commit
42a14f468c41a64c4ebdabaf49021c9f92e6626d .
This query seems to be very broken as it isn't returning the right data
any more and also is taking a very long time.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 15:05:46 +0000 (15:05 +0000)]
exporters: Implement exporting Suricata rules
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 14:51:54 +0000 (14:51 +0000)]
lists: Export domains with a global, unique ID for each domain
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 10:48:50 +0000 (10:48 +0000)]
sources: Convert all domains to lowercase
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 10:41:50 +0000 (10:41 +0000)]
dnsbl: Delete sources by URL as that is unique
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 10:16:49 +0000 (10:16 +0000)]
dnsbl: Create a convenience function to gracefully terminate the program
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 10:13:21 +0000 (10:13 +0000)]
dnsbl: Gracefully terminate if we could not find a list
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 10:08:54 +0000 (10:08 +0000)]
lists: Store a stats history
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 5 Jan 2026 10:04:23 +0000 (10:04 +0000)]
sources: Store a stats history
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 4 Jan 2026 14:12:10 +0000 (14:12 +0000)]
checker: Update list stats after the checker has finished
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 4 Jan 2026 14:08:31 +0000 (14:08 +0000)]
checker: Don't fail if a query timed out
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 3 Jan 2026 15:12:42 +0000 (15:12 +0000)]
lists: Initialize the number of total domains when creating a new list
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 3 Jan 2026 13:32:01 +0000 (13:32 +0000)]
sources: Strip any excess whitespace after the comments have been removed
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 3 Jan 2026 13:31:28 +0000 (13:31 +0000)]
sources: Always return an integer for the length of the source
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 15:07:11 +0000 (15:07 +0000)]
exporters: Move any TXT records out of the apex
Some RPZ clients consider anything existing in the apex a wildcard match
for anything.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 14:28:09 +0000 (14:28 +0000)]
lists: Perform stable sorting for sources
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 14:25:23 +0000 (14:25 +0000)]
sources: Accept the third-party option for ABP
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 14:22:28 +0000 (14:22 +0000)]
sources: Accept "[Adblock Plus 2.0]" as a valid header
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 14:12:42 +0000 (14:12 +0000)]
sources: Refactor the ABP parser
Some sources don't implement the format very strictly. To not miss any
data, we will have to split off any options and then check whether we
want to add the domain to our lists.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 14:11:46 +0000 (14:11 +0000)]
sources: Rework the hosts file parser
Some sources use tabs to split and since we don't want to have a large
list of IP addresses, we simply check if we now have a format where we
list an IP address and something else.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 13:22:51 +0000 (13:22 +0000)]
sources: Consider ABP files as such without the header
Some files don't have the [Adblock Plus] header, but they use ! as a
comment, so we can identify them that way.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 13:22:05 +0000 (13:22 +0000)]
sources: Parse any byte-order marks
https://en.wikipedia.org/wiki/Byte_order_mark
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 13:21:26 +0000 (13:21 +0000)]
sources: Always strip any comments
So far it looks like all file formats are using # to separate any
comments. Therefore we can strip anything away very early on.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 12:15:09 +0000 (12:15 +0000)]
sources: Force an update of empty sources
We assume that we could not parse any data and therefore we will just
try again.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 2 Jan 2026 11:55:23 +0000 (11:55 +0000)]
exporters: Support customizing the DNS zones
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 31 Dec 2025 16:56:52 +0000 (16:56 +0000)]
exporter: Add some metadata to the apex
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 31 Dec 2025 16:37:39 +0000 (16:37 +0000)]
exporter: Support exporting for AdBlock Plus
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 31 Dec 2025 15:42:19 +0000 (15:42 +0000)]
lists: Split whitelisted domains on history
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 31 Dec 2025 15:32:06 +0000 (15:32 +0000)]
reports: Implement closing reports
This will trigger changes to the lists.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 31 Dec 2025 14:50:40 +0000 (14:50 +0000)]
sources: Don't import anything that isn't globally resolvable
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 31 Dec 2025 14:37:57 +0000 (14:37 +0000)]
lists: Allow to go backwards in history
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 31 Dec 2025 13:22:58 +0000 (13:22 +0000)]
api: Export the history
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 31 Dec 2025 13:16:41 +0000 (13:16 +0000)]
lists: Add command to show the history
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 31 Dec 2025 13:11:44 +0000 (13:11 +0000)]
database: Add a custom SELECT method
This is necessary because SQLModel only spits out the first column of
any custom queries.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 31 Dec 2025 11:30:54 +0000 (11:30 +0000)]
domains: Store a report for adding and removing a domain
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 18:34:57 +0000 (18:34 +0000)]
domains: Add a unique index for manually added domains
We don't want to have any duplicates, but we will have to accept any
duplicates that we are receiving from other sources.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 18:34:27 +0000 (18:34 +0000)]
lists: Support whitelisting domains
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 18:17:40 +0000 (18:17 +0000)]
domains: Reference the list directly
This simplifies the queries substantially and we will only have to
select from one single, although larger table.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 17:29:40 +0000 (17:29 +0000)]
domains: Create a unified table
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 16:55:51 +0000 (16:55 +0000)]
lists: Account for how many open reports there
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 15:25:16 +0000 (15:25 +0000)]
search: Return any parent domains
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 15:24:54 +0000 (15:24 +0000)]
API: Implement a simple search
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 15:24:33 +0000 (15:24 +0000)]
lists: Implement fetching reports over the API
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 15:24:07 +0000 (15:24 +0000)]
reports: Export the list slug in the API
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 12:10:31 +0000 (12:10 +0000)]
reports: Use a UUID as primary key
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 30 Dec 2025 11:45:49 +0000 (11:45 +0000)]
api: Export any reports over the API
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 20:28:55 +0000 (20:28 +0000)]
reports: Add a system to create a new report over the API
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 19:28:03 +0000 (19:28 +0000)]
dnsbl: Add a simple authentication mechanism
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 17:49:13 +0000 (17:49 +0000)]
api: List the sources of a list
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 16:34:34 +0000 (16:34 +0000)]
lists: Store the total number of domains
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 13:59:47 +0000 (13:59 +0000)]
api: Add endpoint to fetch a single list
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 13:59:34 +0000 (13:59 +0000)]
backend: Fix reading the configuration file
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 13:48:55 +0000 (13:48 +0000)]
lists: Don't expose some fields to the API
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 13:47:10 +0000 (13:47 +0000)]
api: Add a simple endpoint to fetch all lists
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 13:40:12 +0000 (13:40 +0000)]
api: Create some basic (empty) API service
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 13:36:56 +0000 (13:36 +0000)]
backend: Support passing the configuration as a path
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 13:16:47 +0000 (13:16 +0000)]
configure: Require the Python dns module
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 11:09:31 +0000 (11:09 +0000)]
sources: Fix listing all sources
I have no idea how I confused all these field names... Oh well...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 29 Dec 2025 11:09:19 +0000 (11:09 +0000)]
dnsbl: Add flag to force updating all sources of all lists
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 28 Dec 2025 14:32:14 +0000 (14:32 +0000)]
dnsbl: Show if a domain is dead
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 28 Dec 2025 14:26:12 +0000 (14:26 +0000)]
sources: Store number of total and dead domains
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 28 Dec 2025 13:42:57 +0000 (13:42 +0000)]
sources: Normalize any international domain names
We don't want these to hit the database in Unicode, but only in ASCII
format.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 28 Dec 2025 13:35:04 +0000 (13:35 +0000)]
sources: Remove any trailing dots from domains
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 28 Dec 2025 13:21:23 +0000 (13:21 +0000)]
lists: Create a CTE to fetch all domains
This is reusable so that we don't have to copy any queries.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>