More updates for simpler app management

This commit is contained in:
Taylor Helsper 2020-09-07 16:13:45 -05:00
parent 7930801abf
commit 9786df8c55
9 changed files with 160 additions and 138 deletions

View File

@ -10,6 +10,7 @@ for i in 'rock64' 'rockpro64' 'raspi4' 'debian'; do
rsync -r -u rootfs/$i/* out/rootfs_$i/
rsync -r -u CHANGELOG out/rootfs_$i/usr/share/mynode/changelog
cp -f setup/setup_device.sh out/setup_device.sh
cp -f rootfs/standard/usr/share/mynode/mynode_app_versions.sh out/mynode_app_versions.sh
rm -f out/mynode_rootfs_$i.tar.gz
tar -zcf out/mynode_rootfs_$i.tar.gz out/rootfs_$i/*

View File

@ -1,6 +1,7 @@
#!/bin/bash
source /usr/share/mynode/mynode_config.sh
source /usr/share/mynode/mynode_app_versions.sh
set -x
set -e
@ -158,7 +159,6 @@ usermod -aG docker root
# Upgrade BTC
echo "Upgrading BTC..."
BTC_VERSION="0.20.1"
ARCH="UNKNOWN"
if [ $IS_RASPI = 1 ]; then
ARCH="arm-linux-gnueabihf"
@ -170,7 +170,6 @@ else
echo "Unknown Bitcoin Version"
exit 1
fi
BTC_VERSION_FILE=/home/bitcoin/.mynode/bitcoin_version
BTC_UPGRADE_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/bitcoin-$BTC_VERSION-$ARCH.tar.gz
BTC_UPGRADE_SHA256SUM_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/SHA256SUMS.asc
CURRENT=""
@ -207,12 +206,10 @@ fi
# Upgrade LND
echo "Upgrading LND..."
LND_VERSION="v0.11.0-beta"
LND_ARCH="lnd-linux-armv7"
if [ $IS_X86 = 1 ]; then
LND_ARCH="lnd-linux-amd64"
fi
LND_VERSION_FILE=/home/bitcoin/.mynode/lnd_version
LND_UPGRADE_URL=https://github.com/lightningnetwork/lnd/releases/download/$LND_VERSION/$LND_ARCH-$LND_VERSION.tar.gz
LND_UPGRADE_MANIFEST_URL=https://github.com/lightningnetwork/lnd/releases/download/$LND_VERSION/manifest-$LND_VERSION.txt
LND_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightningnetwork/lnd/releases/download/$LND_VERSION/manifest-$LND_VERSION.txt.sig
@ -246,12 +243,10 @@ fi
# Upgrade Loop
echo "Upgrading loopd..."
LOOP_VERSION="v0.8.1-beta"
LOOP_ARCH="loop-linux-armv7"
if [ $IS_X86 = 1 ]; then
LOOP_ARCH="loop-linux-amd64"
fi
LOOP_VERSION_FILE=/home/bitcoin/.mynode/loop_version
LOOP_UPGRADE_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/$LOOP_ARCH-$LOOP_VERSION.tar.gz
LOOP_UPGRADE_MANIFEST_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/manifest-$LOOP_VERSION.txt
LOOP_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/manifest-$LOOP_VERSION.txt.sig
@ -284,14 +279,12 @@ if [ "$CURRENT" != "$LOOP_VERSION" ]; then
fi
# Install LndHub
LNDHUB_VERSION="v1.2.0"
LNDHUB_UPGRADE_URL=https://github.com/BlueWallet/LndHub/archive/$LNDHUB_VERSION.tar.gz
LNDHUB_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.lndhub_url
CURRENT=""
if [ -f $LNDHUB_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $LNDHUB_UPGRADE_URL_FILE)
if [ -f $LNDHUB_VERSION_FILE ]; then
CURRENT=$(cat $LNDHUB_VERSION_FILE)
fi
if [ "$CURRENT" != "$LNDHUB_UPGRADE_URL" ]; then
if [ "$CURRENT" != "$LNDHUB_VERSION" ]; then
cd /opt/mynode
rm -rf LndHub
@ -305,15 +298,13 @@ if [ "$CURRENT" != "$LNDHUB_UPGRADE_URL" ]; then
sudo -u bitcoin npm install --only=production
sudo -u bitcoin ln -s /home/bitcoin/.lnd/tls.cert tls.cert
sudo -u bitcoin ln -s /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon admin.macaroon
echo $LNDHUB_UPGRADE_URL > $LNDHUB_UPGRADE_URL_FILE
echo $LNDHUB_VERSION > $LNDHUB_VERSION_FILE
fi
cd ~
# Install Caravan
CARAVAN_VERSION="v0.3.3"
CARAVAN_UPGRADE_URL=https://github.com/unchained-capital/caravan/archive/$CARAVAN_VERSION.tar.gz
CARAVAN_VERSION_FILE=/home/bitcoin/.mynode/caravan_version
CARAVAN_SETTINGS_UPDATE_FILE=/home/bitcoin/.mynode/caravan_settings_1
CURRENT=""
if [ -f $CARAVAN_VERSION_FILE ]; then
@ -339,14 +330,12 @@ cd ~
# Install cors proxy (my fork)
CORSPROXY_VERSION="v1.7.0"
CORSPROXY_UPGRADE_URL=https://github.com/tehelsper/CORS-Proxy/archive/$CORSPROXY_VERSION.tar.gz
CORSPROXY_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.corsproxy_url
CURRENT=""
if [ -f $CORSPROXY_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $CORSPROXY_UPGRADE_URL_FILE)
if [ -f $CORSPROXY_VERSION_FILE ]; then
CURRENT=$(cat $CORSPROXY_VERSION_FILE)
fi
if [ "$CURRENT" != "$CORSPROXY_UPGRADE_URL" ]; then
if [ "$CURRENT" != "$CORSPROXY_VERSION" ]; then
cd /opt/mynode
rm -rf corsproxy
@ -358,7 +347,7 @@ if [ "$CURRENT" != "$CORSPROXY_UPGRADE_URL" ]; then
cd corsproxy
npm install
echo $CORSPROXY_UPGRADE_URL > $CORSPROXY_UPGRADE_URL_FILE
echo $CORSPROXY_VERSION > $CORSPROXY_VERSION_FILE
fi
cd ~
@ -381,9 +370,7 @@ fi
# Upgrade JoinMarket
echo "Upgrading JoinMarket..."
if [ $IS_RASPI = 1 ] || [ $IS_X86 = 1 ]; then
JOINMARKET_VERSION="v0.7.0"
JOINMARKET_UPGRADE_URL=https://github.com/JoinMarket-Org/joinmarket-clientserver/archive/$JOINMARKET_VERSION.tar.gz
JOINMARKET_VERSION_FILE=/home/bitcoin/.mynode/joinmarket_version
CURRENT=""
if [ -f $JOINMARKET_VERSION_FILE ]; then
CURRENT=$(cat $JOINMARKET_VERSION_FILE)
@ -413,12 +400,8 @@ if [ $IS_RASPI = 1 ] || [ $IS_X86 = 1 ]; then
fi
# Install Whirlpool
WHIRLPOOL_VERSION="0.10.8"
WHIRLPOOL_UPLOAD_FILE_ID="7998ea5a9bb180451616809bc346b9ac"
WHIRLPOOL_UPLOAD_SIG_ID="8d919af2d97657a835195a928e7646bc"
WHIRLPOOL_UPGRADE_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/$WHIRLPOOL_UPLOAD_FILE_ID/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar
WHIRLPOOL_SIG_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/$WHIRLPOOL_UPLOAD_SIG_ID/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar.sig.asc
WHIRLPOOL_VERSION_FILE=/home/bitcoin/.mynode/whirlpool_version
CURRENT=""
if [ -f $WHIRLPOOL_VERSION_FILE ]; then
CURRENT=$(cat $WHIRLPOOL_VERSION_FILE)
@ -437,10 +420,8 @@ fi
# Upgrade RTL
RTL_VERSION="v0.9.0"
RTL_UPGRADE_URL=https://github.com/Ride-The-Lightning/RTL/archive/$RTL_VERSION.tar.gz
RTL_UPGRADE_ASC_URL=https://github.com/Ride-The-Lightning/RTL/releases/download/$RTL_VERSION/$RTL_VERSION.tar.gz.asc
RTL_VERSION_FILE=/home/bitcoin/.mynode/rtl_version
CURRENT=""
if [ -f $RTL_VERSION_FILE ]; then
CURRENT=$(cat $RTL_VERSION_FILE)
@ -470,12 +451,10 @@ if [ "$CURRENT" != "$RTL_VERSION" ]; then
fi
# Upgrade BTC RPC Explorer
BTCRPCEXPLORER_VERSION="v2.0.2"
BTCRPCEXPLORER_UPGRADE_URL=https://github.com/janoside/btc-rpc-explorer/archive/$BTCRPCEXPLORER_VERSION.tar.gz
BTCRPCEXPLORER_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.btcrpcexplorer_url
CURRENT=""
if [ -f $BTCRPCEXPLORER_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $BTCRPCEXPLORER_UPGRADE_URL_FILE)
if [ -f $BTCRPCEXPLORER_VERSION_FILE ]; then
CURRENT=$(cat $BTCRPCEXPLORER_VERSION_FILE)
fi
if [ "$CURRENT" != "$BTCRPCEXPLORER_UPGRADE_URL" ]; then
cd /opt/mynode
@ -489,19 +468,18 @@ if [ "$CURRENT" != "$BTCRPCEXPLORER_UPGRADE_URL" ]; then
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $BTCRPCEXPLORER_UPGRADE_URL > $BTCRPCEXPLORER_UPGRADE_URL_FILE
echo $BTCRPCEXPLORER_UPGRADE_URL > $BTCRPCEXPLORER_VERSION_FILE
fi
# Upgrade LNBits
# Find URL by going to https://github.com/lnbits/lnbits/releases and finding the exact commit for the mynode tag
LNBITS_UPGRADE_URL=https://github.com/lnbits/lnbits/archive/dd2a282158d5774c2a3c85c164a10709c13ef7b4.tar.gz
LNBITS_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.lnbits_url
LNBITS_UPGRADE_URL=https://github.com/lnbits/lnbits/archive/$LNBITS_VERSION.tar.gz
CURRENT=""
if [ -f $LNBITS_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $LNBITS_UPGRADE_URL_FILE)
if [ -f $LNBITS_VERSION_FILE ]; then
CURRENT=$(cat $LNBITS_VERSION_FILE)
fi
if [ "$CURRENT" != "$LNBITS_UPGRADE_URL" ]; then
if [ "$CURRENT" != "$LNBITS_VERSION" ]; then
cd /opt/mynode
rm -rf lnbits
sudo -u bitcoin wget $LNBITS_UPGRADE_URL -O lnbits.tar.gz
@ -523,13 +501,11 @@ if [ "$CURRENT" != "$LNBITS_UPGRADE_URL" ]; then
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $LNBITS_UPGRADE_URL > $LNBITS_UPGRADE_URL_FILE
echo $LNBITS_VERSION > $LNBITS_VERSION_FILE
fi
# Upgrade Specter Desktop
SPECTER_VERSION="0.7.2"
SPECTER_VERSION_FILE=/home/bitcoin/.mynode/specter_version
CURRENT=""
if [ -f $SPECTER_VERSION_FILE ]; then
CURRENT=$(cat $SPECTER_VERSION_FILE)
@ -555,9 +531,7 @@ fi
# Upgrade Thunderhub
THUNDERHUB_VERSION="v0.9.8"
THUNDERHUB_UPGRADE_URL=https://github.com/apotdevin/thunderhub/archive/$THUNDERHUB_VERSION.tar.gz
THUNDERHUB_VERSION_FILE=/home/bitcoin/.mynode/thunderhub_version
CURRENT=""
if [ -f $THUNDERHUB_VERSION_FILE ]; then
CURRENT=$(cat $THUNDERHUB_VERSION_FILE)
@ -588,14 +562,12 @@ LNDCONNECTARCH="lndconnect-linux-armv7"
if [ $IS_X86 = 1 ]; then
LNDCONNECTARCH="lndconnect-linux-amd64"
fi
LNDCONNECT_VERSION="v0.2.0"
LNDCONNECT_UPGRADE_URL=https://github.com/LN-Zap/lndconnect/releases/download/$LNDCONNECT_VERSION/$LNDCONNECTARCH-$LNDCONNECT_VERSION.tar.gz
LNDCONNECT_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.lndconnect_url
CURRENT=""
if [ -f $LNDCONNECT_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $LNDCONNECT_UPGRADE_URL_FILE)
if [ -f $LNDCONNECT_VERSION_FILE ]; then
CURRENT=$(cat $LNDCONNECT_VERSION_FILE)
fi
if [ "$CURRENT" != "$LNDCONNECT_UPGRADE_URL" ]; then
if [ "$CURRENT" != "$LNDCONNECT_VERSION" ]; then
rm -rf /opt/download
mkdir -p /opt/download
cd /opt/download
@ -607,7 +579,7 @@ if [ "$CURRENT" != "$LNDCONNECT_UPGRADE_URL" ]; then
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $LNDCONNECT_UPGRADE_URL > $LNDCONNECT_UPGRADE_URL_FILE
echo $LNDCONNECT_VERSION > $LNDCONNECT_VERSION_FILE
fi
@ -624,30 +596,8 @@ if [ ! -f /usr/bin/ngrok ]; then
cp ngrok /usr/bin/
fi
# Install recent version of tor
# echo "Installing tor..."
# TOR_UPGRADE_URL=https://dist.torproject.org/tor-0.4.2.5.tar.gz
# TOR_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.tor_url
# CURRENT=""
# if [ -f $TOR_UPGRADE_URL_FILE ]; then
# CURRENT=$(cat $TOR_UPGRADE_URL_FILE)
# fi
# if [ "$CURRENT" != "$TOR_UPGRADE_URL" ]; then
# rm -rf /opt/download
# mkdir -p /opt/download
# cd /opt/download
# wget $TOR_UPGRADE_URL -O tor.tar.gz
# tar -xvf tor.tar.gz
# rm tor.tar.gz
# mv tor-* tor
# cd tor
# ./configure
# make
# make install
# echo $TOR_UPGRADE_URL > $TOR_UPGRADE_URL_FILE
# fi
# Upgrade Tor
rm -f /usr/local/bin/tor || true
TOR_VERSION=$(tor --version)
if [[ "$TOR_VERSION" != *"Tor version 0.4"* ]]; then

View File

@ -4,6 +4,7 @@ set -x
#set -e
source /usr/share/mynode/mynode_config.sh
source /usr/share/mynode/mynode_app_versions.sh
# Make sure we have an app argument
if [ "$#" -ne 1 ]; then
@ -17,23 +18,25 @@ APP="$1"
# Delete the app's version file so it will be re-installed
if [ "$APP" = "bitcoin" ]; then
rm -f /home/bitcoin/.mynode/bitcoin_version
rm -f $BTC_VERSION_FILE
elif [ "$APP" = "lnd" ]; then
rm -f /home/bitcoin/.mynode/lnd_version
rm -f $LND_VERSION_FILE
elif [ "$APP" = "loopd" ]; then
rm -f /home/bitcoin/.mynode/loop_version
rm -f $LOOP_VERSION_FILE
elif [ "$APP" = "btcrpcexplorer" ]; then
rm -f /home/bitcoin/.mynode/.btcrpcexplorer_url
rm -f /home/bitcoin/.mynode/.btcrpcexplorer_url # NEEDS UPDATE TO VERSION FILE
elif [ "$APP" = "caravan" ]; then
rm -f /home/bitcoin/.mynode/caravan_version
rm -f $CARAVAN_VERSION_FILE
elif [ "$APP" = "corsproxy" ]; then
rm -f $CORSPROXY_VERSION_FILE
elif [ "$APP" = "joinmarket" ]; then
rm -f /home/bitcoin/.mynode/joinmarket_version
rm -f $JOINMARKET_VERSION_FILE
elif [ "$APP" = "lnbits" ]; then
rm -f /home/bitcoin/.mynode/.lnbits_url
rm -f /home/bitcoin/.mynode/.lnbits_url # NEEDS UPDATE TO VERSION FILE
elif [ "$APP" = "lndconnect" ]; then
rm -f /home/bitcoin/.mynode/.lndconnect_url
rm -f $LNDCONNECT_VERSION_FILE
elif [ "$APP" = "lndhub" ]; then
rm -f /home/bitcoin/.mynode/.lndhub_url
rm -f $LNDHUB_VERSION_FILE
elif [ "$APP" = "netdata" ]; then
systemctl stop netdata
docker rmi netdata/netdata || true
@ -42,11 +45,11 @@ elif [ "$APP" = "mempoolspace" ]; then
systemctl stop mempoolspace
docker rmi mempoolspace
elif [ "$APP" = "rtl" ]; then
rm -f /home/bitcoin/.mynode/rtl_version
rm -f $RTL_VERSION_FILE
elif [ "$APP" = "specter" ]; then
rm -f /home/bitcoin/.mynode/specter_version
rm -f $SPECTER_VERSION_FILE
elif [ "$APP" = "thunderhub" ]; then
rm -f /home/bitcoin/.mynode/thunderhub_version
rm -f $THUNDERHUB_VERSION_FILE
elif [ "$APP" = "tor" ]; then
apt-get remove -y tor
apt-get install -y tor
@ -58,7 +61,7 @@ elif [ "$APP" = "webssh2" ]; then
systemctl stop webssh2
docker rmi webssh2
elif [ "$APP" = "whirlpool" ]; then
rm -f /home/bitcoin/.mynode/whirlpool_version
rm -f $WHIRLPOOL_VERSION_FILE
elif [ "$APP" = "dojo" ]; then
rm -f /mnt/hdd/mynode/settings/dojo_url
cd /opt/mynode/dojo/docker/my-dojo/

View File

@ -4,6 +4,7 @@ set -e
set -x
source /usr/share/mynode/mynode_config.sh
source /usr/share/mynode/mynode_app_versions.sh
# Verify FS is mounted as R/W
if [ ! -w / ]; then
@ -477,6 +478,23 @@ cp -f /usr/share/mynode/nginx.conf /etc/nginx/nginx.conf
systemctl restart nginx || true
# Update latest version files
echo $BTC_VERSION > $BTC_LATEST_VERSION_FILE
echo $LND_VERSION > $LND_LATEST_VERSION_FILE
echo $LOOP_VERSION > $LOOP_LATEST_VERSION_FILE
echo $LNDHUB_VERSION > $LNDHUB_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 $WHIRLPOOL_VERSION > $WHIRLPOOL_LATEST_VERSION_FILE
echo $RTL_VERSION > $RTL_LATEST_VERSION_FILE
echo $BTCRPCEXPLORER_VERSION > $BTCRPCEXPLORER_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
# 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

View File

@ -0,0 +1,60 @@
#!/bin/bash
BTC_VERSION="0.20.1"
BTC_VERSION_FILE=/home/bitcoin/.mynode/bitcoin_version
BTC_LATEST_VERSION_FILE=/home/bitcoin/.mynode/bitcoin_version_latest
LND_VERSION="v0.11.0-beta"
LND_VERSION_FILE=/home/bitcoin/.mynode/lnd_version
LND_LATEST_VERSION_FILE=/home/bitcoin/.mynode/lnd_version_latest
LOOP_VERSION="v0.8.1-beta"
LOOP_VERSION_FILE=/home/bitcoin/.mynode/loop_version
LOOP_LATEST_VERSION_FILE=/home/bitcoin/.mynode/loop_version_latest
LNDHUB_VERSION="v1.2.0"
LNDHUB_VERSION_FILE=/home/bitcoin/.mynode/lndhub_version
LNDHUB_LATEST_VERSION_FILE=/home/bitcoin/.mynode/lndhub_version_latest
CARAVAN_VERSION="v0.3.3"
CARAVAN_VERSION_FILE=/home/bitcoin/.mynode/caravan_version
CARAVAN_LATEST_VERSION_FILE=/home/bitcoin/.mynode/caravan_version_latest
CORSPROXY_VERSION="v1.7.0"
CORSPROXY_VERSION_FILE=/home/bitcoin/.mynode/corsproxy_version
CORSPROXY_LATEST_VERSION_FILE=/home/bitcoin/.mynode/corsproxy_version_latest
JOINMARKET_VERSION="v0.7.0"
JOINMARKET_VERSION_FILE=/home/bitcoin/.mynode/joinmarket_version
JOINMARKET_LATEST_VERSION_FILE=/home/bitcoin/.mynode/joinmarket_version_latest
WHIRLPOOL_VERSION="0.10.8"
WHIRLPOOL_UPLOAD_FILE_ID="7998ea5a9bb180451616809bc346b9ac"
WHIRLPOOL_UPLOAD_SIG_ID="8d919af2d97657a835195a928e7646bc"
WHIRLPOOL_VERSION_FILE=/home/bitcoin/.mynode/whirlpool_version
WHIRLPOOL_LATEST_VERSION_FILE=/home/bitcoin/.mynode/whirlpool_version_latest
RTL_VERSION="v0.9.0"
RTL_VERSION_FILE=/home/bitcoin/.mynode/rtl_version
RTL_LATEST_VERSION_FILE=/home/bitcoin/.mynode/rtl_version_latest
BTCRPCEXPLORER_VERSION="v2.0.2"
BTCRPCEXPLORER_VERSION_FILE=/home/bitcoin/.mynode/btcrpcexplorer_version
BTCRPCEXPLORER_LATEST_VERSION_FILE=/home/bitcoin/.mynode/btcrpcexplorer_version_latest
LNBITS_VERSION=dd2a282158d5774c2a3c85c164a10709c13ef7b4 # Github hash to download
LNBITS_VERSION_FILE=/home/bitcoin/.mynode/lnbits_version
LNBITS_LATEST_VERSION_FILE=/home/bitcoin/.mynode/lnbits_version_latest
SPECTER_VERSION="0.7.2"
SPECTER_VERSION_FILE=/home/bitcoin/.mynode/specter_version
SPECTER_LATEST_VERSION_FILE=/home/bitcoin/.mynode/specter_version_latest
THUNDERHUB_VERSION="v0.9.8"
THUNDERHUB_VERSION_FILE=/home/bitcoin/.mynode/thunderhub_version
THUNDERHUB_LATEST_VERSION_FILE=/home/bitcoin/.mynode/thunderhub_version_latest
LNDCONNECT_VERSION="v0.2.0"
LNDCONNECT_VERSION_FILE=/home/bitcoin/.mynode/lndconnect_version
LNDCONNECT_LATEST_VERSION_FILE=/home/bitcoin/.mynode/lndconnect_version_latest

View File

@ -195,6 +195,13 @@ def get_app_current_version(app):
version = get_file_contents(filename)
return version
def get_app_latest_version(app):
version = "unknown"
filename = "/home/bitcoin/.mynode/"+app+"_version_latest"
if os.path.isfile(filename):
version = get_file_contents(filename)
return version
# This is going to be the "old" way to install apps
def reinstall_app(app):

View File

@ -19,15 +19,21 @@ def caravan_page():
apps.append({"name":"LND", "short_name": "lnd"})
apps.append({"name":"Loop", "short_name": "loop"})
#apps.append({"name":"Electrum Server", "short_name": "electrs"})
#apps.append({"name":"LND Hub", "short_name": "lndhub"})
#apps.append({"name":"BTC RPC Explorer", "short_name": "btc_rpc_explorer"})
apps.append({"name":"Corsproxy", "short_name": "corsproxy"})
apps.append({"name":"Joinmarket", "short_name": "joinmarket"})
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":"BTC RPC Explorer", "short_name": "btcrpcexplorer"})
apps.append({"name":"Whirlpool", "short_name": "whirlpool"})
apps.append({"name":"Thunderhub", "short_name": "thunderhub"})
#apps.append({"name":"LNbits", "short_name": "lnbits"})
apps.append({"name":"LNbits", "short_name": "lnbits"})
apps.append({"name":"Caravan", "short_name": "caravan"})
apps.append({"name":"Specter", "short_name": "specter"})
for app in apps:
app["current_version"] = get_app_current_version(app["short_name"])
app["latest_version"] = get_app_latest_version(app["short_name"])
# Load page
templateData = {

View File

@ -17,6 +17,7 @@
<thead class="bitcoind_table_header">
<td>Application</td>
<td>Current Version</td>
<td>Latest Version</td>
<td>Actions</td>
</thead>
<tbody>
@ -24,6 +25,7 @@
<tr>
<td>{{ app.name }}</td>
<td>{{ app.current_version }}</td>
<td>{{ app.latest_version }}</td>
<td></td>
</tr>
{% endfor %}

View File

@ -82,6 +82,10 @@ elif [ $IS_X86 = 1 ]; then
fi
wget http://${SERVER_IP}:8000/${TARBALL} -O /tmp/rootfs.tar.gz
# Get mynode_app_versions.sh file
wget http://${SERVER_IP}:8000/mynode_app_versions.sh -O /tmp/mynode_app_versions.sh
source /tmp/mynode_app_versions.sh
# Create any necessary users
@ -247,7 +251,6 @@ rm -rf /etc/update-motd.d/*
# Install Bitcoin
BTC_VERSION="0.20.1"
ARCH="UNKNOWN"
if [ $IS_RASPI = 1 ]; then
ARCH="arm-linux-gnueabihf"
@ -259,7 +262,6 @@ else
echo "Unknown Bitcoin Version"
exit 1
fi
BTC_VERSION_FILE=/home/bitcoin/.mynode/bitcoin_version
BTC_UPGRADE_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/bitcoin-$BTC_VERSION-$ARCH.tar.gz
BTC_UPGRADE_SHA256SUM_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/SHA256SUMS.asc
CURRENT=""
@ -296,12 +298,10 @@ fi
cd ~
# Install Lightning
LND_VERSION="v0.11.0-beta"
LND_ARCH="lnd-linux-armv7"
if [ $IS_X86 = 1 ]; then
LND_ARCH="lnd-linux-amd64"
fi
LND_VERSION_FILE=/home/bitcoin/.mynode/lnd_version
LND_UPGRADE_URL=https://github.com/lightningnetwork/lnd/releases/download/$LND_VERSION/$LND_ARCH-$LND_VERSION.tar.gz
LND_UPGRADE_MANIFEST_URL=https://github.com/lightningnetwork/lnd/releases/download/$LND_VERSION/manifest-$LND_VERSION.txt
LND_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightningnetwork/lnd/releases/download/$LND_VERSION/manifest-$LND_VERSION.txt.sig
@ -333,7 +333,6 @@ cd ~
# Install Loopd
echo "Installing loopd..."
LOOP_VERSION="v0.8.1-beta"
LOOP_ARCH="loop-linux-armv7"
if [ $IS_X86 = 1 ]; then
LOOP_ARCH="loop-linux-amd64"
@ -341,7 +340,6 @@ fi
LOOP_UPGRADE_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/$LOOP_ARCH-$LOOP_VERSION.tar.gz
LOOP_UPGRADE_MANIFEST_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/manifest-$LOOP_VERSION.txt
LOOP_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/manifest-$LOOP_VERSION.txt.sig
LOOP_VERSION_FILE=/home/bitcoin/.mynode/loop_version
CURRENT=""
if [ -f $LOOP_VERSION_FILE ]; then
CURRENT=$(cat $LOOP_VERSION_FILE)
@ -377,14 +375,12 @@ chown -R bitcoin:bitcoin /opt/mynode
# Install LND Hub
LNDHUB_VERSION="v1.2.0"
LNDHUB_UPGRADE_URL=https://github.com/BlueWallet/LndHub/archive/$LNDHUB_VERSION.tar.gz
LNDHUB_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.lndhub_url
CURRENT=""
if [ -f $LNDHUB_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $LNDHUB_UPGRADE_URL_FILE)
if [ -f $LNDHUB_VERSION_FILE ]; then
CURRENT=$(cat $LNDHUB_VERSION_FILE)
fi
if [ "$CURRENT" != "$LNDHUB_UPGRADE_URL" ]; then
if [ "$CURRENT" != "$LNDHUB_VERSION" ]; then
cd /opt/mynode
rm -rf LndHub
@ -398,14 +394,12 @@ if [ "$CURRENT" != "$LNDHUB_UPGRADE_URL" ]; then
sudo -u bitcoin npm install --only=production
sudo -u bitcoin ln -s /home/bitcoin/.lnd/tls.cert tls.cert
sudo -u bitcoin ln -s /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon admin.macaroon
echo $LNDHUB_UPGRADE_URL > $LNDHUB_UPGRADE_URL_FILE
echo $LNDHUB_VERSION > $LNDHUB_VERSION_FILE
fi
cd ~
# Install Caravan
CARAVAN_VERSION="v0.3.3"
CARAVAN_UPGRADE_URL=https://github.com/unchained-capital/caravan/archive/$CARAVAN_VERSION.tar.gz
CARAVAN_VERSION_FILE=/home/bitcoin/.mynode/caravan_version
CURRENT=""
if [ -f $CARAVAN_VERSION_FILE ]; then
CURRENT=$(cat $CARAVAN_VERSION_FILE)
@ -429,14 +423,12 @@ cd ~
# Install cors proxy (my fork)
CORSPROXY_VERSION="v1.7.0"
CORSPROXY_UPGRADE_URL=https://github.com/tehelsper/CORS-Proxy/archive/$CORSPROXY_VERSION.tar.gz
CORSPROXY_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.corsproxy_url
CURRENT=""
if [ -f $CORSPROXY_UPGRADE_URL ]; then
CURRENT=$(cat $CORSPROXY_UPGRADE_URL_FILE)
if [ -f $CORSPROXY_VERSION_FILE ]; then
CURRENT=$(cat $CORSPROXY_VERSION_FILE)
fi
if [ "$CURRENT" != "$CORSPROXY_UPGRADE_URL" ]; then
if [ "$CURRENT" != "$CORSPROXY_VERSION" ]; then
cd /opt/mynode
rm -rf corsproxy
@ -448,7 +440,7 @@ if [ "$CURRENT" != "$CORSPROXY_UPGRADE_URL" ]; then
cd corsproxy
npm install
echo $CORSPROXY_UPGRADE_URL > $CORSPROXY_UPGRADE_URL_FILE
echo $CORSPROXY_VERSION > $CORSPROXY_VERSION_FILE
fi
cd ~
@ -481,9 +473,7 @@ fi
# Install JoinMarket
echo "Install JoinMarket..."
if [ $IS_RASPI = 1 ] || [ $IS_X86 = 1 ]; then
JOINMARKET_VERSION="v0.7.0"
JOINMARKET_UPGRADE_URL=https://github.com/JoinMarket-Org/joinmarket-clientserver/archive/$JOINMARKET_VERSION.tar.gz
JOINMARKET_VERSION_FILE=/home/bitcoin/.mynode/joinmarket_version
CURRENT=""
if [ -f $JOINMARKET_VERSION_FILE ]; then
CURRENT=$(cat $JOINMARKET_VERSION_FILE)
@ -506,12 +496,8 @@ if [ $IS_RASPI = 1 ] || [ $IS_X86 = 1 ]; then
fi
# Install Whirlpool
WHIRLPOOL_VERSION="0.10.8"
WHIRLPOOL_UPLOAD_FILE_ID="7998ea5a9bb180451616809bc346b9ac"
WHIRLPOOL_UPLOAD_SIG_ID="8d919af2d97657a835195a928e7646bc"
WHIRLPOOL_UPGRADE_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/$WHIRLPOOL_UPLOAD_FILE_ID/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar
WHIRLPOOL_SIG_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/$WHIRLPOOL_UPLOAD_SIG_ID/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar.sig.asc
WHIRLPOOL_VERSION_FILE=/home/bitcoin/.mynode/whirlpool_version
CURRENT=""
if [ -f $WHIRLPOOL_VERSION_FILE ]; then
CURRENT=$(cat $WHIRLPOOL_VERSION_FILE)
@ -530,10 +516,8 @@ fi
# Install RTL
RTL_VERSION="v0.9.0"
RTL_UPGRADE_URL=https://github.com/Ride-The-Lightning/RTL/archive/$RTL_VERSION.tar.gz
RTL_UPGRADE_ASC_URL=https://github.com/Ride-The-Lightning/RTL/releases/download/$RTL_VERSION/$RTL_VERSION.tar.gz.asc
RTL_VERSION_FILE=/home/bitcoin/.mynode/rtl_version
CURRENT=""
if [ -f $RTL_VERSION_FILE ]; then
CURRENT=$(cat $RTL_VERSION_FILE)
@ -560,14 +544,12 @@ fi
# Install BTC RPC Explorer
BTCRPCEXPLORER_VERSION="v2.0.2"
BTCRPCEXPLORER_UPGRADE_URL=https://github.com/janoside/btc-rpc-explorer/archive/$BTCRPCEXPLORER_VERSION.tar.gz
BTCRPCEXPLORER_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.btcrpcexplorer_url
CURRENT=""
if [ -f $BTCRPCEXPLORER_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $BTCRPCEXPLORER_UPGRADE_URL_FILE)
if [ -f $BTCRPCEXPLORER_VERSION_FILE ]; then
CURRENT=$(cat $BTCRPCEXPLORER_VERSION_FILE)
fi
if [ "$CURRENT" != "$BTCRPCEXPLORER_UPGRADE_URL" ]; then
if [ "$CURRENT" != "$BTCRPCEXPLORER_VERSION" ]; then
cd /opt/mynode
rm -rf btc-rpc-explorer
sudo -u bitcoin wget $BTCRPCEXPLORER_UPGRADE_URL -O btc-rpc-explorer.tar.gz
@ -579,19 +561,18 @@ if [ "$CURRENT" != "$BTCRPCEXPLORER_UPGRADE_URL" ]; then
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $BTCRPCEXPLORER_UPGRADE_URL > $BTCRPCEXPLORER_UPGRADE_URL_FILE
echo $BTCRPCEXPLORER_VERSION > $BTCRPCEXPLORER_VERSION_FILE
fi
# Install LNBits
# Find URL by going to https://github.com/lnbits/lnbits/releases and finding the exact commit for the mynode tag
LNBITS_UPGRADE_URL=https://github.com/lnbits/lnbits/archive/dd2a282158d5774c2a3c85c164a10709c13ef7b4.tar.gz
LNBITS_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.lnbits_url
LNBITS_UPGRADE_URL=https://github.com/lnbits/lnbits/archive/$LNBITS_VERSION.tar.gz
CURRENT=""
if [ -f $LNBITS_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $LNBITS_UPGRADE_URL_FILE)
if [ -f $LNBITS_VERSION_FILE ]; then
CURRENT=$(cat $LNBITS_VERSION_FILE)
fi
if [ "$CURRENT" != "$LNBITS_UPGRADE_URL" ]; then
if [ "$CURRENT" != "$LNBITS_VERSION" ]; then
cd /opt/mynode
rm -rf lnbits
sudo -u bitcoin wget $LNBITS_UPGRADE_URL -O lnbits.tar.gz
@ -613,13 +594,11 @@ if [ "$CURRENT" != "$LNBITS_UPGRADE_URL" ]; then
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $LNBITS_UPGRADE_URL > $LNBITS_UPGRADE_URL_FILE
echo $LNBITS_VERSION > $LNBITS_VERSION_FILE
fi
# Upgrade Specter Desktop
SPECTER_VERSION="0.7.2"
SPECTER_VERSION_FILE=/home/bitcoin/.mynode/specter_version
CURRENT=""
if [ -f $SPECTER_VERSION_FILE ]; then
CURRENT=$(cat $SPECTER_VERSION_FILE)
@ -645,9 +624,7 @@ fi
# Upgrade Thunderhub
THUNDERHUB_VERSION="v0.9.8"
THUNDERHUB_UPGRADE_URL=https://github.com/apotdevin/thunderhub/archive/$THUNDERHUB_VERSION.tar.gz
THUNDERHUB_VERSION_FILE=/home/bitcoin/.mynode/thunderhub_version
CURRENT=""
if [ -f $THUNDERHUB_VERSION_FILE ]; then
CURRENT=$(cat $THUNDERHUB_VERSION_FILE)
@ -678,14 +655,12 @@ LNDCONNECTARCH="lndconnect-linux-armv7"
if [ $IS_X86 = 1 ]; then
LNDCONNECTARCH="lndconnect-linux-amd64"
fi
LNDCONNECT_VERSION="v0.2.0"
LNDCONNECT_UPGRADE_URL=https://github.com/LN-Zap/lndconnect/releases/download/v0.2.0/$LNDCONNECTARCH-$LNDCONNECT_VERSION.tar.gz
LNDCONNECT_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.lndconnect_url
CURRENT=""
if [ -f $LNDCONNECT_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $LNDCONNECT_UPGRADE_URL_FILE)
if [ -f $LNDCONNECT_VERSION_FILE ]; then
CURRENT=$(cat $LNDCONNECT_VERSION_FILE)
fi
if [ "$CURRENT" != "$LNDCONNECT_UPGRADE_URL" ]; then
if [ "$CURRENT" != "$LNDCONNECT_VERSION" ]; then
rm -rf /opt/download
mkdir -p /opt/download
cd /opt/download
@ -697,7 +672,7 @@ if [ "$CURRENT" != "$LNDCONNECT_UPGRADE_URL" ]; then
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $LNDCONNECT_UPGRADE_URL > $LNDCONNECT_UPGRADE_URL_FILE
echo $LNDCONNECT_VERSION > $LNDCONNECT_VERSION_FILE
fi