[tor-commits] [metrics-web/master] Add v3 certificates tarball to data page.

karsten at torproject.org karsten at torproject.org
Fri Apr 1 13:17:42 UTC 2011


commit d105d7e8e394515556219d03eb4dcf0f2e864866
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Fri Apr 1 15:17:13 2011 +0200

    Add v3 certificates tarball to data page.
---
 .../torproject/ernie/web/ResearchDataServlet.java  |    7 +++++++
 web/WEB-INF/data.jsp                               |    9 +++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/org/torproject/ernie/web/ResearchDataServlet.java b/src/org/torproject/ernie/web/ResearchDataServlet.java
index ca6bf7b..5186ca8 100644
--- a/src/org/torproject/ernie/web/ResearchDataServlet.java
+++ b/src/org/torproject/ernie/web/ResearchDataServlet.java
@@ -68,6 +68,7 @@ public class ResearchDataServlet extends HttpServlet {
      * arrays containing the file url and optional signature file. */
     SortedMap<Date, Map<String, String[]>> relayDescriptors =
         new TreeMap<Date, Map<String, String[]>>();
+    String[] certs = new String[2];
     SortedMap<Date, String[]> bridgeDescriptors =
         new TreeMap<Date, String[]>();
     SortedMap<String, Map<String, String[]>> relayStatistics =
@@ -122,6 +123,11 @@ public class ResearchDataServlet extends HttpServlet {
         }
         relayDescriptors.get(month).get(type)[index] = url;
 
+      /* URL contains v3 certificates. */
+      } else if (filename.startsWith("certs.tar")) {
+        int index = filename.endsWith(".asc") ? 1 : 0;
+        certs[index] = url;
+
       /* URL contains bridge descriptors. */
       } else if (filename.startsWith("bridge-descriptors-20")) {
         String yearMonth = filename.substring(filename.indexOf("20"));
@@ -231,6 +237,7 @@ public class ResearchDataServlet extends HttpServlet {
     /* Add the maps to the request and forward it to the JSP to display
      * the page. */
     request.setAttribute("relayDescriptors", relayDescriptors);
+    request.setAttribute("certs", certs);
     request.setAttribute("bridgeDescriptors", bridgeDescriptors);
     request.setAttribute("relayStatistics", relayStatistics);
     request.setAttribute("torperfData", torperfData);
diff --git a/web/WEB-INF/data.jsp b/web/WEB-INF/data.jsp
index 30d42f6..fdd5a69 100644
--- a/web/WEB-INF/data.jsp
+++ b/web/WEB-INF/data.jsp
@@ -97,6 +97,15 @@
             </tr>
           </c:forEach>
         </table>
+        <c:if test="${certs[0] ne null}">
+          <br>
+          <p>In order to verify the v3 votes and v3 consensuses, download
+          the tarball of <a href="${certs[0]}">v3 certificates</a>
+          <c:if test="${certs[1] ne null}">
+            (<a href="${certs[1]}">sig</a>)
+          </c:if>
+          which is updated whenever new v3 certificates become available.</p>
+        </c:if>
         <br>
         <a name="bridgedesc"></a>
         <h3>Bridge descriptor archives</h3>



More information about the tor-commits mailing list