From 3af4f2023be71ec0fb6ec564515dcaae6a9947a8 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sun, 20 Sep 2020 23:40:16 -0700 Subject: improve readability of templates (as much as one can) --- allium/templates/all.html | 4 +- allium/templates/as.html | 6 +- allium/templates/contact.html | 9 +- allium/templates/country.html | 6 +- allium/templates/family.html | 10 +- allium/templates/first_seen.html | 6 +- allium/templates/flag.html | 9 +- allium/templates/index.html | 11 +- allium/templates/misc-families.html | 135 ++++++++------ allium/templates/misc-networks.html | 109 ++++++----- allium/templates/platform.html | 6 +- allium/templates/relay-info.html | 358 +++++++++++++++++++----------------- allium/templates/relay-list.html | 197 +++++++++++--------- allium/templates/skeleton.html | 3 +- 14 files changed, 494 insertions(+), 375 deletions(-) (limited to 'allium') diff --git a/allium/templates/all.html b/allium/templates/all.html index ef6c64a..7d63705 100644 --- a/allium/templates/all.html +++ b/allium/templates/all.html @@ -2,5 +2,7 @@ {% set relay_count = relays.json['relays']|length %} {% block title %}Tor Relays :: All{% endblock %} {% block header %}Home :: All Relays{% endblock %} -{% block description %}All known (non-guard) relays, {{ relay_count }} in total. A smaller browser-friendly subset (top 500) is available here.{% endblock %} +{% block description %}All known (non-guard) relays, {{ relay_count }} in total. +A smaller browser-friendly subset (top 500) is available +here.{% endblock %} diff --git a/allium/templates/as.html b/allium/templates/as.html index 41abcef..3b62b1e 100644 --- a/allium/templates/as.html +++ b/allium/templates/as.html @@ -3,4 +3,8 @@ {% set as_name = relays.json['relay_subset'][0]['as_name']|escape %} {% block title %}Tor Relays :: {{ as_number }}{% endblock %} {% block header %}Home :: {{ 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 %} +{% 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 index 10bfd93..ed10631 100644 --- a/allium/templates/contact.html +++ b/allium/templates/contact.html @@ -7,5 +7,10 @@ {% set contact_hash = ''|hash %} {% endif %} {% block title %}Tor Relays :: Contact {{ contact_hash }}{% endblock %} -{% block header %}Home :: Contact {{ contact_hash }}{% endblock %} -{% block description %}Relays with contact info {{ contact }} 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 %} +{% block header %}Home :: Contact {{ contact_hash }}{% +endblock %} +{% block description %}Relays with contact info {{ contact }} 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 index ab55af3..77c3d51 100644 --- a/allium/templates/country.html +++ b/allium/templates/country.html @@ -8,4 +8,8 @@ {% endif %} {% block title %}Tor Relays :: {{ country_orig }}{% endblock %} {% block header %}Home :: {{ 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 %} +{% 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 index b4d88d8..454ca21 100644 --- a/allium/templates/family.html +++ b/allium/templates/family.html @@ -1,4 +1,10 @@ {% extends "relay-list.html" %} {% block title %}Tor Relays :: Family {{ value|escape }}{% endblock %} -{% block header %}Home :: Family {{ value|escape }}{% endblock %} -{% block description %}Relays with effective family member {{ value|escape }} 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 %} +{% block header %}Home :: Family {{ value|escape +}}{% endblock %} +{% block description %}Relays with effective family member {{ value|escape +}} 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 index 9b40362..374760a 100644 --- a/allium/templates/first_seen.html +++ b/allium/templates/first_seen.html @@ -1,4 +1,8 @@ {% extends "relay-list.html" %} {% block title %}Tor Relays :: {{ value }}{% endblock %} {% block header %}Home :: {{ 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 %} +{% 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 index 875c494..e174af4 100644 --- a/allium/templates/flag.html +++ b/allium/templates/flag.html @@ -1,4 +1,9 @@ {% extends "relay-list.html" %} {% block title %}Tor Relays :: {{ value|escape }} Relays{% endblock %} -{% block header %}Home :: {{ 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 %} +{% block header %}Home :: {{ 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 index e67a366..224d736 100644 --- a/allium/templates/index.html +++ b/allium/templates/index.html @@ -1,5 +1,10 @@ {% extends "relay-list.html" %} {% block title %}Tor Relays{% endblock %} -{% block header %}Allium (v3, git) :: Networks, Families{% endblock %} -{% block description %}Relay listings are statically generated every hour. Last fetch was at {{ relays.timestamp }}. Listing top 500 relays; view full list.{% endblock %} - +{% block header %}Allium (v3, +git) :: Networks, Families{% endblock %} +{% block description %}Relay listings are statically generated every hour. Last +fetch was at {{ relays.timestamp }}. Listing top 500 relays; view full list.{% endblock %} diff --git a/allium/templates/misc-families.html b/allium/templates/misc-families.html index 7eb2de2..6073a49 100644 --- a/allium/templates/misc-families.html +++ b/allium/templates/misc-families.html @@ -1,60 +1,79 @@ -{% 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 %} -

Home :: Families By {{ sorted_by_label|replace('_', ' ')|title }}

-

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.

+{% 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 -%} +

Home :: Families By {{ +sorted_by_label|replace('_', ' ')|title }}

+

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.

- - - {% if sorted_by_label == 'bandwidth' %} - - {% else %} - - {% endif %} - - {% if sorted_by_label == 'exit_count' %} - - {% elif sorted_by_label == 'middle_count' %} - - {% else %} - - {% endif %} - {% if sorted_by_label == 'first_seen' %} - - {% else %} - - {% endif %} - - - {% 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 %} - - {% 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 %} - - - - - - {% if v['contact'] %} - - {% else %} - {% endif %} - - - - - - {% for r in v['relays'] %} - {% set _dummy = processed.update({relays.json['relay_subset'][r]['fingerprint']: None}) %} - {% endfor %} - - {% endif %} - {% endfor %} - + + + +{% if sorted_by_label == 'bandwidth' -%} + +{% else -%} + +{% endif -%} + + + +{% if sorted_by_label == 'exit_count' -%} + +{% elif sorted_by_label == 'middle_count' -%} + +{% else -%} + +{% endif -%} + +{% if sorted_by_label == 'first_seen' -%} + +{% else -%} + +{% endif -%} + + + +{% 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 -%} + +{% 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 -%} + + + + + +{% if v['contact'] -%} + +{% else -%} + +{% endif -%} + + + + + +{% for r in v['relays'] -%} +{% set _dummy = processed.update({relays.json['relay_subset'][r]['fingerprint']: +None}) -%} +{% endfor -%} + +{% endif -%} +{% endfor -%} +
FamilyBandwidthBandwidthContactExit / MiddleExit / MiddleExit / MiddleFirst SeenFirst Seen
{{ k|escape }}{{ obs_bandwidth }}{{ v['contact']|truncate(50)|escape }}none{{ v['exit_count'] }} / {{ v['middle_count'] }}{{ v['first_seen'].split(' ', 1)[0]|escape }}
FamilyBandwidthBandwidthContactExit / MiddleExit / MiddleExit / MiddleFirst SeenFirst Seen
{{ k|escape +}}{{ obs_bandwidth }}{{ +v['contact']|truncate(50)|escape }}none{{ v['exit_count'] }} / {{ v['middle_count'] }}{{ v['first_seen'].split(' ', 1)[0]|escape }}
-{% endblock %} +{% endblock -%} diff --git a/allium/templates/misc-networks.html b/allium/templates/misc-networks.html index 2eeabb1..c6f1191 100644 --- a/allium/templates/misc-networks.html +++ b/allium/templates/misc-networks.html @@ -1,54 +1,69 @@ -{% 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 %} -

Home :: Networks By {{ sorted_by_label|replace('_', ' ')|title }}

-

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.

+{% 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 -%} +

Home :: Networks By {{ +sorted_by_label|replace('_', ' ')|title }}

+

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.

- - - - - {% if sorted_by_label == 'bandwidth' %} - - {% else %} - - {% endif %} - {% if sorted_by_label == 'exit_count' %} - - {% elif sorted_by_label == 'middle_count' %} - - {% else %} - - {% endif %} - - - {% for k, v in relays.json['sorted']['as'].items()|sort(attribute=sorted_by, reverse=True) %} - - {% 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 %} + + + + +{% if sorted_by_label == 'bandwidth' -%} + +{% else -%} + +{% endif -%} - +{% if sorted_by_label == 'exit_count' -%} + +{% elif sorted_by_label == 'middle_count' -%} + +{% else -%} + +{% endif -%} + - {% if v['as_name'] %} - - {% else %} - - {% endif %} + +{% for k, v in relays.json['sorted']['as'].items()|sort(attribute=sorted_by, +reverse=True) -%} + +{% 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 -%} - {% if v['country'] %} - - {% else %} - - {% endif %} + - +{% if v['as_name'] -%} + +{% else -%} + +{% endif -%} - - - {% endfor %} - +{% if v['country'] -%} + +{% else -%} + +{% endif -%} + + + + + +{% endfor -%} +
AS NumberAS NameCountryBandwidthBandwidthExit / MiddleExit / MiddleExit / Middle
AS NumberAS NameCountryBandwidthBandwidth{{ k|escape }}Exit / MiddleExit / MiddleExit / Middle
{{ v['as_name']|truncate(20)|escape }}Unknown
{{ v['country_name']|escape }}X{{ k|escape }}{{ obs_bandwidth }}{{ v['as_name']|truncate(20)|escape }}Unknown{{ v['exit_count'] }} / {{ v['middle_count'] }}
{{ v['country_name']|escape
+}}X{{ obs_bandwidth }}{{ v['exit_count'] }} / {{ v['middle_count'] }}
-{% endblock %} +{% endblock -%} diff --git a/allium/templates/platform.html b/allium/templates/platform.html index b2832fd..4f6d941 100644 --- a/allium/templates/platform.html +++ b/allium/templates/platform.html @@ -2,4 +2,8 @@ {% set platform = relays.json['relay_subset'][0]['platform']|escape %} {% block title %}Tor Relays :: {{ platform }}{% endblock %} {% block header %}Home :: {{ 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 %} +{% 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 index f46d585..d26dab3 100644 --- a/allium/templates/relay-info.html +++ b/allium/templates/relay-info.html @@ -1,176 +1,192 @@ -{% extends "skeleton.html" %} -{% block title %}Tor Relays :: {{ relay['nickname'] }}{% endblock %} -{% block body %} +{% extends "skeleton.html" -%} +{% block title -%}Tor Relays :: {{ relay['nickname'] }}{% endblock -%} +{% block body -%}

Home :: Relay "{{ relay['nickname'] }}"

-
-
-
Nickname
-
{{ relay['nickname']|escape }}
- -
OR Address
-
{% for address in relay['or_addresses'] -%}
-                {{ address }}
-            {% endfor -%}
-            
- -
Contact
- {% if relay['contact'] %} -
{{ relay['contact']|escape }}
- {% else %} -
none
- {% endif %} - -
Dir Address
- {% if relay['dir_address'] %} -
{{ relay['dir_address']|escape }}
- {% else %} -
none
- {% endif %} - -
Exit Address
- {% if relay['exit_address'] %} -
{{ relay['exit_address']|escape }}
- {% else %} -
none
- {% endif %} - -
Observed Bandwidth
- {% 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 %} -
{{ obs_bandwidth }}
- -
IPv4 Exit Policy Summary
-
- {% if relay['exit_policy_summary'] -%} - {%- set v4_summary = relay['exit_policy_summary'].items() -%} -
{% for k, v in v4_summary -%}
-                    {{ k|escape }}: {{ '\n  ' + v|join('\n  ')|escape }}
-                {% endfor -%}
-                
- {% else -%} -
none
- {% endif -%} -
- -
IPv6 Exit Policy Summary
-
- {% if relay['exit_policy_v6_summary'] -%} - {%- set v6_summary = relay['exit_policy_v6_summary'].items() -%} -
{% for k, v in v6_summary -%}
-                    {{ k|escape }}: {{ '\n  ' + v|join('\n  ')|escape }}
-                {% endfor -%}
-                
- {% else -%} -
none
- {% endif -%} -
- -
Exit Policy
-
{% for policy in relay['exit_policy'] -%}
-                {{ policy|escape }}
-            {% endfor -%}
-            
- - {% if relay['effective_family']|length > 1 -%} -
Effective Family Members (view)
- {% else %} -
Effective Family Members
- {% endif %} -
{% for e_relay in relay['effective_family'] -%}
-                {% if relay['effective_family']|length > 1 -%}
-                {{ e_relay|escape }}
-                {% else -%}
-                {{ e_relay|escape }}
-                {% endif -%}
-            {% endfor -%}
-            
- -
Alleged Family Members
-
- {% if relay['alleged_family'] %} -
{% for a_relay in relay['alleged_family'] -%}
-                    {% if relay['alleged_family']|length > 1 -%}
-                    {{ a_relay|escape }}
-                    {% else -%}
-                    {{ a_relay|escape }}
-                    {% endif -%}
-                {% endfor %}
-            {% else -%}
-                
none
-            {% endif -%}
-            
-
-
-
-
-
Fingerprint
-
{{ relay['fingerprint']|escape }}
- -
Flags
-
- {% for flag in relay['flags'] %} - {% if flag != 'StaleDesc' %} - {{ flag|escape }} {{ flag|escape }} - {% endif %} - {% endfor %} -
- -
Host Name
-
- {% if relay['verified_host_names'] -%} -
{{ relay['verified_host_names']|join('\n')|escape }}
- {% elif relay['unverified_host_names'] -%} -
{{ relay['unverified_host_names']|join('\n')|escape }}
- {% else -%} -
none
- {% endif -%} - -
Country
-
- {% if relay['country'] -%} - {{ relay['country_name']|escape }} {{ relay['country_name']|escape }} - {% else -%} - unknown - {% endif %} -
- -
AS Number
-
- {% if relay['as'] %} - {{ relay['as']|escape }} - {% else %} - unknown - {% endif %} - -
AS Name
-
- {% if relay['as_name'] -%} - {{ relay['as_name']|escape }} (BGP) - {% else -%} - unknown - {% endif -%} - -
First Seen
-
{{ relay['first_seen']|escape }}
- -
Last Restarted
-
{{ relay['last_restarted']|escape }}
- -
Consensus Weight
-
{{ relay['consensus_weight_fraction']|escape }} ({{ relay['consensus_weight']|escape }})
- -
Platform
-
- {{ - relay['platform'] }} -
- -
-
+
+
+
Nickname
+
{{ relay['nickname']|escape }}
+ +
OR Address
+
{% for address in relay['or_addresses'] -%}
+{{ address }}
+{% endfor -%}
+
+ +
Contact
+{% if relay['contact'] -%} +
{{ +relay['contact']|escape }}
+{% else -%} +
none
+{% endif -%} + +
Dir Address
+{% if relay['dir_address'] -%} +
{{ +relay['dir_address']|escape }}
+{% else -%} +
none
+{% endif -%} + +
Exit Address
+{% if relay['exit_address'] -%} +
{{ relay['exit_address']|escape }}
+{% else -%} +
none
+{% endif -%} + +
Observed Bandwidth
+{% 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 -%} +
{{ obs_bandwidth }}
+ +
IPv4 Exit Policy Summary
+
+{% if relay['exit_policy_summary'] -%} +{%- set v4_summary = relay['exit_policy_summary'].items() -%} +
{% for k, v in v4_summary -%}
+{{ k|escape }}: {{ '\n  ' + v|join('\n  ')|escape }}
+{% endfor -%}
+
+{% else -%} +
none
+{% endif -%} +
+ +
IPv6 Exit Policy Summary
+
+{% if relay['exit_policy_v6_summary'] -%} +{%- set v6_summary = relay['exit_policy_v6_summary'].items() -%} +
{% for k, v in v6_summary -%}
+{{ k|escape }}: {{ '\n  ' + v|join('\n  ')|escape }}
+{% endfor -%}
+
+{% else -%} +
none
+{% endif -%} +
+ +
Exit Policy
+
{% for policy in relay['exit_policy'] -%}
+{{ policy|escape }}
+{% endfor -%}
+
+ +{% if relay['effective_family']|length > 1 -%} +
Effective Family Members (view)
+{% else -%} +
Effective Family Members
+{% endif -%} +
{% for e_relay in relay['effective_family'] -%}
+{% if relay['effective_family']|length > 1 -%}
+{{ e_relay|escape }}
+{% else -%}
+{{ e_relay|escape }}
+{% endif -%}
+{% endfor -%}
+
+ +
Alleged Family Members
+
+{% if relay['alleged_family'] -%} +
{% for a_relay in relay['alleged_family'] -%}
+{% if relay['alleged_family']|length > 1 -%}
+{{ a_relay|escape }}
+{% else -%}
+{{ a_relay|escape }}
+{% endif -%}
+{% endfor -%}
+{% else -%}
+
none
+{% endif -%}
+
+
+
+
+
Fingerprint
+
{{ relay['fingerprint']|escape }}
+ +
Flags
+
+{% for flag in relay['flags'] -%} +{% if flag != 'StaleDesc' -%} +{{ flag|escape }} {{ flag|escape }} +{% endif -%} +{% endfor -%} +
+ +
Host Name
+
+{% if relay['verified_host_names'] -%} +
{{
+relay['verified_host_names']|join('\n')|escape }}
+{% elif relay['unverified_host_names'] -%} +
{{
+relay['unverified_host_names']|join('\n')|escape }}
+{% else -%} +
none
+{% endif -%} + +
Country
+
+{% if relay['country'] -%} +{{ relay['country_name']|escape
+}} {{ relay['country_name']|escape }} +{% else -%} +unknown +{% endif -%} +
+ +
AS Number
+
+{% if relay['as'] -%} +{{ relay['as']|escape +}} +{% else -%} +unknown +{% endif -%} + +
AS Name
+
+{% if relay['as_name'] -%} +{{ relay['as_name']|escape }} (BGP) +{% else -%} +unknown +{% endif -%} + +
First Seen
+
{{ relay['first_seen']|escape }}
+ +
Last Restarted
+
{{ relay['last_restarted']|escape }}
+ +
Consensus Weight
+
{{ relay['consensus_weight_fraction']|escape }} ({{ +relay['consensus_weight']|escape }})
+ +
Platform
+
+{{ +relay['platform'] }} +
+ +
-{% endblock %} +
+
+{% endblock -%} diff --git a/allium/templates/relay-list.html b/allium/templates/relay-list.html index dca3d9a..d312af9 100644 --- a/allium/templates/relay-list.html +++ b/allium/templates/relay-list.html @@ -1,97 +1,126 @@ -{% extends "skeleton.html" %} -{% block title %}Tor Relays{% endblock %} -{% block body %} -

{% block header %}{% endblock %}

-

{% block description %}{% endblock %}

+{% extends "skeleton.html" -%} +{% block title -%}Tor Relays{% endblock -%} +{% block body -%} +

{% block header -%}{% endblock -%}

+

{% block description -%}{% endblock -%}

- - - - - - - - - - - - - - - {% 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 %} - - {% 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 is_index -%}{% set relay_list = relays.json['relay_subset'][:500] -%} +{% else -%}{% set relay_list = relays.json['relay_subset'] -%}{% endif -%} +{% for relay in relay_list -%} + +{% 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'] %} - - {% else %} - - {% endif %} +{% if relay['running'] -%} + +{% else -%} + +{% endif -%} - {% if relay['effective_family']|length > 1 %} - - {% else %} - - {% endif %} +{% if relay['effective_family']|length > 1 -%} + +{% else -%} + +{% endif -%} - {% if key != 'contact' %} - {% if relay['contact'] %} - - {% else %} - - {% endif %} - {% else %} - - {% endif %} +{% if key != 'contact' -%} +{% if relay['contact'] -%} + +{% else -%} + +{% endif -%} +{% else -%} + +{% endif -%} - + - + - {% if relay['as'] %}{% if key != 'as' %} - - {% else %} - - {% endif %} - {% else %} - - {% endif %} +{% if relay['as'] -%} +{% if key != 'as' -%} + +{% else -%} + +{% endif -%} +{% else -%} + +{% endif -%} - {% if relay['as_name'] %} - - {% else %} - - {% endif %} +{% if relay['as_name'] -%} + +{% else -%} + +{% endif -%} - {% if relay['country'] %}{% if key != 'country' %} - - {% else %} - - {% endif %} - {% else %} - - {% endif %} +{% if relay['country'] -%} +{% if key != 'country' -%} + +{% else -%} + +{% endif -%} +{% else -%} + +{% endif -%} - {% if key != 'platform' %} - - {% else %} - - {% endif %} +{% if key != 'platform' -%} + +{% else -%} + +{% endif -%} - + - {% if key != 'first_seen' %} - - {% else %} - - {% endif %} - - {% endfor %} - +{% if key != 'first_seen' -%} + +{% else -%} + +{% endif -%} + +{% endfor -%} +
NicknameBandwidthIP AddressAS NumberAS NameCountryPlatformFlagsFirst Seen
NicknameBandwidthIP AddressAS NumberAS NameCountryPlatformFlagsFirst Seen
+{{ relay['nickname']|truncate(10)|escape }} ({{ relay['effective_family']|length }}){{ relay['nickname']|truncate(15)|escape }}{{ relay['nickname']|truncate(10)|escape +}} ({{ +relay['effective_family']| length }}){{ relay['nickname']|truncate(15)|escape +}}{{ obs_bandwidth }}{{ obs_bandwidth }}{{ relay['or_addresses'][0].split(':', 1)[0]|escape }}{{ +relay['or_addresses'][0].split(':', 1)[0]|escape }}{{ relay['as']|escape }}{{ relay['as']|escape }}Unknown{{ +relay['as']|escape }}{{ relay['as']|escape }}Unknown{{ relay['as_name']|escape|truncate(length=20) }}Unknown{{ +relay['as_name']|escape|truncate(length=20) }}Unknown{{ relay['country_name']|escape }}{{ relay['country_name']|escape }}X{{
+relay['country_name']|escape }}{{
+relay['country_name']|escape }}X{{ relay['platform']|truncate(length=10)|escape }}{{ relay['platform']|truncate(length=10)|escape }}{{ +relay['platform']|truncate(length=10)|escape }}{{ relay['platform']|truncate(length=10)|escape }}{% for flag in relay['flags'] %}{% if flag != 'StaleDesc' %}{{ flag|escape }} {% endif %}{% endfor %}{% for flag in relay['flags'] -%}{% if flag != 'StaleDesc' -%}{{ flag|escape }} {% endif -%}{% endfor +-%}{{ relay['first_seen'].split(' ', 1)[0]|escape }}{{ relay['first_seen'].split(' ', 1)[0]|escape }}
{{ +relay['first_seen'].split(' ', 1)[0]|escape }}{{ relay['first_seen'].split(' ', 1)[0]|escape +}}
-{% endblock %} +{% endblock -%} diff --git a/allium/templates/skeleton.html b/allium/templates/skeleton.html index 65b5d3c..d240916 100644 --- a/allium/templates/skeleton.html +++ b/allium/templates/skeleton.html @@ -3,7 +3,8 @@ {% block title %}{% endblock %} - + -- cgit v1.2.3-54-g00ecf