Publish local BIND9 zones from the panel

This commit is contained in:
parkel committed 2026-11-21 01:41:06 +01:00
1 parent 6e075c25f4
commit 70cb4de81b
14 files changed
+450 -19

No files matched your search

+20 -9
View File
@@ -229,15 +229,17 @@ class ProvisioningJobManager(models.Manager):
def queue(self, **target):
job, created = self.get_or_create(**target)
if not created:
self.filter(pk=job.pk, finished_at__isnull=False).exclude(
problem=""
).update(
requested_at=timezone.now(),
last_dispatched_at=None,
started_at=None,
finished_at=None,
problem="",
)
self.requeue(self.filter(pk=job.pk).exclude(problem=""))
def requeue(self, jobs, **updates):
jobs.filter(finished_at__isnull=False).update(
requested_at=timezone.now(),
last_dispatched_at=None,
started_at=None,
finished_at=None,
problem="",
**updates,
)
class ProvisioningJob(models.Model):
@@ -268,3 +270,12 @@ class DatabaseProvisioning(ProvisioningJob):
database = models.OneToOneField(
HostingDatabase, on_delete=models.CASCADE, related_name="provisioning"
)
class DnsPublication(ProvisioningJob):
zone = models.OneToOneField(
HostingDnsZone, on_delete=models.CASCADE, related_name="publication"
)
manifest = models.JSONField()
serial = models.PositiveBigIntegerField()
published_serial = models.PositiveBigIntegerField(null=True, blank=True)