From a08fee5c576805f14294f7f89b0de9e30fdd37f2 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 2 Nov 2013 11:43:54 +0100 Subject: [PATCH] simpler domain overview, add missing template files to repo --- nsupdate/main/templates/main/domain.html | 34 +++++++++++++++++ .../main/templates/main/domain_overview.html | 9 +---- .../templates/main/generate_ns_secret.html | 38 +++++++++++++++++++ 3 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 nsupdate/main/templates/main/domain.html create mode 100644 nsupdate/main/templates/main/generate_ns_secret.html diff --git a/nsupdate/main/templates/main/domain.html b/nsupdate/main/templates/main/domain.html new file mode 100644 index 0000000..a6f8ca2 --- /dev/null +++ b/nsupdate/main/templates/main/domain.html @@ -0,0 +1,34 @@ +{% extends "base.html" %} +{% load bootstrap %} + +{% block content %} +
+
+

{{ domain.domain }}
back to overview

+
+

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.

+
+ {% csrf_token %} + {{ form|bootstrap }} + +
+
+
+

Delete Domain

+

+ Deleting a domain is not undoable. If you need it back, you'll have to add it again and configure a new shared secret. +

+
+ +
+

Generate New Secret

+

You can generate a new shared secret here. If you do so, you have to put it into your nameserver config also. + We'll show you an example config...

+
+ +
+
+
+
+{% endblock %} diff --git a/nsupdate/main/templates/main/domain_overview.html b/nsupdate/main/templates/main/domain_overview.html index 222b2ae..204817f 100644 --- a/nsupdate/main/templates/main/domain_overview.html +++ b/nsupdate/main/templates/main/domain_overview.html @@ -12,22 +12,17 @@ Public? Available? Nameserver IP - Algorithm {% for domain in domains %} - {{ domain.domain }} + {{ domain.domain }} {{ domain.public|yesno }} {{ domain.available|yesno }} {{ domain.nameserver_ip }} - {{ domain.get_nameserver_update_algorithm_display }} - - - Key: {{ domain.nameserver_update_key }} {% empty %} - No domains yet. + No domains yet. {% endfor %} diff --git a/nsupdate/main/templates/main/generate_ns_secret.html b/nsupdate/main/templates/main/generate_ns_secret.html new file mode 100644 index 0000000..cb81e3c --- /dev/null +++ b/nsupdate/main/templates/main/generate_ns_secret.html @@ -0,0 +1,38 @@ +{% extends "base.html" %} +{% load bootstrap %} + +{% block content %} +
+
+
+

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.

+

Secret: {{ shared_secret }}

+
+
+
+
+

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

+
+// configuration snippet for bind 9 nameserver (put it into /etc/bind9/named.conf )
+
+key "{{ object.domain }}." {
+    algorithm {{ object.get_bind9_algorithm }};
+    // the secret is just a shared secret in base64-encoding, you don't need to use a special tool
+    // to create it. Some random in base64 encoding should be OK.
+    secret "{{ shared_secret }}";
+};
+
+zone {{ object.domain }} {
+        type master;
+        // bind9 needs write permissions into that directory and into that file:
+        file "/etc/bind/zones/{{ object.domain }}";
+        // everyone who has that key may update this zone:
+        allow-update { key "{{ object.domain }}."; };
+};
+
+
+
+
+{% endblock %}