Add button to regen LND TLS cert

This commit is contained in:
Taylor Helsper 2019-12-10 19:08:57 -06:00
parent 34a84650e7
commit d81210e70a
4 changed files with 21 additions and 3 deletions

View File

@ -25,7 +25,7 @@ while true; do
/usr/bin/expect /usr/bin/unlock_lnd.tcl
if [ $? -eq 0 ]; then
# Unlocked! Verify unlocked every time LND files change
inotifywait -r -e modify -e create -e delete /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/
inotifywait -r -e modify -e create -e delete /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/ /mnt/hdd/mynode/lnd/tls.cert
else
# Failed, try again in 15 seconds
/bin/sleep 15s

View File

@ -156,6 +156,9 @@ def stop_bitcoind():
def stop_lnd():
os.system("systemctl stop lnd")
def restart_lnd():
os.system("systemctl restart lnd")
def stop_quicksync():
os.system("systemctl stop quicksync")

View File

@ -124,6 +124,19 @@ def page_lnd():
}
return render_template('lnd.html', **templateData)
@mynode_lnd.route("/lnd/regen_tls_cert")
def lnd_regen_tls_cert():
check_logged_in()
os.system("rm /mnt/hdd/mynode/lnd/tls.cert")
os.system("rm /mnt/hdd/mynode/lnd/tls.key")
t = Timer(1.0, restart_lnd)
t.start()
flash("TLS Certificate Regenerated!", category="message")
return redirect(url_for(".page_lnd"))
@mynode_lnd.route("/lnd/tls.cert")
def lnd_tls_cert():
check_logged_in()

View File

@ -127,9 +127,11 @@
</div>
</div>
<div class="info_tile">
<div class="info_tile_header">TLS Certificate</div>
<div class="info_tile_header">&nbsp;&nbsp;&nbsp;&nbsp;TLS Certificate&nbsp;&nbsp;&nbsp;&nbsp;</div>
<div class="info_tile_contents">
<a class="ui-button ui-widget ui-corner-all mynode_button_small" style="width: 70%;" href="/lnd/tls.cert">download</a>
<a class="ui-button ui-widget ui-corner-all mynode_button_small" style="width: 32%;" href="/lnd/tls.cert">download</a>
<a class="ui-button ui-widget ui-corner-all mynode_button_small" style="width: 32%;" href="/lnd/regen_tls_cert">regenerate</a>
</div>
</div>
<div class="info_tile">