simpler domain overview, add missing template files to repo

This commit is contained in:
Thomas Waldmann 2013-11-02 11:43:54 +01:00
parent 35c953347c
commit a08fee5c57
3 changed files with 74 additions and 7 deletions

View File

@ -0,0 +1,34 @@
{% extends "base.html" %}
{% load bootstrap %}
{% block content %}
<div class="container">
<div class="row">
<h3>{{ domain.domain }} <br><small><a href="{% url 'domain_overview' %}"><i class="icon-double-angle-left"></i> back to overview</a></small></h3>
<div class="col-lg-8">
<h3>Edit Domain</h3>
<p>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.</p>
<form method="post" action="">
{% csrf_token %}
{{ form|bootstrap }}
<button type="submit" class="btn btn-primary">Update</button>
</form>
</div>
<div class="col-lg-4">
<h3>Delete Domain</h3>
<p>
Deleting a domain is not undoable. If you need it back, you'll have to add it again and configure a new shared secret.
</p>
<form method="get" action="{% url 'delete_domain' domain.pk %}">
<button type="submit" class="btn btn-primary">Delete domain {{ domain.domain }}</button>
</form>
<h3>Generate New Secret</h3>
<p>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...</p>
<form action="{% url 'generate_ns_secret_view' domain.pk %}" method="get">
<button type="submit" class="btn btn-primary">Generate New</button>
</form>
</div>
</div>
</div>
{% endblock %}

View File

@ -12,22 +12,17 @@
<th>Public?</th> <th>Public?</th>
<th>Available?</th> <th>Available?</th>
<th>Nameserver IP</th> <th>Nameserver IP</th>
<th>Algorithm</th>
</tr> </tr>
</thead> </thead>
{% for domain in domains %} {% for domain in domains %}
<tr> <tr>
<td rowspan="2" style="vertical-align: middle"><a href="{% url 'domain_view' domain.pk %}">{{ domain.domain }}</a></td> <td><a href="{% url 'domain_view' domain.pk %}">{{ domain.domain }}</a></td>
<td>{{ domain.public|yesno }}</td> <td>{{ domain.public|yesno }}</td>
<td>{{ domain.available|yesno }}</td> <td>{{ domain.available|yesno }}</td>
<td>{{ domain.nameserver_ip }}</td> <td>{{ domain.nameserver_ip }}</td>
<td>{{ domain.get_nameserver_update_algorithm_display }}</td>
</tr>
<tr>
<td colspan="4">Key: {{ domain.nameserver_update_key }}</td>
</tr> </tr>
{% empty %} {% empty %}
<tr><td colspan="6">No domains yet.</td></tr> <tr><td colspan="4">No domains yet.</td></tr>
{% endfor %} {% endfor %}
</table> </table>
</div> </div>

View File

@ -0,0 +1,38 @@
{% extends "base.html" %}
{% load bootstrap %}
{% block content %}
<div class="row">
<div class="col-lg-12">
<div class="well">
<h3>Nameserver Shared Secret Generated <small><br>
<a href="{% url 'domain_overview' %}"><i class="icon-double-angle-left"></i> back to overview</a></small></h3>
<p>New nameserver shared secret generated for you. Everytime you visit this page a new secret will be generated and the old one becomes invalid.</p>
<p>Secret: <b>{{ shared_secret }}</b></p>
</div>
</div>
<div class="col-lg-12">
<div class="well">
<h3>How to configure your bind9 nameserver to accept dynamic DNS updates?</h3>
<pre>
// 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 }}."; };
};
</pre>
</div>
</div>
</div>
{% endblock %}