aboutsummaryrefslogtreecommitdiff
path: root/allium/templates
diff options
context:
space:
mode:
Diffstat (limited to 'allium/templates')
-rw-r--r--allium/templates/all.html6
-rw-r--r--allium/templates/as.html6
-rw-r--r--allium/templates/contact.html11
-rw-r--r--allium/templates/country.html11
-rw-r--r--allium/templates/family.html4
-rw-r--r--allium/templates/first_seen.html4
-rw-r--r--allium/templates/flag.html4
-rw-r--r--allium/templates/index.html5
-rw-r--r--allium/templates/misc-families.html60
-rw-r--r--allium/templates/misc-networks.html54
-rw-r--r--allium/templates/platform.html5
-rw-r--r--allium/templates/relay-info.html176
-rw-r--r--allium/templates/relay-list.html97
-rw-r--r--allium/templates/skeleton.html56
14 files changed, 499 insertions, 0 deletions
diff --git a/allium/templates/all.html b/allium/templates/all.html
new file mode 100644
index 0000000..ef6c64a
--- /dev/null
+++ b/allium/templates/all.html
@@ -0,0 +1,6 @@
+{% extends "relay-list.html" %}
+{% set relay_count = relays.json['relays']|length %}
+{% block title %}Tor Relays :: All{% endblock %}
+{% block header %}<a href="./">Home</a> :: All Relays{% endblock %}
+{% block description %}All known (non-guard) relays, {{ relay_count }} in total. A smaller browser-friendly subset (top 500) is <a href="./">available here</a>.{% endblock %}
+
diff --git a/allium/templates/as.html b/allium/templates/as.html
new file mode 100644
index 0000000..41abcef
--- /dev/null
+++ b/allium/templates/as.html
@@ -0,0 +1,6 @@
+{% extends "relay-list.html" %}
+{% set as_number = relays.json['relay_subset'][0]['as']|escape %}
+{% set as_name = relays.json['relay_subset'][0]['as_name']|escape %}
+{% block title %}Tor Relays :: {{ as_number }}{% endblock %}
+{% block header %}<a href="../../">Home</a> :: {{ as_number }}{% endblock %}
+{% block description %}{{ as_number }} ({{ as_name }}) is responsible for ~{{ bandwidth }} MB/s of traffic, with {% if middle_count > 0 %}{{ middle_count }} middle relay{% if middle_count > 1 %}s{% endif %}{% if exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count }} exit relay{% if exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
diff --git a/allium/templates/contact.html b/allium/templates/contact.html
new file mode 100644
index 0000000..10bfd93
--- /dev/null
+++ b/allium/templates/contact.html
@@ -0,0 +1,11 @@
+{% extends "relay-list.html" %}
+{% if relays.json['relay_subset'][0]['contact'] %}
+ {% set contact = relays.json['relay_subset'][0]['contact']|escape %}
+ {% set contact_hash = relays.json['relay_subset'][0]['contact']|hash %}
+{% else %}
+ {% set contact = 'none' %}
+ {% set contact_hash = ''|hash %}
+{% endif %}
+{% block title %}Tor Relays :: Contact {{ contact_hash }}{% endblock %}
+{% block header %}<a href="../../">Home</a> :: Contact {{ contact_hash }}{% endblock %}
+{% block description %}Relays with contact info <code>{{ contact }}</code> are responsible for ~{{ bandwidth }} MB/s of traffic, with {% if middle_count > 0 %}{{ middle_count }} middle relay{% if middle_count > 1 %}s{% endif %}{% if exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count }} exit relay{% if exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
diff --git a/allium/templates/country.html b/allium/templates/country.html
new file mode 100644
index 0000000..ab55af3
--- /dev/null
+++ b/allium/templates/country.html
@@ -0,0 +1,11 @@
+{% extends "relay-list.html" %}
+{% set country_orig = relays.json['relay_subset'][0]['country_name']|escape %}
+{% set country_abbr = relays.json['relay_subset'][0]['country']|escape %}
+{% if country_orig in sp_countries %}
+ {% set country_name = 'The ' + country_orig %}
+{% else %}
+ {% set country_name = country_orig %}
+{% endif %}
+{% block title %}Tor Relays :: {{ country_orig }}{% endblock %}
+{% block header %}<a href="../../">Home</a> :: {{ country_name }}{% endblock %}
+{% block description %}{{ country_name }} ({{ country_abbr }}) is responsible for ~{{ bandwidth }} MB/s of traffic, with {% if middle_count > 0 %}{{ middle_count }} middle relay{% if middle_count > 1 %}s{% endif %}{% if exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count }} exit relay{% if exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
diff --git a/allium/templates/family.html b/allium/templates/family.html
new file mode 100644
index 0000000..b4d88d8
--- /dev/null
+++ b/allium/templates/family.html
@@ -0,0 +1,4 @@
+{% extends "relay-list.html" %}
+{% block title %}Tor Relays :: Family {{ value|escape }}{% endblock %}
+{% block header %}<a href="../../">Home</a> :: Family <code>{{ value|escape }}</code>{% endblock %}
+{% block description %}Relays with effective family member <code>{{ value|escape }}</code> are responsible for ~{{ bandwidth }} MB/s of traffic, with {% if middle_count > 0 %}{{ middle_count }} middle relay{% if middle_count > 1 %}s{% endif %}{% if exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count }} exit relay{% if exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
diff --git a/allium/templates/first_seen.html b/allium/templates/first_seen.html
new file mode 100644
index 0000000..9b40362
--- /dev/null
+++ b/allium/templates/first_seen.html
@@ -0,0 +1,4 @@
+{% extends "relay-list.html" %}
+{% block title %}Tor Relays :: {{ value }}{% endblock %}
+{% block header %}<a href="../../">Home</a> :: {{ value }}{% endblock %}
+{% block description %}Relays started on {{ value }} are responsible for ~{{ bandwidth }} MB/s of traffic, with {% if middle_count > 0 %}{{ middle_count }} middle relay{% if middle_count > 1 %}s{% endif %}{% if exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count }} exit relay{% if exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
diff --git a/allium/templates/flag.html b/allium/templates/flag.html
new file mode 100644
index 0000000..875c494
--- /dev/null
+++ b/allium/templates/flag.html
@@ -0,0 +1,4 @@
+{% extends "relay-list.html" %}
+{% block title %}Tor Relays :: {{ value|escape }} Relays{% endblock %}
+{% block header %}<a href="../../">Home</a> :: {{ value|escape }} Relays{% endblock %}
+{% block description %}Relays with the {{ value }} flag are responsible for ~{{ bandwidth }} MB/s of traffic, with {% if middle_count > 0 %}{{ middle_count }} middle relay{% if middle_count > 1 %}s{% endif %}{% if exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count }} exit relay{% if exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
diff --git a/allium/templates/index.html b/allium/templates/index.html
new file mode 100644
index 0000000..e67a366
--- /dev/null
+++ b/allium/templates/index.html
@@ -0,0 +1,5 @@
+{% extends "relay-list.html" %}
+{% block title %}Tor Relays{% endblock %}
+{% block header %}Allium (<a href="http://d6amkx45augz4kskvjryv3bmmwyf7vw4k3uwxsh5egnibw2igl5aozqd.onion/">v3</a>, <a href="https://github.com/tempname1024/allium">git</a>) :: <a href="./misc/networks-by-bandwidth.html">Networks</a>, <a href="./misc/families-by-bandwidth.html">Families</a>{% endblock %}
+{% block description %}Relay listings are statically generated every hour. Last fetch was at {{ relays.timestamp }}. Listing top 500 relays; <a href="misc/all.html">view full list</a>.{% endblock %}
+
diff --git a/allium/templates/misc-families.html b/allium/templates/misc-families.html
new file mode 100644
index 0000000..7eb2de2
--- /dev/null
+++ b/allium/templates/misc-families.html
@@ -0,0 +1,60 @@
+{% extends "skeleton.html" %}
+{% set sorted_by_label = sorted_by.split(',')[0].split('.')[1] %}
+{% block title %}Tor Relays :: Families By {{ sorted_by_label|replace('_', ' ')|title }}{% endblock %}
+{% block body %}
+<h2><a href={{ path_prefix }}>Home</a> :: Families By {{ sorted_by_label|replace('_', ' ')|title }}</h2>
+<p>The set of all relay families with > 1 effective members, sorted by {{ sorted_by_label|replace('_', ' ') }}. The first seen parameter is taken from the oldest relay in the family.</p>
+<table class="table table-condensed">
+ <tr>
+ <th>Family</th>
+ {% if sorted_by_label == 'bandwidth' %}
+ <th>Bandwidth</th>
+ {% else %}
+ <th><a href="families-by-bandwidth.html">Bandwidth</a></th>
+ {% endif %}
+ <th class="visible-md visible-lg">Contact</th>
+ {% if sorted_by_label == 'exit_count' %}
+ <th>Exit / <a href="families-by-middle-count.html">Middle</a></th>
+ {% elif sorted_by_label == 'middle_count' %}
+ <th><a href="families-by-exit-count.html">Exit</a> / Middle</th>
+ {% else %}
+ <th><a href="families-by-exit-count.html">Exit</a> / <a href="families-by-middle-count.html">Middle</a></th>
+ {% endif %}
+ {% if sorted_by_label == 'first_seen' %}
+ <th>First Seen</th>
+ {% else %}
+ <th><a href="families-by-first-seen.html">First Seen</a></th>
+ {% endif %}
+ </tr>
+ <tbody>
+ {% set processed = dict() %}
+ {% for k, v in relays.json['sorted']['family'].items()|sort(attribute=sorted_by, reverse=True) %}
+ {% if relays.json['relays'][v['relays'][0]]['fingerprint'] not in processed %}
+ <tr>
+ {% if v['bandwidth'] > 1000000 %}
+ {% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000000)|round(2, 'common'), 'MB/s') %}
+ {% else %}
+ {% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000)|round(2, 'common'), 'KB/s') %}{% endif %}
+
+ <td><code><a href="{{ path_prefix}}family/{{ k|escape }}/">{{ k|escape }}</a></code></td>
+
+ <td>{{ obs_bandwidth }}</td>
+
+ {% if v['contact'] %}
+ <td class="visible-md visible-lg"><code><a href="{{ path_prefix }}contact/{{ v['contact']|hash }}/" title="{{ v['contact']|escape }}">{{ v['contact']|truncate(50)|escape }}<a></td></code>
+ {% else %}
+ <td>none</td>{% endif %}
+
+ <td>{{ v['exit_count'] }} / {{ v['middle_count'] }}</td>
+
+ <td><a href="{{ path_prefix }}first_seen/{{ v['first_seen'].split(' ', 1)[0]|escape }}">{{ v['first_seen'].split(' ', 1)[0]|escape }}</a></td>
+
+ {% for r in v['relays'] %}
+ {% set _dummy = processed.update({relays.json['relay_subset'][r]['fingerprint']: None}) %}
+ {% endfor %}
+ </tr>
+ {% endif %}
+ {% endfor %}
+ </tbody>
+</table>
+{% endblock %}
diff --git a/allium/templates/misc-networks.html b/allium/templates/misc-networks.html
new file mode 100644
index 0000000..2eeabb1
--- /dev/null
+++ b/allium/templates/misc-networks.html
@@ -0,0 +1,54 @@
+{% extends "skeleton.html" %}
+{% set sorted_by_label = sorted_by.split(',')[0].split('.')[1] %}
+{% block title %}Tor Relays :: Networks By {{ sorted_by_label|replace('_', ' ')|title }}{% endblock %}
+{% block body %}
+<h2><a href={{ path_prefix }}>Home</a> :: Networks By {{ sorted_by_label|replace('_', ' ')|title }}</h2>
+<p>The set of all ({{ relays.json['sorted']['as']|length }}) recognized networks running at least one relay sorted by {{ sorted_by_label|replace('_', ' ') }}. This data is onionoo-derived and might be out of date with respect to other sources.</p>
+<table class="table table-condensed">
+ <tr>
+ <th>AS Number</th>
+ <th>AS Name</th>
+ <th>Country</th>
+ {% if sorted_by_label == 'bandwidth' %}
+ <th>Bandwidth</th>
+ {% else %}
+ <th><a href="networks-by-bandwidth.html">Bandwidth</a></th>
+ {% endif %}
+ {% if sorted_by_label == 'exit_count' %}
+ <th>Exit / <a href="networks-by-middle-count.html">Middle</a></th>
+ {% elif sorted_by_label == 'middle_count' %}
+ <th><a href="networks-by-exit-count.html">Exit</a> / Middle</th>
+ {% else %}
+ <th><a href="networks-by-exit-count.html">Exit</a> / <a href="families-by-middle-count.html">Middle</a></th>
+ {% endif %}
+ </tr>
+ <tbody>
+ {% for k, v in relays.json['sorted']['as'].items()|sort(attribute=sorted_by, reverse=True) %}
+ <tr>
+ {% if v['bandwidth'] > 1000000 %}
+ {% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000000)|round(2, 'common'), 'MB/s') %}
+ {% else %}
+ {% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000)|round(2, 'common'), 'KB/s') %}{% endif %}
+
+ <td><a href="{{ path_prefix}}as/{{ k|escape }}/">{{ k|escape }}</a></td>
+
+ {% if v['as_name'] %}
+ <td title="{{ v['as_name']|escape }}"><a href="https://bgp.he.net/{{ k|escape }}">{{ v['as_name']|truncate(20)|escape }}</a></td>
+ {% else %}
+ <td>Unknown</td>
+ {% endif %}
+
+ {% if v['country'] %}
+ <td><a href="{{ path_prefix }}country/{{ v['country']|escape }}/"><img src="{{ path_prefix }}static/images/cc/{{ v['country']|escape }}.png" title="{{ v['country_name']|escape }}"alt="{{ v['country_name']|escape }}"></a></td>
+ {% else %}
+ <td>X</td>
+ {% endif %}
+
+ <td>{{ obs_bandwidth }}</td>
+
+ <td>{{ v['exit_count'] }} / {{ v['middle_count'] }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% endblock %}
diff --git a/allium/templates/platform.html b/allium/templates/platform.html
new file mode 100644
index 0000000..b2832fd
--- /dev/null
+++ b/allium/templates/platform.html
@@ -0,0 +1,5 @@
+{% extends "relay-list.html" %}
+{% set platform = relays.json['relay_subset'][0]['platform']|escape %}
+{% block title %}Tor Relays :: {{ platform }}{% endblock %}
+{% block header %}<a href="../../">Home</a> :: {{ platform }}{% endblock %}
+{% block description %}{{ platform }} systems are responsible for ~{{ bandwidth }} MB/s of traffic, with {% if middle_count > 0 %}{{ middle_count }} middle relay{% if middle_count > 1 %}s{% endif %}{% if exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count }} exit relay{% if exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
diff --git a/allium/templates/relay-info.html b/allium/templates/relay-info.html
new file mode 100644
index 0000000..f46d585
--- /dev/null
+++ b/allium/templates/relay-info.html
@@ -0,0 +1,176 @@
+{% extends "skeleton.html" %}
+{% block title %}Tor Relays :: {{ relay['nickname'] }}{% endblock %}
+{% block body %}
+<div id="content">
+<h2><a href="{{ path_prefix }}">Home</a> :: Relay "{{ relay['nickname'] }}"</h2>
+<div class="row">
+ <div class="col-md-6">
+ <dl>
+ <dt>Nickname</dt>
+ <dd>{{ relay['nickname']|escape }}</dd>
+
+ <dt>OR Address</dt>
+ <dd><pre class="pre-scrollable">{% for address in relay['or_addresses'] -%}
+ {{ address }}
+ {% endfor -%}
+ </pre></dd>
+
+ <dt>Contact</dt>
+ {% if relay['contact'] %}
+ <dd><a href="{{ path_prefix }}contact/{{ relay['contact']|hash }}">{{ relay['contact']|escape }}</a></dd>
+ {% else %}
+ <dd><a href="{{ path_prefix }}contact/{{ ''|hash }}">none</a></dd>
+ {% endif %}
+
+ <dt>Dir Address</dt>
+ {% if relay['dir_address'] %}
+ <dd><a href="http://{{ relay['dir_address']|escape }}">{{ relay['dir_address']|escape }}</a></dd>
+ {% else %}
+ <dd>none</dd>
+ {% endif %}
+
+ <dt>Exit Address</dt>
+ {% if relay['exit_address'] %}
+ <dd>{{ relay['exit_address']|escape }}</dd>
+ {% else %}
+ <dd>none</dd>
+ {% endif %}
+
+ <dt>Observed Bandwidth</dt>
+ {% if relay['observed_bandwidth'] > 1000000 %}
+ {% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth'] / 1000000)|round(2, 'common'), 'MB/s') %}
+ {% else %}
+ {% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth'] / 1000)|round(2, 'common'), 'KB/s') %}{% endif %}
+ <dd>{{ obs_bandwidth }}</dd>
+
+ <dt>IPv4 Exit Policy Summary</dt>
+ <dd>
+ {% if relay['exit_policy_summary'] -%}
+ {%- set v4_summary = relay['exit_policy_summary'].items() -%}
+ <pre class="pre-scrollable">{% for k, v in v4_summary -%}
+ {{ k|escape }}: {{ '\n ' + v|join('\n ')|escape }}
+ {% endfor -%}
+ </pre>
+ {% else -%}
+ <pre>none</pre>
+ {% endif -%}
+ </dd>
+
+ <dt>IPv6 Exit Policy Summary</dt>
+ <dd>
+ {% if relay['exit_policy_v6_summary'] -%}
+ {%- set v6_summary = relay['exit_policy_v6_summary'].items() -%}
+ <pre class="pre-scrollable">{% for k, v in v6_summary -%}
+ {{ k|escape }}: {{ '\n ' + v|join('\n ')|escape }}
+ {% endfor -%}
+ </pre>
+ {% else -%}
+ <pre>none</pre>
+ {% endif -%}
+ </dd>
+
+ <dt>Exit Policy</dt>
+ <dd><pre class="pre-scrollable">{% for policy in relay['exit_policy'] -%}
+ {{ policy|escape }}
+ {% endfor -%}
+ </pre></dd>
+
+ {% if relay['effective_family']|length > 1 -%}
+ <dt>Effective Family Members (<a href="{{ path_prefix }}family/{{ relay['fingerprint']|escape }}">view</a>)</dt>
+ {% else %}
+ <dt>Effective Family Members</dt>
+ {% endif %}
+ <dd><pre class="pre-scrollable">{% for e_relay in relay['effective_family'] -%}
+ {% if relay['effective_family']|length > 1 -%}
+ <a href="{{ e_relay|escape }}.html">{{ e_relay|escape }}</a>
+ {% else -%}
+ {{ e_relay|escape }}
+ {% endif -%}
+ {% endfor -%}
+ </pre></dd>
+
+ <dt>Alleged Family Members</dt>
+ <dd>
+ {% if relay['alleged_family'] %}
+ <pre class="pre-scrollable">{% for a_relay in relay['alleged_family'] -%}
+ {% if relay['alleged_family']|length > 1 -%}
+ <a href="{{ a_relay|escape }}.html">{{ a_relay|escape }}</a>
+ {% else -%}
+ {{ a_relay|escape }}
+ {% endif -%}
+ {% endfor %}
+ {% else -%}
+ <pre class="pre-scrollable">none
+ {% endif -%}
+ </pre></dd>
+ </dl>
+ </div>
+ <div class="col-md-6">
+ <dl>
+ <dt>Fingerprint</dt>
+ <dd><pre>{{ relay['fingerprint']|escape }}</pre></dd>
+
+ <dt>Flags</dt>
+ <dd>
+ {% for flag in relay['flags'] %}
+ {% if flag != 'StaleDesc' %}
+ <a href="{{ path_prefix }}flag/{{ flag.lower()|escape }}"><img src="{{ path_prefix}}static/images/flags/{{ flag.lower()|escape }}.png" title="{{ flag|escape }}" alt="{{ flag|escape }}"></a> {{ flag|escape }}
+ {% endif %}
+ {% endfor %}
+ </dd>
+
+ <dt>Host Name</dt>
+ <dd>
+ {% if relay['verified_host_names'] -%}
+ <pre class="verified-hostname" title="verified hostname">{{ relay['verified_host_names']|join('\n')|escape }}</pre>
+ {% elif relay['unverified_host_names'] -%}
+ <pre class="unverified-hostname" title="unverified hostname">{{ relay['unverified_host_names']|join('\n')|escape }}</pre>
+ {% else -%}
+ <pre>none</pre>
+ {% endif -%}
+
+ <dt>Country</dt>
+ <dd>
+ {% if relay['country'] -%}
+ <a href="{{ path_prefix }}country/{{ relay['country']|escape }}/"><img src="{{ path_prefix }}static/images/cc/{{ relay['country']|escape }}.png" title="{{ relay['country_name']|escape }}" alt="{{ relay['country_name']|escape }}"></a> {{ relay['country_name']|escape }}
+ {% else -%}
+ unknown
+ {% endif %}
+ </dd>
+
+ <dt>AS Number</dt>
+ <dd>
+ {% if relay['as'] %}
+ <a href='{{ path_prefix }}as/{{ relay['as']|escape }}'>{{ relay['as']|escape }}</a>
+ {% else %}
+ unknown
+ {% endif %}
+
+ <dt>AS Name</dt>
+ <dd>
+ {% if relay['as_name'] -%}
+ {{ relay['as_name']|escape }} (<a href='https://bgp.he.net/{{ relay['as']|escape }}'>BGP</a>)
+ {% else -%}
+ unknown
+ {% endif -%}
+
+ <dt>First Seen</dt>
+ <dd><a href="{{ path_prefix }}first_seen/{{ relay['first_seen'].split(' ', 1)[0]|escape }}">{{ relay['first_seen']|escape }}</a></dd>
+
+ <dt>Last Restarted</dt>
+ <dd>{{ relay['last_restarted']|escape }}</dd>
+
+ <dt>Consensus Weight</dt>
+ <dd>{{ relay['consensus_weight_fraction']|escape }} ({{ relay['consensus_weight']|escape }})</dd>
+
+ <dt>Platform</dt>
+ <dd>
+ <a href='{{ path_prefix}}platform/{{ relay['platform']|escape }}'>{{
+ relay['platform'] }}</a>
+ </dd>
+
+ </dl>
+ </div>
+</div>
+</div>
+{% endblock %}
diff --git a/allium/templates/relay-list.html b/allium/templates/relay-list.html
new file mode 100644
index 0000000..dca3d9a
--- /dev/null
+++ b/allium/templates/relay-list.html
@@ -0,0 +1,97 @@
+{% extends "skeleton.html" %}
+{% block title %}Tor Relays{% endblock %}
+{% block body %}
+<h2>{% block header %}{% endblock %}</h2>
+<p>{% block description %}{% endblock %}</p>
+<table class="table table-condensed">
+ <tr>
+ <th></th>
+ <th>Nickname</th>
+ <th></th>
+ <th>Bandwidth</th>
+ <th class="visible-md visible-lg">IP Address</th>
+ <th>AS Number</th>
+ <th>AS Name</th>
+ <th>Country</th>
+ <th>Platform</th>
+ <th>Flags</th>
+ <th class="visible-md visible-lg">First Seen</th>
+ </tr>
+ <tbody>
+ {% if is_index %}{% set relay_list = relays.json['relay_subset'][:500] %}
+ {% else %}{% set relay_list = relays.json['relay_subset'] %}{% endif %}
+ {% for relay in relay_list %}
+ <tr>
+ {% if relay['observed_bandwidth'] > 1000000 %}
+ {% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth'] / 1000000)|round(2, 'common'), 'MB/s') %}
+ {% else %}
+ {% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth'] / 1000)|round(2, 'common'), 'KB/s') %}{% endif %}
+
+ {% if relay['running'] %}
+ <td><span class="circle circle-online" title="This relay is online"></span></td>
+ {% else %}
+ <td><span class="circle circle-offline" title="This relay is offline"></span></td>
+ {% endif %}
+
+ {% if relay['effective_family']|length > 1 %}
+ <td title="{{ relay['nickname']|escape }}"><a href="{{ path_prefix }}relay/{{ relay['fingerprint']|escape }}.html">{{ relay['nickname']|truncate(10)|escape }}</a> (<a href="{{ path_prefix }}family/{{ relay['fingerprint']|escape }}/">{{ relay['effective_family']|length }}</a>)</td>
+ {% else %}
+ <td title="{{ relay['nickname']|escape }}"><a href="{{ path_prefix}}relay/{{ relay['fingerprint']|escape }}.html">{{ relay['nickname']|truncate(15)|escape }}</a></td>
+ {% endif %}
+
+ {% if key != 'contact' %}
+ {% if relay['contact'] %}
+ <td><a href="{{ path_prefix }}contact/{{ relay['contact']|hash }}/" title="{{ relay['contact']|escape }}">&#9993;</a></td>
+ {% else %}
+ <td title="none">&#9993;</td>
+ {% endif %}
+ {% else %}
+ <td title="{{ relay['contact']|escape }}">&#9993;</td>
+ {% endif %}
+
+ <td>{{ obs_bandwidth }}</td>
+
+ <td class="visible-md visible-lg"><a href="https://bgp.he.net/ip/{{ relay['or_addresses'][0].split(':', 1)[0]|escape }}">{{ relay['or_addresses'][0].split(':', 1)[0]|escape }}</a></td>
+
+ {% if relay['as'] %}{% if key != 'as' %}
+ <td><a href="{{ path_prefix }}as/{{ relay['as']|escape }}/">{{ relay['as']|escape }}</a></td>
+ {% else %}
+ <td>{{ relay['as']|escape }}</td>
+ {% endif %}
+ {% else %}
+ <td>Unknown</td>
+ {% endif %}
+
+ {% if relay['as_name'] %}
+ <td><a href="https://bgp.he.net/{{ relay['as']|escape }}" title="{{ relay['as_name']|escape }}">{{ relay['as_name']|escape|truncate(length=20) }}</a></td>
+ {% else %}
+ <td>Unknown</td>
+ {% endif %}
+
+ {% if relay['country'] %}{% if key != 'country' %}
+ <td><a href="{{ path_prefix }}country/{{ relay['country']|escape }}/"><img src="{{ path_prefix }}static/images/cc/{{ relay['country']|escape }}.png" title="{{ relay['country_name']|escape }}" alt="{{ relay['country_name']|escape }}"></a></td>
+ {% else %}
+ <td><img src="{{ path_prefix }}static/images/cc/{{ relay['country']|escape }}.png" title="{{ relay['country_name']|escape }}" alt="{{ relay['country_name']|escape }}"></td>
+ {% endif %}
+ {% else %}
+ <td>X</td>
+ {% endif %}
+
+ {% if key != 'platform' %}
+ <td><a href="{{ path_prefix }}platform/{{ relay['platform']|escape }}/">{{ relay['platform']|truncate(length=10)|escape }}</a></td>
+ {% else %}
+ <td>{{ relay['platform']|truncate(length=10)|escape }}</td>
+ {% endif %}
+
+ <td>{% for flag in relay['flags'] %}{% if flag != 'StaleDesc' %}<a href="{{ path_prefix }}flag/{{ flag.lower()|escape }}"><img src="{{ path_prefix}}static/images/flags/{{ flag.lower()|escape }}.png" title="{{ flag|escape }}" alt="{{ flag|escape }}"></a> {% endif %}{% endfor %}</td>
+
+ {% if key != 'first_seen' %}
+ <td class="visible-md visible-lg"><a href="{{ path_prefix }}first_seen/{{ relay['first_seen'].split(' ', 1)[0]|escape }}">{{ relay['first_seen'].split(' ', 1)[0]|escape }}</a></td>
+ {% else %}
+ <td class="visible-md visible-lg">{{ relay['first_seen'].split(' ', 1)[0]|escape }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% endblock %}
diff --git a/allium/templates/skeleton.html b/allium/templates/skeleton.html
new file mode 100644
index 0000000..f6b4a82
--- /dev/null
+++ b/allium/templates/skeleton.html
@@ -0,0 +1,56 @@
+{% block head %}
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>{% block title %}{% endblock %}</title>
+ <meta name="description" content="Javascript-free Tor metrics generated from an hourly API request.">
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" href="{{ path_prefix }}static/css/bootstrap.min.css">
+ <!--source: metrics.torproject.org-->
+ <style>
+ .circle {
+ display: inline-block;
+ vertical-align: middle;
+ background: #999999;
+ width: 7px;
+ height: 7px;
+ -moz-border-radius: 50%;
+ -webkit-border-radius: 50%;
+ border-radius: 50%;
+ }
+
+ .circle-online {
+ background: #25d918;
+ }
+
+ .circle-offline {
+ background: #ff1515;
+ }
+ .verified-hostname {
+ color: #FE9F30;
+ }
+ .verified-hostname {
+ color: #68b030;
+ }
+ .unverified-hostname {
+ color: #FE9F30;
+ }
+ </style>
+</head>
+{% endblock %}
+<body>
+<div class="container">
+{% block body %}
+{% endblock %}
+</div>
+</body>
+{% block footer %}
+<footer class="page-footer font-small">
+<div class="footer-copyright text-center text-muted">
+<p>generated by <a href="https://git.jordan.im/allium">allium</a> on
+{{ relays.timestamp }}</p>
+</div>
+</footer>
+</html>
+{% endblock %}