List of Tor relays

parent b8edc718
......@@ -3,6 +3,7 @@ $(document).ready(function () {
"columnDefs": [{
"orderable": false,
"targets": 'no-sort'
}]
}],
responsive: true,
});
});
\ No newline at end of file
$(document).ready(function () {
$('#torRelayList').DataTable({
"columnDefs": [{
"orderable": false,
"targets": 'no-sort'
}],
responsive: true,
});
});
\ No newline at end of file
......@@ -30,6 +30,7 @@ import {
NetController,
ExploreController,
TldController,
TorController,
} from "./controllers";
twig.extendFunction("getenv", (name: string) => {
......@@ -107,8 +108,9 @@ app.use("/assets/libs/fontawesome-free/webfonts/", express.static("node_modules/
app.use("/assets/libs/svg-country-flags/svg/", express.static("node_modules/svg-country-flags/svg/"));
app.use("/assets/libs/highlight.js/styles/", express.static("node_modules/highlight.js/styles/"));
app.use("/assets/libs/datatables.net/js/", express.static("node_modules/datatables.net/js/"));
app.use("/assets/libs/datatables.net-bs4/js/", express.static("node_modules/datatables.net-bs4/js/"));
app.use("/assets/libs/datatables.net-bs4/css/", express.static("node_modules/datatables.net-bs4/css/"));
app.use("/assets/libs/datatables.net-bs4/js/", express.static("node_modules/datatables.net-bs4/js/"));
app.use("/assets/libs/datatables.net-responsive/js/", express.static("node_modules/datatables.net-responsive/js/"));
// In production, minify HTML
if (production) {
......@@ -202,6 +204,9 @@ app.use("/dns/", DnsController);
// TLDs
app.use("/tld/", TldController);
// Tor relays
app.use("/tor-relay/", TorController);
const badgeData = [
/* ASN data badges */
{
......
......@@ -9,3 +9,4 @@ export * from "./ix.controller";
export * from "./net.controller";
export * from "./explore.controller";
export * from "./tld.controller";
export * from "./tor.controller";
import { NextFunction, Request, Response, Router } from "express";
import Axios from "axios";
const router: Router = Router();
/**
* List of Tor relays
*/
router.get("/", (req: Request, res: Response, next: NextFunction) => {
Axios.get(`https://api.telcodb.net/dl/tor-relay-list.json`)
.then(x => x.data)
.then(data => {
res.render("tor-relay/list.twig", {
"canonical_url": `/tor-relay/`,
"title": "List of Tor relays",
"data": data,
});
})
.catch(next);
});
export const TorController: Router = router;
......@@ -121,6 +121,7 @@
<link rel="stylesheet" type="text/css" href="/assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css"/>
<script type="text/javascript" src="/assets/libs/datatables.net/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script>
<script type="text/javascript" src="/assets/libs/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
{# TODO: Do in the backend due to ASNs that have large amount of IXPs #}
<script src="/assets/js/pages/dns/show/reverse-fetch.js" async defer></script>
......
......@@ -17,6 +17,7 @@
<a class="dropdown-item" href="/explore/asn">ASN List</a>
{# <a class="dropdown-item" href="/explore/ip">Browse IPs</a> #}
<a class="dropdown-item" href="/tld/">Top Level Domains</a>
<a class="dropdown-item" href="/tor-relay/">Tor relays</a>
</div>
</li>
<li class="nav-item dropdown">
......
{% extends 'layouts/default.twig' %}
{% block body %}
<h1>{{ title }}</h1>
<table class="table" id="torRelayList">
<thead>
<tr>
<th scope="col">IP Address</th>
<th scope="col">Name</th>
<th scope="col">ORPort</th>
<th scope="col">Directory Port</th>
<th scope="col">Flags</th>
<th scope="col">Uptime</th>
<th scope="col">Version</th>
<th scope="col">Contact Info</th>
</tr>
</thead>
<tbody>
{% for relay in data %}
<tr>
<td>
<a href="/ip/{{ relay.ip|e }}" class="ipRecord add-parenthesis" data-ip="{{ relay.ip|e }}">{{ relay.ip|e }}</a>
</td>
<td>{{ relay.name|e }}</td>
<td>{{ relay.router_port|e }}</td>
<td>{{ relay.directory_port|e }}</td>
<td>{{ relay.flags|e }}</td>
{# TODO: #}
<td data-order="{{ relay.uptime|e }}">{{ relay.uptime|e }}</td>
<td>{{ relay.version|e }}</td>
<td>{{ relay.contactinfo|e }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
{% block javascripts %}
{# Datatables #}
<script src="/assets/js/pages/tor-relay/index.js"></script>
<link rel="stylesheet" type="text/css" href="/assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css"/>
<script type="text/javascript" src="/assets/libs/datatables.net/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script>
<script type="text/javascript" src="/assets/libs/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
{% endblock %}
\ No newline at end of file
......@@ -1420,13 +1420,26 @@ datatables.net-bs4@^1.10.20:
datatables.net "1.10.20"
jquery ">=1.7"
datatables.net@1.10.20:
datatables.net-responsive@^2.2.3:
version "2.2.3"
resolved "https://registry.yarnpkg.com/datatables.net-responsive/-/datatables.net-responsive-2.2.3.tgz#50a2b1b4955b16b32f573a3f00f473b0bfbee913"
integrity sha512-8D6VtZcyuH3FG0Hn5A4LPZQEOX3+HrRFM7HjpmsQc/nQDBbdeBLkJX4Sh/o1nzFTSneuT1Wh/lYZHVPpjcN+Sw==
dependencies:
datatables.net "^1.10.15"
jquery ">=1.7"
datatables.net@1.10.20, datatables.net@^1.10.15:
version "1.10.20"
resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-1.10.20.tgz#9d65ecc3c83cbe7baa4fa5a053405c8fe42c1350"
integrity sha512-4E4S7tTU607N3h0fZPkGmAtr9mwy462u+VJ6gxYZ8MxcRIjZqHy3Dv1GNry7i3zQCktTdWbULVKBbkAJkuHEnQ==
dependencies:
jquery ">=1.7"
datejs@^1.0.0-rc3:
version "1.0.0-rc3"
resolved "https://registry.yarnpkg.com/datejs/-/datejs-1.0.0-rc3.tgz#bffa1efedefeb41fdd8a242af55afa01fb58de57"
integrity sha1-v/oe/t7+tB/diiQq9Vr6AftY3lc=
debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment