5
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2024-11-09 16:00:27 +00:00

Merge pull request #1 from Arceliar/master

Base to Fork
This commit is contained in:
Christer Warén 2018-12-22 09:56:43 +02:00 committed by GitHub
commit 08aa9fcacf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,9 @@
# Yggdrasil map # Yggdrasil map
* Internet: https://yggdrasil-map.cwo.fi
* Hyperboria: https://yggdrasil-map.h.cwo.fi
* Yggdrasil Network: https://yggdrasil-map.y.cwo.fi
Forked from the code for http://www.fc00.org (http://h.fc00.org on Hyperboria). Forked from the code for http://www.fc00.org (http://h.fc00.org on Hyperboria).
## Sending your view of the network ## Sending your view of the network

View File

@ -65,6 +65,8 @@ def get_graph_json(G):
centrality = centralities.get(n.name, 0) centrality = centralities.get(n.name, 0)
size = 5*(1 + 1*centrality) size = 5*(1 + 1*centrality)
name = db.get(canonalize_ip(n.name)) name = db.get(canonalize_ip(n.name))
# If label isn't the default value, set name to that instead
if n.attr['label'] != n.name.split(':')[-1]: name = n.attr['label']
out_data['nodes'].append({ out_data['nodes'].append({
'id': n.name, 'id': n.name,

View File

@ -8,7 +8,7 @@
<br> <br>
<h3>Network map</h3> <h3>Network map</h3>
<p>The network page has a map of Yggdrasil's spanning tree as it is now. The map is not complete since it is hard/impossible to get a full picture of the network, and it only includes the minimum subset of links needed to construct the spanning tree. The known nodes and tree coordinates are taken from <a href="http://y.yakamo.org:3000/">Yakamo's API</a>. Node names are taken from <a href="https://github.com/yakamok/yggdrasil-nodelist">Yakamo's node list</a>.</p> <p>The network page has a map of Yggdrasil's spanning tree as it is now. The map is not complete since it is hard/impossible to get a full picture of the network, and it only includes the minimum subset of links needed to construct the spanning tree. The known nodes and tree coordinates are taken from <a href="http://y.yakamo.org:3000/">Yakamo's API</a>. Node can be configured by setting a "name" field in <a href="https://yggdrasil-network.github.io/configuration.html">NodeInfo</a>, or from <a href="https://github.com/yakamok/yggdrasil-nodelist">Yakamo's node list</a> as a fallback.</p>
<!-- <!--
<h3>Node names</h3> <h3>Node names</h3>
<p>For now, node names are assigned manually. You can submit Pull Request to <a href="https://github.com/zielmicha/nodedb">nodedb</a> if you want to have your node named. <p>For now, node names are assigned manually. You can submit Pull Request to <a href="https://github.com/zielmicha/nodedb">nodedb</a> if you want to have your node named.

View File

@ -35,13 +35,14 @@ def generate_graph(time_limit=60*60*3):
toAdd = [] toAdd = []
for ip in data: for ip in data:
info = NodeInfo(ip, data[ip][0]) info = NodeInfo(ip, data[ip][0])
if len(data[ip]) >= 3: info.label = data[ip][2]
toAdd.append(info) toAdd.append(info)
nodes = dict() nodes = dict()
def addAncestors(info): def addAncestors(info):
coords = info.getParent() coords = info.getParent()
parent = NodeInfo("{} {}".format("?", coords), coords) parent = NodeInfo("{} {}".format("?", coords), coords)
parent.label = "?" parent.label = parent.ip
nodes[parent.coords] = parent nodes[parent.coords] = parent
if parent.coords != parent.getParent(): addAncestors(parent) if parent.coords != parent.getParent(): addAncestors(parent)