Add more Tor services

This commit is contained in:
Taylor Helsper 2019-09-15 20:50:38 -05:00
parent 01e46595d4
commit d9a2aa08ee
7 changed files with 66 additions and 85 deletions

View File

@ -212,15 +212,29 @@ ControlPort 9051
CookieAuthentication 1 CookieAuthentication 1
CookieAuthFileGroupReadable 1 CookieAuthFileGroupReadable 1
# Hidden Service for Electrum Server # Hidden Service for Electrum Server (legacy)
HiddenServiceDir /var/lib/tor/electrs_hidden_service/ HiddenServiceDir /var/lib/tor/electrs_hidden_service/
HiddenServiceVersion 2 HiddenServiceVersion 2
HiddenServicePort 50001 127.0.0.1:50001 HiddenServicePort 50001 127.0.0.1:50001
HiddenServicePort 50002 127.0.0.1:50002 HiddenServicePort 50002 127.0.0.1:50002
# Hidden Service for LND # Hidden Service for LND (legacy)
HiddenServiceDir /var/lib/tor/lnd_api/ HiddenServiceDir /var/lib/tor/lnd_api/
HiddenServiceVersion 2 HiddenServiceVersion 2
HiddenServiceAuthorizeClient stealth mynode HiddenServiceAuthorizeClient stealth mynode
HiddenServicePort 10009 127.0.0.1:10009 HiddenServicePort 10009 127.0.0.1:10009
HiddenServicePort 10080 127.0.0.1:10080 HiddenServicePort 10080 127.0.0.1:10080
# Hidden Service for myNode
HiddenServiceDir /var/lib/tor/mynode/
HiddenServiceVersion 2
HiddenServiceAuthorizeClient stealth mynode
HiddenServicePort 80 127.0.0.1:80
HiddenServicePort 3000 127.0.0.1:3000
HiddenServicePort 3002 127.0.0.1:3002
HiddenServicePort 3004 127.0.0.1:3004
HiddenServicePort 3010 127.0.0.1:3010
HiddenServicePort 10009 127.0.0.1:10009
HiddenServicePort 10080 127.0.0.1:10080
HiddenServicePort 50001 127.0.0.1:50001
HiddenServicePort 50002 127.0.0.1:50002

View File

@ -24,7 +24,7 @@ while true; do
rm -rf /tmp/mynode_lndconnect/* rm -rf /tmp/mynode_lndconnect/*
# Find URLs # Find URLs
LND_TOR_ADDR=$(cat /var/lib/tor/lnd_api/hostname | awk '{print $1}') LND_TOR_ADDR=$(cat /var/lib/tor/mynode/hostname | awk '{print $1}')
# Generate QR Codes # Generate QR Codes
lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet --localip lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet --localip

View File

@ -95,8 +95,8 @@ def electrum_server_page():
# Get Onion URLs # Get Onion URLs
electrs_onion_hostname = "..." electrs_onion_hostname = "..."
electrs_onion_command = "..." electrs_onion_command = "..."
if os.path.isfile("/var/lib/tor/electrs_hidden_service/hostname"): if os.path.isfile("/var/lib/tor/mynode/hostname"):
with open("/var/lib/tor/electrs_hidden_service/hostname") as f: with open("/var/lib/tor/mynode/hostname") as f:
electrs_onion_hostname = f.read().strip() electrs_onion_hostname = f.read().strip()
electrs_onion_command = "./electrum -1 -s {}:50002:s -p socks5:localhost:9050".format(electrs_onion_hostname) electrs_onion_command = "./electrum -1 -s {}:50002:s -p socks5:localhost:9050".format(electrs_onion_hostname)
else: else:

View File

@ -47,6 +47,7 @@
</div> </div>
</div> </div>
<!--
<div class="divider" style="width: 800px;"></div> <div class="divider" style="width: 800px;"></div>
<div class="app_tile_row"> <div class="app_tile_row">
@ -71,6 +72,7 @@
</div> </div>
{% endif %} {% endif %}
</div> </div>
-->
{% include 'includes/footer.html' %} {% include 'includes/footer.html' %}
</body> </body>

View File

@ -77,7 +77,7 @@
<div class="app_status_icon {% if product_key_skipped %}gray{% else %}green{% endif %}"></div> <div class="app_status_icon {% if product_key_skipped %}gray{% else %}green{% endif %}"></div>
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/tor.png")}}"/></div> <div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/tor.png")}}"/></div>
<div class="app_title">Tor Services</div> <div class="app_title">Tor Services</div>
<div class="app_status"></div> <div class="app_status">Remote Access</div>
<div class="app_contents"> <div class="app_contents">
{% if product_key_skipped %} {% if product_key_skipped %}
Premium Feature Premium Feature

View File

@ -21,7 +21,7 @@
{% include 'includes/message_display.html' %} {% include 'includes/message_display.html' %}
<div class="main_header">Tor Services</div> <div class="main_header">Core Services</div>
<br/> <br/>
<div class="app_tile_row"> <div class="app_tile_row">
@ -35,61 +35,27 @@
</div> </div>
</div> </div>
<div class="divider" style="width: 800px;"></div> <br/>
<div class="main_header">Tor Onion URLs</div>
<table class="bitcoind_table">
<thead class="bitcoind_table_header">
<td>Service</td>
<td>Address</td>
<td>Port</td>
<td>Password</td>
</thead>
<tbody>
{% for service in services %}
<tr>
<td><b>{{ service.service }}</b></td>
<td>{{ service.address }}</td>
<td>{{ service.port }}</td>
<td>{{ service.password }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="app_tile_row">
<div class="info_tile">
<div class="info_tile_header">Electrum Server</div>
<div class="info_tile_contents">Tor Enabled</div>
</div>
<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>
</div>
<div class="divider" style="width: 800px;"></div>
<div class="app_tile_row">
<div class="info_tile">
<div class="info_tile_header">LND</div>
<div class="info_tile_contents">Tor Enabled</div>
</div>
<div class="info_tile">
<div class="info_tile_header">LND gRPC Port</div>
<div class="info_tile_contents">10009</div>
</div>
<div class="info_tile">
<div class="info_tile_header">LND REST Port</div>
<div class="info_tile_contents">10080</div>
</div>
</div>
<div class="app_tile_row">
<div class="info_tile">
<div class="info_tile_header">LND Tor Hostname</div>
<div class="info_tile_contents">{{lnd_onion_hostname}}</div>
</div>
<!--
<div class="info_tile">
<div class="info_tile_header">LND Tor Client Name</div>
<div class="info_tile_contents">mynode</div>
</div>
-->
<div class="info_tile">
<div class="info_tile_header">LND Tor Client Password</div>
<div class="info_tile_contents">{{lnd_onion_password}}</div>
</div>
</div>
{% include 'includes/footer.html' %} {% include 'includes/footer.html' %}
</body> </body>

View File

@ -12,10 +12,8 @@ mynode_tor = Blueprint('mynode_tor',__name__)
### Page functions ### Page functions
@mynode_tor.route("/tor") @mynode_tor.route("/tor")
def page_tor(): def page_tor():
electrs_onion_hostname = "..." mynode_onion_hostname = "..."
electrs_onion_command = "..." mynode_onion_password = "..."
lnd_onion_hostname = "..."
lnd_onion_password = "..."
# Check if we are premium # Check if we are premium
if is_community_edition(): if is_community_edition():
@ -23,30 +21,31 @@ def page_tor():
# Get Onion URLs # Get Onion URLs
try: try:
if os.path.isfile("/var/lib/tor/electrs_hidden_service/hostname"): if os.path.isfile("/var/lib/tor/mynode/hostname"):
with open("/var/lib/tor/electrs_hidden_service/hostname") as f: with open("/var/lib/tor/mynode/hostname") as f:
electrs_onion_hostname = f.read().strip()
electrs_onion_command = "./electrum -1 -s {}:50002:s -p socks5:localhost:9050".format(electrs_onion_hostname)
else:
electrs_onion_hostname = "disabled"
electrs_onion_command = "disabled"
if os.path.isfile("/var/lib/tor/lnd_api/hostname"):
with open("/var/lib/tor/lnd_api/hostname") as f:
contents = f.read().split() contents = f.read().split()
lnd_onion_hostname = contents[0] mynode_onion_hostname = contents[0]
lnd_onion_password = contents[1] mynode_onion_password = contents[1]
except: except:
electrs_onion_hostname = "error" mynode_onion_hostname = "error"
lnd_onion_hostname = "error" mynode_onion_password = "error"
services = []
services.append({"service":"myNode Web","address":mynode_onion_hostname,"port": "80","password":mynode_onion_password})
services.append({"service":"LND Hub","address":mynode_onion_hostname,"port": "3000","password":mynode_onion_password})
services.append({"service":"BTC RPC Explorer","address":mynode_onion_hostname,"port": "3002","password":mynode_onion_password})
services.append({"service":"LND Admin","address":mynode_onion_hostname,"port": "3004","password":mynode_onion_password})
services.append({"service":"Ride the Lightning","address":mynode_onion_hostname,"port": "3010","password":mynode_onion_password})
services.append({"service":"LND API (gRPC)","address":mynode_onion_hostname,"port": "10009","password":mynode_onion_password})
services.append({"service":"LND API (REST)","address":mynode_onion_hostname,"port": "10080","password":mynode_onion_password})
services.append({"service":"Electrum Server","address":mynode_onion_hostname,"port": "50001","password":mynode_onion_password})
services.append({"service":"Electrum Server","address":mynode_onion_hostname,"port": "50002","password":mynode_onion_password})
# Load page # Load page
templateData = { templateData = {
"title": "myNode Tor Services", "title": "myNode Tor Services",
"electrs_onion_hostname": electrs_onion_hostname, "mynode_onion_hostname": mynode_onion_hostname,
"electrs_onion_command": electrs_onion_command, "mynode_onion_password": mynode_onion_password,
"lnd_onion_hostname": lnd_onion_hostname, "services": services
"lnd_onion_password": lnd_onion_password
} }
return render_template('tor.html', **templateData) return render_template('tor.html', **templateData)