[tor-commits] [metrics-web/release] Show verified and unverified host names for relays

karsten at torproject.org karsten at torproject.org
Wed Sep 26 15:20:35 UTC 2018


commit 97443f9b006d64139543fe2f2582975927b000b7
Author: Iain R. Learmonth <irl at fsfe.org>
Date:   Wed Jul 18 13:57:53 2018 +0100

    Show verified and unverified host names for relays
    
    Each hostname is displayed in a list, in a similar format to effective
    and alleged family. Non-verified hostnames are coloured orange and
    followed by an asterisk to differentiate them from verified host names.
    
    This commit also drops the use of the host_name field.
    
    Fixes: #26834
---
 src/main/resources/web/js/rs/models/relay.js            | 3 ++-
 src/main/resources/web/templates/rs/details/router.html | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/web/js/rs/models/relay.js b/src/main/resources/web/js/rs/models/relay.js
index d01f748..ad23b15 100644
--- a/src/main/resources/web/js/rs/models/relay.js
+++ b/src/main/resources/web/js/rs/models/relay.js
@@ -216,7 +216,8 @@ define([
                     relay.or_port = relay.or_addresses ? relay.or_addresses[0].split(":")[1] : 0;
                     relay.dir_port = relay.dir_address ? relay.dir_address.split(":")[1] : 0;
                     relay.exit_addresses = relay.exit_addresses ? relay.exit_addresses : null;
-                    relay.host_name = relay.host_name ? relay.host_name : null;
+                    relay.verified_host_names = relay.verified_host_names ? relay.verified_host_names : null;
+                    relay.unverified_host_names = relay.unverified_host_names ? relay.unverified_host_names : null;
                     relay.country = relay.country ? relay.country.toLowerCase() : null;
                     relay.countryname = relay.country ? CountryCodes[relay.country] : null;
                     relay.age = relay.first_seen ? model.parsedate(relay.first_seen).hrfull : null;
diff --git a/src/main/resources/web/templates/rs/details/router.html b/src/main/resources/web/templates/rs/details/router.html
index 29924cf..4ee4c88 100644
--- a/src/main/resources/web/templates/rs/details/router.html
+++ b/src/main/resources/web/templates/rs/details/router.html
@@ -144,8 +144,10 @@ should update it as soon as possible.</div>
         <%= propertyCount==0 ? 'none' : '' %>
     </dd>
 
-    <dt><span class="tip" title="Host name as found in a reverse DNS lookup of the relay's primary IP address. This field is updated at most once in 12 hours, unless the relay IP address changes. Omitted if the relay IP address was not looked up, if no lookup request was successful yet or if no A record was found matching the PTR record.">Host Name</span></dt>
-    <dd><% if (relay.get('host_name')) { %><%= relay.get('host_name') %><% } else { %>No PTR record found<% } %></dd>
+    <dt><span class="tip" title="Host name as found in a reverse DNS lookup of the relay's primary IP address. This field is updated at most once in 12 hours, unless the relay IP address changes. Omitted if the relay IP address was not looked up, if no lookup request was successful yet. If no A record was found matching the PTR record then the host name will be followed by an asterisk.">Host Name</span></dt>
+    <dd>
+        <pre class="pre-scrollable"><% if (relay.get('verified_host_names') !== null) { %><% _.each(relay.get('verified_host_names'), function(host_name) { %><a href="#search/host_name:<%= host_name %>"><%= host_name %></a><% }); } %><% if (relay.get('unverified_host_names') !== null) { %><% _.each(relay.get('unverified_host_names'), function(host_name) { %><a class="alleged" href="#search/host_name:<%= host_name %>"><%= host_name %></a>*<% }); } %><% if(relay.get('verified_host_names') == relay.get('unverified_host_names')) { %>none<% } %></pre>
+    </dd>
 
     <dt><span class="tip" title="Country as found in a GeoIP database by resolving the relay's first onion-routing address.">Country</span></dt>
     <dd><% if (relay.get('country')) { %><img class="inline country" title="<%= relay.get('countryname') %>" alt="" src="/images/cc/<%= relay.get('country') %>.png"/> <a href="#search/country:<%= relay.get('country') %>"><%= relay.get('countryname') %></a> (<a href="#search/country:<%= relay.get('country') %>%20flag:exit"><img src="/images/flags/exit.png" title="All exits in <%= relay.get('countryname') %>"></a>)<% } else { %>Unknown<% } %></dd>





More information about the tor-commits mailing list