Queue database provisioning and new DNS publications on creation #140

Merged
parkel merged 2 commits from feature/automatic-provisioning into main 2026-11-22 23:30:44 +01:00
3 changed files with 31 additions and 4 deletions
Showing only changes of commit 0f12e7c456 - Show all commits

No files matched your search

+4 -2
View File
@@ -7,6 +7,7 @@ from django.views.decorators.cache import never_cache
from django.views.generic import TemplateView
from .access import OperatorOnlyMixin
from .dns_defaults import zone_defaults
@method_decorator(never_cache, name="dispatch")
@@ -22,6 +23,7 @@ class InstallationView(
except PackageNotFoundError:
installed_version = "Unavailable"
dns_defaults = zone_defaults()
features = (
("Local website provisioning", settings.LOCAL_WEB_ACTIVATION),
("Managed website certificates", settings.LOCAL_WEB_HTTPS),
@@ -31,8 +33,8 @@ class InstallationView(
(
"Default managed DNS zones for new accounts",
settings.LOCAL_DNS_PUBLISHING
and settings.HOSTING_NAMESERVERS
and settings.HOSTING_PUBLIC_ADDRESSES,
and dns_defaults.nameservers
and dns_defaults.addresses,
),
(
"Local mailbox provisioning",
@@ -25,7 +25,14 @@
{% for name, enabled in features %}
<tr>
<th scope="row">{{ name }}</th>
<td>{% if enabled %}<span class="status active">Enabled</span>{% else %}Disabled{% endif %}</td>
<td>
<div class="table-actions">
{% if enabled %}<span class="status active">Enabled</span>{% else %}<span>Disabled</span>{% endif %}
{% if request.user.is_superuser and name == 'Default managed DNS zones for new accounts' %}
<a class="record-link" href="{% url 'panel:dns_defaults' %}">Configure DNS defaults</a>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
+19 -1
View File
@@ -20,7 +20,7 @@ from coulobre.service_health import (
main,
)
from .models import Customer, Reseller, ServiceHealth
from .models import Customer, DnsZoneDefaults, Reseller, ServiceHealth
TARGETS = (
HealthTarget("panel-01", "local", ("mariadb", "apache")),
@@ -196,6 +196,24 @@ class ServiceHealthPanelTests(TestCase):
self.assertNotContains(response, "test-only-bridge-key")
self.assertNotContains(response, "https://webmail.example.net")
@override_settings(
LOCAL_DNS_PUBLISHING=True,
HOSTING_NAMESERVERS=(),
HOSTING_PUBLIC_ADDRESSES=(),
)
def test_installation_reports_dns_defaults_saved_in_the_panel(self):
DnsZoneDefaults.objects.create(
pk=1, nameservers=["ns.example.net"], addresses=["192.0.2.20"]
)
self.client.force_login(self.admin)
response = self.client.get(reverse("panel:installation"))
self.assertTrue(
dict(response.context["features"])[
"Default managed DNS zones for new accounts"
]
)
self.assertContains(response, "Configure DNS defaults")
def test_view_marks_missing_and_old_observations_distinctly(self):
now = timezone.now()
for node, service, result, observed_at in (