]> git.ipfire.org Git - dnsbl.git/log
dnsbl.git
3 days agoexporters: Drop exporting zones using dnspython master
Michael Tremer [Thu, 11 Dec 2025 20:24:51 +0000 (20:24 +0000)] 
exporters: Drop exporting zones using dnspython

dnspython is taking hours as well as several gigabytes of memory to
generate a zone file. This is not sustainable at all since we want to be
able to push out updates fast.

I could not find any alternatives, but we are able to generate ZONEMD
records externally.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 days agoutil: Don't accept any IP addresses being listed
Michael Tremer [Thu, 11 Dec 2025 19:21:39 +0000 (19:21 +0000)] 
util: Don't accept any IP addresses being listed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agolists: Fix creating lists by initializing updated_at
Michael Tremer [Wed, 10 Dec 2025 17:35:31 +0000 (17:35 +0000)] 
lists: Fix creating lists by initializing updated_at

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoexporters: Create expressions and urls files for squidguard
Michael Tremer [Wed, 10 Dec 2025 17:20:29 +0000 (17:20 +0000)] 
exporters: Create expressions and urls files for squidguard

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoutil: Refactor is_fqdn
Michael Tremer [Wed, 10 Dec 2025 17:10:49 +0000 (17:10 +0000)] 
util: Refactor is_fqdn

No functional changes.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoutil: Be more lax with domain names
Michael Tremer [Wed, 10 Dec 2025 17:10:01 +0000 (17:10 +0000)] 
util: Be more lax with domain names

There are a lot of domain names out there that start/end with a
non-alphanumerical character which is why we need to remove this check.

We also need to accept underscores in domain names.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agosources: Remove leading *.
Michael Tremer [Wed, 10 Dec 2025 17:09:04 +0000 (17:09 +0000)] 
sources: Remove leading *.

Some lists store domains with a leading *. which we can simply remove.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agosources: Insert domains in batches
Michael Tremer [Wed, 10 Dec 2025 17:07:57 +0000 (17:07 +0000)] 
sources: Insert domains in batches

Since too many database roundtrips are making the parsing of other large
lists extremely slow, we will collect them all in a set (so that we will
never have any duplicates) and insert them into the database in batches
of 1000 domains at a time.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agosources: Support transparent decompression of compressed files
Michael Tremer [Wed, 10 Dec 2025 17:04:23 +0000 (17:04 +0000)] 
sources: Support transparent decompression of compressed files

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agosources: Fix sending the Etag
Michael Tremer [Wed, 10 Dec 2025 16:54:41 +0000 (16:54 +0000)] 
sources: Fix sending the Etag

Obviously this must be sent in an If-None-Match header.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoexporter: Create the RRset only once
Michael Tremer [Wed, 10 Dec 2025 16:09:53 +0000 (16:09 +0000)] 
exporter: Create the RRset only once

Since all records have the same rrset, we simply create it only once
instead of doing this every time we iterate over our loop.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoutil: Create a stopwatch to monitor how long some expensive functions take
Michael Tremer [Wed, 10 Dec 2025 16:09:30 +0000 (16:09 +0000)] 
util: Create a stopwatch to monitor how long some expensive functions take

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agodnsbl: Add an analyze command to show duplicates in lists
Michael Tremer [Wed, 10 Dec 2025 15:46:02 +0000 (15:46 +0000)] 
dnsbl: Add an analyze command to show duplicates in lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agosources: Don't rely on the Adblock Plus header
Michael Tremer [Wed, 10 Dec 2025 12:56:31 +0000 (12:56 +0000)] 
sources: Don't rely on the Adblock Plus header

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agosources: Log an error if we could not parse anything
Michael Tremer [Wed, 10 Dec 2025 12:56:19 +0000 (12:56 +0000)] 
sources: Log an error if we could not parse anything

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agosources: Support parsing hosts files
Michael Tremer [Wed, 10 Dec 2025 12:41:13 +0000 (12:41 +0000)] 
sources: Support parsing hosts files

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agodnsbl: Show the number of domains on lists/sources
Michael Tremer [Wed, 10 Dec 2025 12:40:56 +0000 (12:40 +0000)] 
dnsbl: Show the number of domains on lists/sources

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agodnsbl: export-all: Create a tarball with all lists for squidGuard
Michael Tremer [Wed, 10 Dec 2025 12:16:22 +0000 (12:16 +0000)] 
dnsbl: export-all: Create a tarball with all lists for squidGuard

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agolists: Initialize updated_at with the current timestamp
Michael Tremer [Wed, 10 Dec 2025 12:16:00 +0000 (12:16 +0000)] 
lists: Initialize updated_at with the current timestamp

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoexporters: Support exporting lists that have never been updated
Michael Tremer [Wed, 10 Dec 2025 12:10:35 +0000 (12:10 +0000)] 
exporters: Support exporting lists that have never been updated

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agodnsbl: Add description to lists
Michael Tremer [Wed, 10 Dec 2025 11:49:51 +0000 (11:49 +0000)] 
dnsbl: Add description to lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoexporters: Add an exporter for squidGuard
Michael Tremer [Wed, 10 Dec 2025 11:36:50 +0000 (11:36 +0000)] 
exporters: Add an exporter for squidGuard

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoexporters: Split logic for text and binary exporters
Michael Tremer [Wed, 10 Dec 2025 11:36:24 +0000 (11:36 +0000)] 
exporters: Split logic for text and binary exporters

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agosources: Download the entire payload before processing it
Michael Tremer [Wed, 10 Dec 2025 10:58:50 +0000 (10:58 +0000)] 
sources: Download the entire payload before processing it

Some web servers did not keep the connection open for long enough so
that we cannot keep processing all domains on the fly.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoexporter: Build an exporter for a regular DNS BL zone
Michael Tremer [Wed, 10 Dec 2025 10:52:15 +0000 (10:52 +0000)] 
exporter: Build an exporter for a regular DNS BL zone

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 days agodb: Drop the PowerDNS views
Michael Tremer [Mon, 8 Dec 2025 17:01:23 +0000 (17:01 +0000)] 
db: Drop the PowerDNS views

Although this worked really well, we cannot create ZONEMD records and
catalog zones and anything else that needs to store data is becoming
very difficult to manage.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 days agodnsbl: Allow to specify an output file for single exports
Michael Tremer [Mon, 8 Dec 2025 17:00:24 +0000 (17:00 +0000)] 
dnsbl: Allow to specify an output file for single exports

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 days agodnsbl: Add ZONEMD records to the exported zones
Michael Tremer [Mon, 8 Dec 2025 16:59:54 +0000 (16:59 +0000)] 
dnsbl: Add ZONEMD records to the exported zones

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 days agodnsbl: Move the exporters into a separate file
Michael Tremer [Mon, 8 Dec 2025 15:48:51 +0000 (15:48 +0000)] 
dnsbl: Move the exporters into a separate file

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 days agodnsbl: Use "dns" to write the zone file
Michael Tremer [Mon, 8 Dec 2025 15:29:26 +0000 (15:29 +0000)] 
dnsbl: Use "dns" to write the zone file

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 days agodb: Don't export deleted lists/sources to DNS
Michael Tremer [Mon, 8 Dec 2025 14:14:40 +0000 (14:14 +0000)] 
db: Don't export deleted lists/sources to DNS

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Support output in hosts file format
Michael Tremer [Sat, 6 Dec 2025 21:06:11 +0000 (21:06 +0000)] 
dnsbl: Support output in hosts file format

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agosources: Store and show when sources have been updated last
Michael Tremer [Sat, 6 Dec 2025 21:03:19 +0000 (21:03 +0000)] 
sources: Store and show when sources have been updated last

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agolists: Show the last update time in the header
Michael Tremer [Sat, 6 Dec 2025 20:59:32 +0000 (20:59 +0000)] 
lists: Show the last update time in the header

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Create a sub-directory for each exported list
Michael Tremer [Sat, 6 Dec 2025 20:57:31 +0000 (20:57 +0000)] 
dnsbl: Create a sub-directory for each exported list

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agoutil: Allow blocking an entire TLD
Michael Tremer [Sat, 6 Dec 2025 20:46:55 +0000 (20:46 +0000)] 
util: Allow blocking an entire TLD

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Add a search command
Michael Tremer [Sat, 6 Dec 2025 20:38:44 +0000 (20:38 +0000)] 
dnsbl: Add a search command

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodb: Create an index to remove old domains quicker
Michael Tremer [Sat, 6 Dec 2025 20:16:15 +0000 (20:16 +0000)] 
db: Create an index to remove old domains quicker

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agosources: Add format detecting and parse the Adblock Plus format
Michael Tremer [Sat, 6 Dec 2025 20:15:36 +0000 (20:15 +0000)] 
sources: Add format detecting and parse the Adblock Plus format

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agosources: Don't delete domains that have already been deleted
Michael Tremer [Sat, 6 Dec 2025 20:15:10 +0000 (20:15 +0000)] 
sources: Don't delete domains that have already been deleted

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Add command to remove a source
Michael Tremer [Sat, 6 Dec 2025 19:38:56 +0000 (19:38 +0000)] 
dnsbl: Add command to remove a source

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Add a header to all exports
Michael Tremer [Sat, 6 Dec 2025 19:30:02 +0000 (19:30 +0000)] 
dnsbl: Add a header to all exports

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agolists: Fetch sources ordered by their name
Michael Tremer [Sat, 6 Dec 2025 19:29:33 +0000 (19:29 +0000)] 
lists: Fetch sources ordered by their name

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Make the list only as updated when we actually have new data
Michael Tremer [Sat, 6 Dec 2025 19:09:16 +0000 (19:09 +0000)] 
dnsbl: Make the list only as updated when we actually have new data

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Set the mtime of the file to when the list was last updated
Michael Tremer [Sat, 6 Dec 2025 18:52:50 +0000 (18:52 +0000)] 
dnsbl: Set the mtime of the file to when the list was last updated

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Allow handling binary file descriptors on export
Michael Tremer [Sat, 6 Dec 2025 18:43:49 +0000 (18:43 +0000)] 
dnsbl: Allow handling binary file descriptors on export

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Add command to export all lists
Michael Tremer [Sat, 6 Dec 2025 18:32:35 +0000 (18:32 +0000)] 
dnsbl: Add command to export all lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Support exporting RPZ zone files
Michael Tremer [Sat, 6 Dec 2025 18:19:54 +0000 (18:19 +0000)] 
dnsbl: Support exporting RPZ zone files

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Allow to pass the output format
Michael Tremer [Sat, 6 Dec 2025 18:10:13 +0000 (18:10 +0000)] 
dnsbl: Allow to pass the output format

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Add --quiet/-q flag to be less verbose
Michael Tremer [Sat, 6 Dec 2025 18:06:42 +0000 (18:06 +0000)] 
dnsbl: Add --quiet/-q flag to be less verbose

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Add a command to update all lists
Michael Tremer [Sat, 6 Dec 2025 18:03:57 +0000 (18:03 +0000)] 
dnsbl: Add a command to update all lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Add a command to delete a list
Michael Tremer [Sat, 6 Dec 2025 17:56:12 +0000 (17:56 +0000)] 
dnsbl: Add a command to delete a list

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodb: Make "notified_serial" writable
Michael Tremer [Sat, 6 Dec 2025 17:48:56 +0000 (17:48 +0000)] 
db: Make "notified_serial" writable

That way, we can run PowerDNS in master mode and it will notify any
slaves if there are any changes.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodb: Set the correct master namesever
Michael Tremer [Sat, 6 Dec 2025 17:40:51 +0000 (17:40 +0000)] 
db: Set the correct master namesever

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodb: Add NS records to the zones
Michael Tremer [Sat, 6 Dec 2025 17:39:16 +0000 (17:39 +0000)] 
db: Add NS records to the zones

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodb: Create some experimental VIEWs for PowerDNS
Michael Tremer [Sat, 6 Dec 2025 17:10:30 +0000 (17:10 +0000)] 
db: Create some experimental VIEWs for PowerDNS

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agosources: Only download when upstream has actually changed
Michael Tremer [Sat, 6 Dec 2025 17:10:14 +0000 (17:10 +0000)] 
sources: Only download when upstream has actually changed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agosources: Don't prune domains from other sources
Michael Tremer [Sat, 6 Dec 2025 17:09:13 +0000 (17:09 +0000)] 
sources: Don't prune domains from other sources

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Remove the "list-" prefix from all commands
Michael Tremer [Sat, 6 Dec 2025 17:07:50 +0000 (17:07 +0000)] 
dnsbl: Remove the "list-" prefix from all commands

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agoBlacklist -> Blocklist
Michael Tremer [Sat, 6 Dec 2025 15:54:05 +0000 (15:54 +0000)] 
Blacklist -> Blocklist

Let's make this politically correct.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agodnsbl: Add a simply way to download plaintext lists
Michael Tremer [Sat, 6 Dec 2025 15:48:35 +0000 (15:48 +0000)] 
dnsbl: Add a simply way to download plaintext lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agoconfigure: Require httpx
Michael Tremer [Sat, 6 Dec 2025 15:48:09 +0000 (15:48 +0000)] 
configure: Require httpx

To download stuff.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
8 days agoutil: Add a helper function to check if something is a valid FQDN
Michael Tremer [Sat, 6 Dec 2025 15:47:49 +0000 (15:47 +0000)] 
util: Add a helper function to check if something is a valid FQDN

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Add domains to sources and add export command
Michael Tremer [Fri, 5 Dec 2025 17:56:14 +0000 (17:56 +0000)] 
dnsbl: Add domains to sources and add export command

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: sources: Use the new db methods to fetch sources
Michael Tremer [Fri, 5 Dec 2025 17:27:04 +0000 (17:27 +0000)] 
dnsbl: sources: Use the new db methods to fetch sources

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Create a command to update a list
Michael Tremer [Fri, 5 Dec 2025 17:25:25 +0000 (17:25 +0000)] 
dnsbl: Create a command to update a list

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodatabase: Make the backend available to all objects
Michael Tremer [Fri, 5 Dec 2025 17:24:36 +0000 (17:24 +0000)] 
database: Make the backend available to all objects

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Add a command to show all lists
Michael Tremer [Fri, 5 Dec 2025 17:06:17 +0000 (17:06 +0000)] 
dnsbl: Add a command to show all lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Add a command to show information about a list
Michael Tremer [Fri, 5 Dec 2025 16:31:58 +0000 (16:31 +0000)] 
dnsbl: Add a command to show information about a list

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Add our own database abstraction
Michael Tremer [Fri, 5 Dec 2025 16:31:22 +0000 (16:31 +0000)] 
dnsbl: Add our own database abstraction

Otherwise we would have to carry session objects around which makes the
code incredibly messy.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Align the naming of the "list-create" command
Michael Tremer [Fri, 5 Dec 2025 16:00:08 +0000 (16:00 +0000)] 
dnsbl: Align the naming of the "list-create" command

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Add a command to add a source to a list
Michael Tremer [Fri, 5 Dec 2025 15:59:02 +0000 (15:59 +0000)] 
dnsbl: Add a command to add a source to a list

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Add a command to create a new list
Michael Tremer [Fri, 5 Dec 2025 15:37:09 +0000 (15:37 +0000)] 
dnsbl: Add a command to create a new list

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodb: Create a simple database schema for lists and sources
Michael Tremer [Fri, 5 Dec 2025 15:36:23 +0000 (15:36 +0000)] 
db: Create a simple database schema for lists and sources

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agoconfigure: Add check for Python modules
Michael Tremer [Fri, 5 Dec 2025 15:35:22 +0000 (15:35 +0000)] 
configure: Add check for Python modules

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Log any SQL statements when in debug mode
Michael Tremer [Fri, 5 Dec 2025 15:34:37 +0000 (15:34 +0000)] 
dnsbl: Log any SQL statements when in debug mode

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodb: Create an empty schema
Michael Tremer [Fri, 5 Dec 2025 14:49:06 +0000 (14:49 +0000)] 
db: Create an empty schema

This also adds a tool to dump the schema easily.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Connect to the PostgreSQL database
Michael Tremer [Fri, 5 Dec 2025 14:42:49 +0000 (14:42 +0000)] 
dnsbl: Connect to the PostgreSQL database

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Load a default configuration file
Michael Tremer [Fri, 5 Dec 2025 14:42:35 +0000 (14:42 +0000)] 
dnsbl: Load a default configuration file

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Add a dummy "update" command
Michael Tremer [Fri, 5 Dec 2025 14:29:30 +0000 (14:29 +0000)] 
dnsbl: Add a dummy "update" command

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agodnsbl: Create a basic Backend module and CLI util
Michael Tremer [Fri, 5 Dec 2025 14:16:14 +0000 (14:16 +0000)] 
dnsbl: Create a basic Backend module and CLI util

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agoconfigure: Fix copyright header
Michael Tremer [Fri, 5 Dec 2025 13:37:46 +0000 (13:37 +0000)] 
configure: Fix copyright header

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agoconfigure: Require Python 3.13
Michael Tremer [Fri, 5 Dec 2025 13:32:24 +0000 (13:32 +0000)] 
configure: Require Python 3.13

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agoconfigure: Create some basic build system
Michael Tremer [Fri, 5 Dec 2025 13:32:41 +0000 (13:32 +0000)] 
configure: Create some basic build system

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>