commit f2ea20289c8c7e52aee7c45ff9450499c269636b Author: Karsten Loesing karsten.loesing@gmx.net Date: Wed Dec 21 11:30:48 2016 +0100
Create sources page. --- website/etc/web.xml | 12 ++- .../org/torproject/metrics/web/SourcesServlet.java | 31 ++++++ website/web/WEB-INF/sources.jsp | 104 +++++++++++++++++++++ website/web/images/collector-logo.png | Bin 0 -> 90241 bytes website/web/images/default-logo.png | Bin 0 -> 96441 bytes website/web/images/ooni-logo.png | Bin 0 -> 5573 bytes 6 files changed, 146 insertions(+), 1 deletion(-)
diff --git a/website/etc/web.xml b/website/etc/web.xml index 4a53b86..b6f2015 100644 --- a/website/etc/web.xml +++ b/website/etc/web.xml @@ -202,6 +202,17 @@ </servlet-mapping>
<servlet> + <servlet-name>SourcesServlet</servlet-name> + <servlet-class> + org.torproject.metrics.web.SourcesServlet + </servlet-class> + </servlet> + <servlet-mapping> + <servlet-name>SourcesServlet</servlet-name> + <url-pattern>/sources.html</url-pattern> + </servlet-mapping> + + <servlet> <servlet-name>ToolsServlet</servlet-name> <servlet-class> org.torproject.metrics.web.ToolsServlet @@ -209,7 +220,6 @@ </servlet> <servlet-mapping> <servlet-name>ToolsServlet</servlet-name> - <url-pattern>/sources.html</url-pattern> <url-pattern>/operation.html</url-pattern> <url-pattern>/development.html</url-pattern> </servlet-mapping> diff --git a/website/src/org/torproject/metrics/web/SourcesServlet.java b/website/src/org/torproject/metrics/web/SourcesServlet.java new file mode 100644 index 0000000..3c0e894 --- /dev/null +++ b/website/src/org/torproject/metrics/web/SourcesServlet.java @@ -0,0 +1,31 @@ +/* Copyright 2016 The Tor Project + * See LICENSE for licensing information */ + +package org.torproject.metrics.web; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class SourcesServlet extends AnyServlet { + + private static final long serialVersionUID = 6850919895248020945L; + + @Override + public void init() throws ServletException { + super.init(); + } + + @Override + public void doGet(HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + + /* Forward the request to the JSP that does all the hard work. */ + request.setAttribute("categories", this.categories); + request.getRequestDispatcher("WEB-INF/sources.jsp").forward(request, + response); + } +} + diff --git a/website/web/WEB-INF/sources.jsp b/website/web/WEB-INF/sources.jsp new file mode 100644 index 0000000..3c36611 --- /dev/null +++ b/website/web/WEB-INF/sources.jsp @@ -0,0 +1,104 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<jsp:include page="top.jsp"> + <jsp:param name="pageTitle" value="Sources – Tor Metrics"/> + <jsp:param name="navActive" value="Sources"/> +</jsp:include> + + <div class="container"> + <ul class="breadcrumb"> + <li><a href="index.html">Home</a></li> + <li class="active">Sources</li> + </ul> + </div> + + <div class="container"> + <h1>Sources</h1> + <p>You're a data person and only trust the statistics that you doctored yourself? Here's all the data right from the source, doctor.</p> + </div> + + <div class="container tools"> + <a name="archive" id="anchor-archive"></a> + <h2>Network archives</h2> + <p>We get our data from the network archives below.</p> + <div class="row"> + + <div class="col-md-3 col-sm-4 col-xs-6"> + <a href="https://collector.torproject.org/" target="_blank"> + <div class="logo" style="background-image:url(images/collector-logo.png);"></div> + <h2>CollecTor</h2> + <p>collects data from various nodes and services in the public Tor network.</p> + </a> + </div> + + <div class="col-md-3 col-sm-4 col-xs-6"> + <a href="https://ooni.torproject.org/" target="_blank"> + <div class="logo" style="background-image:url(images/ooni-logo.png);"></div> + <h2>OONI</h2> + <p>detects censorship, surveillance, and traffic manipulation on the internet.</p> + </a> + </div> + + </div> + </div> + + <div class="container tools"> + <a name="measurement" id="anchor-measurement"></a> + <h2>Measurement tools</h2> + <p>The following tools perform active measurements in the Tor network. (They don't have pretty logos yet, but they are all uniquely useful!)</p> + <div class="row"> + + <div class="col-md-2 col-sm-3 col-xs-4"> + <a href="https://www.torproject.org/projects/tordnsel.html.en" target="_blank"> + <div class="logo" style="background-image:url(images/default-logo.png);"></div> + <h3>TorDNSEL</h3> + <p>publishes lists of IP addresses of multi-homed Tor exits.</p> + </a> + </div> + + <div class="col-md-2 col-sm-3 col-xs-4"> + <a href="https://gitweb.torproject.org/torperf.git" target="_blank"> + <div class="logo" style="background-image:url(images/default-logo.png);"></div> + <h3>Torperf</h3> + <p>measures Tor performance with a set of utilities and Python scripts.</p> + </a> + </div> + + <div class="col-md-2 col-sm-3 col-xs-4"> + <a href="https://github.com/robgjansen/onionperf" target="_blank"> + <div class="logo" style="background-image:url(images/default-logo.png);"></div> + <h3>OnionPerf</h3> + <p>measures the performance of onion services.</p> + </a> + </div> + + </div> + </div> + + <div class="container tools"> + <a name="aggregated" id="anchor-aggregated"></a> + <h2>Pre-aggregated data</h2> + <p>Sometimes the data from the original sources can be hard to process. If you want to take a little shortcut, try out the following pre-aggregated statistics.</p> + <div class="row"> + + <div class="col-md-2 col-sm-3 col-xs-4"> + <a href="stats.html"> + <div class="logo" style="background-image:url(images/default-logo.png);"></div> + <h3>CSV files</h3> + <p>are available with aggregated statistics of visualizations on this site.</p> + </a> + </div> + + <div class="col-md-2 col-sm-3 col-xs-4"> + <a href="https://onionoo.torproject.org/" target="_blank"> + <div class="logo" style="background-image:url(images/default-logo.png);"></div> + <h3>Onionoo</h3> + <p>provides current and historical data about relays and bridges via a web-based API.</p> + </a> + </div> + + </div> + </div> + +<jsp:include page="bottom.jsp"/> + diff --git a/website/web/images/collector-logo.png b/website/web/images/collector-logo.png new file mode 100644 index 0000000..90a72d8 Binary files /dev/null and b/website/web/images/collector-logo.png differ diff --git a/website/web/images/default-logo.png b/website/web/images/default-logo.png new file mode 100644 index 0000000..ef0cd90 Binary files /dev/null and b/website/web/images/default-logo.png differ diff --git a/website/web/images/ooni-logo.png b/website/web/images/ooni-logo.png new file mode 100644 index 0000000..777481b Binary files /dev/null and b/website/web/images/ooni-logo.png differ