GUI changes for Tor

This commit is contained in:
Taylor Helsper 2019-08-30 23:22:20 -05:00
parent 6a474b259b
commit d1e1a80181
3 changed files with 42 additions and 4 deletions

View File

@ -89,12 +89,25 @@ def electrum_server_page():
server_url = get_local_ip() + ":50002:s"
# Get Onion URLs
electrs_onion_hostname = "..."
electrs_onion_command = "..."
if os.path.isfile("/var/lib/tor/electrs_hidden_service/hostname"):
with open("/var/lib/tor/electrs_hidden_service/hostname") as f:
electrs_onion_hostname = f.read().strip()
electrs_onion_command = "./electrum -1 -s {}:50001:t -p socks5:localhost:9050".format(electrs_onion_hostname)
else:
electrs_onion_hostname = "disabled"
electrs_onion_command = "disabled"
# Load page
templateData = {
"title": "myNode Electrum Server",
"port": 50002,
"status": status,
"current_block": current_block,
"server_url": server_url
"server_url": server_url,
"electrs_onion_hostname": electrs_onion_hostname,
"electrs_onion_command": electrs_onion_command
}
return render_template('electrum_server.html', **templateData)

View File

@ -43,6 +43,29 @@
</div>
</div>
<div class="app_tile_row">
<div class="info_tile">
<div class="info_tile_header">Electrum Tor Service</div>
<div class="info_tile_contents">{% if not product_key_skipped %}Enabled{% else %}Premium Feature{% endif %}</div>
</div>
{% if not product_key_skipped %}
<div class="info_tile">
<div class="info_tile_header">Electrum Tor Hostname</div>
<div class="info_tile_contents">{{electrs_onion_hostname}}</div>
</div>
</div>
<div class="app_tile_row">
<div class="info_tile">
<div class="info_tile_header">Electrum Tor Command</div>
<div class="info_tile_contents">{{electrs_onion_command}}</div>
</div>
<div class="info_tile">
<div class="info_tile_header">Electrum Tor Help</div>
<div class="info_tile_contents"><a href="http://docs.electrum.org/en/latest/tor.html" target="_blank">Link</a></div>
</div>
{% endif %}
</div>
{% include 'includes/footer.html' %}
</body>
</html>

View File

@ -43,15 +43,17 @@
<div class="info_tile_contents">Tor Enabled</div>
</div>
<div class="info_tile">
<div class="info_tile_header">Onion Hostname</div>
<div class="info_tile_header">Electrum Tor Hostname</div>
<div class="info_tile_contents">{{electrs_onion_hostname}}</div>
</div>
</div>
<div class="app_tile_row">
<div class="info_tile">
<div class="info_tile_header">Electrum Command</div>
<div class="info_tile_header">Electrum Tor Command</div>
<div class="info_tile_contents">{{electrs_onion_command}}</div>
</div>
<div class="info_tile">
<div class="info_tile_header">Help</div>
<div class="info_tile_header">Electrum Tor Help</div>
<div class="info_tile_contents"><a href="http://docs.electrum.org/en/latest/tor.html" target="_blank">Link</a></div>
</div>
</div>