mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-09-24 09:43:24 +00:00
Add LND Tor service and lndconnect QR codes for it
This commit is contained in:
parent
aba7ebf9bf
commit
185539e8a6
|
@ -23,21 +23,24 @@ while true; do
|
|||
echo "Generating lndconnect QR codes..."
|
||||
rm -rf /tmp/mynode_lndconnect/*
|
||||
|
||||
# Find URLs
|
||||
LND_TOR_ADDR=$(cat /var/lib/tor/lnd_api/hostname | awk '{print $1}')
|
||||
|
||||
# Generate QR Codes
|
||||
#lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet
|
||||
#cp -f lndconnect-qr.png lndconnect_remote_grpc.png
|
||||
lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet --localip
|
||||
cp -f lndconnect-qr.png lndconnect_local_grpc.png
|
||||
#lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet -p 10080
|
||||
#cp -f lndconnect-qr.png lndconnect_remote_rest.png
|
||||
lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet --localip -p 10080
|
||||
cp -f lndconnect-qr.png lndconnect_local_rest.png
|
||||
lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet --host=$LND_TOR_ADDR
|
||||
cp -f lndconnect-qr.png lndconnect_tor_grpc.png
|
||||
lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet --host=$LND_TOR_ADDR -p 10080
|
||||
cp -f lndconnect-qr.png lndconnect_tor_rest.png
|
||||
|
||||
# Generate Text Files
|
||||
#lndconnect --lnddir=/mnt/hdd/mynode/lnd -j --bitcoin.mainnet > lndconnect_remote_grpc.txt
|
||||
lndconnect --lnddir=/mnt/hdd/mynode/lnd -j --bitcoin.mainnet --localip > lndconnect_local_grpc.txt
|
||||
#lndconnect --lnddir=/mnt/hdd/mynode/lnd -j --bitcoin.mainnet -p 10080 > lndconnect_remote_rest.txt
|
||||
lndconnect --lnddir=/mnt/hdd/mynode/lnd -j --bitcoin.mainnet --localip -p 10080 > lndconnect_local_rest.txt
|
||||
lndconnect --lnddir=/mnt/hdd/mynode/lnd -j --bitcoin.mainnet --host=$LND_TOR_ADDR > lndconnect_tor_grpc.txt
|
||||
lndconnect --lnddir=/mnt/hdd/mynode/lnd -j --bitcoin.mainnet --host=$LND_TOR_ADDR -p 10080 > lndconnect_tor_rest.txt
|
||||
|
||||
echo "Done! Waiting until LND changes, then regen lndconnect codes!"
|
||||
inotifywait -e modify -e create -e delete $LND_ADMIN_MACAROON_FILE
|
||||
|
|
|
@ -78,7 +78,8 @@ def unset_skipped_product_key():
|
|||
def skipped_product_key():
|
||||
return os.path.isfile("/home/bitcoin/.mynode/.product_key_skipped") or \
|
||||
os.path.isfile("/mnt/hdd/mynode/settings/.product_key_skipped")
|
||||
|
||||
def is_community_edition():
|
||||
return skipped_product_key()
|
||||
|
||||
def delete_product_key():
|
||||
os.system("rm -rf /home/bitcoin/.mynode/.product_key")
|
||||
|
|
|
@ -4,6 +4,7 @@ from threading import Timer
|
|||
from bitcoin_info import *
|
||||
from lightning_info import *
|
||||
from settings import reboot_device
|
||||
from device_info import is_community_edition
|
||||
import base64
|
||||
import subprocess
|
||||
import json
|
||||
|
@ -217,25 +218,31 @@ def page_lnd_lndconnect():
|
|||
|
||||
lndconnect_local_grpc_text = get_text_contents("/tmp/mynode_lndconnect/lndconnect_local_grpc.txt")
|
||||
lndconnect_local_rest_text = get_text_contents("/tmp/mynode_lndconnect/lndconnect_local_rest.txt")
|
||||
lndconnect_remote_grpc_text = get_text_contents("/tmp/mynode_lndconnect/lndconnect_remote_grpc.txt")
|
||||
lndconnect_remote_rest_text = get_text_contents("/tmp/mynode_lndconnect/lndconnect_remote_rest.txt")
|
||||
lndconnect_tor_grpc_text = get_text_contents("/tmp/mynode_lndconnect/lndconnect_tor_grpc.txt")
|
||||
lndconnect_tor_rest_text = get_text_contents("/tmp/mynode_lndconnect/lndconnect_tor_rest.txt")
|
||||
if is_community_edition():
|
||||
lndconnect_tor_grpc_text = "Premium Feature"
|
||||
lndconnect_tor_rest_text = "Premium Feature"
|
||||
|
||||
lndconnect_local_grpc_img = get_image_contents("/tmp/mynode_lndconnect/lndconnect_local_grpc.png")
|
||||
lndconnect_local_rest_img = get_image_contents("/tmp/mynode_lndconnect/lndconnect_local_rest.png")
|
||||
lndconnect_remote_grpc_img = get_image_contents("/tmp/mynode_lndconnect/lndconnect_remote_grpc.png")
|
||||
lndconnect_remote_rest_img = get_image_contents("/tmp/mynode_lndconnect/lndconnect_remote_rest.png")
|
||||
|
||||
lndconnect_tor_grpc_img = get_image_contents("/tmp/mynode_lndconnect/lndconnect_tor_grpc.png")
|
||||
lndconnect_tor_rest_img = get_image_contents("/tmp/mynode_lndconnect/lndconnect_tor_rest.png")
|
||||
if is_community_edition():
|
||||
lndconnect_tor_grpc_img = get_image_contents("/var/www/mynode/static/images/dots.png")
|
||||
lndconnect_tor_rest_img = get_image_contents("/var/www/mynode/static/images/dots.png")
|
||||
|
||||
# Show lndconnect page
|
||||
templateData = {
|
||||
"title": "myNode Lightning Wallet",
|
||||
"lndconnect_local_grpc_text": lndconnect_local_grpc_text,
|
||||
"lndconnect_local_rest_text": lndconnect_local_rest_text,
|
||||
"lndconnect_remote_grpc_text": lndconnect_remote_grpc_text,
|
||||
"lndconnect_remote_rest_text": lndconnect_remote_rest_text,
|
||||
"lndconnect_tor_grpc_text": lndconnect_tor_grpc_text,
|
||||
"lndconnect_tor_rest_text": lndconnect_tor_rest_text,
|
||||
"lndconnect_local_grpc_img": lndconnect_local_grpc_img,
|
||||
"lndconnect_local_rest_img": lndconnect_local_rest_img,
|
||||
"lndconnect_remote_grpc_img": lndconnect_remote_grpc_img,
|
||||
"lndconnect_remote_rest_img": lndconnect_remote_rest_img
|
||||
"lndconnect_tor_grpc_img": lndconnect_tor_grpc_img,
|
||||
"lndconnect_tor_rest_img": lndconnect_tor_rest_img
|
||||
}
|
||||
return render_template('lndconnect.html', **templateData)
|
||||
|
||||
|
|
BIN
rootfs/standard/var/www/mynode/static/images/dots.png
Normal file
BIN
rootfs/standard/var/www/mynode/static/images/dots.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
BIN
rootfs/standard/var/www/mynode/static/images/upgrade.png
Normal file
BIN
rootfs/standard/var/www/mynode/static/images/upgrade.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
|
@ -30,8 +30,10 @@
|
|||
<div class="main_header">LND Connect</div>
|
||||
<div id="lndconnect_tabs" style="width: 800px;">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">gRPC</a></li>
|
||||
<li><a href="#tabs-2">REST</a></li>
|
||||
<li><a href="#tabs-1">gRPC Local IP</a></li>
|
||||
<li><a href="#tabs-2">REST Local IP</a></li>
|
||||
<li><a href="#tabs-3">gRPC Tor</a></li>
|
||||
<li><a href="#tabs-4">REST Tor</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
<img class="lndconnect_qr_code" src="data:image/png;base64,{{lndconnect_local_grpc_img}}"/>
|
||||
|
@ -41,6 +43,14 @@
|
|||
<img class="lndconnect_qr_code" src="data:image/png;base64,{{lndconnect_local_rest_img}}"/>
|
||||
<p>{{ lndconnect_local_rest_text }}</p>
|
||||
</div>
|
||||
<div id="tabs-3">
|
||||
<img class="lndconnect_qr_code" src="data:image/png;base64,{{lndconnect_tor_grpc_img}}"/>
|
||||
<p>{{ lndconnect_tor_grpc_text }}</p>
|
||||
</div>
|
||||
<div id="tabs-4">
|
||||
<img class="lndconnect_qr_code" src="data:image/png;base64,{{lndconnect_tor_rest_img}}"/>
|
||||
<p>{{ lndconnect_tor_rest_text }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user