Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# Write the header
self.write_header(f, ";")
+ # Fetch the zone's origin
+ origin = self.list.zone(prefix=self.prefix)
+
# Make the serial
serial = self.list.updated_at.strftime("%s")
# Write $ORIGIN
- f.write("$ORIGIN %s\n" % self.list.zone)
+ f.write("$ORIGIN %s\n" % origin)
# Set the TTL
f.write("$TTL %s\n" % ttl)
"""
Exports the list as a regular DNSBL zone file
"""
+ prefix = "dnsbl"
type = "A"
content = "127.0.0.2"
"""
Exports the list as a RPZ zone file
"""
+ prefix = "rpz"
type = "CNAME"
content = "."
sa_column_kwargs = {"server_default" : sqlmodel.text("CURRENT_TIMESTAMP")}
)
- @functools.cached_property
- def zone(self):
- return "%s.dnsbl.ipfire.org." % self.slug
+ def zone(self, prefix=None):
+ s = (
+ self.slug, prefix, "ipfire.org.",
+ )
+
+ # Join it all together
+ return ".".join(e for e in s if e)
@property
def domains(self):