diff --git a/nsupdate/main/forms.py b/nsupdate/main/forms.py index 95c1b77..cad4cbe 100644 --- a/nsupdate/main/forms.py +++ b/nsupdate/main/forms.py @@ -22,7 +22,8 @@ class EditHostForm(forms.ModelForm): class CreateDomainForm(forms.ModelForm): class Meta(object): model = Domain - exclude = ['created_by'] + fields = ['domain', 'nameserver_ip', 'nameserver_update_algorithm', + 'public', 'available', 'comment'] widgets = { 'domain': forms.widgets.TextInput(attrs=dict(autofocus=None)), } diff --git a/nsupdate/main/models.py b/nsupdate/main/models.py index 98f2dcf..8d6af22 100644 --- a/nsupdate/main/models.py +++ b/nsupdate/main/models.py @@ -65,7 +65,8 @@ class Domain(models.Model): help_text="Shared secret that allows updating this zone (base64 encoded)") nameserver_update_algorithm = models.CharField( max_length=16, # see elements of UPDATE_ALGORITHM_CHOICES - default=UPDATE_ALGORITHM_DEFAULT, choices=UPDATE_ALGORITHM_CHOICES) + default=UPDATE_ALGORITHM_DEFAULT, choices=UPDATE_ALGORITHM_CHOICES, + help_text="HMAC_SHA512 is fine for bind9 (you can change this later, if needed)") public = models.BooleanField( default=False, help_text="Check to allow any user to add dynamic hosts to this zone - " diff --git a/nsupdate/main/templates/main/domain.html b/nsupdate/main/templates/main/domain.html index b17e8af..8ec8f4a 100644 --- a/nsupdate/main/templates/main/domain.html +++ b/nsupdate/main/templates/main/domain.html @@ -7,6 +7,10 @@

Edit Domain

You can't change the domain name. If you want to have another domain name, you have to delete this domain and create a new one.

+

+ Please note that update algorithm and update secret need to match. + Just create a new secret after submitting this form with a changed update algorithm. +

{% csrf_token %} {{ form|bootstrap }} diff --git a/nsupdate/main/templates/main/domain_overview.html b/nsupdate/main/templates/main/domain_overview.html index f15da24..86692cd 100644 --- a/nsupdate/main/templates/main/domain_overview.html +++ b/nsupdate/main/templates/main/domain_overview.html @@ -57,10 +57,11 @@

Help

Here you can add new domains (zones) which you control (and this is only useful if you - have some own zone which you can update automatically).

-

You need to configure the primary master nameserver of the zone so it accepts dynamic updates - if the correct update key is presented (which is just a shared secret between the nameserver - and this service). + have some own zone which you can update automatically). +

+

You need to be able to configure the primary master nameserver of the zone so it accepts + dynamic updates (via RFC 2136 "dynamic update" protocol) if the correct update secret is presented. + We'll show you configuration examples after you add a domain.

diff --git a/nsupdate/main/templates/main/generate_ns_secret.html b/nsupdate/main/templates/main/generate_ns_secret.html index d7349ae..8a33b74 100644 --- a/nsupdate/main/templates/main/generate_ns_secret.html +++ b/nsupdate/main/templates/main/generate_ns_secret.html @@ -8,9 +8,12 @@

Nameserver Shared Secret Generated
back to overview

New nameserver shared secret generated for you. Everytime you visit this page a new secret will be generated and the old one becomes invalid.

+

Algorithm: {{ object.get_bind9_algorithm }}

Secret: {{ shared_secret }}

+ +

How to configure your bind9 nameserver to accept dynamic DNS updates?

diff --git a/nsupdate/main/views.py b/nsupdate/main/views.py index b5bc326..ac6f0fc 100644 --- a/nsupdate/main/views.py +++ b/nsupdate/main/views.py @@ -241,7 +241,7 @@ class DomainOverwievView(CreateView): return super(DomainOverwievView, self).dispatch(*args, **kwargs) def get_success_url(self): - return reverse('domain_overview') + return reverse('generate_ns_secret_view', args=(self.object.pk,)) def form_valid(self, form): self.object = form.save(commit=False)