Add Warden Terminal

This commit is contained in:
Taylor Helsper 2021-12-05 16:11:22 -06:00
parent 5f551c3d58
commit c3411446e1
14 changed files with 199 additions and 20 deletions

View File

@ -60,24 +60,6 @@ https://github.com/lightningnetwork/lnd/blob/master/docs/watchtower.md
https://github.com/openoms/lightning-node-management/blob/master/advanced-tools/watchtower.md
## Add WARden Terminal Application
Known active efforts: none
Payout: 250k sats
Warden Terminal is a very interesting application that users would like to see available on myNode.
Acceptance Criteria:
- Warden Terminal application installed similar to existing applications
- Warden Terminal icon visible on the home screen
- Warden Terminal page in the UI that explains how to open the application in the Linux Terminal (similar to JoininBox)
- Verify install, re-install, uninstall options work on application page for Warden Terminal
- New `mynode-warden-terminal` command available in Linux Terminal to easily open application (similar to `mynode-joininbox`)
Helpful links:
https://github.com/pxsocs/warden_terminal
# Claimed Bounties

View File

@ -0,0 +1,7 @@
#!/bin/bash
# mynode-warden-terminal
# This script needs to be run with sudo so it can run as the bitcoin user
cp -f /usr/share/mynode/wardenterminal.ini /opt/mynode/wardenterminal/config.ini
sudo -u bitcoin bash -c "cd /opt/mynode/wardenterminal/; source env/bin/activate; python3 node_warden.py 2>/dev/null"

View File

@ -48,6 +48,8 @@ ufw allow 4080 comment 'allow Mempool'
ufw allow 4081 comment 'allow Mempool HTTPS'
ufw allow 5000 comment 'allow LNBits'
ufw allow 5001 comment 'allow LNBits HTTPS'
ufw allow 5010 comment 'allow Warden Terminal'
ufw allow 5011 comment 'allow Warden Terminal HTTPS'
ufw allow 5353 comment 'allow Avahi'
ufw allow 8899 comment 'allow Whirlpool'
ufw allow 9823 comment 'allow CKBunker'

View File

@ -949,6 +949,36 @@ if should_install_app "warden" ; then
fi
# Upgrade WARden Terminal
if should_install_app "wardenterminal" ; then
WARDEN_TERMINAL_UPGRADE_URL=https://github.com/pxsocs/warden_terminal/archive/$WARDEN_TERMINAL_VERSION.tar.gz
CURRENT=""
if [ -f $WARDEN_TERMINAL_VERSION_FILE ]; then
CURRENT=$(cat $WARDEN_TERMINAL_VERSION_FILE)
fi
if [ "$CURRENT" != "$WARDEN_TERMINAL_VERSION" ]; then
cd /opt/mynode
rm -rf wardenterminal
sudo -u bitcoin wget $WARDEN_TERMINAL_UPGRADE_URL -O wardenterminal.tar.gz
sudo -u bitcoin tar -xvf wardenterminal.tar.gz
sudo -u bitcoin rm wardenterminal.tar.gz
sudo -u bitcoin mv warden_terminal-* wardenterminal
cd wardenterminal
# Make venv
if [ ! -d env ]; then
sudo -u bitcoin python3 -m venv env
fi
source env/bin/activate
pip3 install -r requirements.txt
deactivate
echo $WARDEN_TERMINAL_VERSION > $WARDEN_TERMINAL_VERSION_FILE
fi
fi
# Upgrade Balance of Satoshis
if should_install_app "bos" ; then
CURRENT=""

View File

@ -31,3 +31,4 @@ echo $NETDATA_VERSION > $NETDATA_LATEST_VERSION_FILE
echo $WEBSSH2_VERSION > $WEBSSH2_LATEST_VERSION_FILE
echo $PYBLOCK_VERSION > $PYBLOCK_LATEST_VERSION_FILE
echo $WARDEN_VERSION > $WARDEN_LATEST_VERSION_FILE
echo $WARDEN_TERMINAL_VERSION > $WARDEN_TERMINAL_LATEST_VERSION_FILE

View File

@ -232,10 +232,23 @@
"app_tile_default_status_text": "Portfolio Tracker",
"can_uninstall": false,
"can_reinstall": false,
"show_on_homepage_page": false,
"show_on_homepage": false,
"show_on_application_page": false,
"homepage_order": 41
},
{
"name": "Warden Terminal",
"short_name": "wardenterminal",
"hide_status_icon": true,
"app_tile_default_status_text": "Bitcoin Dashboard",
"app_tile_button_href": "/wardenterminal",
"app_tile_button_text": "Info",
"can_uninstall": true,
"can_enable_disable": false,
"show_on_homepage": true,
"show_on_application_page": true,
"homepage_order": 41
},
{
"name": "PyBlock",
"short_name": "pyblock",

View File

@ -121,6 +121,10 @@ WARDEN_VERSION="0.91"
WARDEN_VERSION_FILE=/home/bitcoin/.mynode/warden_version
WARDEN_LATEST_VERSION_FILE=/home/bitcoin/.mynode/warden_version_latest
WARDEN_TERMINAL_VERSION=c327e84fb95fa6e29bb24d641e6215b3942d8da4
WARDEN_TERMINAL_VERSION_FILE=/home/bitcoin/.mynode/wardenterminal_version
WARDEN_TERMINAL_LATEST_VERSION_FILE=/home/bitcoin/.mynode/wardenterminal_version_latest
NETDATA_VERSION="v1.19.0"
NETDATA_VERSION_FILE=/mnt/hdd/mynode/settings/netdata_version
NETDATA_LATEST_VERSION_FILE=/mnt/hdd/mynode/settings/netdata_version_latest

View File

@ -0,0 +1,61 @@
[MAIN]
refresh = 10
price_refresh_interval = 30
welcome_sound = on
welcome_text = “Good evening, Dave. Everything is running smoothly. And you?”
large_text_font = standard
hide_private_info = False
sound = False
auto_scroll = False
message_widget = Running Bitcoin
tty = /dev/tty
output_to_monitor = False
node_url = mynode.local
auto_upgrade = False
[PORTFOLIO]
position_btc = 0.00
[CURRENCIES]
primary_fx = 'USD'
fx_list = ['USD','EUR', 'GBP', 'CAD']
[STOCKS]
gbtc_enabled = on
gbtc_shares = 0.000939303
gbtc_shares_asof = 07-29-2021
[ALERTS]
ssh_alert = on
[MEMPOOL]
block_found_sound = on
block_found_txt = 'Tick Tock. Next Block'
url = http://mynode.local:4080/
[QUOTES]
url = https://raw.githubusercontent.com/NakamotoInstitute/nakamotoinstitute.org/0bf08c48cd21655c76e8db06da39d16036a88594/data/quotes.json
[UMBREL]
url = http://umbrel.local/
[BITCOIN_RPC]
user = None
password = None
ip_address = None
port = None
[SPECTER]
specter_url = https://192.168.86.204:25441/
specter_login = None
specter_password = None
specter_port = 25441
[MYNODE]
url = http://mynode.local/
[SERVER]
host = 0.0.0.0
port = 5010
onion_server = True
onion_port = 80

View File

@ -11,6 +11,7 @@ from caravan import mynode_caravan
from sphinxrelay import mynode_sphinxrelay
from pyblock import mynode_pyblock
from bos import mynode_bos
from wardenterminal import mynode_wardenterminal
from lndmanage import mynode_lndmanage
from manage_apps import mynode_manage_apps
from tor import mynode_tor
@ -90,6 +91,7 @@ app.register_blueprint(mynode_caravan)
app.register_blueprint(mynode_sphinxrelay)
app.register_blueprint(mynode_pyblock)
app.register_blueprint(mynode_bos)
app.register_blueprint(mynode_wardenterminal)
app.register_blueprint(mynode_lndmanage)
app.register_blueprint(mynode_manage_apps)
app.register_blueprint(mynode_tor)

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -23,7 +23,7 @@
<div class="instructions">
<div class="instructions-header">Instructions to setup PyBlock</div>
<div class="instructions-header">Instructions to run PyBlock</div>
<ol class="instructions-steps">
<li>PyBlock is a tool for viewing and interacting with your node.</li>
<li>To get started, you need access to the Linux terminal of your myNode device.</li>

View File

@ -0,0 +1,53 @@
<!DOCTYPE html lang="en">
<head>
<title>{{ title }}</title>
{% include 'includes/head.html' %}
</head>
<body>
{% include 'includes/logo_header.html' %}
<div class="mynode_back_div">
<a class="ui-button ui-widget ui-corner-all mynode_back" href="/"><span class="ui-icon ui-icon-home"></span>home&nbsp;</a>
</div>
{% include 'includes/message_display.html' %}
<div class="main_header">Warden Terminal</div>
<br/>
<div class="app_tile_row">
<div class="info_tile">
<div class="info_tile_header">Status</div>
<div class="info_tile_contents">Ready</div>
</div>
</div>
<div class="instructions">
<div class="instructions-header">Instructions to run Warden Terminal</div>
<ol class="instructions-steps">
<li>Warden Terminal is a Bitcoin dashboard for viewing information.</li>
<li>To get started, you need access to the Linux terminal of your myNode device.</li>
<ul>
<li>A guide to access the Linux terminal is available on mynodebtc.com - <a href="https://mynodebtc.github.io/advanced/linux-terminal.html" target="_blank">guide</a></li>
</ul>
<li>Once you have terminal access, run the following command:</li>
<ul>
<li><pre>sudo mynode-warden-terminal</pre></li>
</ul>
<li>Enter your myNode password when prompted.</li>
<li>Enjoy Warden Terminal!</li>
</ol>
<br/><br/>
<!--
<div class="instructions-header">Tips and Notes</div>
<ul style="font-size: 12px;">
<li>Add tips and notes</li>
</ul>
-->
</div>
{% include 'includes/footer.html' %}
</body>
</html>

View File

@ -0,0 +1,23 @@
from flask import Blueprint, render_template, redirect, request, flash, send_from_directory
from user_management import check_logged_in
from device_info import read_ui_settings
from systemctl_info import *
import os
import time
import subprocess
import os
mynode_wardenterminal = Blueprint('mynode_wardenterminal',__name__)
### Page functions
@mynode_wardenterminal.route("/wardenterminal")
def pyblock_page():
check_logged_in()
# Load page
templateData = {
"title": "myNode Warden Terminal",
"ui_settings": read_ui_settings(),
}
return render_template('wardenterminal.html', **templateData)

View File

@ -22,6 +22,7 @@ apps = [{"name": "bitcoin/bitcoin", "current_version_var
{"name": "alexbosworth/balanceofsatoshis", "current_version_variable": "BOS_VERSION"},
{"name": "bitromortac/lndmanage", "current_version_variable": "LNDMANAGE_VERSION"},
{"name": "lnbits/lnbits", "current_version": "bcecf6d"},
{"name": "pxsocs/warden_terminal", "current_version": "64e5db1"},
{"name": "apotdevin/thunderhub", "current_version_variable": "THUNDERHUB_VERSION"},
{"name": "stakwork/sphinx-relay", "current_version_variable": "SPHINXRELAY_VERSION"},
{"name": "whirlpool/whirlpool-client-cli", "current_version_variable": "WHIRLPOOL_VERSION"},