diff options
Diffstat (limited to 'portal-gui')
-rw-r--r-- | portal-gui/rpkigui/myrpki/glue.py | 76 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/add_conf.html | 21 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/conf_list.html | 17 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/parent_resource.html | 15 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/parent_view.html | 34 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/resource_view.html | 43 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/roaform.html | 13 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/xml_import.html | 20 |
8 files changed, 0 insertions, 239 deletions
diff --git a/portal-gui/rpkigui/myrpki/glue.py b/portal-gui/rpkigui/myrpki/glue.py index 23609131..c25b3055 100644 --- a/portal-gui/rpkigui/myrpki/glue.py +++ b/portal-gui/rpkigui/myrpki/glue.py @@ -74,79 +74,3 @@ def configure_resources(handle): output_prefixes(handle) output_roas(handle) #invoke_rpki(handle.handle, ['configure_daemons']) -from __future__ import with_statement - -import os -import os.path -import csv -import math -import rpki.myrpki -from rpki.resource_set import resource_range_ipv4 -from rpki.ipaddrs import v4addr -import settings - -def form_to_conf(data): - """Write out a myrpki.conf based on the given form data.""" - handle = data['handle'] - confdir = settings.MYRPKI_DATA_DIR + '/' + handle - if os.path.exists(confdir): - raise RuntimeError, '%s: directory already exists!' % (confdir, ) - os.makedirs(confdir) - template = open(settings.MYRPKI_DATA_DIR + '/examples/myrpki.conf', 'r').read() - # stuff the appropriate output directory into the dict - data['MYRPKI_DATA_DIR'] = confdir - with open(confdir + '/myrpki.conf', 'w') as conf: - print >>conf, template % data - invoke_rpki(handle, ['initialize']) - -def invoke_rpki(handle, args): - """Invoke the myrpki cli for the specified configuration.""" - config = settings.MYRPKI_DATA_DIR + '/' + handle + '/myrpki.conf' - os.chdir(settings.MYRPKI_DATA_DIR + '/' + handle) - cmd = 'python ' + settings.MYRPKI_SRC_DIR + '/myrpki.py ' + ' '.join(['--config=' + config] + args) - print 'invoking', cmd - os.system(cmd) - -def read_identity(handle): - fname = settings.MYRPKI_DATA_DIR + '/' + handle + '/entitydb/identity.xml' - with open(fname, 'r') as fp: - data = fp.read() - return data - -def read_child_response(handle, child): - fname = '%s/%s/entitydb/children/%s.xml' % (settings.MYRPKI_DATA_DIR, handle, child) - with open(fname, 'r') as fp: - data = fp.read() - return data - -def output_asns(handle): - '''Write out csv file containing resources delegated to my children.''' - confdir = settings.MYRPKI_DATA_DIR + '/' + handle.handle - f = csv.writer(open(confdir + '/asns.csv', 'w'), delimiter='\t') - for p in handle.children.all(): - for asn in p.asn.all(): - if asn.lo == asn.hi: - f.writerow([p.handle, asn.lo]) - -def output_prefixes(handle): - '''Write out csv file containing resources delegated to my children.''' - confdir = settings.MYRPKI_DATA_DIR + '/' + handle.handle - f = csv.writer(open(confdir + '/prefixes.csv', 'w'), delimiter='\t') - for p in handle.children.all(): - for prefix in p.address_range.all(): - f.writerow([p.handle, '%s-%s' % (prefix.lo, prefix.hi)]) - -def output_roas(handle): - confdir = settings.MYRPKI_DATA_DIR + '/' + handle.handle - f = csv.writer(open(confdir + '/roas.csv', 'w'), delimiter='\t') - for r in handle.roas.all(): - for addr in r.prefix.all(): - f.writerow([resource_range_ipv4(v4addr(str(addr.lo)), v4addr(str(addr.hi))), - r.asn, handle.handle]) - -def configure_resources(handle): - # write out the .csv files and invoke the myrpki command line tool - output_asns(handle) - output_prefixes(handle) - output_roas(handle) - #invoke_rpki(handle.handle, ['configure_daemons']) diff --git a/portal-gui/rpkigui/templates/myrpki/add_conf.html b/portal-gui/rpkigui/templates/myrpki/add_conf.html index b0994138..a3440e4a 100644 --- a/portal-gui/rpkigui/templates/myrpki/add_conf.html +++ b/portal-gui/rpkigui/templates/myrpki/add_conf.html @@ -21,24 +21,3 @@ {% endblock %} {% extends "base.html" %} - -{% block content %} -<h1>Add Configuration</h1> -<p>Please enter a unique handle for your RPKI instance. - -{% if errors %} -<ul> -{% for m in errors %} -<li class="errmsg">{{ m }} -{% endfor %} -</ul> -{% endif %} - -<form action="/myrpki/conf/add" method="post"> -<table> -{{ form.as_table }} -<tr><td><input type="submit" value="Submit" /></td></tr> -</table> -</form> - -{% endblock %} diff --git a/portal-gui/rpkigui/templates/myrpki/conf_list.html b/portal-gui/rpkigui/templates/myrpki/conf_list.html index 827994f4..9f350ef4 100644 --- a/portal-gui/rpkigui/templates/myrpki/conf_list.html +++ b/portal-gui/rpkigui/templates/myrpki/conf_list.html @@ -15,20 +15,3 @@ --> {% endblock %} -{% extends "base.html" %} - -{% block content %} -<h1>Handle List</h1> -<p>Please select a handle. - -<ul> -{% for c in conf_list %} -<li><a href="/myrpki/conf/select?handle={{ c.handle }}&next={{ next_url }}">{{ c.handle }}</a> -{% endfor %} -</ul> - -<!-- -<p><a href="/myrpki/conf/add?next={{ next_url }}">[create]</a> ---> - -{% endblock %} diff --git a/portal-gui/rpkigui/templates/myrpki/parent_resource.html b/portal-gui/rpkigui/templates/myrpki/parent_resource.html index b0b61a86..764207e4 100644 --- a/portal-gui/rpkigui/templates/myrpki/parent_resource.html +++ b/portal-gui/rpkigui/templates/myrpki/parent_resource.html @@ -13,18 +13,3 @@ </form> {% endblock %} -{% extends "base.html" %} - -{% block content %} - -<p>Handle: <a href="/myrpki/">{{ request.session.handle }}</a> - -<h1>Add Resource Range</h1> -<form action="{{ request.url }}" method="post"> -<table> -{{ form.as_table }} -</table> -<input type="submit" value="Submit" /> -</form> - -{% endblock %} diff --git a/portal-gui/rpkigui/templates/myrpki/parent_view.html b/portal-gui/rpkigui/templates/myrpki/parent_view.html index 5da574a2..1f1c2465 100644 --- a/portal-gui/rpkigui/templates/myrpki/parent_view.html +++ b/portal-gui/rpkigui/templates/myrpki/parent_view.html @@ -32,37 +32,3 @@ {% endif %} {% endblock %} -{% extends "base.html" %} - -{% block content %} -<p>Handle: <a href="/myrpki/">{{ request.session.handle.handle }}</a> -<h1>Parent View</h1> -<p>Parent: {{ parent.handle }} -<h2>Delegated Addresses</h2> -{% if parent.address_range.count %} -<table> - <tr><td>Low</td><td>High</td><td></td></tr> -{% for a in parent.address_range.all %} -<tr> - <td>{{ a.lo }}</td> - <td>{{ a.hi }}</td> - <td><a href="{{ a.get_absolute_url }}">view</a></td> -</tr> -{% endfor %} -</table> -{% else %} -<p>--none-- -{% endif %} - -<h2>Delegated ASNs</h2> -{% if parent.asn.count %} -<ul> -{% for a in parent.asn.all %} -<li><a href="{{ a.get_absolute_url }}">{{ a }}</a> -{% endfor %} -</ul> -{% else %} -<p>--none-- -{% endif %} - -{% endblock %} diff --git a/portal-gui/rpkigui/templates/myrpki/resource_view.html b/portal-gui/rpkigui/templates/myrpki/resource_view.html index 55dc1b46..e2992f4e 100644 --- a/portal-gui/rpkigui/templates/myrpki/resource_view.html +++ b/portal-gui/rpkigui/templates/myrpki/resource_view.html @@ -41,46 +41,3 @@ </form> {% endblock %} -{% extends "base.html" %} - -{% block content %} -<p>Handle: <a href="/myrpki/">{{ request.session.handle }}</a> -<h1>Resource Range View</h1> -<table> - <tr> - <td>Range:</td><td>{{ addr }}</td> - </tr> - <tr> - <td>Parent:</td> - <td><a href="{{ parent.get_absolute_url }}">{{ parent.handle }}</a></td> - </tr> - {% if addr.parent %} - <tr> - <td>Suballocated from:</td> - <td><a href="{{ addr.parent.get_absolute_url }}">{{ addr.parent }}</a></td> - </tr> - {% endif %} -</table> - -<h2>Suballocations</h2> - -{% if addr.children.count %} - -<ul> -{% for subaddr in addr.children.all %} -<li><a href="{{ subaddr.get_absolute_url }}">{{ subaddr }}</a> -{% endfor %} -</ul> - -{% else %} - -<p>--none-- - -{% endif %} - -<form action="{{ request.url }}" method="post"> - {{ form.as_p }} - <p><input type="submit" value="Submit"> -</form> - -{% endblock %} diff --git a/portal-gui/rpkigui/templates/myrpki/roaform.html b/portal-gui/rpkigui/templates/myrpki/roaform.html index 2678ed12..c81d0ae8 100644 --- a/portal-gui/rpkigui/templates/myrpki/roaform.html +++ b/portal-gui/rpkigui/templates/myrpki/roaform.html @@ -11,16 +11,3 @@ </form> {% endblock %} -{% extends "base.html" %} - -{% block content %} -<h1>Edit ROA</h1> - -<p>Handle: <a href="/myrpki/">{{ request.session.handle }}</a> - -<form action="{{ request.url }}" method="POST"> -{{ form.as_p }} -<p><input type="submit" value="Submit"> -</form> - -{% endblock %} diff --git a/portal-gui/rpkigui/templates/myrpki/xml_import.html b/portal-gui/rpkigui/templates/myrpki/xml_import.html index bdd449ad..e26830e3 100644 --- a/portal-gui/rpkigui/templates/myrpki/xml_import.html +++ b/portal-gui/rpkigui/templates/myrpki/xml_import.html @@ -18,23 +18,3 @@ </form> {% endblock %} -{% extends "base.html" %} - -{% block content %} -<h1>Import {{ kind }}</h1> -<p>Handle: {{ request.session.handle }} -<p>Please select the xml file containing the identity of the <strong>{{ kind }}</strong> to import. -{% if errors %} -<ul> -{% for e in errors %} -<li>{{ e }} -{% endfor %} -</ul> -{% endif %} - -<form enctype="multipart/form-data" action="{{ post_url }}" method="post"> -{{ form.as_p }} -<input type="submit" value="Submit" /> -</form> - -{% endblock %} |