mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-11 16:09:16 +00:00
Large refactor for better application management
This commit is contained in:
parent
c0d22a1cb5
commit
26286be6f5
|
@ -1,10 +1,10 @@
|
|||
# bitcoind configuration
|
||||
# bitcoin configuration
|
||||
# /home/bitcoin/.bitcoin/bitcoin.conf
|
||||
|
||||
# remove the following line to enable Bitcoin mainnet
|
||||
#testnet=1
|
||||
|
||||
# Bitcoind options
|
||||
# Bitcoin options
|
||||
server=1
|
||||
daemon=1
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# bitcoind configuration
|
||||
# bitcoin configuration
|
||||
# /home/bitcoin/.bitcoin/bitcoin.conf
|
||||
|
||||
# remove the following line to enable Bitcoin mainnet
|
||||
#testnet=1
|
||||
|
||||
# Bitcoind options
|
||||
# Bitcoin options
|
||||
server=1
|
||||
daemon=1
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# bitcoind configuration
|
||||
# bitcoin configuration
|
||||
# /home/bitcoin/.bitcoin/bitcoin.conf
|
||||
|
||||
# remove the following line to enable Bitcoin mainnet
|
||||
#testnet=1
|
||||
|
||||
# Bitcoind options
|
||||
# Bitcoin options
|
||||
server=1
|
||||
daemon=1
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# bitcoind configuration
|
||||
# bitcoin configuration
|
||||
# /home/bitcoin/.bitcoin/bitcoin.conf
|
||||
|
||||
# remove the following line to enable Bitcoin mainnet
|
||||
#testnet=1
|
||||
|
||||
# Bitcoind options
|
||||
# Bitcoin options
|
||||
server=1
|
||||
daemon=1
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/var/log/flask
|
||||
/var/log/lndhub.log
|
||||
/var/log/lnd.log
|
||||
/var/log/litd.log
|
||||
/var/log/lit.log
|
||||
/var/log/lnd_backup.log
|
||||
/var/log/lnd_admin.log
|
||||
/var/log/mynode.log
|
||||
|
@ -12,7 +12,7 @@
|
|||
/var/log/rtl.log
|
||||
/var/log/caravan.log
|
||||
/var/log/www.log
|
||||
/var/log/bitcoind.log
|
||||
/var/log/bitcoin.log
|
||||
/var/log/unlock_lnd.log
|
||||
/var/log/mynode_docker_images.log
|
||||
{
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
if $programname == 'bitcoind' then /var/log/bitcoind.log
|
||||
if $programname == 'bitcoin' then /var/log/bitcoin.log
|
||||
& stop
|
|
@ -1,2 +1,2 @@
|
|||
if $programname == 'btc_rpc_explorer' then /dev/null
|
||||
if $programname == 'btcrpcexplorer' then /dev/null
|
||||
& stop
|
|
@ -1,2 +1,2 @@
|
|||
if $programname == 'litd' then /var/log/litd.log
|
||||
if $programname == 'lit' then /var/log/lit.log
|
||||
& stop
|
|
@ -1,2 +1,2 @@
|
|||
if $programname == 'loopd' then /var/log/loopd.log
|
||||
if $programname == 'loop' then /var/log/loop.log
|
||||
& stop
|
|
@ -1,5 +1,5 @@
|
|||
# bitcoind service
|
||||
# /etc/systemd/system/bitcoind.service
|
||||
# bitcoin service
|
||||
# /etc/systemd/system/bitcoin.service
|
||||
|
||||
[Unit]
|
||||
Description=Bitcoin daemon
|
||||
|
@ -10,9 +10,9 @@ ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
|||
ExecStartPre=/usr/bin/wait_on_uploader.sh
|
||||
ExecStartPre=/bin/sh -c 'cat /mnt/hdd/mynode/quicksync/.quicksync_complete'
|
||||
EnvironmentFile=/mnt/hdd/mynode/bitcoin/env
|
||||
ExecStart=/usr/local/bin/bitcoind -daemon $BTCARGS -deprecatedrpc=accounts -par=-1 -conf=/home/bitcoin/.bitcoin/bitcoin.conf -printtoconsole -pid=/home/bitcoin/.bitcoin/bitcoind.pid
|
||||
ExecStart=/usr/local/bin/bitcoind -daemon $BTCARGS -deprecatedrpc=accounts -par=-1 -conf=/home/bitcoin/.bitcoin/bitcoin.conf -printtoconsole -pid=/home/bitcoin/.bitcoin/bitcoin.pid
|
||||
ExecStartPost=+/usr/bin/mynode_post_bitcoin.sh
|
||||
PIDFile=/home/bitcoin/.bitcoin/bitcoind.pid
|
||||
PIDFile=/home/bitcoin/.bitcoin/bitcoin.pid
|
||||
User=bitcoin
|
||||
Group=bitcoin
|
||||
Type=forking
|
||||
|
@ -25,7 +25,7 @@ TimeoutSec=300
|
|||
RestartSec=30
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=bitcoind
|
||||
SyslogIdentifier=bitcoin
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=BTCPayServer service
|
||||
After=docker.service network-online.target bitcoind.service
|
||||
Requires=docker.service network-online.target bitcoind.service
|
||||
After=docker.service network-online.target bitcoin.service
|
||||
Requires=docker.service network-online.target bitcoin.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# BTC RPC Explorer service
|
||||
# /etc/systemd/system/btc_rpc_explorer.service
|
||||
# /etc/systemd/system/btcrpcexplorer.service
|
||||
|
||||
[Unit]
|
||||
Description=BTC RPC Explorer
|
||||
Wants=bitcoind.service
|
||||
After=bitcoind.service
|
||||
Wants=bitcoin.service
|
||||
After=bitcoin.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
|
@ -21,7 +21,7 @@ Restart=always
|
|||
RestartSec=60
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=btc_rpc_explorer
|
||||
SyslogIdentifier=btcrpcexplorer
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=Caravan
|
||||
Wants=bitcoind.service
|
||||
After=bitcoind.service
|
||||
Wants=bitcoin.service
|
||||
After=bitcoin.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=CKBunker
|
||||
Wants=bitcoind.service
|
||||
After=bitcoind.service
|
||||
Wants=bitcoin.service
|
||||
After=bitcoin.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=corsproxy_btcrpc
|
||||
Wants=bitcoind.service
|
||||
After=bitcoind.service
|
||||
Wants=bitcoin.service
|
||||
After=bitcoin.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=myNode Electrum Server
|
||||
Wants=bitcoind.service quicksync.service
|
||||
After=bitcoind.service
|
||||
Wants=bitcoin.service quicksync.service
|
||||
After=bitcoin.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
|
|
@ -17,7 +17,7 @@ RestartSec=30
|
|||
Nice=5
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=bitcoind
|
||||
SyslogIdentifier=bitcoin
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# litd service
|
||||
# /etc/systemd/system/litd.service
|
||||
# lit service
|
||||
# /etc/systemd/system/lit.service
|
||||
|
||||
[Unit]
|
||||
Description=Lightning Terminal
|
||||
Wants=bitcoind.service lnd.service
|
||||
After=bitcoind.service lnd.service
|
||||
Wants=bitcoin.service lnd.service
|
||||
After=bitcoin.service lnd.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
|
@ -25,7 +25,7 @@ Restart=always
|
|||
RestartSec=1
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=litd
|
||||
SyslogIdentifier=lit
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=LNBits
|
||||
Wants=bitcoind.service lnd.service
|
||||
After=bitcoind.service lnd.service
|
||||
Wants=bitcoin.service lnd.service
|
||||
After=bitcoin.service lnd.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=LND Lightning Daemon
|
||||
Wants=bitcoind.service
|
||||
After=bitcoind.service
|
||||
Wants=bitcoin.service
|
||||
After=bitcoin.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# loopd service
|
||||
# /etc/systemd/system/loopd.service
|
||||
# loop service
|
||||
# /etc/systemd/system/loop.service
|
||||
|
||||
[Unit]
|
||||
Description=loopd
|
||||
Description=loop
|
||||
Wants=lnd.service
|
||||
After=lnd.service
|
||||
|
||||
|
@ -21,7 +21,7 @@ Restart=always
|
|||
RestartSec=60
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=loopd
|
||||
SyslogIdentifier=loop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,5 +1,5 @@
|
|||
# Mempool service
|
||||
# /etc/systemd/system/mempoolspace.service
|
||||
# /etc/systemd/system/mempool.service
|
||||
|
||||
[Unit]
|
||||
Description=Mempool
|
||||
|
@ -29,7 +29,7 @@ Restart=always
|
|||
RestartSec=30
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=mempoolspace
|
||||
SyslogIdentifier=mempool
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,8 +1,8 @@
|
|||
# poold service
|
||||
# /etc/systemd/system/poold.service
|
||||
# pool service
|
||||
# /etc/systemd/system/pool.service
|
||||
|
||||
[Unit]
|
||||
Description=poold
|
||||
Description=pool
|
||||
Wants=lnd.service
|
||||
After=lnd.service
|
||||
|
||||
|
@ -10,7 +10,7 @@ After=lnd.service
|
|||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
ExecStartPre=/usr/bin/wait_on_lnd.sh
|
||||
EnvironmentFile=/mnt/hdd/mynode/pool/env
|
||||
ExecStart=/usr/local/bin/poold --network=${NETWORK} --basedir=/mnt/hdd/mynode/pool
|
||||
ExecStart=/usr/local/bin/pool --network=${NETWORK} --basedir=/mnt/hdd/mynode/pool
|
||||
|
||||
User=bitcoin
|
||||
Group=bitcoin
|
||||
|
@ -21,7 +21,7 @@ Restart=always
|
|||
RestartSec=60
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=poold
|
||||
SyslogIdentifier=pool
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=RTL
|
||||
Wants=bitcoind.service
|
||||
After=bitcoind.service
|
||||
Wants=bitcoin.service
|
||||
After=bitcoin.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=myNode Add Seed Peers
|
||||
Wants=bitcoind.service
|
||||
After=bitcoind.service
|
||||
Wants=bitcoin.service
|
||||
After=bitcoin.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=Specter
|
||||
Wants=bitcoind.service
|
||||
After=bitcoind.service
|
||||
Wants=bitcoin.service
|
||||
After=bitcoin.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=Proxy for Secure Electrs
|
||||
Wants=mynode.service bitcoind.service
|
||||
After=mynode.service bitcoind.service
|
||||
Wants=mynode.service bitcoin.service
|
||||
After=mynode.service bitcoin.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
|
|
@ -22,6 +22,6 @@ TOR_RELAY_NICKNAME=
|
|||
TOR_RELAY_EMAIL=
|
||||
|
||||
# myNode Additions
|
||||
BTCPAY_VERSION=1.0.6.2
|
||||
NBXPLORER_VERSION=2.1.47
|
||||
BTCPAY_VERSION=REPLACE_BTCPAY_VERSION
|
||||
NBXPLORER_VERSION=REPLACE_NBXPLORER_VERSION
|
||||
POSTGRES_VERSION=9.6.5
|
|
@ -9662,10 +9662,10 @@
|
|||
# dim system.slice_lndconnect.service algorithm = incremental
|
||||
# dim system.slice_lndconnect.service multiplier = 100
|
||||
# dim system.slice_lndconnect.service divisor = 100
|
||||
# dim system.slice_bitcoind.service name = bitcoind
|
||||
# dim system.slice_bitcoind.service algorithm = incremental
|
||||
# dim system.slice_bitcoind.service multiplier = 100
|
||||
# dim system.slice_bitcoind.service divisor = 100
|
||||
# dim system.slice_bitcoin.service name = bitcoind
|
||||
# dim system.slice_bitcoin.service algorithm = incremental
|
||||
# dim system.slice_bitcoin.service multiplier = 100
|
||||
# dim system.slice_bitcoin.service divisor = 100
|
||||
# dim system.slice_rc-local.service name = rc-local
|
||||
# dim system.slice_rc-local.service algorithm = incremental
|
||||
# dim system.slice_rc-local.service multiplier = 100
|
||||
|
@ -9967,10 +9967,10 @@
|
|||
# dim system.slice_lndconnect.service algorithm = absolute
|
||||
# dim system.slice_lndconnect.service multiplier = 1
|
||||
# dim system.slice_lndconnect.service divisor = 1048576
|
||||
# dim system.slice_bitcoind.service name = bitcoind
|
||||
# dim system.slice_bitcoind.service algorithm = absolute
|
||||
# dim system.slice_bitcoind.service multiplier = 1
|
||||
# dim system.slice_bitcoind.service divisor = 1048576
|
||||
# dim system.slice_bitcoin.service name = bitcoind
|
||||
# dim system.slice_bitcoin.service algorithm = absolute
|
||||
# dim system.slice_bitcoin.service multiplier = 1
|
||||
# dim system.slice_bitcoin.service divisor = 1048576
|
||||
# dim system.slice_rc-local.service name = rc-local
|
||||
# dim system.slice_rc-local.service algorithm = absolute
|
||||
# dim system.slice_rc-local.service multiplier = 1
|
||||
|
@ -10272,10 +10272,10 @@
|
|||
# dim system.slice_lndconnect.service algorithm = incremental
|
||||
# dim system.slice_lndconnect.service multiplier = 1
|
||||
# dim system.slice_lndconnect.service divisor = 1024
|
||||
# dim system.slice_bitcoind.service name = bitcoind
|
||||
# dim system.slice_bitcoind.service algorithm = incremental
|
||||
# dim system.slice_bitcoind.service multiplier = 1
|
||||
# dim system.slice_bitcoind.service divisor = 1024
|
||||
# dim system.slice_bitcoin.service name = bitcoind
|
||||
# dim system.slice_bitcoin.service algorithm = incremental
|
||||
# dim system.slice_bitcoin.service multiplier = 1
|
||||
# dim system.slice_bitcoin.service divisor = 1024
|
||||
# dim system.slice_rc-local.service name = rc-local
|
||||
# dim system.slice_rc-local.service algorithm = incremental
|
||||
# dim system.slice_rc-local.service multiplier = 1
|
||||
|
@ -10577,10 +10577,10 @@
|
|||
# dim system.slice_lndconnect.service algorithm = incremental
|
||||
# dim system.slice_lndconnect.service multiplier = 1
|
||||
# dim system.slice_lndconnect.service divisor = 1024
|
||||
# dim system.slice_bitcoind.service name = bitcoind
|
||||
# dim system.slice_bitcoind.service algorithm = incremental
|
||||
# dim system.slice_bitcoind.service multiplier = 1
|
||||
# dim system.slice_bitcoind.service divisor = 1024
|
||||
# dim system.slice_bitcoin.service name = bitcoind
|
||||
# dim system.slice_bitcoin.service algorithm = incremental
|
||||
# dim system.slice_bitcoin.service multiplier = 1
|
||||
# dim system.slice_bitcoin.service divisor = 1024
|
||||
# dim system.slice_rc-local.service name = rc-local
|
||||
# dim system.slice_rc-local.service algorithm = incremental
|
||||
# dim system.slice_rc-local.service multiplier = 1
|
||||
|
@ -10882,10 +10882,10 @@
|
|||
# dim system.slice_lndconnect.service algorithm = incremental
|
||||
# dim system.slice_lndconnect.service multiplier = 1
|
||||
# dim system.slice_lndconnect.service divisor = 1
|
||||
# dim system.slice_bitcoind.service name = bitcoind
|
||||
# dim system.slice_bitcoind.service algorithm = incremental
|
||||
# dim system.slice_bitcoind.service multiplier = 1
|
||||
# dim system.slice_bitcoind.service divisor = 1
|
||||
# dim system.slice_bitcoin.service name = bitcoind
|
||||
# dim system.slice_bitcoin.service algorithm = incremental
|
||||
# dim system.slice_bitcoin.service multiplier = 1
|
||||
# dim system.slice_bitcoin.service divisor = 1
|
||||
# dim system.slice_rc-local.service name = rc-local
|
||||
# dim system.slice_rc-local.service algorithm = incremental
|
||||
# dim system.slice_rc-local.service multiplier = 1
|
||||
|
@ -11187,10 +11187,10 @@
|
|||
# dim system.slice_lndconnect.service algorithm = incremental
|
||||
# dim system.slice_lndconnect.service multiplier = 1
|
||||
# dim system.slice_lndconnect.service divisor = 1
|
||||
# dim system.slice_bitcoind.service name = bitcoind
|
||||
# dim system.slice_bitcoind.service algorithm = incremental
|
||||
# dim system.slice_bitcoind.service multiplier = 1
|
||||
# dim system.slice_bitcoind.service divisor = 1
|
||||
# dim system.slice_bitcoin.service name = bitcoind
|
||||
# dim system.slice_bitcoin.service algorithm = incremental
|
||||
# dim system.slice_bitcoin.service multiplier = 1
|
||||
# dim system.slice_bitcoin.service divisor = 1
|
||||
# dim system.slice_rc-local.service name = rc-local
|
||||
# dim system.slice_rc-local.service algorithm = incremental
|
||||
# dim system.slice_rc-local.service multiplier = 1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Wait to see if bitcoind is synced
|
||||
# Wait to see if bitcoin is synced
|
||||
echo "Checking if device is shutting down..."
|
||||
if [ ! -f "/tmp/shutting_down" ]; then
|
||||
echo "Not shutting down!"
|
||||
|
|
|
@ -23,11 +23,11 @@ printStatus() {
|
|||
# Apps are classified into three categories and arranged alphabetically
|
||||
|
||||
echo ":::::::Core-Apps:::::::"
|
||||
printStatus bitcoind electrs lnd tor vpn | column -t
|
||||
printStatus bitcoin electrs lnd tor vpn | column -t
|
||||
|
||||
echo -e "\n::::::Other-Apps:::::::"
|
||||
printStatus btc_rpc_explorer btcpayserver dojo firewall https glances \
|
||||
lndconnect lndhub mempoolspace netdata quicksync rtl webssh2 whirlpool www | column -t
|
||||
printStatus btcrpcexplorer btcpayserver dojo firewall https glances \
|
||||
lndconnect lndhub mempool netdata quicksync rtl webssh2 whirlpool www | column -t
|
||||
|
||||
echo -e "\n:::::::Beta-Apps:::::::"
|
||||
printStatus caravan lnbits specter thunderhub | column -t
|
||||
|
@ -36,5 +36,5 @@ printStatus caravan lnbits specter thunderhub | column -t
|
|||
|
||||
echo -e "\n::Background-Services::"
|
||||
printStatus bandwidth check_in corsproxy_btcrpc docker_images drive_check \
|
||||
invalid_block_check lnd_admin_files lnd_backup lnd_unlock loopd \
|
||||
invalid_block_check lnd_admin_files lnd_backup lnd_unlock loop pool lit \
|
||||
mynode rotate_logs tls_proxy torrent_check usb_driver_check | column -t
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
set -x
|
||||
set -e
|
||||
|
||||
# Try to get peer info - if it fails serice will restart until bitcoind is ready
|
||||
# Try to get peer info - if it fails serice will restart until bitcoin is ready
|
||||
bitcoin-cli getpeerinfo
|
||||
|
||||
# Give bitcoind some time to start
|
||||
# Give bitcoin some time to start
|
||||
sleep 2m
|
||||
|
||||
# Check if btc has peers
|
||||
|
|
|
@ -22,7 +22,7 @@ while true; do
|
|||
fi
|
||||
|
||||
# Download bitcoin whitepaper
|
||||
if [ -f "/mnt/hdd/mynode/.mynode_bitcoind_synced" ]; then
|
||||
if [ -f "/mnt/hdd/mynode/.mynode_bitcoin_synced" ]; then
|
||||
if [ ! -f /mnt/hdd/mynode/bitcoin/bitcoin_whitepaper.pdf ]; then
|
||||
sudo -u bitcoin bitcoin-cli getrawtransaction 54e48e5f5c656b26c3bca14a8c95aa583d07ebe84dde3b7dd4a78f4e4186e713 true | \
|
||||
jq -r '.vout[].scriptPubKey.asm' | cut -c3- | \
|
||||
|
|
|
@ -50,7 +50,7 @@ while true; do
|
|||
transmission-remote -u $UPLOAD_RATE
|
||||
transmission-remote -D
|
||||
transmission-remote -t 1 --peers 10
|
||||
elif [ ! -f "/mnt/hdd/mynode/.mynode_bitcoind_synced" ]; then
|
||||
elif [ ! -f "/mnt/hdd/mynode/.mynode_bitcoin_synced" ]; then
|
||||
echo "Bitcoin not synced, stopping upload, stopping download"
|
||||
transmission-remote -u 0
|
||||
transmission-remote -d 0
|
||||
|
|
|
@ -26,12 +26,11 @@ while true; do
|
|||
|
||||
echo "Checking for new webssh2..."
|
||||
WEBSSH2_UPGRADE_URL=https://github.com/billchurch/webssh2/archive/${WEBSSH2_VERSION}.tar.gz
|
||||
WEBSSH2_UPGRADE_URL_FILE=/mnt/hdd/mynode/settings/webssh2_url
|
||||
CURRENT=""
|
||||
if [ -f $WEBSSH2_UPGRADE_URL_FILE ]; then
|
||||
CURRENT=$(cat $WEBSSH2_UPGRADE_URL_FILE)
|
||||
if [ -f $WEBSSH2_VERSION_FILE ]; then
|
||||
CURRENT=$(cat $WEBSSH2_VERSION_FILE)
|
||||
fi
|
||||
if [ "$CURRENT" != "$WEBSSH2_UPGRADE_URL" ]; then
|
||||
if [ "$CURRENT" != "$WEBSSH2_VERSION" ]; then
|
||||
docker rmi webssh2 || true
|
||||
|
||||
cd /tmp/
|
||||
|
@ -43,19 +42,18 @@ while true; do
|
|||
cd webssh2
|
||||
docker build -t webssh2 .
|
||||
if [ $? == 0 ]; then
|
||||
echo $WEBSSH2_UPGRADE_URL > $WEBSSH2_UPGRADE_URL_FILE
|
||||
echo $WEBSSH2_VERSION > $WEBSSH2_VERSION_FILE
|
||||
fi
|
||||
fi
|
||||
|
||||
# Upgrade mempool
|
||||
MEMPOOL_URL=https://github.com/mempool/mempool/archive/${MEMPOOL_VERSION}.tar.gz
|
||||
MEMPOOL_URL_FILE=/mnt/hdd/mynode/settings/mempoolspace_url
|
||||
echo "Checking for new mempool..."
|
||||
CURRENT=""
|
||||
if [ -f $MEMPOOL_UPGRADE_URL_FILE ]; then
|
||||
CURRENT=$(cat $MEMPOOL_UPGRADE_URL_FILE)
|
||||
if [ -f $MEMPOOL_VERSION_FILE ]; then
|
||||
CURRENT=$(cat $MEMPOOL_VERSION_FILE)
|
||||
fi
|
||||
if [ "$CURRENT" != "$MEMPOOL_UPGRADE_URL" ]; then
|
||||
if [ "$CURRENT" != "$MEMPOOL_VERSION" ]; then
|
||||
docker rmi mempoolspace || true # Remove old v1 image
|
||||
|
||||
cd /mnt/hdd/mynode/mempool
|
||||
|
@ -77,12 +75,12 @@ while true; do
|
|||
docker pull mempool/frontend:${MEMPOOL_VERSION}
|
||||
docker pull mempool/backend:${MEMPOOL_VERSION}
|
||||
|
||||
enabled=$(systemctl is-enabled mempoolspace)
|
||||
enabled=$(systemctl is-enabled mempool)
|
||||
if [ "$enabled" = "enabled" ]; then
|
||||
systemctl restart mempoolspace &
|
||||
systemctl restart mempool &
|
||||
fi
|
||||
|
||||
echo $MEMPOOL_UPGRADE_URL > $MEMPOOL_UPGRADE_URL_FILE
|
||||
echo $MEMPOOL_VERSION > $MEMPOOL_VERSION_FILE
|
||||
fi
|
||||
|
||||
# Install Dojo
|
||||
|
@ -91,18 +89,22 @@ while true; do
|
|||
CURRENT=""
|
||||
INSTALL=true
|
||||
# If Upgrade file existed, mark "install" choice for legacy devices
|
||||
if [ -f $DOJO_UPGRADE_URL_FILE ]; then
|
||||
if [ -f /mnt/hdd/mynode/settings/dojo_url ]; then
|
||||
touch /mnt/hdd/mynode/settings/mynode_dojo_install
|
||||
sync
|
||||
sleep 3s
|
||||
fi
|
||||
# Only install Dojo if marked for installation and testnet not enabled
|
||||
if [ -f /mnt/hdd/mynode/settings/mynode_dojo_install ] && [ ! -f $IS_TESTNET_ENABLED_FILE ]; then
|
||||
if [ -f $DOJO_UPGRADE_URL_FILE ]; then
|
||||
INSTALL=false
|
||||
CURRENT=$(cat $DOJO_UPGRADE_URL_FILE)
|
||||
if [ -f $DOJO_UPGRADE_URL_FILE ] && [ ! -f $DOJO_VERSION_FILE ]; then
|
||||
echo $DOJO_VERSION > $DOJO_VERSION_FILE
|
||||
sync
|
||||
fi
|
||||
if [ "$CURRENT" != "$DOJO_UPGRADE_URL" ]; then
|
||||
if [ -f $DOJO_VERSION_FILE ]; then
|
||||
INSTALL=false
|
||||
CURRENT=$(cat $DOJO_VERSION_FILE)
|
||||
fi
|
||||
if [ "$CURRENT" != "$DOJO_VERSION" ]; then
|
||||
MARK_DOJO_COMPLETE=1
|
||||
sudo mkdir -p /opt/download/dojo
|
||||
sudo mkdir -p /mnt/hdd/mynode/dojo
|
||||
|
@ -145,7 +147,7 @@ while true; do
|
|||
|
||||
# Mark dojo install complete
|
||||
if [ $MARK_DOJO_COMPLETE = 1 ]; then
|
||||
echo $DOJO_UPGRADE_URL > $DOJO_UPGRADE_URL_FILE
|
||||
echo $DOJO_VERSION > $DOJO_VERSION_FILE
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -20,6 +20,11 @@ if [ -f /mnt/hdd/mynode/bitcoin/testnet3/.cookie ]; then
|
|||
chown -R admin:admin /home/admin/.bitcoin/testnet3
|
||||
fi
|
||||
|
||||
# Make data folders readable for easier transfer between nodes
|
||||
chmod -R 755 /mnt/hdd/mynode/bitcoin/blocks || true
|
||||
chmod -R 755 /mnt/hdd/mynode/bitcoin/chainstate || true
|
||||
chmod -R 755 /mnt/hdd/mynode/bitcoin/indexes || true
|
||||
|
||||
# Make default wallets
|
||||
if [ ! -d ${WALLET_FOLDER}/joinmarket_wallet.dat ]; then
|
||||
bitcoin-cli createwallet joinmarket_wallet.dat > /dev/null 2>&1 || true
|
||||
|
|
|
@ -120,7 +120,7 @@ echo "" > /etc/nginx/sites-available/default
|
|||
dpkg --configure -a
|
||||
|
||||
# Install any pip software
|
||||
pip2 install tzupdate virtualenv pysocks redis qrcode image --no-cache-dir
|
||||
pip2 install tzupdate virtualenv pysocks redis qrcode image subprocess32 --no-cache-dir
|
||||
|
||||
|
||||
# Update Python3 to 3.7.X
|
||||
|
@ -261,7 +261,7 @@ if [ "$CURRENT" != "$LND_VERSION" ]; then
|
|||
fi
|
||||
|
||||
# Upgrade Loop
|
||||
echo "Upgrading loopd..."
|
||||
echo "Upgrading loop..."
|
||||
LOOP_ARCH="loop-linux-armv7"
|
||||
if [ $IS_X86 = 1 ]; then
|
||||
LOOP_ARCH="loop-linux-amd64"
|
||||
|
@ -461,6 +461,7 @@ cd ~
|
|||
# echo $ELECTRS_VERSION > $ELECTRS_VERSION_FILE
|
||||
# fi
|
||||
# cd ~
|
||||
echo $ELECTRS_VERSION > $ELECTRS_VERSION_FILE
|
||||
|
||||
|
||||
# Install recent version of secp256k1
|
||||
|
@ -836,10 +837,10 @@ apt-get clean
|
|||
systemctl enable check_in
|
||||
systemctl enable background
|
||||
systemctl enable docker
|
||||
systemctl enable bitcoind
|
||||
systemctl enable bitcoin
|
||||
systemctl enable seed_bitcoin_peers
|
||||
systemctl enable lnd
|
||||
systemctl enable litd
|
||||
systemctl enable lit
|
||||
systemctl enable firewall
|
||||
systemctl enable invalid_block_check
|
||||
systemctl enable usb_driver_check
|
||||
|
@ -847,16 +848,26 @@ systemctl enable docker_images
|
|||
systemctl enable glances
|
||||
systemctl enable webssh2
|
||||
systemctl enable tor
|
||||
systemctl enable loopd
|
||||
systemctl enable poold
|
||||
systemctl enable loop
|
||||
systemctl enable pool
|
||||
systemctl enable rotate_logs
|
||||
systemctl enable corsproxy_btcrpc
|
||||
|
||||
# Disable any old services
|
||||
systemctl disable bitcoind || true
|
||||
systemctl disable poold || true
|
||||
systemctl disable loopd || true
|
||||
systemctl disable btc_rpc_explorer || true
|
||||
systemctl disable mempoolspace || true
|
||||
systemctl disable hitch || true
|
||||
systemctl disable mongodb || true
|
||||
systemctl disable lnd_admin || true
|
||||
systemctl disable dhcpcd || true
|
||||
rm /etc/systemd/system/bitcoind.service || true
|
||||
rm /etc/systemd/system/btc_rpc_explorer.service || true
|
||||
rm /etc/systemd/system/mempoolspace.service || true
|
||||
rm /etc/systemd/system/poold.service || true
|
||||
rm /etc/systemd/system/loopd.service || true
|
||||
|
||||
# Reload service settings
|
||||
systemctl daemon-reload
|
||||
|
|
|
@ -17,53 +17,16 @@ APP="$1"
|
|||
/usr/bin/mynode_stop_critical_services.sh
|
||||
|
||||
# Delete the app's version file so it will be re-installed
|
||||
if [ "$APP" = "bitcoin" ]; then
|
||||
rm -f $BTC_VERSION_FILE
|
||||
elif [ "$APP" = "lnd" ]; then
|
||||
rm -f $LND_VERSION_FILE
|
||||
elif [ "$APP" = "loop" ]; then
|
||||
rm -f $LOOP_VERSION_FILE
|
||||
elif [ "$APP" = "pool" ]; then
|
||||
rm -f $POOL_VERSION_FILE
|
||||
elif [ "$APP" = "lit" ]; then
|
||||
rm -f $LIT_VERSION_FILE
|
||||
elif [ "$APP" = "btcrpcexplorer" ]; then
|
||||
rm -f $BTCRPCEXPLORER_VERSION_FILE
|
||||
elif [ "$APP" = "caravan" ]; then
|
||||
rm -f $CARAVAN_VERSION_FILE
|
||||
elif [ "$APP" = "corsproxy" ]; then
|
||||
rm -f $CORSPROXY_VERSION_FILE
|
||||
elif [ "$APP" = "joinmarket" ]; then
|
||||
rm -f $JOINMARKET_VERSION_FILE
|
||||
elif [ "$APP" = "joininbox" ]; then
|
||||
rm -f $JOININBOX_VERSION_FILE
|
||||
elif [ "$APP" = "lnbits" ]; then
|
||||
rm -f $LNBITS_VERSION_FILE
|
||||
elif [ "$APP" = "lndconnect" ]; then
|
||||
rm -f $LNDCONNECT_VERSION_FILE
|
||||
elif [ "$APP" = "lndhub" ]; then
|
||||
rm -f $LNDHUB_VERSION_FILE
|
||||
elif [ "$APP" = "netdata" ]; then
|
||||
rm -f /home/bitcoin/.mynode/${APP}_version || true
|
||||
rm -f /mnt/hdd/mynode/settings/${APP}_version || true
|
||||
|
||||
# Custom re-install steps
|
||||
if [ "$APP" = "netdata" ]; then
|
||||
systemctl stop netdata
|
||||
docker rmi netdata/netdata || true
|
||||
elif [ "$APP" = "mempoolspace" ]; then
|
||||
rm -f /mnt/hdd/mynode/settings/mempoolspace_url
|
||||
systemctl stop mempoolspace
|
||||
docker rmi mempoolspace || true
|
||||
rm -rf /mnt/hdd/mynode/mempool/*
|
||||
elif [ "$APP" = "btcpayserver" ]; then
|
||||
. "/opt/mynode/btcpayserver/btcpay-env.sh" && cd "$BTCPAY_BASE_DIRECTORY" && . helpers.sh && btcpay_remove
|
||||
cd ~
|
||||
elif [ "$APP" = "rtl" ]; then
|
||||
rm -f $RTL_VERSION_FILE
|
||||
elif [ "$APP" = "specter" ]; then
|
||||
rm -f $SPECTER_VERSION_FILE
|
||||
elif [ "$APP" = "thunderhub" ]; then
|
||||
rm -f $THUNDERHUB_VERSION_FILE
|
||||
elif [ "$APP" = "ckbunker" ]; then
|
||||
rm -f $CKBUNKER_VERSION_FILE
|
||||
elif [ "$APP" = "sphinxrelay" ]; then
|
||||
rm -f $SPHINXRELAY_VERSION_FILE
|
||||
elif [ "$APP" = "tor" ]; then
|
||||
apt-get remove -y tor
|
||||
apt-get install -y tor
|
||||
|
@ -71,7 +34,7 @@ elif [ "$APP" = "ufw" ]; then
|
|||
apt-get purge -y ufw
|
||||
apt-get install -y ufw
|
||||
elif [ "$APP" = "webssh2" ]; then
|
||||
rm -f /mnt/hdd/mynode/settings/webssh2_url
|
||||
rm -f /mnt/hdd/mynode/settings/webssh2_version
|
||||
systemctl stop webssh2
|
||||
docker rmi webssh2
|
||||
elif [ "$APP" = "whirlpool" ]; then
|
||||
|
@ -88,8 +51,7 @@ elif [ "$APP" = "dojo" ]; then
|
|||
rm -rf /opt/download/dojo
|
||||
rm -rf /mnt/hdd/mynode/dojo
|
||||
else
|
||||
echo "UNKNOWN APP: $APP"
|
||||
exit 1
|
||||
echo "No custom re-install steps"
|
||||
fi
|
||||
|
||||
# Run post upgrade script
|
||||
|
|
|
@ -192,7 +192,7 @@ mkdir -p /mnt/hdd/mynode/tor_backup
|
|||
mkdir -p /tmp/flask_uploads
|
||||
echo "drive_mounted" > $MYNODE_STATUS_FILE
|
||||
chmod 777 $MYNODE_STATUS_FILE
|
||||
rm -rf $MYNODE_DIR/.mynode_bitcoind_synced
|
||||
rm -rf $MYNODE_DIR/.mynode_bitcoin_synced
|
||||
|
||||
|
||||
# Sync product key (SD preferred)
|
||||
|
@ -371,8 +371,15 @@ else
|
|||
sed -i "s/testnet/mainnet/g" /mnt/hdd/mynode/rtl/RTL-Config.json || true
|
||||
fi
|
||||
|
||||
# BTCPay Server Setup
|
||||
if [ -f /opt/mynode/btcpayserver/.env ]; then
|
||||
sed -i "s/REPLACE_BTCPAY_VERSION/$BTCPAYSERVER_VERSION/g" /opt/mynode/btcpayserver/.env || true
|
||||
sed -i "s/REPLACE_NBXPLORER_VERSION/$BTCPAYSERVER_NBXPLORER_VERSION/g" /opt/mynode/btcpayserver/.env || true
|
||||
fi
|
||||
echo $BTCPAYSERVER_VERSION > $BTCPAYSERVER_VERSION_FILE
|
||||
|
||||
# BTC RPC Explorer Config
|
||||
cp /usr/share/mynode/btc_rpc_explorer_env /opt/mynode/btc-rpc-explorer/.env
|
||||
cp /usr/share/mynode/btcrpcexplorer_env /opt/mynode/btc-rpc-explorer/.env
|
||||
chown bitcoin:bitcoin /opt/mynode/btc-rpc-explorer/.env
|
||||
|
||||
# LNBits Config
|
||||
|
@ -655,6 +662,16 @@ fi
|
|||
|
||||
# Make sure every enabled service is really enabled
|
||||
# This can happen from full-SD card upgrades
|
||||
# FUTURE: Loop over service names with enable / disable possibility like
|
||||
# services=electrs lndhub btcrpcexplorer mempool btcpayserver vpn ...
|
||||
# for s in services; do
|
||||
# if [ -f /mnt/hdd/mynode/settings/${s}_enabled ]; then
|
||||
# if systemctl status $s | grep "disabled;"; then
|
||||
# systemctl enable $s
|
||||
# STARTUP_MODIFIED=1
|
||||
# fi
|
||||
# fi
|
||||
# done
|
||||
STARTUP_MODIFIED=0
|
||||
if [ -f $ELECTRS_ENABLED_FILE ]; then
|
||||
if systemctl status electrs | grep "disabled;"; then
|
||||
|
@ -669,14 +686,14 @@ if [ -f $LNDHUB_ENABLED_FILE ]; then
|
|||
fi
|
||||
fi
|
||||
if [ -f $BTCRPCEXPLORER_ENABLED_FILE ]; then
|
||||
if systemctl status btc_rpc_explorer | grep "disabled;"; then
|
||||
systemctl enable btc_rpc_explorer
|
||||
if systemctl status btcrpcexplorer | grep "disabled;"; then
|
||||
systemctl enable btcrpcexplorer
|
||||
STARTUP_MODIFIED=1
|
||||
fi
|
||||
fi
|
||||
if [ -f $MEMPOOLSPACE_ENABLED_FILE ]; then
|
||||
if systemctl status mempoolspace | grep "disabled;"; then
|
||||
systemctl enable mempoolspace
|
||||
if [ -f $MEMPOOL_ENABLED_FILE ]; then
|
||||
if systemctl status mempool | grep "disabled;"; then
|
||||
systemctl enable mempool
|
||||
STARTUP_MODIFIED=1
|
||||
fi
|
||||
fi
|
||||
|
@ -723,26 +740,32 @@ echo $POOL_VERSION > $POOL_LATEST_VERSION_FILE
|
|||
echo $LIT_VERSION > $LIT_LATEST_VERSION_FILE
|
||||
echo $ELECTRS_VERSION > $ELECTRS_LATEST_VERSION_FILE
|
||||
echo $LNDHUB_VERSION > $LNDHUB_LATEST_VERSION_FILE
|
||||
echo $MEMPOOL_VERSION > $MEMPOOL_LATEST_VERSION_FILE
|
||||
echo $CARAVAN_VERSION > $CARAVAN_LATEST_VERSION_FILE
|
||||
echo $CORSPROXY_VERSION > $CORSPROXY_LATEST_VERSION_FILE
|
||||
echo $JOINMARKET_VERSION > $JOINMARKET_LATEST_VERSION_FILE
|
||||
echo $JOININBOX_VERSION > $JOININBOX_LATEST_VERSION_FILE
|
||||
echo $WHIRLPOOL_VERSION > $WHIRLPOOL_LATEST_VERSION_FILE
|
||||
echo $DOJO_VERSION > $DOJO_LATEST_VERSION_FILE
|
||||
echo $RTL_VERSION > $RTL_LATEST_VERSION_FILE
|
||||
echo $BTCRPCEXPLORER_VERSION > $BTCRPCEXPLORER_LATEST_VERSION_FILE
|
||||
echo $BTCPAYSERVER_VERSION > $BTCPAYSERVER_LATEST_VERSION_FILE
|
||||
echo $LNBITS_VERSION > $LNBITS_LATEST_VERSION_FILE
|
||||
echo $SPECTER_VERSION > $SPECTER_LATEST_VERSION_FILE
|
||||
echo $THUNDERHUB_VERSION > $THUNDERHUB_LATEST_VERSION_FILE
|
||||
echo $LNDCONNECT_VERSION > $LNDCONNECT_LATEST_VERSION_FILE
|
||||
echo $CKBUNKER_VERSION > $CKBUNKER_LATEST_VERSION_FILE
|
||||
echo $SPHINXRELAY_VERSION > $SPHINXRELAY_LATEST_VERSION_FILE
|
||||
|
||||
echo $WEBSSH2_VERSION > $WEBSSH2_LATEST_VERSION_FILE
|
||||
|
||||
# Weird hacks
|
||||
chmod +x /usr/bin/electrs || true # Once, a device didn't have the execute bit set for electrs
|
||||
timedatectl set-ntp True || true # Make sure NTP is enabled for Tor and Bitcoin
|
||||
rm -f /var/swap || true # Remove old swap file to save SD card space
|
||||
systemctl enable check_in || true
|
||||
systemctl enable bitcoin || true # Make sure new bitcoin service is used
|
||||
systemctl disable bitcoind || true # Make sure new bitcoin service is used
|
||||
rm /etc/systemd/system/bitcoind.service || true # Make sure new bitcoin service is used
|
||||
|
||||
|
||||
# Check for new versions
|
||||
|
|
|
@ -11,9 +11,9 @@ touch /tmp/shutting_down
|
|||
date
|
||||
systemctl stop glances lndhub netdata rtl webssh2 whirlpool dojo
|
||||
date
|
||||
systemctl stop btcpayserver btc_rpc_explorer specter caravan lnbits
|
||||
systemctl stop btcpayserver btcrpcexplorer specter caravan lnbits
|
||||
date
|
||||
systemctl stop thunderhub mempoolspace
|
||||
systemctl stop thunderhub mempool
|
||||
date
|
||||
|
||||
|
||||
|
@ -25,10 +25,10 @@ fi
|
|||
|
||||
# Stop core services
|
||||
date
|
||||
systemctl stop electrs loopd poold lnd quicksync
|
||||
systemctl stop electrs loop pool lnd quicksync
|
||||
date
|
||||
killall bitcoind || true
|
||||
systemctl stop bitcoind
|
||||
systemctl stop bitcoin
|
||||
date
|
||||
|
||||
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
set -x
|
||||
set -e
|
||||
|
||||
# Wait to see if bitcoind is synced
|
||||
# Wait to see if bitcoin is synced
|
||||
echo "Checking if Bitcoin is synced..."
|
||||
while [ ! -f "/mnt/hdd/mynode/.mynode_bitcoind_synced" ]; do
|
||||
while [ ! -f "/mnt/hdd/mynode/.mynode_bitcoin_synced" ]; do
|
||||
echo "BTC not synced, sleeping 30s"
|
||||
/bin/sleep 30s
|
||||
done
|
||||
|
||||
# And finally, make sure bitcoind responds to API requests
|
||||
# And finally, make sure bitcoin responds to API requests
|
||||
bitcoin-cli -datadir=/mnt/hdd/mynode/bitcoin -rpcwait getblockchaininfo
|
||||
|
||||
exit 0
|
|
@ -5,7 +5,7 @@ set -x
|
|||
|
||||
source /usr/share/mynode/mynode_config.sh
|
||||
|
||||
# Don't start bitcoind if we are marked as an uploader
|
||||
# Don't start bitcoin if we are marked as an uploader
|
||||
echo "Checking if uploader..."
|
||||
while [ -f $UPLOADER_FILE ]; do
|
||||
echo "We are an uploader, sleeping for 15 minutes..."
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# bitcoind configuration
|
||||
# bitcoin configuration
|
||||
# /home/bitcoin/.bitcoin/bitcoin.conf
|
||||
|
||||
# Bitcoind options
|
||||
# Bitcoin options
|
||||
server=1
|
||||
daemon=1
|
||||
|
||||
|
|
|
@ -28,11 +28,13 @@ LIT_LATEST_VERSION_FILE=/home/bitcoin/.mynode/lit_version_latest
|
|||
LIT_UPGRADE_MANIFEST_URL=https://github.com/lightninglabs/lightning-terminal/releases/download/$LIT_VERSION/manifest-$LIT_VERSION.txt
|
||||
LIT_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightninglabs/lightning-terminal/releases/download/$LIT_VERSION/manifest-guggero-$LIT_VERSION.sig
|
||||
|
||||
ELECTRS_VERSION="v0.8.6"
|
||||
ELECTRS_VERSION="v0.8.9"
|
||||
ELECTRS_VERSION_FILE=/home/bitcoin/.mynode/electrs_version
|
||||
ELECTRS_LATEST_VERSION_FILE=/home/bitcoin/.mynode/electrs_version_latest
|
||||
|
||||
MEMPOOL_VERSION="v2.1.2"
|
||||
MEMPOOL_VERSION_FILE=/mnt/hdd/mynode/settings/mempool_version
|
||||
MEMPOOL_LATEST_VERSION_FILE=/mnt/hdd/mynode/settings/mempool_version_latest
|
||||
|
||||
LNDHUB_VERSION="v1.3.0"
|
||||
LNDHUB_VERSION_FILE=/home/bitcoin/.mynode/lndhub_version
|
||||
|
@ -62,11 +64,18 @@ WHIRLPOOL_LATEST_VERSION_FILE=/home/bitcoin/.mynode/whirlpool_version_latest
|
|||
|
||||
DOJO_VERSION="v1.9.0"
|
||||
DOJO_TAR_HASH="b9709c18bb58f514a2f1db948b421b691b22fbf7713f5a68ce9627f35fcbf306"
|
||||
DOJO_VERSION_FILE=/mnt/hdd/mynode/settings/dojo_version
|
||||
DOJO_LATEST_VERSION_FILE=/mnt/hdd/mynode/settings/dojo_version_latest
|
||||
|
||||
RTL_VERSION="v0.10.1"
|
||||
RTL_VERSION_FILE=/home/bitcoin/.mynode/rtl_version
|
||||
RTL_LATEST_VERSION_FILE=/home/bitcoin/.mynode/rtl_version_latest
|
||||
|
||||
BTCPAYSERVER_VERSION="1.0.6.2"
|
||||
BTCPAYSERVER_NBXPLORER_VERSION="2.1.47"
|
||||
BTCPAYSERVER_VERSION_FILE=/home/bitcoin/.mynode/btcpayserver_version
|
||||
BTCPAYSERVER_LATEST_VERSION_FILE=/home/bitcoin/.mynode/btcpayserver_version_latest
|
||||
|
||||
BTCRPCEXPLORER_VERSION="v2.2.0"
|
||||
BTCRPCEXPLORER_VERSION_FILE=/home/bitcoin/.mynode/btcrpcexplorer_version
|
||||
BTCRPCEXPLORER_LATEST_VERSION_FILE=/home/bitcoin/.mynode/btcrpcexplorer_version_latest
|
||||
|
@ -96,3 +105,5 @@ SPHINXRELAY_VERSION_FILE=/home/bitcoin/.mynode/sphinxrelay_version
|
|||
SPHINXRELAY_LATEST_VERSION_FILE=/home/bitcoin/.mynode/sphinxrelay_version_latest
|
||||
|
||||
WEBSSH2_VERSION="v0.2.10-0"
|
||||
WEBSSH2_VERSION_FILE=/mnt/hdd/mynode/settings/webssh2_version
|
||||
WEBSSH2_LATEST_VERSION_FILE=/mnt/hdd/mynode/settings/webssh2_version_latest
|
||||
|
|
|
@ -75,10 +75,10 @@ ELECTRS_ENABLED_FILE="/mnt/hdd/mynode/.mynode_electrs_enabled"
|
|||
LNDHUB_ENABLED_FILE="/mnt/hdd/mynode/.mynode_lndhub_enabled"
|
||||
BTCRPCEXPLORER_ENABLED_FILE="/mnt/hdd/mynode/.mynode_btcrpceplorer_enabled"
|
||||
VPN_ENABLED_FILE="/mnt/hdd/mynode/.mynode_vpn_enabled"
|
||||
MEMPOOLSPACE_ENABLED_FILE="/mnt/hdd/mynode/.mynode_mempoolspace_enabled"
|
||||
MEMPOOL_ENABLED_FILE="/mnt/hdd/mynode/.mynode_mempoolspace_enabled"
|
||||
BTCPAYSERVER_ENABLED_FILE="/mnt/hdd/mynode/.mynode_btcpayserver_enabled"
|
||||
|
||||
BITCOIN_SYNCED_FILE="/mnt/hdd/mynode/.mynode_bitcoind_synced"
|
||||
BITCOIN_SYNCED_FILE="/mnt/hdd/mynode/.mynode_bitcoin_synced"
|
||||
QUICKSYNC_COMPLETE_FILE="$QUICKSYNC_DIR/.quicksync_complete"
|
||||
|
||||
IS_PREMIUM=0
|
||||
|
|
|
@ -138,7 +138,7 @@ def api_homepage_needs_refresh():
|
|||
data["needs_refresh"] = "yes"
|
||||
if not get_has_updated_btc_info():
|
||||
data["needs_refresh"] = "yes"
|
||||
if not is_bitcoind_synced():
|
||||
if not is_bitcoin_synced():
|
||||
data["needs_refresh"] = "yes"
|
||||
|
||||
return jsonify(data)
|
||||
|
|
238
rootfs/standard/var/www/mynode/application_info.py
Normal file
238
rootfs/standard/var/www/mynode/application_info.py
Normal file
|
@ -0,0 +1,238 @@
|
|||
from bitcoin_info import *
|
||||
from lightning_info import *
|
||||
from electrum_info import *
|
||||
from device_info import *
|
||||
from systemctl_info import *
|
||||
import copy
|
||||
import json
|
||||
import subprocess
|
||||
import re
|
||||
import os
|
||||
|
||||
# Cached data
|
||||
mynode_applications = None
|
||||
|
||||
# Utility functions
|
||||
def is_installed(current_version):
|
||||
return current_version != "not installed"
|
||||
|
||||
def create_application(name="NAME",
|
||||
short_name="SHORT_NAME",
|
||||
is_premium=False,
|
||||
can_reinstall=True,
|
||||
can_uninstall=False,
|
||||
show_on_homepage=False,
|
||||
show_on_application_page=True,
|
||||
can_enable_disable=True,
|
||||
icon="TODO",
|
||||
status="UNKNOWN"):
|
||||
app = {}
|
||||
app["name"] = name
|
||||
app["short_name"] = short_name
|
||||
app["is_premium"] = is_premium
|
||||
app["current_version"] = get_app_current_version(short_name)
|
||||
app["latest_version"] = get_app_latest_version(short_name)
|
||||
app["is_installed"] = is_installed(app["current_version"])
|
||||
app["can_reinstall"] = can_reinstall
|
||||
app["can_uninstall"] = can_uninstall
|
||||
app["show_on_homepage"] = show_on_homepage
|
||||
app["show_on_application_page"] = show_on_application_page
|
||||
app["can_enable_disable"] = can_enable_disable
|
||||
app["is_enabled"] = is_service_enabled(short_name)
|
||||
app["icon"] = icon
|
||||
#app["status"] = status # Should status be optional to include? Takes lots of time.
|
||||
#app["status_color"] = get_service_status_color(short_name)
|
||||
return app
|
||||
|
||||
def update_application(app):
|
||||
short_name = app["short_name"]
|
||||
app["is_enabled"] = is_service_enabled(short_name)
|
||||
#app["status"] = "???" # Should status be optional to include? Takes lots of time.
|
||||
#app["status_color"] = get_service_status_color(short_name)
|
||||
|
||||
def initialize_applications():
|
||||
global mynode_applications
|
||||
apps = []
|
||||
|
||||
apps.append(create_application(
|
||||
name="Bitcoin",
|
||||
short_name="bitcoin",
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="LND",
|
||||
short_name="lnd",
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Loop",
|
||||
short_name="loop",
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Pool",
|
||||
short_name="pool",
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Lightning Terminal",
|
||||
short_name="lit",
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Electrum Server",
|
||||
short_name="electrs",
|
||||
can_reinstall=False,
|
||||
show_on_homepage=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="BTC RPC Explorer",
|
||||
short_name="btcrpcexplorer",
|
||||
show_on_homepage=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Corsproxy",
|
||||
short_name="corsproxy",
|
||||
can_enable_disable=False,
|
||||
show_on_application_page=False
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="LNDConnect",
|
||||
short_name="lndconnect",
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="LND Hub",
|
||||
short_name="lndhub",
|
||||
show_on_homepage=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Ride the Lightning",
|
||||
short_name="rtl",
|
||||
show_on_homepage=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="BTCPay Server",
|
||||
short_name="btcpayserver",
|
||||
show_on_homepage=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Mempool",
|
||||
short_name="mempool",
|
||||
show_on_homepage=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Whirlpool",
|
||||
short_name="whirlpool",
|
||||
show_on_homepage=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Dojo",
|
||||
short_name="dojo",
|
||||
show_on_application_page=True,
|
||||
show_on_homepage=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Joinmarket",
|
||||
short_name="joinmarket",
|
||||
show_on_homepage=True,
|
||||
is_premium=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="JoininBox",
|
||||
short_name="joininbox",
|
||||
show_on_homepage=True,
|
||||
can_enable_disable=False,
|
||||
is_premium=True,
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Thunderhub",
|
||||
short_name="thunderhub",
|
||||
show_on_homepage=True,
|
||||
is_premium=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="LNbits",
|
||||
short_name="lnbits",
|
||||
show_on_homepage=True,
|
||||
is_premium=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Caravan",
|
||||
short_name="caravan",
|
||||
show_on_homepage=True,
|
||||
is_premium=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Specter",
|
||||
short_name="specter",
|
||||
show_on_homepage=True,
|
||||
is_premium=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="CKBunker",
|
||||
short_name="ckbunker",
|
||||
show_on_homepage=True,
|
||||
is_premium=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Sphinx Relay",
|
||||
short_name="sphinxrelay",
|
||||
show_on_homepage=True,
|
||||
is_premium=True
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Web SSH",
|
||||
short_name="webssh2"
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Netdata",
|
||||
short_name="netdata",
|
||||
show_on_application_page=False
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Tor",
|
||||
short_name="tor",
|
||||
show_on_application_page=False
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="VPN",
|
||||
short_name="vpn",
|
||||
show_on_homepage=True,
|
||||
can_reinstall=False,
|
||||
show_on_application_page=False
|
||||
))
|
||||
apps.append(create_application(
|
||||
name="Firewall",
|
||||
short_name="ufw",
|
||||
show_on_application_page=False
|
||||
))
|
||||
mynode_applications = copy.deepcopy(apps)
|
||||
|
||||
def update_applications():
|
||||
global mynode_applications
|
||||
|
||||
for app in mynode_applications:
|
||||
update_application(app)
|
||||
|
||||
def get_all_applications(order_by="none"):
|
||||
global mynode_applications
|
||||
|
||||
if mynode_applications == None:
|
||||
initialize_applications()
|
||||
else:
|
||||
update_applications()
|
||||
|
||||
apps = copy.deepcopy(mynode_applications)
|
||||
if order_by == "alphabetic":
|
||||
apps.sort(key=lambda x: x["name"])
|
||||
|
||||
return apps
|
||||
|
||||
def get_application(short_name):
|
||||
apps = get_all_applications()
|
||||
for app in apps:
|
||||
if app["short_name"] == short_name:
|
||||
return app
|
||||
return None
|
||||
|
||||
def is_application_valid(short_name):
|
||||
apps = get_all_applications()
|
||||
for app in apps:
|
||||
if app["short_name"] == short_name:
|
||||
return True
|
||||
return False
|
|
@ -28,7 +28,7 @@ def cleanup_download_wallets():
|
|||
|
||||
### Page functions
|
||||
@mynode_bitcoin.route("/bitcoin")
|
||||
def bitcoind_status_page():
|
||||
def bitcoin_status_page():
|
||||
check_logged_in()
|
||||
|
||||
# Get current information
|
||||
|
@ -95,7 +95,7 @@ def bitcoind_status_page():
|
|||
templateData = {
|
||||
"title": "myNode Bitcoin Error",
|
||||
"header": "Bitcoin Status",
|
||||
"message": Markup("Error communicating with bitcoind. Node may be busy syncing.<br/><br/>{}".format(str(e))),
|
||||
"message": Markup("Error communicating with bitcoin. Node may be busy syncing.<br/><br/>{}".format(str(e))),
|
||||
"ui_settings": read_ui_settings()
|
||||
}
|
||||
return render_template('error.html', **templateData)
|
||||
|
@ -167,7 +167,7 @@ def bitcoin_reset_config_page():
|
|||
return render_template('reboot.html', **templateData)
|
||||
|
||||
@mynode_bitcoin.route("/bitcoin/config", methods=['GET','POST'])
|
||||
def bitcoind_config_page():
|
||||
def bitcoin_config_page():
|
||||
check_logged_in()
|
||||
|
||||
# Handle form
|
||||
|
|
|
@ -36,7 +36,7 @@ def get_bitcoin_version():
|
|||
bitcoin_version = subprocess.check_output("bitcoind --version | egrep -o 'v[0-9]+\\.[0-9]+\\.[0-9]+'", shell=True)
|
||||
return bitcoin_version
|
||||
|
||||
def is_bitcoind_synced():
|
||||
def is_bitcoin_synced():
|
||||
if os.path.isfile( BITCOIN_SYNCED_FILE ):
|
||||
return True
|
||||
return False
|
||||
|
@ -236,7 +236,7 @@ def delete_bitcoin_custom_config():
|
|||
os.system("rm -f /mnt/hdd/mynode/settings/bitcoin_custom.conf")
|
||||
|
||||
def restart_bitcoin_actual():
|
||||
os.system("systemctl restart bitcoind")
|
||||
os.system("systemctl restart bitcoin")
|
||||
|
||||
def restart_bitcoin():
|
||||
t = Timer(1.0, restart_bitcoin_actual)
|
||||
|
|
|
@ -12,7 +12,7 @@ CHECKIN_URL = "https://www.mynodebtc.com/device_api/check_in.php"
|
|||
|
||||
# Bitcoin Variables
|
||||
BITCOIN_ENV_FILE = "/mnt/hdd/mynode/bitcoin/env"
|
||||
BITCOIN_SYNCED_FILE = "/mnt/hdd/mynode/.mynode_bitcoind_synced"
|
||||
BITCOIN_SYNCED_FILE = "/mnt/hdd/mynode/.mynode_bitcoin_synced"
|
||||
|
||||
# LND Variables
|
||||
LND_DATA_FOLDER = "/mnt/hdd/mynode/lnd/data/"
|
||||
|
@ -26,5 +26,5 @@ LNDHUB_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_lndhub_enabled"
|
|||
BTCRPCEXPLORER_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_btcrpceplorer_enabled"
|
||||
VPN_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_vpn_enabled"
|
||||
NETDATA_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_netdata_enabled"
|
||||
MEMPOOLSPACE_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_mempoolspace_enabled"
|
||||
MEMPOOL_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_mempoolspace_enabled"
|
||||
BTCPAYSERVER_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_btcpayserver_enabled"
|
||||
|
|
|
@ -7,7 +7,7 @@ from enable_disable_functions import *
|
|||
from lightning_info import is_lnd_ready, get_lnd_status, get_lnd_status_color
|
||||
from systemctl_info import *
|
||||
from electrum_info import get_electrs_status, is_electrs_active
|
||||
from bitcoin_info import get_bitcoin_status, is_bitcoind_synced
|
||||
from bitcoin_info import get_bitcoin_status, is_bitcoin_synced
|
||||
from datetime import timedelta
|
||||
import time
|
||||
import json
|
||||
|
@ -18,6 +18,11 @@ import string
|
|||
import redis
|
||||
import qrcode
|
||||
|
||||
try:
|
||||
import subprocess32
|
||||
except:
|
||||
pass
|
||||
|
||||
# Globals
|
||||
local_ip = "unknown"
|
||||
cached_data = {}
|
||||
|
@ -55,7 +60,7 @@ def factory_reset():
|
|||
# Disable services
|
||||
os.system("systemctl disable electrs --no-pager")
|
||||
os.system("systemctl disable lndhub --no-pager")
|
||||
os.system("systemctl disable btc_rpc_explorer --no-pager")
|
||||
os.system("systemctl disable btcrpcexplorer --no-pager")
|
||||
os.system("systemctl disable vpn --no-pager")
|
||||
|
||||
# Trigger drive to be reformatted on reboot
|
||||
|
@ -461,7 +466,7 @@ def get_drive_info(drive):
|
|||
def get_bitcoin_status_and_color():
|
||||
status = ""
|
||||
color = "gray"
|
||||
if get_service_status_code("bitcoind") == 0:
|
||||
if get_service_status_code("bitcoin") == 0:
|
||||
status = get_bitcoin_status()
|
||||
color = "green"
|
||||
else:
|
||||
|
@ -477,7 +482,7 @@ def get_lnd_status_and_color():
|
|||
def get_vpn_status_and_color():
|
||||
status = ""
|
||||
color = "gray"
|
||||
if is_vpn_enabled():
|
||||
if is_service_enabled("vpn"):
|
||||
color = get_service_status_color("vpn")
|
||||
status_code = get_service_status_code("vpn")
|
||||
if status_code != 0:
|
||||
|
@ -493,7 +498,7 @@ def get_rtl_status_and_color():
|
|||
status = "Lightning Wallet"
|
||||
color = "gray"
|
||||
if is_lnd_ready():
|
||||
if is_rtl_enabled():
|
||||
if is_service_enabled("rtl"):
|
||||
status_code = get_service_status_code("rtl")
|
||||
if status_code != 0:
|
||||
color = "red"
|
||||
|
@ -509,7 +514,7 @@ def get_lnbits_status_and_color():
|
|||
if is_testnet_enabled():
|
||||
return "Requires Mainnet", "gray"
|
||||
if is_lnd_ready():
|
||||
if is_lnbits_enabled():
|
||||
if is_service_enabled("lnbits"):
|
||||
status_code = get_service_status_code("lnbits")
|
||||
if status_code != 0:
|
||||
color = "red"
|
||||
|
@ -523,7 +528,7 @@ def get_thunderhub_status_and_color():
|
|||
color = "gray"
|
||||
status = "Lightning Wallet"
|
||||
if is_lnd_ready():
|
||||
if is_thunderhub_enabled():
|
||||
if is_service_enabled("thunderhub"):
|
||||
status_code = get_service_status_code("thunderhub")
|
||||
if status_code != 0:
|
||||
color = "red"
|
||||
|
@ -536,8 +541,8 @@ def get_thunderhub_status_and_color():
|
|||
def get_ckbunker_status_and_color():
|
||||
status = "Coldcard Signing Tool"
|
||||
color = "gray"
|
||||
if is_bitcoind_synced():
|
||||
if is_ckbunker_enabled():
|
||||
if is_bitcoin_synced():
|
||||
if is_service_enabled("ckbunker"):
|
||||
color = get_service_status_color("ckbunker")
|
||||
else:
|
||||
status = "Waiting on Bitcoin"
|
||||
|
@ -549,7 +554,7 @@ def get_sphinxrelay_status_and_color():
|
|||
if is_testnet_enabled():
|
||||
return "Requires Mainnet", "gray"
|
||||
if is_lnd_ready():
|
||||
if is_sphinxrelay_enabled():
|
||||
if is_service_enabled("sphinxrelay"):
|
||||
status_code = get_service_status_code("sphinxrelay")
|
||||
if status_code != 0:
|
||||
color = "red"
|
||||
|
@ -565,7 +570,7 @@ def get_lndhub_status_and_color():
|
|||
if is_testnet_enabled():
|
||||
return "Requires Mainnet", "gray"
|
||||
if is_lnd_ready():
|
||||
if is_lndhub_enabled():
|
||||
if is_service_enabled("lndhub"):
|
||||
color = get_service_status_color("lndhub")
|
||||
else:
|
||||
status = "Waiting on Lightning"
|
||||
|
@ -585,7 +590,7 @@ def get_btcpayserver_status_and_color():
|
|||
def get_electrs_status_and_color():
|
||||
status = ""
|
||||
color = "gray"
|
||||
if is_electrs_enabled():
|
||||
if is_service_enabled("electrs"):
|
||||
status_code = get_service_status_code("electrs")
|
||||
color = get_service_status_color("electrs")
|
||||
if status_code == 0:
|
||||
|
@ -596,11 +601,11 @@ def get_btcrpcexplorer_status_and_color_and_ready():
|
|||
status = "BTC RPC Explorer"
|
||||
color = "gray"
|
||||
ready = False
|
||||
if is_btcrpcexplorer_enabled():
|
||||
if is_bitcoind_synced():
|
||||
if is_service_enabled("btcrpcexplorer"):
|
||||
if is_bitcoin_synced():
|
||||
if is_electrs_active():
|
||||
color = get_service_status_color("btc_rpc_explorer")
|
||||
status_code = get_service_status_code("btc_rpc_explorer")
|
||||
color = get_service_status_color("btcrpcexplorer")
|
||||
status_code = get_service_status_code("btcrpcexplorer")
|
||||
if status_code == 0:
|
||||
ready = True
|
||||
else:
|
||||
|
@ -614,7 +619,7 @@ def get_btcrpcexplorer_status_and_color_and_ready():
|
|||
def get_caravan_status_and_color():
|
||||
status = ""
|
||||
color = "gray"
|
||||
if is_caravan_enabled():
|
||||
if is_service_enabled("caravan"):
|
||||
color = get_service_status_color("caravan")
|
||||
status = "Running"
|
||||
return status,color
|
||||
|
@ -622,7 +627,7 @@ def get_caravan_status_and_color():
|
|||
def get_specter_status_and_color():
|
||||
status = ""
|
||||
color = "gray"
|
||||
if is_specter_enabled():
|
||||
if is_service_enabled("specter"):
|
||||
color = get_service_status_color("specter")
|
||||
status = "Running"
|
||||
return status,color
|
||||
|
@ -630,12 +635,12 @@ def get_specter_status_and_color():
|
|||
def get_mempool_status_and_color():
|
||||
status = "Mempool Viewer"
|
||||
color = "gray"
|
||||
if is_mempoolspace_enabled():
|
||||
if is_service_enabled("mempool"):
|
||||
if is_installing_docker_images():
|
||||
color = "yellow"
|
||||
status = "Installing..."
|
||||
else:
|
||||
color = get_service_status_color("mempoolspace")
|
||||
color = get_service_status_color("mempool")
|
||||
return status,color
|
||||
|
||||
|
||||
|
@ -764,14 +769,14 @@ def enable_quicksync():
|
|||
|
||||
def settings_disable_quicksync():
|
||||
disable_quicksync()
|
||||
stop_bitcoind()
|
||||
stop_bitcoin()
|
||||
stop_quicksync()
|
||||
disable_quicksync() # Try disable again (some users had disable fail)
|
||||
delete_quicksync_data()
|
||||
reboot_device()
|
||||
|
||||
def settings_enable_quicksync():
|
||||
stop_bitcoind()
|
||||
stop_bitcoin()
|
||||
stop_quicksync()
|
||||
enable_quicksync()
|
||||
delete_quicksync_data()
|
||||
|
@ -787,7 +792,7 @@ def stop_quicksync():
|
|||
|
||||
def restart_quicksync():
|
||||
os.system('echo "quicksync_reset" > /tmp/.mynode_status')
|
||||
stop_bitcoind()
|
||||
stop_bitcoin()
|
||||
stop_quicksync()
|
||||
delete_bitcoin_data()
|
||||
delete_quicksync_data()
|
||||
|
@ -911,9 +916,9 @@ def reset_docker():
|
|||
os.system("touch /home/bitcoin/reset_docker")
|
||||
|
||||
# Reset marker files
|
||||
os.system("rm -f /mnt/hdd/mynode/settings/webssh2_url")
|
||||
os.system("rm -f /mnt/hdd/mynode/settings/mempoolspace_url")
|
||||
os.system("rm -f /mnt/hdd/mynode/settings/dojo_url")
|
||||
os.system("rm -f /mnt/hdd/mynode/settings/webssh2_version")
|
||||
os.system("rm -f /mnt/hdd/mynode/settings/mempool_version")
|
||||
os.system("rm -f /mnt/hdd/mynode/settings/dojo_version")
|
||||
|
||||
# Delete Dojo files
|
||||
os.system("rm -rf /opt/download/dojo")
|
||||
|
@ -925,10 +930,10 @@ def reset_docker():
|
|||
def get_docker_running_containers():
|
||||
containers = []
|
||||
try:
|
||||
text = subprocess.check_output("docker ps --format '{{.Names}}'", shell=True, timeout=3).decode("utf8")
|
||||
text = subprocess32.check_output("docker ps --format '{{.Names}}'", shell=True, timeout=3).decode("utf8")
|
||||
containers = text.splitlines()
|
||||
except:
|
||||
containers = ["ERROR"]
|
||||
except Exception as e:
|
||||
containers = [str(e)]
|
||||
return containers
|
||||
|
||||
#==================================
|
||||
|
@ -942,8 +947,8 @@ def get_bitcoin_rpc_password():
|
|||
return "ERROR"
|
||||
return "ERROR"
|
||||
|
||||
def stop_bitcoind():
|
||||
os.system("systemctl stop bitcoind")
|
||||
def stop_bitcoin():
|
||||
os.system("systemctl stop bitcoin")
|
||||
|
||||
def get_bitcoin_log_file():
|
||||
if is_testnet_enabled():
|
||||
|
@ -960,7 +965,7 @@ def delete_bitcoin_data():
|
|||
os.system("rm -rf /mnt/hdd/mynode/settings/.btcrpcpw")
|
||||
|
||||
def reset_blockchain():
|
||||
stop_bitcoind()
|
||||
stop_bitcoin()
|
||||
delete_bitcoin_data()
|
||||
reboot_device()
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from flask import Blueprint, render_template, redirect
|
||||
from device_info import read_ui_settings, is_installing_docker_images, is_testnet_enabled
|
||||
from user_management import check_logged_in
|
||||
from enable_disable_functions import is_dojo_enabled, enable_dojo, disable_dojo, is_dojo_installed
|
||||
from enable_disable_functions import *
|
||||
from bitcoin_info import get_mynode_block_height
|
||||
from electrum_info import get_electrs_status, is_electrs_active
|
||||
import subprocess
|
||||
|
@ -34,7 +34,7 @@ def get_dojo_status():
|
|||
dojo_initialized = dojo_initialized.strip()
|
||||
except:
|
||||
dojo_initialized = ""
|
||||
if is_dojo_enabled():
|
||||
if is_service_enabled("dojo"):
|
||||
if dojo_initialized != "false":
|
||||
if is_electrs_active():
|
||||
dojo_status = "Running"
|
||||
|
@ -126,7 +126,7 @@ def dojo_page():
|
|||
"dojo_status": dojo_status,
|
||||
"dojo_version": get_dojo_version(),
|
||||
"dojo_status_color": dojo_status_color,
|
||||
"dojo_enabled": is_dojo_enabled(),
|
||||
"dojo_enabled": is_service_enabled("dojo"),
|
||||
"dojo_initialized": dojo_initialized,
|
||||
"dojo_tracker_status": get_dojo_tracker_status(),
|
||||
"electrs_status": get_electrs_status(),
|
||||
|
@ -136,7 +136,7 @@ def dojo_page():
|
|||
return render_template('dojo.html', **templateData)
|
||||
|
||||
@mynode_dojo.route("/restart-dojo")
|
||||
def page_toggle_dojo():
|
||||
def page_restart_dojo():
|
||||
check_logged_in()
|
||||
disable_dojo()
|
||||
enable_dojo()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from bitcoin_info import get_bitcoin_block_height
|
||||
from prometheus_client.parser import text_string_to_metric_families
|
||||
from enable_disable_functions import is_electrs_enabled
|
||||
from systemctl_info import *
|
||||
import subprocess
|
||||
import requests
|
||||
import socket
|
||||
|
@ -37,7 +37,7 @@ def update_electrs_info():
|
|||
|
||||
def is_electrs_active():
|
||||
global electrs_active
|
||||
if not is_electrs_enabled():
|
||||
if not is_service_enabled("electrs"):
|
||||
return False
|
||||
return electrs_active
|
||||
|
||||
|
@ -45,7 +45,7 @@ def get_electrs_status():
|
|||
global electrum_server_current_block
|
||||
global electrs_active
|
||||
|
||||
if not is_electrs_enabled():
|
||||
if not is_service_enabled("electrs"):
|
||||
return "Disabled"
|
||||
|
||||
bitcoin_block_height = get_bitcoin_block_height()
|
||||
|
|
|
@ -3,207 +3,40 @@ import subprocess
|
|||
from config import *
|
||||
from systemctl_info import *
|
||||
|
||||
# Enable disable functions on homepage
|
||||
def is_lndhub_enabled():
|
||||
if os.path.isfile(LNDHUB_ENABLED_FILE):
|
||||
return True
|
||||
return False
|
||||
# Generic Enable / Disable Function
|
||||
def enable_service(short_name):
|
||||
enable_actions(short_name)
|
||||
os.system("systemctl enable {} --no-pager".format(short_name))
|
||||
os.system("systemctl start {} --no-pager".format(short_name))
|
||||
open("/mnt/hdd/mynode/settings/{}_enabled".format(short_name), 'a').close() # touch file
|
||||
clear_service_enabled_cache()
|
||||
|
||||
def enable_lndhub():
|
||||
os.system("systemctl enable lndhub --no-pager")
|
||||
os.system("systemctl start lndhub --no-pager")
|
||||
open(LNDHUB_ENABLED_FILE, 'a').close() # touch file
|
||||
def disable_service(short_name):
|
||||
enabled_file = "/mnt/hdd/mynode/settings/{}_enabled".format(short_name)
|
||||
if os.path.isfile(enabled_file):
|
||||
os.remove(enabled_file)
|
||||
disable_actions(short_name)
|
||||
os.system("systemctl stop {} --no-pager".format(short_name))
|
||||
os.system("systemctl disable {} --no-pager".format(short_name))
|
||||
clear_service_enabled_cache()
|
||||
|
||||
def disable_lndhub():
|
||||
if os.path.isfile(LNDHUB_ENABLED_FILE):
|
||||
os.remove(LNDHUB_ENABLED_FILE)
|
||||
os.system("systemctl stop lndhub --no-pager")
|
||||
os.system("systemctl disable lndhub --no-pager")
|
||||
# Functions to handle special enable/disable cases
|
||||
def enable_actions(short_name):
|
||||
pass
|
||||
|
||||
def disable_actions(short_name):
|
||||
if short_name == "electrs":
|
||||
# Hard kill since we are disabling
|
||||
os.system("killall -9 electrs")
|
||||
if short_name == "vpn":
|
||||
# Disable OpenVPN as well
|
||||
os.system("systemctl stop openvpn --no-pager")
|
||||
os.system("systemctl disable openvpn --no-pager")
|
||||
|
||||
|
||||
def is_electrs_enabled():
|
||||
if os.path.isfile(ELECTRS_ENABLED_FILE):
|
||||
return True
|
||||
return False
|
||||
|
||||
def enable_electrs():
|
||||
os.system("systemctl enable electrs --no-pager")
|
||||
os.system("systemctl start electrs --no-pager")
|
||||
open(ELECTRS_ENABLED_FILE, 'a').close() # touch file
|
||||
|
||||
def disable_electrs():
|
||||
if os.path.isfile(ELECTRS_ENABLED_FILE):
|
||||
os.remove(ELECTRS_ENABLED_FILE)
|
||||
os.system("killall -9 electrs") # Hard kill since we are disabing
|
||||
os.system("systemctl stop electrs --no-pager")
|
||||
os.system("systemctl disable electrs --no-pager")
|
||||
|
||||
|
||||
def is_rtl_enabled():
|
||||
return is_service_enabled("rtl")
|
||||
|
||||
def enable_rtl():
|
||||
os.system("systemctl enable rtl --no-pager")
|
||||
os.system("systemctl start rtl --no-pager")
|
||||
|
||||
def disable_rtl():
|
||||
os.system("systemctl stop rtl --no-pager")
|
||||
os.system("systemctl disable rtl --no-pager")
|
||||
|
||||
|
||||
def is_lnbits_enabled():
|
||||
return is_service_enabled("lnbits")
|
||||
def enable_lnbits():
|
||||
os.system("systemctl enable lnbits --no-pager")
|
||||
os.system("systemctl start lnbits --no-pager")
|
||||
def disable_lnbits():
|
||||
os.system("systemctl stop lnbits --no-pager")
|
||||
os.system("systemctl disable lnbits --no-pager")
|
||||
|
||||
|
||||
def is_thunderhub_enabled():
|
||||
return is_service_enabled("thunderhub")
|
||||
def enable_thunderhub():
|
||||
os.system("systemctl enable thunderhub --no-pager")
|
||||
os.system("systemctl start thunderhub --no-pager")
|
||||
def disable_thunderhub():
|
||||
os.system("systemctl stop thunderhub --no-pager")
|
||||
os.system("systemctl disable thunderhub --no-pager")
|
||||
|
||||
|
||||
def is_ckbunker_enabled():
|
||||
return is_service_enabled("ckbunker")
|
||||
def enable_ckbunker():
|
||||
os.system("systemctl enable ckbunker --no-pager")
|
||||
os.system("systemctl start ckbunker --no-pager")
|
||||
def disable_ckbunker():
|
||||
os.system("systemctl stop ckbunker --no-pager")
|
||||
os.system("systemctl disable ckbunker --no-pager")
|
||||
|
||||
|
||||
def is_sphinxrelay_enabled():
|
||||
return is_service_enabled("sphinxrelay")
|
||||
def enable_sphinxrelay():
|
||||
os.system("systemctl enable sphinxrelay --no-pager")
|
||||
os.system("systemctl start sphinxrelay --no-pager")
|
||||
def disable_sphinxrelay():
|
||||
os.system("systemctl stop sphinxrelay --no-pager")
|
||||
os.system("systemctl disable sphinxrelay --no-pager")
|
||||
|
||||
|
||||
def is_btcrpcexplorer_enabled():
|
||||
if os.path.isfile(BTCRPCEXPLORER_ENABLED_FILE):
|
||||
return True
|
||||
return False
|
||||
|
||||
def enable_btcrpcexplorer():
|
||||
os.system("systemctl enable btc_rpc_explorer --no-pager")
|
||||
os.system("systemctl start btc_rpc_explorer --no-pager")
|
||||
open(BTCRPCEXPLORER_ENABLED_FILE, 'a').close() # touch file
|
||||
|
||||
def disable_btcrpcexplorer():
|
||||
if os.path.isfile(BTCRPCEXPLORER_ENABLED_FILE):
|
||||
os.remove(BTCRPCEXPLORER_ENABLED_FILE)
|
||||
#os.system("killall -9 electrs") # Hard kill since we are disabing
|
||||
os.system("systemctl stop btc_rpc_explorer --no-pager")
|
||||
os.system("systemctl disable btc_rpc_explorer --no-pager")
|
||||
|
||||
|
||||
def is_mempoolspace_enabled():
|
||||
return is_service_enabled("mempoolspace")
|
||||
|
||||
def enable_mempoolspace():
|
||||
os.system("systemctl enable mempoolspace --no-pager")
|
||||
os.system("systemctl start mempoolspace --no-pager")
|
||||
open(MEMPOOLSPACE_ENABLED_FILE, 'a').close() # touch file
|
||||
|
||||
def disable_mempoolspace():
|
||||
if os.path.isfile(MEMPOOLSPACE_ENABLED_FILE):
|
||||
os.remove(MEMPOOLSPACE_ENABLED_FILE)
|
||||
os.system("systemctl stop mempoolspace --no-pager")
|
||||
os.system("systemctl disable mempoolspace --no-pager")
|
||||
|
||||
|
||||
def is_btcpayserver_enabled():
|
||||
return is_service_enabled("btcpayserver")
|
||||
|
||||
def enable_btcpayserver():
|
||||
os.system("systemctl enable btcpayserver --no-pager")
|
||||
os.system("systemctl start btcpayserver --no-pager")
|
||||
open(BTCPAYSERVER_ENABLED_FILE, 'a').close() # touch file
|
||||
|
||||
def disable_btcpayserver():
|
||||
if os.path.isfile(BTCPAYSERVER_ENABLED_FILE):
|
||||
os.remove(BTCPAYSERVER_ENABLED_FILE)
|
||||
os.system("systemctl stop btcpayserver --no-pager")
|
||||
os.system("systemctl disable btcpayserver --no-pager")
|
||||
|
||||
|
||||
def is_caravan_enabled():
|
||||
return is_service_enabled("caravan")
|
||||
|
||||
def enable_caravan():
|
||||
os.system("systemctl enable caravan --no-pager")
|
||||
os.system("systemctl start caravan --no-pager")
|
||||
|
||||
def disable_caravan():
|
||||
os.system("systemctl stop caravan --no-pager")
|
||||
os.system("systemctl disable caravan --no-pager")
|
||||
|
||||
|
||||
def is_specter_enabled():
|
||||
return is_service_enabled("specter")
|
||||
|
||||
def enable_specter():
|
||||
os.system("systemctl enable specter --no-pager")
|
||||
os.system("systemctl start specter --no-pager")
|
||||
|
||||
def disable_specter():
|
||||
os.system("systemctl stop specter --no-pager")
|
||||
os.system("systemctl disable specter --no-pager")
|
||||
|
||||
|
||||
def is_vpn_enabled():
|
||||
if os.path.isfile(VPN_ENABLED_FILE):
|
||||
return True
|
||||
return False
|
||||
|
||||
def enable_vpn():
|
||||
os.system("systemctl enable vpn --no-pager")
|
||||
os.system("systemctl start vpn --no-pager")
|
||||
open(VPN_ENABLED_FILE, 'a').close() # touch file
|
||||
|
||||
def disable_vpn():
|
||||
if os.path.isfile(VPN_ENABLED_FILE):
|
||||
os.remove(VPN_ENABLED_FILE)
|
||||
os.system("systemctl stop vpn --no-pager")
|
||||
os.system("systemctl disable vpn --no-pager")
|
||||
os.system("systemctl stop openvpn --no-pager")
|
||||
os.system("systemctl disable openvpn --no-pager")
|
||||
|
||||
|
||||
def is_netdata_enabled():
|
||||
return is_service_enabled("netdata")
|
||||
|
||||
def enable_netdata():
|
||||
os.system("systemctl enable netdata --no-pager")
|
||||
os.system("systemctl start netdata --no-pager")
|
||||
|
||||
def disable_netdata():
|
||||
os.system("systemctl stop netdata --no-pager")
|
||||
os.system("systemctl disable netdata --no-pager")
|
||||
|
||||
def is_whirlpool_enabled():
|
||||
return is_service_enabled("whirlpool")
|
||||
|
||||
def enable_whirlpool():
|
||||
os.system("systemctl enable whirlpool --no-pager")
|
||||
os.system("systemctl start whirlpool --no-pager")
|
||||
|
||||
def disable_whirlpool():
|
||||
os.system("systemctl stop whirlpool --no-pager")
|
||||
os.system("systemctl disable whirlpool --no-pager")
|
||||
|
||||
# Dojo install / uninstall functions.... future work to abstract this
|
||||
def is_dojo_installed():
|
||||
return os.path.isfile(DOJO_INSTALL_FILE)
|
||||
|
||||
|
@ -217,13 +50,3 @@ def uninstall_dojo():
|
|||
disable_dojo()
|
||||
os.system("sync")
|
||||
|
||||
def is_dojo_enabled():
|
||||
return is_service_enabled("dojo")
|
||||
|
||||
def enable_dojo():
|
||||
os.system("systemctl enable dojo --no-pager")
|
||||
os.system("systemctl start dojo --no-pager")
|
||||
|
||||
def disable_dojo():
|
||||
os.system("systemctl stop dojo --no-pager")
|
||||
os.system("systemctl disable dojo --no-pager")
|
||||
|
|
|
@ -331,7 +331,7 @@ def get_lnd_status():
|
|||
if not lnd_wallet_exists():
|
||||
return "Please create wallet..."
|
||||
|
||||
if not is_bitcoind_synced():
|
||||
if not is_bitcoin_synced():
|
||||
return "Waiting..."
|
||||
|
||||
if is_lnd_ready():
|
||||
|
@ -370,7 +370,7 @@ def get_lnd_status():
|
|||
return "Status Error"
|
||||
|
||||
def get_lnd_status_color():
|
||||
if not is_bitcoind_synced():
|
||||
if not is_bitcoin_synced():
|
||||
return "yellow"
|
||||
|
||||
if not lnd_wallet_exists():
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
from flask import Blueprint, render_template, redirect
|
||||
from user_management import check_logged_in
|
||||
from device_info import *
|
||||
from application_info import *
|
||||
import subprocess
|
||||
import re
|
||||
import os
|
||||
|
@ -11,43 +12,18 @@ mynode_manage_apps = Blueprint('mynode_manage_apps',__name__)
|
|||
|
||||
### Page functions
|
||||
@mynode_manage_apps.route("/apps")
|
||||
def caravan_page():
|
||||
def manage_apps_page():
|
||||
check_logged_in()
|
||||
|
||||
# Community Apps
|
||||
apps = []
|
||||
apps.append({"name":"Bitcoin", "short_name": "bitcoin"})
|
||||
apps.append({"name":"LND", "short_name": "lnd"})
|
||||
apps.append({"name":"Loop", "short_name": "loop"})
|
||||
apps.append({"name":"Pool", "short_name": "pool"})
|
||||
apps.append({"name":"Lightning Terminal", "short_name": "lit"})
|
||||
#apps.append({"name":"Electrum Server", "short_name": "electrs"})
|
||||
apps.append({"name":"BTC RPC Explorer", "short_name": "btcrpcexplorer"})
|
||||
apps.append({"name":"Corsproxy", "short_name": "corsproxy"})
|
||||
apps.append({"name":"LNDConnect", "short_name": "lndconnect"})
|
||||
apps.append({"name":"LND Hub", "short_name": "lndhub"})
|
||||
apps.append({"name":"Ride the Lightning", "short_name": "rtl"})
|
||||
apps.append({"name":"Whirlpool", "short_name": "whirlpool"})
|
||||
|
||||
# Premium Apps
|
||||
if not is_community_edition():
|
||||
apps.append({"name":"Joinmarket", "short_name": "joinmarket"})
|
||||
apps.append({"name":"JoininBox", "short_name": "joininbox"})
|
||||
apps.append({"name":"Thunderhub", "short_name": "thunderhub"})
|
||||
apps.append({"name":"LNbits", "short_name": "lnbits"})
|
||||
apps.append({"name":"Caravan", "short_name": "caravan"})
|
||||
apps.append({"name":"Specter", "short_name": "specter"})
|
||||
apps.append({"name":"CKBunker", "short_name": "ckbunker"})
|
||||
apps.append({"name":"Sphinx Relay", "short_name": "sphinxrelay"})
|
||||
|
||||
for app in apps:
|
||||
app["current_version"] = get_app_current_version(app["short_name"])
|
||||
app["latest_version"] = get_app_latest_version(app["short_name"])
|
||||
|
||||
t1 = get_system_time_in_ms()
|
||||
apps = get_all_applications(order_by="alphabetic")
|
||||
t2 = get_system_time_in_ms()
|
||||
# Load page
|
||||
templateData = {
|
||||
"title": "myNode Manage Apps",
|
||||
"ui_settings": read_ui_settings(),
|
||||
"load_time": t2-t1,
|
||||
"product_key_skipped": skipped_product_key(),
|
||||
"apps": apps
|
||||
}
|
||||
return render_template('manage_apps.html', **templateData)
|
||||
|
|
|
@ -27,6 +27,7 @@ from datetime import timedelta
|
|||
from device_info import *
|
||||
from device_warnings import *
|
||||
from systemctl_info import *
|
||||
from application_info import *
|
||||
import pam
|
||||
import re
|
||||
import json
|
||||
|
@ -397,26 +398,26 @@ def index():
|
|||
}
|
||||
return render_template('state.html', **templateData)
|
||||
elif status == STATE_STABLE:
|
||||
bitcoind_status_code = get_service_status_code("bitcoind")
|
||||
bitcoin_status_code = get_service_status_code("bitcoin")
|
||||
lnd_status_code = get_service_status_code("lnd")
|
||||
tor_status_color = "gray"
|
||||
bitcoind_status_color = "red"
|
||||
bitcoin_status_color = "red"
|
||||
lnd_status_color = "red"
|
||||
lnd_ready = is_lnd_ready()
|
||||
electrs_active = is_electrs_active()
|
||||
bitcoind_status = "Inactive"
|
||||
bitcoin_status = "Inactive"
|
||||
lnd_status = "Inactive"
|
||||
electrs_status = ""
|
||||
lndconnect_status_color = "gray"
|
||||
btcpayserver_status_color = "gray"
|
||||
mempoolspace_status_color = "gray"
|
||||
mempool_status_color = "gray"
|
||||
vpn_status_color = "gray"
|
||||
vpn_status = ""
|
||||
current_block = 1234
|
||||
|
||||
if not get_has_updated_btc_info() or uptime_in_seconds < 180:
|
||||
error_message = ""
|
||||
if bitcoind_status_code != 0 and uptime_in_seconds > 600:
|
||||
if bitcoin_status_code != 0 and uptime_in_seconds > 600:
|
||||
error_message = "Bitcoin has experienced an error. Please check the logs."
|
||||
message = "<div class='small_message'>{}</<div>".format( get_message(include_funny=True) )
|
||||
templateData = {
|
||||
|
@ -439,7 +440,7 @@ def index():
|
|||
# return render_template('state.html', **templateData)
|
||||
|
||||
# Display sync info if not synced
|
||||
if not is_bitcoind_synced():
|
||||
if not is_bitcoin_synced():
|
||||
subheader = Markup("Syncing...")
|
||||
if bitcoin_block_height != None:
|
||||
message = "<div class='small_message'>{}</<div>".format( get_message(include_funny=True) )
|
||||
|
@ -459,14 +460,14 @@ def index():
|
|||
tor_status_color = get_service_status_color("tor@default")
|
||||
tor_status = "Private Connections"
|
||||
|
||||
# Find bitcoind status
|
||||
# Find bitcoid status
|
||||
bitcoin_info = get_bitcoin_blockchain_info()
|
||||
bitcoin_peers = get_bitcoin_peers()
|
||||
if bitcoind_status_code != 0:
|
||||
bitcoind_status_color = "red"
|
||||
if bitcoin_status_code != 0:
|
||||
bitcoin_status_color = "red"
|
||||
else:
|
||||
bitcoind_status_color = "green"
|
||||
bitcoind_status = get_bitcoin_status()
|
||||
bitcoin_status_color = "green"
|
||||
bitcoin_status = get_bitcoin_status()
|
||||
current_block = get_mynode_block_height()
|
||||
|
||||
# Find lnd status
|
||||
|
@ -505,7 +506,7 @@ def index():
|
|||
btcrpcexplorer_status, btcrpcexplorer_status_color, btcrpcexplorer_ready = get_btcrpcexplorer_status_and_color_and_ready()
|
||||
|
||||
# Find mempool space status
|
||||
mempoolspace_status, mempoolspace_status_color = get_mempool_status_and_color()
|
||||
mempool_status, mempool_status_color = get_mempool_status_and_color()
|
||||
|
||||
# Find btcpayserver status
|
||||
btcpayserver_status, btcpayserver_status_color = get_btcpayserver_status_and_color()
|
||||
|
@ -534,17 +535,18 @@ def index():
|
|||
|
||||
# Refresh rate
|
||||
refresh_rate = 3600 * 24
|
||||
if bitcoind_status_color == "red" or lnd_status_color == "red":
|
||||
if bitcoin_status_color == "red" or lnd_status_color == "red":
|
||||
refresh_rate = 60
|
||||
elif bitcoind_status_color == "yellow" or lnd_status_color == "yellow":
|
||||
elif bitcoin_status_color == "yellow" or lnd_status_color == "yellow":
|
||||
refresh_rate = 120
|
||||
|
||||
templateData = {
|
||||
"title": "myNode Home",
|
||||
"refresh_rate": refresh_rate,
|
||||
"config": CONFIG,
|
||||
"bitcoind_status_color": bitcoind_status_color,
|
||||
"bitcoind_status": Markup(bitcoind_status),
|
||||
"apps": get_all_applications(order_by="alphabetic"),
|
||||
"bitcoin_status_color": bitcoin_status_color,
|
||||
"bitcoin_status": Markup(bitcoin_status),
|
||||
"current_block": current_block,
|
||||
"bitcoin_peer_count": get_bitcoin_peer_count(),
|
||||
"bitcoin_difficulty": get_bitcoin_difficulty(),
|
||||
|
@ -567,55 +569,55 @@ def index():
|
|||
"is_device_from_reseller": is_device_from_reseller(),
|
||||
"electrs_status_color": electrs_status_color,
|
||||
"electrs_status": Markup(electrs_status),
|
||||
"electrs_enabled": is_electrs_enabled(),
|
||||
"electrs_enabled": is_service_enabled("electrs"),
|
||||
"electrs_active": electrs_active,
|
||||
"rtl_status_color": rtl_status_color,
|
||||
"rtl_status": rtl_status,
|
||||
"rtl_enabled": is_rtl_enabled(),
|
||||
"rtl_enabled": is_service_enabled("rtl"),
|
||||
"lnbits_status_color": lnbits_status_color,
|
||||
"lnbits_status": lnbits_status,
|
||||
"lnbits_enabled": is_lnbits_enabled(),
|
||||
"lnbits_enabled": is_service_enabled("lnbits"),
|
||||
"thunderhub_status_color": thunderhub_status_color,
|
||||
"thunderhub_status": thunderhub_status,
|
||||
"thunderhub_enabled": is_thunderhub_enabled(),
|
||||
"thunderhub_enabled": is_service_enabled("thunderhub"),
|
||||
"thunderhub_sso_token": get_thunderhub_sso_token(),
|
||||
"ckbunker_status_color": ckbunker_status_color,
|
||||
"ckbunker_status": ckbunker_status,
|
||||
"ckbunker_enabled": is_ckbunker_enabled(),
|
||||
"ckbunker_enabled": is_service_enabled("ckbunker"),
|
||||
"sphinxrelay_status_color": sphinxrelay_status_color,
|
||||
"sphinxrelay_status": sphinxrelay_status,
|
||||
"sphinxrelay_enabled": is_sphinxrelay_enabled(),
|
||||
"sphinxrelay_enabled": is_service_enabled("sphinxrelay"),
|
||||
"lndhub_status_color": lndhub_status_color,
|
||||
"lndhub_status": lndhub_status,
|
||||
"lndhub_enabled": is_lndhub_enabled(),
|
||||
"lndhub_enabled": is_service_enabled("lndhub"),
|
||||
"btcrpcexplorer_ready": btcrpcexplorer_ready,
|
||||
"btcrpcexplorer_status_color": btcrpcexplorer_status_color,
|
||||
"btcrpcexplorer_status": btcrpcexplorer_status,
|
||||
"btcrpcexplorer_enabled": is_btcrpcexplorer_enabled(),
|
||||
"btcrpcexplorer_enabled": is_service_enabled("btcrpcexplorer"),
|
||||
"btcrpcexplorer_sso_token": get_btcrpcexplorer_sso_token(),
|
||||
"caravan_status_color": caravan_status_color,
|
||||
"caravan_status": caravan_status,
|
||||
"caravan_enabled": is_caravan_enabled(),
|
||||
"caravan_enabled": is_service_enabled("caravan"),
|
||||
"specter_status_color": specter_status_color,
|
||||
"specter_status": specter_status,
|
||||
"specter_enabled": is_specter_enabled(),
|
||||
"mempoolspace_status_color": mempoolspace_status_color,
|
||||
"mempoolspace_status": mempoolspace_status,
|
||||
"mempoolspace_enabled": is_mempoolspace_enabled(),
|
||||
"btcpayserver_enabled": is_btcpayserver_enabled(),
|
||||
"specter_enabled": is_service_enabled("specter"),
|
||||
"mempool_status_color": mempool_status_color,
|
||||
"mempool_status": mempool_status,
|
||||
"mempool_enabled": is_service_enabled("mempool"),
|
||||
"btcpayserver_enabled": is_service_enabled("btcpayserver"),
|
||||
"btcpayserver_status_color": btcpayserver_status_color,
|
||||
"btcpayserver_status": btcpayserver_status,
|
||||
"vpn_status_color": vpn_status_color,
|
||||
"vpn_status": vpn_status,
|
||||
"vpn_enabled": is_vpn_enabled(),
|
||||
"vpn_enabled": is_service_enabled("vpn"),
|
||||
"whirlpool_status": whirlpool_status,
|
||||
"whirlpool_status_color": whirlpool_status_color,
|
||||
"whirlpool_enabled": is_whirlpool_enabled(),
|
||||
"whirlpool_enabled": is_service_enabled("whirlpool"),
|
||||
"whirlpool_initialized": whirlpool_initialized,
|
||||
"is_dojo_installed": is_dojo_installed(),
|
||||
"dojo_status": dojo_status,
|
||||
"dojo_status_color": dojo_status_color,
|
||||
"dojo_enabled": is_dojo_enabled(),
|
||||
"dojo_enabled": is_service_enabled("dojo"),
|
||||
"dojo_initialized": dojo_initialized,
|
||||
"product_key_skipped": pk_skipped,
|
||||
"product_key_error": pk_error,
|
||||
|
@ -688,139 +690,26 @@ def page_ignore_warning():
|
|||
skip_warning(warning)
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-lndhub")
|
||||
def page_toggle_lndhub():
|
||||
@app.route("/toggle-enabled")
|
||||
def page_toggle_app():
|
||||
check_logged_in()
|
||||
if is_lndhub_enabled():
|
||||
disable_lndhub()
|
||||
else:
|
||||
enable_lndhub()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-thunderhub")
|
||||
def page_toggle_thunderhub():
|
||||
check_logged_in()
|
||||
if is_thunderhub_enabled():
|
||||
disable_thunderhub()
|
||||
else:
|
||||
enable_thunderhub()
|
||||
return redirect("/")
|
||||
# Check application specified
|
||||
if not request.args.get("app"):
|
||||
flash("No application specified", category="error")
|
||||
return redirect("/")
|
||||
|
||||
# Check application name is valid
|
||||
app_short_name = request.args.get("app")
|
||||
if not is_application_valid(app_short_name):
|
||||
flash("Application is invalid", category="error")
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-ckbunker")
|
||||
def page_toggle_ckbunker():
|
||||
check_logged_in()
|
||||
if is_ckbunker_enabled():
|
||||
disable_ckbunker()
|
||||
# Toggle enabled/disabled
|
||||
if is_service_enabled(app_short_name):
|
||||
disable_service(app_short_name)
|
||||
else:
|
||||
enable_ckbunker()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-sphinxrelay")
|
||||
def page_toggle_sphinxrelay():
|
||||
check_logged_in()
|
||||
if is_sphinxrelay_enabled():
|
||||
disable_sphinxrelay()
|
||||
else:
|
||||
enable_sphinxrelay()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-electrs")
|
||||
def page_toggle_electrs():
|
||||
check_logged_in()
|
||||
if is_electrs_enabled():
|
||||
disable_electrs()
|
||||
else:
|
||||
enable_electrs()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-rtl")
|
||||
def page_toggle_rtl():
|
||||
check_logged_in()
|
||||
if is_rtl_enabled():
|
||||
disable_rtl()
|
||||
else:
|
||||
enable_rtl()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-lnbits")
|
||||
def page_toggle_lnbits():
|
||||
check_logged_in()
|
||||
if is_lnbits_enabled():
|
||||
disable_lnbits()
|
||||
else:
|
||||
enable_lnbits()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-btcrpcexplorer")
|
||||
def page_toggle_btcrpcexplorer():
|
||||
check_logged_in()
|
||||
if is_btcrpcexplorer_enabled():
|
||||
disable_btcrpcexplorer()
|
||||
else:
|
||||
enable_btcrpcexplorer()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-mempoolspace")
|
||||
def page_toggle_mempoolspace():
|
||||
check_logged_in()
|
||||
if is_mempoolspace_enabled():
|
||||
disable_mempoolspace()
|
||||
else:
|
||||
enable_mempoolspace()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-btcpayserver")
|
||||
def page_toggle_btcpayserver():
|
||||
check_logged_in()
|
||||
if is_btcpayserver_enabled():
|
||||
disable_btcpayserver()
|
||||
else:
|
||||
enable_btcpayserver()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-caravan")
|
||||
def page_toggle_caravan():
|
||||
check_logged_in()
|
||||
if is_caravan_enabled():
|
||||
disable_caravan()
|
||||
else:
|
||||
enable_caravan()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-specter")
|
||||
def page_toggle_specter():
|
||||
check_logged_in()
|
||||
if is_specter_enabled():
|
||||
disable_specter()
|
||||
else:
|
||||
enable_specter()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-vpn")
|
||||
def page_toggle_vpn():
|
||||
check_logged_in()
|
||||
if is_vpn_enabled():
|
||||
disable_vpn()
|
||||
else:
|
||||
enable_vpn()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-whirlpool")
|
||||
def page_toggle_whirlpool():
|
||||
check_logged_in()
|
||||
if is_whirlpool_enabled():
|
||||
disable_whirlpool()
|
||||
else:
|
||||
enable_whirlpool()
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-dojo")
|
||||
def page_toggle_dojo():
|
||||
check_logged_in()
|
||||
if is_dojo_enabled():
|
||||
disable_dojo()
|
||||
else:
|
||||
enable_dojo()
|
||||
enable_service(app_short_name)
|
||||
return redirect("/")
|
||||
|
||||
@app.route("/toggle-dojo-install")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from config import *
|
||||
from flask import Blueprint, render_template, session, abort, Markup, request, redirect, send_from_directory, url_for, flash, current_app
|
||||
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
|
||||
from bitcoin import is_bitcoind_synced
|
||||
from bitcoin import is_bitcoin_synced
|
||||
from bitcoin_info import using_bitcoin_custom_config
|
||||
from lightning_info import using_lnd_custom_config
|
||||
from pprint import pprint, pformat
|
||||
|
@ -11,6 +11,7 @@ from user_management import check_logged_in
|
|||
from lightning_info import *
|
||||
from thread_functions import *
|
||||
from utilities import *
|
||||
from application_info import *
|
||||
import pam
|
||||
import time
|
||||
import os
|
||||
|
@ -53,6 +54,7 @@ def page_settings():
|
|||
|
||||
templateData = {
|
||||
"title": "myNode Settings",
|
||||
"apps": get_all_applications(order_by="alphabetic"),
|
||||
"password_message": "",
|
||||
"current_version": current_version,
|
||||
"latest_version": latest_version,
|
||||
|
@ -74,12 +76,12 @@ def page_settings():
|
|||
"logout_time_hours": logout_time_hours,
|
||||
"using_bitcoin_custom_config": using_bitcoin_custom_config(),
|
||||
"using_lnd_custom_config": using_lnd_custom_config(),
|
||||
"is_bitcoin_synced": is_bitcoind_synced(),
|
||||
"is_bitcoin_synced": is_bitcoin_synced(),
|
||||
"is_installing_docker_images": is_installing_docker_images(),
|
||||
"firewall_rules": get_firewall_rules(),
|
||||
"is_testnet_enabled": is_testnet_enabled(),
|
||||
"is_quicksync_disabled": not is_quicksync_enabled(),
|
||||
"is_netdata_enabled": is_netdata_enabled(),
|
||||
"netdata_enabled": is_service_enabled("netdata"),
|
||||
"is_uploader_device": is_uploader(),
|
||||
"download_rate": download_rate,
|
||||
"upload_rate": upload_rate,
|
||||
|
@ -102,6 +104,7 @@ def page_settings():
|
|||
@mynode_settings.route("/status")
|
||||
def page_status():
|
||||
check_logged_in()
|
||||
t1 = get_system_time_in_ms()
|
||||
|
||||
current_version = get_current_version()
|
||||
latest_version = get_latest_version()
|
||||
|
@ -138,15 +141,15 @@ def page_status():
|
|||
|
||||
# Get Bitcoin Status
|
||||
bitcoin_status_log = get_file_log( get_bitcoin_log_file() )
|
||||
# GET lnd, loopd, poold logs from file???
|
||||
# GET lnd, loop, pool logs from file???
|
||||
#lnd_status_log = get_file_log("/mnt/hdd/mynode/lnd/logs/bitcoin/mainnet/lnd.log")
|
||||
#loopd_status_log = get_file_log("/mnt/hdd/mynode/loop/logs/mainnet/loopd.log")
|
||||
#poold_status_log = get_file_log("/mnt/hdd/mynode/pool/logs/mainnet/poold.log")
|
||||
#loop_status_log = get_file_log("/mnt/hdd/mynode/loop/logs/mainnet/loopd.log")
|
||||
#pool_status_log = get_file_log("/mnt/hdd/mynode/pool/logs/mainnet/poold.log")
|
||||
|
||||
# Get Status
|
||||
lnd_status_log = get_journalctl_log("lnd")
|
||||
loopd_status_log = get_journalctl_log("loopd")
|
||||
poold_status_log = get_journalctl_log("poold")
|
||||
loop_status_log = get_journalctl_log("loop")
|
||||
pool_status_log = get_journalctl_log("pool")
|
||||
lndhub_status_log = get_journalctl_log("lndhub")
|
||||
tor_status_log = get_journalctl_log("tor@default")
|
||||
electrs_status_log = get_journalctl_log("electrs")
|
||||
|
@ -188,19 +191,22 @@ def page_status():
|
|||
"quicksync_status_log": quicksync_status_log,
|
||||
"quicksync_status": quicksync_status,
|
||||
"quicksync_status_color": quicksync_status_color,
|
||||
"is_bitcoin_synced": is_bitcoind_synced(),
|
||||
"is_bitcoin_synced": is_bitcoin_synced(),
|
||||
"bitcoin_status_log": bitcoin_status_log,
|
||||
"bitcoin_status": get_service_status_basic_text("bitcoind"),
|
||||
"bitcoin_status_color": get_service_status_color("bitcoind"),
|
||||
"bitcoin_status": get_service_status_basic_text("bitcoin"),
|
||||
"bitcoin_status_color": get_service_status_color("bitcoin"),
|
||||
"lnd_status_log": lnd_status_log,
|
||||
"lnd_status": get_service_status_basic_text("lnd"),
|
||||
"lnd_status_color": get_service_status_color("lnd"),
|
||||
"loopd_status_log": loopd_status_log,
|
||||
"loopd_status": get_service_status_basic_text("loopd"),
|
||||
"loopd_status_color": get_service_status_color("loopd"),
|
||||
"poold_status_log": poold_status_log,
|
||||
"poold_status": get_service_status_basic_text("poold"),
|
||||
"poold_status_color": get_service_status_color("poold"),
|
||||
"loop_status_log": loop_status_log,
|
||||
"loop_status": get_service_status_basic_text("loop"),
|
||||
"loop_status_color": get_service_status_color("loop"),
|
||||
"pool_status_log": pool_status_log,
|
||||
"pool_status": get_service_status_basic_text("pool"),
|
||||
"pool_status_color": get_service_status_color("pool"),
|
||||
"lit_status_log": get_journalctl_log("lit"),
|
||||
"lit_status": get_service_status_basic_text("lit"),
|
||||
"lit_status_color": get_service_status_color("lit"),
|
||||
"tor_status_log": tor_status_log,
|
||||
"tor_status": get_service_status_basic_text("tor@default"),
|
||||
"tor_status_color": get_service_status_color("tor@default"),
|
||||
|
@ -243,9 +249,9 @@ def page_status():
|
|||
"btcpayserver_status_log": get_journalctl_log("btcpayserver"),
|
||||
"btcpayserver_status": get_service_status_basic_text("btcpayserver"),
|
||||
"btcpayserver_status_color": get_service_status_color("btcpayserver"),
|
||||
"mempoolspace_status_log": get_journalctl_log("mempoolspace"),
|
||||
"mempoolspace_status": get_service_status_basic_text("mempoolspace"),
|
||||
"mempoolspace_status_color": get_service_status_color("mempoolspace"),
|
||||
"mempool_status_log": get_journalctl_log("mempool"),
|
||||
"mempool_status": get_service_status_basic_text("mempool"),
|
||||
"mempool_status_color": get_service_status_color("mempool"),
|
||||
"caravan_status_log": get_journalctl_log("caravan"),
|
||||
"caravan_status": get_service_status_basic_text("caravan"),
|
||||
"caravan_status_color": get_service_status_color("caravan"),
|
||||
|
@ -260,7 +266,7 @@ def page_status():
|
|||
"firewall_status_color": get_service_status_color("ufw"),
|
||||
"firewall_rules": get_firewall_rules(),
|
||||
"is_quicksync_disabled": not quicksync_enabled,
|
||||
"is_netdata_enabled": is_netdata_enabled(),
|
||||
"netdata_enabled": is_service_enabled("netdata"),
|
||||
"uptime": uptime,
|
||||
"date": date,
|
||||
"local_ip": local_ip,
|
||||
|
@ -273,6 +279,8 @@ def page_status():
|
|||
"device_temp": get_device_temp(),
|
||||
"ui_settings": read_ui_settings()
|
||||
}
|
||||
t2 = get_system_time_in_ms()
|
||||
templateData["load_time"] = t2-t1
|
||||
return render_template('status.html', **templateData)
|
||||
|
||||
@mynode_settings.route("/settings/upgrade")
|
||||
|
@ -443,7 +451,7 @@ def shutdown_device_page():
|
|||
def reindex_blockchain_page():
|
||||
check_logged_in()
|
||||
os.system("echo 'BTCARGS=-reindex-chainstate' > "+BITCOIN_ENV_FILE)
|
||||
os.system("systemctl restart bitcoind")
|
||||
os.system("systemctl restart bitcoin")
|
||||
t = Timer(30.0, reset_bitcoin_env_file)
|
||||
t.start()
|
||||
return redirect("/settings")
|
||||
|
@ -452,7 +460,7 @@ def reindex_blockchain_page():
|
|||
def rescan_blockchain_page():
|
||||
check_logged_in()
|
||||
os.system("echo 'BTCARGS=-rescan' > "+BITCOIN_ENV_FILE)
|
||||
os.system("systemctl restart bitcoind")
|
||||
os.system("systemctl restart bitcoin")
|
||||
t = Timer(30.0, reset_bitcoin_env_file)
|
||||
t.start()
|
||||
return redirect("/settings")
|
||||
|
@ -788,7 +796,16 @@ def reinstall_app_page():
|
|||
|
||||
check_and_mark_reboot_action("reinstall_app")
|
||||
|
||||
app = request.args.get('app')
|
||||
# Check application specified
|
||||
if not request.args.get("app"):
|
||||
flash("No application specified", category="error")
|
||||
return redirect("/settings")
|
||||
|
||||
# Check application name is valid
|
||||
app = request.args.get("app")
|
||||
if not is_application_valid(app):
|
||||
flash("Application is invalid", category="error")
|
||||
return redirect("/settings")
|
||||
|
||||
# Re-install app
|
||||
t = Timer(1.0, reinstall_app, [app])
|
||||
|
@ -895,10 +912,10 @@ def toggle_darkmode_page_home():
|
|||
def toggle_netdata_page():
|
||||
check_logged_in()
|
||||
|
||||
if is_netdata_enabled():
|
||||
disable_netdata()
|
||||
if is_service_enabled("netdata"):
|
||||
disable_service("netdata")
|
||||
else:
|
||||
enable_netdata()
|
||||
enable_service("netdata")
|
||||
return redirect("/settings")
|
||||
|
||||
@mynode_settings.route("/settings/modify-swap")
|
||||
|
|
|
@ -349,7 +349,7 @@ td, th {
|
|||
background: green;
|
||||
}
|
||||
|
||||
.bitcoind_table {
|
||||
.bitcoin_table {
|
||||
width: 1000px;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
|
@ -358,22 +358,22 @@ td, th {
|
|||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.bitcoind_table_header {
|
||||
.bitcoin_table_header {
|
||||
font-size: 16px;
|
||||
background-color: #FFFFFF;
|
||||
font-weight: bold;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
table.bitcoind_table tbody tr:nth-child(odd) td{
|
||||
table.bitcoin_table tbody tr:nth-child(odd) td{
|
||||
background-color: #ffa5000d;
|
||||
}
|
||||
|
||||
table.bitcoind_table tbody tr:nth-child(even) td{
|
||||
table.bitcoin_table tbody tr:nth-child(even) td{
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
table.bitcoind_table td {
|
||||
table.bitcoin_table td {
|
||||
padding: 10px 0;
|
||||
margin: 0px;
|
||||
}
|
||||
|
|
|
@ -70,15 +70,15 @@ table,
|
|||
background-color: #f9c132;
|
||||
}
|
||||
|
||||
.bitcoind_table_header {
|
||||
.bitcoin_table_header {
|
||||
border-bottom: 2px solid gray;
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
table.bitcoind_table tbody tr:nth-child(odd) td{
|
||||
table.bitcoin_table tbody tr:nth-child(odd) td{
|
||||
background-color: #ffffff05;
|
||||
}
|
||||
table.bitcoind_table tbody tr:nth-child(even) td{
|
||||
table.bitcoin_table tbody tr:nth-child(even) td{
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
rootfs/standard/var/www/mynode/static/images/running.png
Normal file
BIN
rootfs/standard/var/www/mynode/static/images/running.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
|
@ -1,16 +1,26 @@
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
service_enabled_cache = {}
|
||||
|
||||
#==================================
|
||||
# Service Status, Enabled, Logs, etc...
|
||||
#==================================
|
||||
def clear_service_enabled_cache():
|
||||
global service_enabled_cache
|
||||
service_enabled_cache = {}
|
||||
|
||||
def is_service_enabled(service_name):
|
||||
cmd = "systemctl is-enabled {} > /dev/null".format(service_name)
|
||||
try:
|
||||
subprocess.check_call(cmd, shell=True)
|
||||
global service_enabled_cache
|
||||
|
||||
if service_name in service_enabled_cache:
|
||||
return service_enabled_cache[service_name]
|
||||
|
||||
code = os.system("systemctl is-enabled {} > /dev/null".format(service_name))
|
||||
if code == 0:
|
||||
service_enabled_cache[service_name] = True
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
service_enabled_cache[service_name] = False
|
||||
return False
|
||||
|
||||
def get_service_status_code(service_name):
|
||||
|
|
|
@ -120,8 +120,8 @@
|
|||
{% if wallets is not none %}
|
||||
<br/>
|
||||
<div class="main_header">Wallets</div>
|
||||
<table class="bitcoind_table">
|
||||
<thead class="bitcoind_table_header">
|
||||
<table class="bitcoin_table">
|
||||
<thead class="bitcoin_table_header">
|
||||
<td>Wallet</td>
|
||||
<td>Balance</td>
|
||||
<td>Actions</td>
|
||||
|
@ -152,8 +152,8 @@
|
|||
|
||||
<br/>
|
||||
<div class="main_header">Recent Blocks</div>
|
||||
<table class="bitcoind_table">
|
||||
<thead class="bitcoind_table_header">
|
||||
<table class="bitcoin_table">
|
||||
<thead class="bitcoin_table_header">
|
||||
<td>Height</td>
|
||||
<td>Age</td>
|
||||
<td>Transactions</td>
|
||||
|
@ -173,8 +173,8 @@
|
|||
|
||||
<br/>
|
||||
<div class="main_header">Peers</div>
|
||||
<table class="bitcoind_table">
|
||||
<thead class="bitcoind_table_header">
|
||||
<table class="bitcoin_table">
|
||||
<thead class="bitcoin_table_header">
|
||||
<td>ID</td>
|
||||
<td>IP</td>
|
||||
<td>Version</td>
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
{% if rtl_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="rtl">RTL</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/toggle-rtl" id="toggle-rtl">{% if rtl_enabled %}Disable{% else %}Enable{% endif %}</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('rtl')">
|
||||
{% if rtl_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -31,7 +33,9 @@
|
|||
{% if electrs_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/electrum-server">Info</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-electrs">{% if electrs_enabled %}Disable{% else %}Enable{% endif %}</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('electrs')">
|
||||
{% if electrs_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -48,25 +52,27 @@
|
|||
{% if btcpayserver_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="btcpayserver">BTCPay Server</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/toggle-btcpayserver" id="toggle-btcpayserver">{% if btcpayserver_enabled %}Disable{% else %}Enable{% endif %}</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('btcpayserver')">
|
||||
{% if btcpayserver_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="app_tile">
|
||||
<div class="app_status_icon {{mempoolspace_status_color}}" id="mempoolspace_status_icon"></div>
|
||||
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/mempoolspace.png")}}"/></div>
|
||||
<div class="app_status_icon {{mempool_status_color}}" id="mempool_status_icon"></div>
|
||||
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/mempool.png")}}"/></div>
|
||||
<div class="app_title">Mempool</div>
|
||||
<div class="app_status" id="mempoolspace_status">{{ mempoolspace_status }}</div>
|
||||
<div class="app_status" id="mempool_status">{{ mempool_status }}</div>
|
||||
<div class="app_contents">
|
||||
{% if not is_installing_docker_images %}
|
||||
{% if mempoolspace_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="mempoolspace">View</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-mempoolspace">Disable</a>
|
||||
{% else %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-mempoolspace">Enable</a>
|
||||
{% if mempool_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="mempool">View</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('mempool')">
|
||||
{% if mempool_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -80,25 +86,25 @@
|
|||
{% if lndhub_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="lndhub">LND Hub</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/toggle-lndhub" id="toggle-lndhub">{% if lndhub_enabled %}Disable{% else %}Enable{% endif %}</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('lndhub')">
|
||||
{% if lndhub_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="app_tile">
|
||||
<div class="app_status_icon {{ btcrpcexplorer_status_color }}" id="btcrpcexplorer_status_icon"></div>
|
||||
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/btc_rpc_explorer.png")}}"/></div>
|
||||
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/btcrpcexplorer.png")}}"/></div>
|
||||
<div class="app_title">Explorer</div>
|
||||
<div class="app_status">{{ btcrpcexplorer_status }}</div>
|
||||
<div class="app_contents">
|
||||
{% if btcrpcexplorer_enabled %}
|
||||
{% if btcrpcexplorer_ready %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="btcrpcexplorer">Explorer</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-btcrpcexplorer">Disable</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-btcrpcexplorer">Enable</a>
|
||||
{% if btcrpcexplorer_enabled and btcrpcexplorer_ready %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="btcrpcexplorer">Explorer</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('btcrpcexplorer')">
|
||||
{% if btcrpcexplorer_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -113,7 +119,7 @@
|
|||
{% if is_dojo_installed %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/dojo">Info</a>
|
||||
{% if electrs_active %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/toggle-dojo">
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('dojo')">
|
||||
{% if dojo_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
@ -136,7 +142,7 @@
|
|||
<div class="app_contents">
|
||||
{% if not is_testnet_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/whirlpool">Info</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/toggle-whirlpool">
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('whirlpool')">
|
||||
{% if whirlpool_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
@ -165,11 +171,11 @@
|
|||
{% else %}
|
||||
{% if lnd_ready %}
|
||||
{% if thunderhub_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="thunderhub">Thunderhub</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-thunderhub">Disable</a>
|
||||
{% else %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-thunderhub">Enable</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="thunderhub">Thunderhub</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('thunderhub')">
|
||||
{% if thunderhub_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -185,11 +191,11 @@
|
|||
Premium Feature
|
||||
{% else %}
|
||||
{% if caravan_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/caravan">Info</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-caravan">Disable</a>
|
||||
{% else %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-caravan">Enable</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/caravan">Info</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('caravan')">
|
||||
{% if caravan_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -204,11 +210,11 @@
|
|||
Premium Feature
|
||||
{% else %}
|
||||
{% if specter_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="specter">Specter</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-specter">Disable</a>
|
||||
{% else %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-specter">Enable</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="specter">Specter</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('specter')">
|
||||
{% if specter_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -224,11 +230,11 @@
|
|||
Premium Feature
|
||||
{% else %}
|
||||
{% if ckbunker_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="ckbunker">CKBunker</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-ckbunker">Disable</a>
|
||||
{% else %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-ckbunker">Enable</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="ckbunker">CKBunker</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('ckbunker')">
|
||||
{% if ckbunker_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -245,10 +251,10 @@
|
|||
{% if lnd_ready and not is_testnet_enabled %}
|
||||
{% if sphinxrelay_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/sphinxrelay">Info</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-sphinxrelay">Disable</a>
|
||||
{% else %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-sphinxrelay">Enable</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('sphinxrelay')">
|
||||
{% if sphinxrelay_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -266,15 +272,15 @@
|
|||
{% if lnd_ready and not is_testnet_enabled %}
|
||||
{% if lnbits_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="lnbits">LNbits</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-lnbits">Disable</a>
|
||||
{% else %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-lnbits">Enable</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('lnbits')">
|
||||
{% if lnbits_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -308,7 +314,9 @@
|
|||
{% if vpn_enabled %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/vpn-info">Info</a>
|
||||
{% endif %}
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-vpn">{% if vpn_enabled %}Disable{% else %}Enable{% endif %}</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button" onclick="toggleEnabled('vpn')">
|
||||
{% if vpn_enabled %}Disable{% else %}Enable{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
<div class="app_tile_row">
|
||||
<div class="app_tile_wide">
|
||||
<div style="width: 130px; float: left;">
|
||||
<div class="app_status_icon {{ bitcoind_status_color }}" id="bitcoin_status_icon"></div>
|
||||
<div class="app_status_icon {{ bitcoin_status_color }}" id="bitcoin_status_icon"></div>
|
||||
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/bitcoin.png")}}"/></div>
|
||||
<div class="app_title">Bitcoin</div>
|
||||
<div class="app_status" id="bitcoin_status">{{ bitcoind_status }}</div>
|
||||
<div class="app_status" id="bitcoin_status">{{ bitcoin_status }}</div>
|
||||
{% if is_testnet_enabled %}
|
||||
<div class="app_status" style="color: green; margin-top: 3px;">Testnet</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<tr>
|
||||
<th>Details</th>
|
||||
<td>
|
||||
{% if is_netdata_enabled %}
|
||||
{% if netdata_enabled %}
|
||||
{% if is_bitcoin_synced %}
|
||||
{% if not is_installing_docker_images %}
|
||||
<a id="netdata" class="ui-button ui-widget ui-corner-all settings_button_small" href="#">Open Netdata</a>
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
{% if wallets is not none and wallets|length > 0 %}
|
||||
<br/>
|
||||
<div class="main_header">Wallets</div>
|
||||
<table class="bitcoind_table">
|
||||
<thead class="bitcoind_table_header">
|
||||
<table class="bitcoin_table">
|
||||
<thead class="bitcoin_table_header">
|
||||
<td>Wallet</td>
|
||||
<td>Actions</td>
|
||||
</thead>
|
||||
|
|
|
@ -392,8 +392,8 @@
|
|||
<br/>
|
||||
|
||||
<div id="channel_table_{{ c.chan_id }}" style="display: none; margin-bottom: 40px;">
|
||||
<table class="bitcoind_table" >
|
||||
<thead class="bitcoind_table_header">
|
||||
<table class="bitcoin_table" >
|
||||
<thead class="bitcoin_table_header">
|
||||
<td>Peer Alias</td>
|
||||
<td>Active</td>
|
||||
<td>Capacity</td>
|
||||
|
@ -423,8 +423,8 @@
|
|||
<br/>
|
||||
<div class="main_header">Peers</div>
|
||||
<div class="app_tile_row">
|
||||
<table class="bitcoind_table">
|
||||
<thead class="bitcoind_table_header">
|
||||
<table class="bitcoin_table">
|
||||
<thead class="bitcoin_table_header">
|
||||
<td>Alias</td>
|
||||
<td>Pub Key</td>
|
||||
<!--<td>Address</td>-->
|
||||
|
|
|
@ -5,6 +5,56 @@
|
|||
<meta http-equiv="refresh" content="{{ refresh_rate }}">
|
||||
|
||||
<script>
|
||||
// Data
|
||||
var application_data = {};
|
||||
{% for app in apps %}
|
||||
application_data["{{app.short_name}}"] = {};
|
||||
application_data["{{app.short_name}}"]["name"] = "{{app.name}}";
|
||||
application_data["{{app.short_name}}"]["short_name"] = "{{app.short_name}}";
|
||||
application_data["{{app.short_name}}"]["is_enabled"] = {% if app.is_enabled %}true{% else %}false{% endif %};
|
||||
{% endfor %}
|
||||
|
||||
// Toggle enable/disable functions
|
||||
function get_custom_enable_message(short_name) {
|
||||
message = "";
|
||||
if (short_name == "electrs") {
|
||||
message = "Enabling Electrum Server will take several days to fully sync for \
|
||||
the first time. Your myNode may run slowly during this period.";
|
||||
} else if (short_name == "vpn") {
|
||||
message = "Enabling VPN will set your IP to a static IP rather than a dynamic one via DHCP. \
|
||||
The initial setup may take about an hour.";
|
||||
}
|
||||
if (message != "") {
|
||||
message += "<br/><br/>";
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
function toggleEnabled(short_name) {
|
||||
enabled = application_data[short_name]["is_enabled"];
|
||||
full_name = application_data[short_name]["name"];
|
||||
|
||||
if ( enabled ) {
|
||||
// Disabling
|
||||
openConfirmDialog("confirm-dialog",
|
||||
"Disable "+full_name,
|
||||
"Are you sure you want to disable "+full_name+"?",
|
||||
function(){
|
||||
window.location.href="/toggle-enabled?app="+short_name
|
||||
});
|
||||
} else {
|
||||
custom_message = "";
|
||||
// Enabling
|
||||
openConfirmDialog("confirm-dialog",
|
||||
"Enable "+full_name,
|
||||
get_custom_enable_message(short_name) +
|
||||
"Are you sure you want to enable "+full_name+"?",
|
||||
function(){
|
||||
window.location.href="/toggle-enabled?app="+short_name
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Update status functions
|
||||
function update_status(status_name, data) {
|
||||
if (data != null && "status" in data && data["status"] != null) {
|
||||
|
@ -173,8 +223,8 @@
|
|||
update_status_icon("rtl_status_icon", data);
|
||||
});
|
||||
$.getJSON("/api/get_service_status?service=mempool", function( data ) {
|
||||
update_status("mempoolspace_status", data);
|
||||
update_status_icon("mempoolspace_status_icon", data);
|
||||
update_status("mempool_status", data);
|
||||
update_status_icon("mempool_status_icon", data);
|
||||
});
|
||||
$.getJSON("/api/get_service_status?service=whirlpool", function( data ) {
|
||||
update_status("whirlpool_status", data);
|
||||
|
@ -275,7 +325,7 @@
|
|||
electrs_enabled = {% if electrs_enabled %}1{% else %}0{% endif %}
|
||||
lndhub_enabled = {% if lndhub_enabled %}1{% else %}0{% endif %}
|
||||
vpn_enabled = {% if vpn_enabled %}1{% else %}0{% endif %}
|
||||
mempoolspace_enabled = {% if mempoolspace_enabled %}1{% else %}0{% endif %}
|
||||
mempool_enabled = {% if mempool_enabled %}1{% else %}0{% endif %}
|
||||
|
||||
$( document ).tooltip();
|
||||
|
||||
|
@ -349,7 +399,7 @@
|
|||
window.open(url,'_blank');
|
||||
})
|
||||
|
||||
$("#mempoolspace").on("click", function() {
|
||||
$("#mempool").on("click", function() {
|
||||
port="4080"
|
||||
if (location.protocol == "https:") {
|
||||
port="4081"
|
||||
|
@ -367,86 +417,6 @@
|
|||
window.open(url,'_blank');
|
||||
})
|
||||
|
||||
$("#toggle-electrs").on("click", function() {
|
||||
if (electrs_enabled)
|
||||
{
|
||||
// Disable electrs
|
||||
window.location.href="/toggle-electrs"
|
||||
}
|
||||
else
|
||||
{
|
||||
// Enable electrs
|
||||
var okFunction = function() {
|
||||
window.location.href="/toggle-electrs"
|
||||
}
|
||||
openConfirmDialog("confirm-dialog",
|
||||
"Enable Electrum Server",
|
||||
"Enabling Electrum Server will take several days to fully sync for \
|
||||
the first time. Your myNode may run slowly during this period.<br/><br/> \
|
||||
Would you like to enable electrum server?",
|
||||
okFunction)
|
||||
}
|
||||
return false
|
||||
});
|
||||
|
||||
$("#toggle-vpn").on("click", function() {
|
||||
if (vpn_enabled)
|
||||
{
|
||||
// Disable vpn
|
||||
window.location.href="/toggle-vpn"
|
||||
}
|
||||
else
|
||||
{
|
||||
// Enable vpn
|
||||
var okFunction = function() {
|
||||
window.location.href="/toggle-vpn"
|
||||
}
|
||||
openConfirmDialog("confirm-dialog",
|
||||
"Enable VPN",
|
||||
"Enabling VPN will set your IP to a static IP rather than a dynamic one via DHCP. \
|
||||
The initial setup may take about an hour.<br/><br/> \
|
||||
Would you like to enable VPN?",
|
||||
okFunction)
|
||||
}
|
||||
return false
|
||||
});
|
||||
|
||||
$("#toggle-btcrpcexplorer").on("click", function() {
|
||||
window.location.href="/toggle-btcrpcexplorer"
|
||||
});
|
||||
|
||||
$("#toggle-mempoolspace").on("click", function() {
|
||||
window.location.href="/toggle-mempoolspace"
|
||||
});
|
||||
|
||||
$("#toggle-btcpayserver").on("click", function() {
|
||||
window.location.href="/toggle-btcpayserver"
|
||||
});
|
||||
|
||||
$("#toggle-caravan").on("click", function() {
|
||||
window.location.href="/toggle-caravan"
|
||||
});
|
||||
|
||||
$("#toggle-specter").on("click", function() {
|
||||
window.location.href="/toggle-specter"
|
||||
});
|
||||
|
||||
$("#toggle-lnbits").on("click", function() {
|
||||
window.location.href="/toggle-lnbits"
|
||||
});
|
||||
|
||||
$("#toggle-thunderhub").on("click", function() {
|
||||
window.location.href="/toggle-thunderhub"
|
||||
});
|
||||
|
||||
$("#toggle-ckbunker").on("click", function() {
|
||||
window.location.href="/toggle-ckbunker"
|
||||
});
|
||||
|
||||
$("#toggle-sphinxrelay").on("click", function() {
|
||||
window.location.href="/toggle-sphinxrelay"
|
||||
});
|
||||
|
||||
function pair_wallet_submit() {
|
||||
$("#pair_wallet_form").submit();
|
||||
pair_wallet_dialog.dialog( "close" );
|
||||
|
|
|
@ -4,21 +4,26 @@
|
|||
{% include 'includes/head.html' %}
|
||||
|
||||
<script>
|
||||
|
||||
function upgrade(name, short_name) {
|
||||
if ( confirm("Are you sure you want to upgrade "+name+"? This will reboot your device.") ) {
|
||||
window.location.href='/settings/reinstall-app?app='+short_name;
|
||||
}
|
||||
}
|
||||
|
||||
function reinstall(name, short_name) {
|
||||
if ( confirm("Are you sure you want to re-install "+name+"? This will reboot your device.") ) {
|
||||
window.location.href='/settings/reinstall-app?app='+short_name;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
function upgrade(name, short_name) {
|
||||
if ( confirm("Are you sure you want to upgrade "+name+"? This will reboot your device.") ) {
|
||||
window.location.href='/settings/reinstall-app?app='+short_name;
|
||||
}
|
||||
}
|
||||
|
||||
function reinstall(name, short_name) {
|
||||
if ( confirm("Are you sure you want to re-install "+name+"? This will reboot your device.") ) {
|
||||
window.location.href='/settings/reinstall-app?app='+short_name;
|
||||
}
|
||||
}
|
||||
|
||||
function uninstall(name, short_name) {
|
||||
if ( confirm("Are you sure you want to uninstall "+name+"? This will reboot your device.") ) {
|
||||
window.location.href='/settings/uninstall-app?app='+short_name;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
@ -30,30 +35,47 @@
|
|||
|
||||
<div class="main_header">Manage Applications</div>
|
||||
</br>
|
||||
|
||||
<!-- {{ load_time }} ms -->
|
||||
<br/><br/>
|
||||
<table class="bitcoind_table">
|
||||
<thead class="bitcoind_table_header">
|
||||
<table class="bitcoin_table">
|
||||
<thead class="bitcoin_table_header">
|
||||
<td>Application</td>
|
||||
<td>Current Version</td>
|
||||
<td>Latest Version</td>
|
||||
<td><!-- Enabled Icon --></td>
|
||||
<td colspan="2">Actions</td>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for app in apps %}
|
||||
<tr>
|
||||
<td>{{ app.name }}</td>
|
||||
<td>{{ app.current_version }}</td>
|
||||
<td>{{ app.latest_version }}</td>
|
||||
<td>
|
||||
{% if app.current_version != app.latest_version %}
|
||||
<button class="ui-button ui-widget ui-corner-all mynode_button_small" onclick="upgrade('{{ app.name }}', '{{ app.short_name }}');">Upgrade</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<button class="ui-button ui-widget ui-corner-all mynode_button_small" onclick="reinstall('{{ app.name }}', '{{ app.short_name }}');">Reinstall</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% if app.show_on_application_page %}
|
||||
{% if not product_key_skipped or product_key_skipped and not app.is_premium %}
|
||||
<tr>
|
||||
<td>{{ app.name }}</td>
|
||||
<td>{{ app.current_version }}</td>
|
||||
<td>{{ app.latest_version }}</td>
|
||||
<td>
|
||||
{% if app.is_enabled %}<img style="width: 20px;" title="Enabled" src="{{ url_for('static', filename="images/running.png")}}"/>{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if app.is_installed %}
|
||||
{% if app.current_version != app.latest_version %}
|
||||
<button class="ui-button ui-widget ui-corner-all mynode_button_small" onclick="upgrade('{{ app.name }}', '{{ app.short_name }}');">Upgrade</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if app.is_installed %}
|
||||
{% if app.can_reinstall %}
|
||||
<button class="ui-button ui-widget ui-corner-all mynode_button_small" onclick="reinstall('{{ app.name }}', '{{ app.short_name }}');">Reinstall</button>
|
||||
{% endif %}
|
||||
{% if app.can_uninstall %}
|
||||
<button class="ui-button ui-widget ui-corner-all mynode_button_small" onclick="uninstall('{{ app.name }}', '{{ app.short_name }}');">Uninstall</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
}
|
||||
openConfirmDialog("confirm-dialog",
|
||||
"Reset Bitcoin Blockchain",
|
||||
"Resetting the blockchain will restart bitcoind from scratch or from QuickSync, " +
|
||||
"Resetting the blockchain will restart bitcoin from scratch or from QuickSync, " +
|
||||
"depending on your settings. This may take a long time. "+
|
||||
"Would you still like to reset the bitcoin blockchain?",
|
||||
okFunction)
|
||||
|
@ -106,7 +106,7 @@
|
|||
}
|
||||
openConfirmDialog("confirm-dialog",
|
||||
"Reset QuickSync",
|
||||
"<p>Restarting QuickSync will delete all current bitcoind blockchain data and redownload " +
|
||||
"<p>Restarting QuickSync will delete all current bitcoin blockchain data and redownload " +
|
||||
"the pre-synced blockchain. This will take a while.</p>"+
|
||||
"<p>Would you still like to restart QuickSync?</p>",
|
||||
okFunction)
|
||||
|
@ -813,7 +813,7 @@
|
|||
<div class="settings_block_subheader">Netdata</div>
|
||||
This will enable or disable Netdata device monitoring.
|
||||
<br/>
|
||||
{% if is_netdata_enabled %}
|
||||
{% if netdata_enabled %}
|
||||
<a href="/settings/toggle-netdata" class="ui-button ui-widget ui-corner-all settings_button">Disable</a>
|
||||
{% else %}
|
||||
<a href="/settings/toggle-netdata" class="ui-button ui-widget ui-corner-all settings_button">Enable</a>
|
||||
|
@ -873,27 +873,11 @@
|
|||
|
||||
<select name="reinstall_app" id="reinstall_app">
|
||||
<option value="none" selected="selected">Choose...</option>
|
||||
<option value="bitcoin">Bitcoin</option>
|
||||
<option value="lnd">LND</option>
|
||||
<option value="btcrpcexplorer">BTC RPC Explorer</option>
|
||||
<option value="btcpayserver">BTCPay Server</option>
|
||||
<option value="caravan">Caravan</option>
|
||||
<option value="dojo">Dojo</option>
|
||||
<option value="joinmarket">JoinMarket</option>
|
||||
<option value="lnbits">Lnbits</option>
|
||||
<option value="loop">Lightning Loop</option>
|
||||
<option value="webssh2">Linux Terminal</option>
|
||||
<option value="lndconnect">LND Connect</option>
|
||||
<option value="lndhub">LNDHub</option>
|
||||
<option value="mempoolspace">Mempool</option>
|
||||
<option value="netdata">Netdata</option>
|
||||
<option value="specter">Specter</option>
|
||||
<option value="rtl">RTL</option>
|
||||
<option value="thunderhub">Thunderhub</option>
|
||||
<option value="tor">Tor</option>
|
||||
<option value="ufw">UFW</option>
|
||||
<option value="whirlpool">Whirlpool</option>
|
||||
|
||||
{% for app in apps %}
|
||||
{% if app.can_reinstall %}
|
||||
<option value="{{app.short_name}}">{{app.name}}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button id="reinstall_button">Reinstall</button>
|
||||
|
||||
|
|
|
@ -4,123 +4,18 @@
|
|||
{% include 'includes/head.html' %}
|
||||
|
||||
<script>
|
||||
function showLog(name) {
|
||||
visible = $("#"+name+"_status").is(':visible');
|
||||
if (visible) {
|
||||
$("#show_"+name+"_status").html("Show Log");
|
||||
$("#"+name+"_status").hide();
|
||||
} else {
|
||||
$("#show_"+name+"_status").html("Hide Log");
|
||||
$("#"+name+"_status").show();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#show_startup_status").on("click", function() {
|
||||
$("#show_startup_status").hide(0);
|
||||
$("#startup_status").show();
|
||||
});
|
||||
|
||||
$("#show_quicksync_status").on("click", function() {
|
||||
$("#show_quicksync_status").hide(0);
|
||||
$("#quicksync_status").show();
|
||||
});
|
||||
|
||||
$("#show_bitcoin_status").on("click", function() {
|
||||
$("#show_bitcoin_status").hide(0);
|
||||
$("#bitcoin_status").show();
|
||||
});
|
||||
|
||||
$("#show_lnd_status").on("click", function() {
|
||||
$("#show_lnd_status").hide(0);
|
||||
$("#lnd_status").show();
|
||||
});
|
||||
|
||||
$("#show_loopd_status").on("click", function() {
|
||||
$("#show_loopd_status").hide(0);
|
||||
$("#loopd_status").show();
|
||||
});
|
||||
|
||||
$("#show_poold_status").on("click", function() {
|
||||
$("#show_poold_status").hide(0);
|
||||
$("#poold_status").show();
|
||||
});
|
||||
|
||||
$("#show_lndhub_status").on("click", function() {
|
||||
$("#show_lndhub_status").hide(0);
|
||||
$("#lndhub_status").show();
|
||||
});
|
||||
|
||||
$("#show_tor_status").on("click", function() {
|
||||
$("#show_tor_status").hide(0);
|
||||
$("#tor_status").show();
|
||||
});
|
||||
|
||||
$("#show_electrs_status").on("click", function() {
|
||||
$("#show_electrs_status").hide(0);
|
||||
$("#electrs_status").show();
|
||||
});
|
||||
|
||||
$("#show_rtl_status").on("click", function() {
|
||||
$("#show_rtl_status").hide(0);
|
||||
$("#rtl_status").show();
|
||||
});
|
||||
|
||||
$("#show_lnbits_status").on("click", function() {
|
||||
$("#show_lnbits_status").hide(0);
|
||||
$("#lnbits_status").show();
|
||||
});
|
||||
|
||||
$("#show_thunderhub_status").on("click", function() {
|
||||
$("#show_thunderhub_status").hide(0);
|
||||
$("#thunderhub_status").show();
|
||||
});
|
||||
|
||||
$("#show_docker_status").on("click", function() {
|
||||
$("#show_docker_status").hide(0);
|
||||
$("#docker_status").show();
|
||||
});
|
||||
|
||||
$("#show_docker_image_build_status").on("click", function() {
|
||||
$("#show_docker_image_build_status").hide(0);
|
||||
$("#docker_image_build_status").show();
|
||||
});
|
||||
|
||||
$("#show_netdata_status").on("click", function() {
|
||||
$("#show_netdata_status").hide(0);
|
||||
$("#netdata_status").show();
|
||||
});
|
||||
|
||||
$("#show_whirlpool_status").on("click", function() {
|
||||
$("#show_whirlpool_status").hide(0);
|
||||
$("#whirlpool_status").show();
|
||||
});
|
||||
|
||||
$("#show_dojo_status").on("click", function() {
|
||||
$("#show_dojo_status").hide(0);
|
||||
$("#dojo_status").show();
|
||||
});
|
||||
|
||||
$("#show_btcpayserver_status").on("click", function() {
|
||||
$("#show_btcpayserver_status").hide(0);
|
||||
$("#btcpayserver_status").show();
|
||||
});
|
||||
|
||||
$("#show_mempoolspace_status").on("click", function() {
|
||||
$("#show_mempoolspace_status").hide(0);
|
||||
$("#mempoolspace_status").show();
|
||||
});
|
||||
|
||||
$("#show_caravan_status").on("click", function() {
|
||||
$("#show_caravan_status").hide(0);
|
||||
$("#caravan_status").show();
|
||||
});
|
||||
|
||||
$("#show_ckbunker_status").on("click", function() {
|
||||
$("#show_ckbunker_status").hide(0);
|
||||
$("#ckbunker_status").show();
|
||||
});
|
||||
|
||||
$("#show_specter_status").on("click", function() {
|
||||
$("#show_specter_status").hide(0);
|
||||
$("#specter_status").show();
|
||||
});
|
||||
|
||||
$("#show_sphinxrelay_status").on("click", function() {
|
||||
$("#show_sphinxrelay_status").hide(0);
|
||||
$("#sphinxrelay_status").show();
|
||||
});
|
||||
|
||||
$("#show_upgrade_status").on("click", function() {
|
||||
$("#show_upgrade_status").hide(0);
|
||||
$("#upgrade_status").show();
|
||||
|
@ -131,16 +26,6 @@
|
|||
$("#upgrade_status_beta").show();
|
||||
});
|
||||
|
||||
$("#show_nginx_status").on("click", function() {
|
||||
$("#show_nginx_status").hide(0);
|
||||
$("#nginx_status").show();
|
||||
});
|
||||
|
||||
$("#show_firewall_status").on("click", function() {
|
||||
$("#show_firewall_status").hide(0);
|
||||
$("#firewall_status").show();
|
||||
});
|
||||
|
||||
$("#show_product_key").on("click", function() {
|
||||
$("#show_product_key").hide(0);
|
||||
$("#product_key").show();
|
||||
|
@ -186,6 +71,8 @@
|
|||
|
||||
{% include 'includes/message_display.html' %}
|
||||
|
||||
<!-- {{load_time}} ms -->
|
||||
|
||||
<br/>
|
||||
<div class="settings_block">
|
||||
<div class="settings_block_header">myNode</div>
|
||||
|
@ -216,7 +103,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ startup_status_color }}"></div>
|
||||
{{ startup_status }}
|
||||
</div>
|
||||
<button id="show_startup_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_startup_status" onclick="showLog('startup')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="startup_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{startup_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -225,7 +112,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ quicksync_status_color }}"></div>
|
||||
{{ quicksync_status }}
|
||||
</div>
|
||||
<button id="show_quicksync_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_quicksync_status" onclick="showLog('quicksync')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="quicksync_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{quicksync_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -234,7 +121,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ tor_status_color }}"></div>
|
||||
{{ tor_status }}
|
||||
</div>
|
||||
<button id="show_tor_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_tor_status" onclick="showLog('tor')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="tor_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{tor_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -243,7 +130,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ bitcoin_status_color }}"></div>
|
||||
{{ bitcoin_status }}
|
||||
</div>
|
||||
<button id="show_bitcoin_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_bitcoin_status" onclick="showLog('bitcoin')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="bitcoin_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{bitcoin_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -254,29 +141,40 @@
|
|||
<div class="settings_block_subheader_status_icon {{ lnd_status_color }}"></div>
|
||||
{{ lnd_status }}
|
||||
</div>
|
||||
<button id="show_lnd_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_lnd_status" onclick="showLog('lnd')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="lnd_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{lnd_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
{% if lnd_wallet_exists %}
|
||||
<div class="settings_block_subheader">Loop Status</div>
|
||||
<div class="settings_block_subheader_status">
|
||||
<div class="settings_block_subheader_status_icon {{ loopd_status_color }}"></div>
|
||||
{{ loopd_status }}
|
||||
<div class="settings_block_subheader_status_icon {{ loop_status_color }}"></div>
|
||||
{{ loop_status }}
|
||||
</div>
|
||||
<button id="show_loopd_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="loopd_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{loopd_status_log}}</pre></div>
|
||||
<button id="show_loop_status" onclick="showLog('loop')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="loop_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{loop_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
{% endif %}
|
||||
|
||||
{% if lnd_wallet_exists %}
|
||||
<div class="settings_block_subheader">Pool Status</div>
|
||||
<div class="settings_block_subheader_status">
|
||||
<div class="settings_block_subheader_status_icon {{ poold_status_color }}"></div>
|
||||
{{ poold_status }}
|
||||
<div class="settings_block_subheader_status_icon {{ pool_status_color }}"></div>
|
||||
{{ pool_status }}
|
||||
</div>
|
||||
<button id="show_poold_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="poold_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{poold_status_log}}</pre></div>
|
||||
<button id="show_pool_status" onclick="showLog('pool')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="pool_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{pool_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
{% endif %}
|
||||
|
||||
{% if lnd_wallet_exists %}
|
||||
<div class="settings_block_subheader">Lightning Terminal Status</div>
|
||||
<div class="settings_block_subheader_status">
|
||||
<div class="settings_block_subheader_status_icon {{ lit_status_color }}"></div>
|
||||
{{ lit_status }}
|
||||
</div>
|
||||
<button id="show_lit_status" onclick="showLog('lit')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="lit_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{lit_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
{% endif %}
|
||||
|
||||
|
@ -285,7 +183,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ electrs_status_color }}"></div>
|
||||
{{ electrs_status }}
|
||||
</div>
|
||||
<button id="show_electrs_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_electrs_status" onclick="showLog('electrs')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="electrs_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{electrs_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -294,7 +192,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ lndhub_status_color }}"></div>
|
||||
{{ lndhub_status }}
|
||||
</div>
|
||||
<button id="show_lndhub_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_lndhub_status" onclick="showLog('lndhub')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="lndhub_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{lndhub_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -303,7 +201,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ rtl_status_color }}"></div>
|
||||
{{ rtl_status }}
|
||||
</div>
|
||||
<button id="show_rtl_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_rtl_status" onclick="showLog('rtl')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="rtl_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{rtl_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -312,7 +210,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ lnbits_status_color }}"></div>
|
||||
{{ lnbits_status }}
|
||||
</div>
|
||||
<button id="show_lnbits_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_lnbits_status" onclick="showLog('lnbits')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="lnbits_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{lnbits_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -321,7 +219,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ thunderhub_status_color }}"></div>
|
||||
{{ thunderhub_status }}
|
||||
</div>
|
||||
<button id="show_thunderhub_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_thunderhub_status" onclick="showLog('thunderhub')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="thunderhub_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{thunderhub_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -330,7 +228,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ docker_status_color }}"></div>
|
||||
{{ docker_status }}
|
||||
</div>
|
||||
<button id="show_docker_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_docker_status" onclick="showLog('docker')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="docker_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{docker_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -339,7 +237,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ docker_image_build_status_color }}"></div>
|
||||
{{ docker_image_build_status }}
|
||||
</div>
|
||||
<button id="show_docker_image_build_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_docker_image_build_status" onclick="showLog('docker_image_build')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="docker_image_build_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{docker_image_build_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -349,7 +247,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ whirlpool_status_color }}"></div>
|
||||
{{ whirlpool_status }}
|
||||
</div>
|
||||
<button id="show_whirlpool_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_whirlpool_status" onclick="showLog('whirlpool')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="whirlpool_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{whirlpool_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -365,7 +263,7 @@
|
|||
{% if 'nginx' in running_containers %} nginx {% endif %}
|
||||
</span>
|
||||
</div>
|
||||
<button id="show_dojo_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_dojo_status" onclick="showLog('dojo')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="dojo_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{dojo_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
{% endif %}
|
||||
|
@ -381,21 +279,23 @@
|
|||
{% if 'btcpayserver_postgres_1' in running_containers %} postgres {% endif %}
|
||||
</span>
|
||||
</div>
|
||||
<button id="show_btcpayserver_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_btcpayserver_status" onclick="showLog('btcpayserver')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="btcpayserver_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{btcpayserver_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="settings_block_subheader">Mempool Status</div>
|
||||
<div class="settings_block_subheader_status">
|
||||
<div class="settings_block_subheader_status_icon {{ mempoolspace_status_color }}"></div>
|
||||
{{ mempoolspace_status }}
|
||||
<div class="settings_block_subheader_status_icon {{ mempool_status_color }}"></div>
|
||||
{{ mempool_status }}
|
||||
<span class='status_container_list'>
|
||||
Running Containers:
|
||||
{% if 'mempoolspace' in running_containers %} mempoolspace {% endif %}
|
||||
{% if 'mempool_web_1' in running_containers %} mempool_web_1 {% endif %}
|
||||
{% if 'mempool_db_1' in running_containers %} mempool_db_1 {% endif %}
|
||||
{% if 'mempool_api_1' in running_containers %} mempool_api_1 {% endif %}
|
||||
</span>
|
||||
</div>
|
||||
<button id="show_mempoolspace_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="mempoolspace_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{mempoolspace_status_log}}</pre></div>
|
||||
<button id="show_mempool_status" onclick="showLog('mempool')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="mempool_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{mempool_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="settings_block_subheader">Caravan Status</div>
|
||||
|
@ -403,7 +303,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ caravan_status_color }}"></div>
|
||||
{{ caravan_status }}
|
||||
</div>
|
||||
<button id="show_caravan_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_caravan_status" onclick="showLog('caravan')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="caravan_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{caravan_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -412,7 +312,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ ckbunker_status_color }}"></div>
|
||||
{{ ckbunker_status }}
|
||||
</div>
|
||||
<button id="show_ckbunker_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_ckbunker_status" onclick="showLog('ckbunker')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="ckbunker_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{ckbunker_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -421,7 +321,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ specter_status_color }}"></div>
|
||||
{{ specter_status }}
|
||||
</div>
|
||||
<button id="show_specter_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_specter_status" onclick="showLog('specter')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="specter_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{specter_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -431,18 +331,18 @@
|
|||
<div class="settings_block_subheader_status_icon {{ sphinxrelay_status_color }}"></div>
|
||||
{{ sphinxrelay_status }}
|
||||
</div>
|
||||
<button id="show_sphinxrelay_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_sphinxrelay_status" onclick="showLog('sphinxrelay')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="sphinxrelay_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{sphinxrelay_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
{% endif %}
|
||||
|
||||
{% if is_netdata_enabled %}
|
||||
{% if netdata_enabled %}
|
||||
<div class="settings_block_subheader">Netdata Status</div>
|
||||
<div class="settings_block_subheader_status">
|
||||
<div class="settings_block_subheader_status_icon {{ netdata_status_color }}"></div>
|
||||
{{ netdata_status }}
|
||||
</div>
|
||||
<button id="show_netdata_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_netdata_status" onclick="showLog('netdata')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="netdata_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{netdata_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
{% endif %}
|
||||
|
@ -454,7 +354,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ nginx_status_color }}"></div>
|
||||
{{ nginx_status }}
|
||||
</div>
|
||||
<button id="show_nginx_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_nginx_status" onclick="showLog('nginx')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="nginx_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{nginx_status_log}}</pre></div>
|
||||
<div class="divider"></div>
|
||||
|
||||
|
@ -463,7 +363,7 @@
|
|||
<div class="settings_block_subheader_status_icon {{ firewall_status_color }}"></div>
|
||||
{{ firewall_status }}
|
||||
</div>
|
||||
<button id="show_firewall_status" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<button id="show_firewall_status" onclick="showLog('firewall')" class="ui-button ui-widget ui-corner-all settings_button_small">Show Log</button>
|
||||
<div id="firewall_status" style='text-align: left; font-size: 12px; width: 800px; display: none;'><pre>{{firewall_status_log}}</pre></div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -94,8 +94,8 @@
|
|||
<br/>
|
||||
|
||||
<div class="sub_header">v3 Addresses</div>
|
||||
<table class="bitcoind_table">
|
||||
<thead class="bitcoind_table_header">
|
||||
<table class="bitcoin_table">
|
||||
<thead class="bitcoin_table_header">
|
||||
<td>Service</td>
|
||||
<td>Address</td>
|
||||
<td>Port</td>
|
||||
|
@ -134,8 +134,8 @@
|
|||
<br/>
|
||||
|
||||
<div class="sub_header">v2 Addresses</div>
|
||||
<table class="bitcoind_table">
|
||||
<thead class="bitcoind_table_header">
|
||||
<table class="bitcoin_table">
|
||||
<thead class="bitcoin_table_header">
|
||||
<td>Service</td>
|
||||
<td>Address</td>
|
||||
<td>Password</td>
|
||||
|
|
|
@ -7,6 +7,7 @@ from bitcoin_info import *
|
|||
from lightning_info import *
|
||||
from device_info import *
|
||||
from enable_disable_functions import *
|
||||
from systemctl_info import *
|
||||
from electrum_info import update_electrs_info
|
||||
from requests import get
|
||||
import random
|
||||
|
@ -123,7 +124,7 @@ def update_bitcoin_other_info_thread():
|
|||
# Updates electrs info every 60 seconds
|
||||
def update_electrs_info_thread():
|
||||
try:
|
||||
if is_electrs_enabled():
|
||||
if is_service_enabled("electrs"):
|
||||
update_electrs_info()
|
||||
except Exception as e:
|
||||
print("CAUGHT update_electrs_info_thread EXCEPTION: " + str(e))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from flask import Blueprint, render_template, redirect
|
||||
from user_management import check_logged_in
|
||||
from enable_disable_functions import is_whirlpool_enabled, enable_whirlpool, disable_whirlpool
|
||||
from enable_disable_functions import *
|
||||
from device_info import read_ui_settings, is_testnet_enabled, get_local_ip
|
||||
from systemctl_info import *
|
||||
import subprocess
|
||||
|
@ -20,7 +20,7 @@ def get_whirlpool_status():
|
|||
whirlpool_status_color = "gray"
|
||||
return whirlpool_status, whirlpool_status_color, whirlpool_initialized
|
||||
|
||||
if is_whirlpool_enabled():
|
||||
if is_service_enabled("whirlpool"):
|
||||
status_code = get_service_status_code("whirlpool")
|
||||
if status_code != 0:
|
||||
whirlpool_status = "Inactive"
|
||||
|
@ -54,7 +54,7 @@ def whirlpool_page():
|
|||
"local_ip": get_local_ip(),
|
||||
"whirlpool_status": whirlpool_status,
|
||||
"whirlpool_status_color": whirlpool_status_color,
|
||||
"whirlpool_enabled": is_whirlpool_enabled(),
|
||||
"whirlpool_enabled": is_service_enabled("whirlpool"),
|
||||
"whirlpool_initialized": whirlpool_initialized,
|
||||
"whirlpool_api_key": whirlpool_api_key
|
||||
}
|
||||
|
|
|
@ -202,7 +202,7 @@ pip2 install --upgrade wheel
|
|||
pip2 install speedtest-cli transmissionrpc flask python-bitcoinrpc redis prometheus_client requests
|
||||
pip2 install python-pam python-bitcoinlib psutil
|
||||
pip2 install grpcio grpcio-tools googleapis-common-protos
|
||||
pip2 install tzupdate virtualenv pysocks redis qrcode image
|
||||
pip2 install tzupdate virtualenv pysocks redis qrcode image subprocess32
|
||||
|
||||
|
||||
# Update Python3 to 3.7.X
|
||||
|
@ -882,11 +882,12 @@ systemctl enable firewall
|
|||
systemctl enable bandwidth
|
||||
systemctl enable www
|
||||
systemctl enable drive_check
|
||||
systemctl enable bitcoind
|
||||
systemctl enable bitcoin
|
||||
systemctl enable seed_bitcoin_peers
|
||||
systemctl enable lnd
|
||||
systemctl enable loopd
|
||||
systemctl enable poold
|
||||
systemctl enable loop
|
||||
systemctl enable pool
|
||||
systemctl enable lit
|
||||
systemctl enable lnd_unlock
|
||||
systemctl enable lnd_backup
|
||||
systemctl enable lnd_admin_files
|
||||
|
@ -895,7 +896,7 @@ systemctl enable redis-server
|
|||
#systemctl enable mongodb
|
||||
#systemctl enable electrs # DISABLED BY DEFAULT
|
||||
#systemctl enable lndhub # DISABLED BY DEFAULT
|
||||
#systemctl enable btc_rpc_explorer # DISABLED BY DEFAULT
|
||||
#systemctl enable btcrpcexplorer # DISABLED BY DEFAULT
|
||||
systemctl enable tls_proxy
|
||||
systemctl enable rtl
|
||||
systemctl enable tor
|
||||
|
|
Loading…
Reference in New Issue
Block a user