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

adjustments for fc00.atomshare.net

This commit is contained in:
Michał Zieliński 2015-07-26 19:08:51 +02:00
parent c3779480de
commit 5ae90eeae3
5 changed files with 14 additions and 8 deletions

View File

@ -1,5 +1,5 @@
CREATE DATABASE IF NOT EXISTS `fc00`;
USE `fc00`;
CREATE DATABASE IF NOT EXISTS `cjdns`;
USE `cjdns`;
--

View File

@ -1,6 +1,7 @@
import json
from database import NodeDB
from graph import Node, Edge
import traceback
def insert_graph_data(config, json_str):
try:
@ -13,14 +14,14 @@ def insert_graph_data(config, json_str):
try:
for n in graph_data['nodes']:
try:
try:
node = Node(n['ip'], version=n['version'])
nodes[n['ip']] = node
except Exception:
pass
for e in graph_data['edges']:
try:
try:
edge = Edge(nodes[e['a']], nodes[e['b']])
edges.append(edge)
except Exception:
@ -37,6 +38,7 @@ def insert_graph_data(config, json_str):
with NodeDB(config) as db:
db.insert_graph(nodes, edges)
except Exception:
traceback.print_exc()
return 'Database failure'
return None

View File

@ -11,7 +11,8 @@
<p>The network page has a map of Hyperboria as it is now. The map is not complete since it is hard/impossible to get a full picture of the network. A rough estimate is that at least half of the nodes are pictured here, probably more. The nodes and links that are shown on the page are very likely to exist but this should not be taken as a guarantee.</p>
<h3>Contact</h3>
<p>Currently fc00 is run by <em>randati</em>. If you have something to say or you would like to help, contact him on HypeIRC or EFNet.</p>
<p>fc00 was orginally created by <em>Randati</em>. Currently fc00 is run by <em>zielmicha</em>.
If you have something to say or you would like to help, contact him via michal@zielinscy.org.pl.</p>
</div>
</div>
{% endblock %}

View File

@ -14,7 +14,7 @@
<ul>
<li><a href="/" {% if page == 'network' %} class="selected" {% endif %}>Network</a></li>
<li><a href="/about"{% if page == 'about' %} class="selected" {% endif %}>About</a></li>
<li><a href="https://github.com/Randati/fc00.org">Source</a></li>
<li><a href="https://github.com/zielmicha/fc00.org">Source</a></li>
<li><tt>{{ ip }}</tt></li>
</ul>
</div>

View File

@ -7,7 +7,10 @@ app.config.from_pyfile('web_config.cfg')
@app.context_processor
def add_ip():
return dict(ip=request.environ['REMOTE_ADDR'])
ip = request.headers['x-real-ip']
if ip == '10.18.3.20':
ip = request.headers['x-atomshare-real-ip']
return dict(ip=ip)
@app.route('/')
@ -31,4 +34,4 @@ def page_sendGraph():
return 'Error: %s' % ret
if __name__ == '__main__':
app.run(host='::')
app.run(host='localhost', port=3000)