Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
TelcoDB
Web Frontend
Commits
ead2ced5
Verified
Commit
ead2ced5
authored
Oct 27, 2019
by
Elias Ojala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Escape JSON on Tor relay page and other general improvements
parent
a30b3f57
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
4 deletions
+7
-4
src/app.ts
src/app.ts
+2
-2
views/docs/tor-relay-list.twig
views/docs/tor-relay-list.twig
+2
-1
views/home/about.twig
views/home/about.twig
+1
-0
views/tor-relay/list.twig
views/tor-relay/list.twig
+1
-0
views/tor-relay/show.twig
views/tor-relay/show.twig
+1
-1
No files found.
src/app.ts
View file @
ead2ced5
...
...
@@ -237,8 +237,8 @@ twig.extendFunction("getBadge", (badgeName: string, asn?: number, pdb?, pdbDataT
if
(
asn
&&
badgeName
===
"
cymru
"
)
{
data
.
url
=
`https://api.telcodb.net/v1/asn/cymru?format=json&q=
${
asn
}
`
;
}
else
if
(
asn
&&
badgeName
===
"
asr
"
)
{
suffix
=
`/asns/
3356
`
;
}
else
if
(
asn
&&
badgeName
===
"
caida-asrank
"
)
{
suffix
=
`/asns/
${
asn
}
`
;
}
else
if
(
pdb
&&
badgeName
===
"
peeringdb
"
&&
pdbDataType
===
"
orgPage
"
)
{
suffix
=
`/org/
${
pdb
.
org
.
id
}
`
;
}
else
if
(
pdb
&&
badgeName
===
"
peeringdb
"
&&
pdbDataType
===
"
netPage
"
)
{
...
...
views/docs/tor-relay-list.twig
View file @
ead2ced5
...
...
@@ -23,7 +23,8 @@
<p
class=
"mb-2"
>
The JSON version currently has the following extra features that are not available on the original/TXT version:
<ul>
<li>
Tor relay fingerprint
</li>
{# <li><a href="https://en.wikipedia.org/wiki/Reverse_DNS_lookup">Reverse DNS</a> records</li> #}
<li><a
href=
"https://en.wikipedia.org/wiki/Forward-confirmed_reverse_DNS"
>
Forward-confirmed reverse DNS
</a>
records
</li>
<li>
Array containing
<a
href=
"https://metrics.torproject.org/glossary.html#relay-flag"
>
relay flags
</a>
in English
</li>
</ul></p>
<p>
The data is automatically updated to the forementioned endpoints,
...
...
views/home/about.twig
View file @
ead2ced5
...
...
@@ -27,6 +27,7 @@
<li><a
href=
"https://www.dan.me.uk/dnsbl"
>
Tor Relay DNSBL by dan.me.uk
</a></li>
<li><a
href=
"/docs/tor-relay-list/"
>
Tor Relay List in JSON format
</a>
(based on
<a
href=
"https://www.dan.me.uk/tornodes"
>
dan.me.uk
</a>
's data)
</li>
<li><a
href=
"https://metrics.torproject.org/onionoo.html"
>
Onionoo
</a></li>
</ul>
</p>
...
...
views/tor-relay/list.twig
View file @
ead2ced5
...
...
@@ -33,6 +33,7 @@
<td>
{{
relay.router_port
|
e
}}
</td>
<td>
{{
relay.directory_port
|
e
}}
</td>
<td>
{{
relay.flags
|
e
}}
</td>
{# <td>{{ relay.flags_alt|join(', ')|e }}</td> #}
{# TODO: #}
<td
data-order=
"
{{
relay.uptime
|
e
}}
"
>
{{
relay.uptime
|
e
}}
</td>
<td>
{{
relay.version
|
e
}}
</td>
...
...
views/tor-relay/show.twig
View file @
ead2ced5
...
...
@@ -3,5 +3,5 @@
{%
block
body
%}
<h1>
{{
title
|
e
}}
</h1>
<pre><code>
{{
json_data
}}
</code></pre>
<pre><code>
{{
json_data
|
e
}}
</code></pre>
{%
endblock
%}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment