[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [atlas/master] Only show version from consensus if inconsistent with platform (Fixes: #24974)



commit b186e90e81f158b222d5df4e91956420db83c8b0
Author: Iain R. Learmonth <irl@xxxxxxxx>
Date:   Sat Feb 10 00:29:56 2018 +0000

    Only show version from consensus if inconsistent with platform (Fixes: #24974)
---
 js/models/relay.js            | 4 +++-
 templates/details/router.html | 7 ++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/js/models/relay.js b/js/models/relay.js
index 4984d65..cd3078b 100644
--- a/js/models/relay.js
+++ b/js/models/relay.js
@@ -233,9 +233,11 @@ define([
                     model.set({badexit: false});
                     relay.flags = model.parseflags(relay.flags, relay.is_bridge);
 
+                    relay.version_consistent = relay.version == relay.platform.split(" ")[1];
+
                     /* Synthetic Additional Flags */
                     var additional_flags = []
-                    if (!((typeof relay.recommended_version !== 'undefined') ? relay.recommended_version : true)) additional_flags.push("Not Recommended");
+                    if (!((typeof relay.recommended_version !== 'undefined') ? relay.recommended_version : false) && relay.version_consistent) additional_flags.push("Not Recommended");
                     if (!((typeof relay.measured !== 'undefined') ? relay.measured : true)) additional_flags.push("Unmeasured");
                     if (((typeof relay.hibernating !== 'undefined') ? relay.hibernating : false)) additional_flags.push("Hibernating");
                     if (IsFallbackDir(relay.fingerprint)) additional_flags.push("FallbackDir");
diff --git a/templates/details/router.html b/templates/details/router.html
index 4842987..5233648 100644
--- a/templates/details/router.html
+++ b/templates/details/router.html
@@ -10,7 +10,7 @@
 <% if (relay.get('new_relay') === true) {%>
 <div class="alert alert-info">This relay appears to be less than 2 weeks old. <a href="https://blog.torproject.org/lifecycle-new-relay";>This blog post</a> explains the lifecycle of a new relay, and why it will not be immediately fully used to capacity.</div>
 <% } %>
-<% if (relay.get('recommended_version') === false) { %>
+<% if (relay.get('recommended_version') === false && relay.get('version_consistent') == true) { %>
 <div class="alert alert-danger">This relay is running an outdated Tor version and should be updated to a recent release of Tor that may contain important fixes.</div>
 <% } %>
 <div class="row">
@@ -164,10 +164,7 @@
     <dd><%= relay.get('consensus_weight') %></dd>
 
     <dt><span class="tip" title="What OS and Tor version the relay is using">Platform</span></dt>
-    <dd><%= _.escape(relay.get('platform')) %></dd>
-
-    <dt><span class="tip" title="Tor version as seen in the consensus (used to determine whether or not this relay runs a recommended version of tor)">Version</span></dt>
-    <dd><%= _.escape(relay.get('version')) %></dd>
+    <dd><%= _.escape(relay.get('platform')) %><% if (!relay.get('version_consistent')) { %> (version is <%= _.escape(relay.get('version')) %> in consensus)<% } %></dd>
 
     </dl>
     </div>



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits