From 90917bd7f1e0f0c9d762a717ae6c219e3abc0349 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Sun, 8 Nov 2020 16:23:01 -0600 Subject: [PATCH] Add poold binary; Add pgp key for new lnd upgrades --- .../standard/usr/bin/mynode_post_upgrade.sh | 40 ++++++++++++++++++- .../usr/share/mynode/mynode_app_versions.sh | 4 ++ setup/setup_device.sh | 38 ++++++++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index 8f44920f..e88546fc 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -58,6 +58,7 @@ fi # Import Keys set +e curl https://keybase.io/roasbeef/pgp_keys.asc | gpg --import +curl https://keybase.io/bitconner/pgp_keys.asc | gpg --import curl https://raw.githubusercontent.com/JoinMarket-Org/joinmarket-clientserver/master/pubkeys/AdamGibson.asc | gpg --import gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 01EA5486DE18A882D4C2684590C8019E36C2E964 curl https://keybase.io/suheb/pgp_keys.asc | gpg --import @@ -280,7 +281,44 @@ if [ "$CURRENT" != "$LOOP_VERSION" ]; then # Mark current version echo $LOOP_VERSION > $LOOP_VERSION_FILE else - echo "ERROR UPGRADING LND - GPG FAILED" + echo "ERROR UPGRADING LOOP - GPG FAILED" + fi +fi + +# Upgrade Pool +echo "Upgrading pool..." +POOL_ARCH="pool-linux-armv7" +if [ $IS_X86 = 1 ]; then + POOL_ARCH="pool-linux-amd64" +fi +POOL_UPGRADE_URL=https://github.com/lightninglabs/pool/releases/download/$POOL_VERSION/$POOL_ARCH-$POOL_VERSION.tar.gz +POOL_UPGRADE_MANIFEST_URL=https://github.com/lightninglabs/pool/releases/download/$POOL_VERSION/manifest-$POOL_VERSION.txt +POOL_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightninglabs/pool/releases/download/$POOL_VERSION/manifest-$POOL_VERSION.txt.sig +CURRENT="" +if [ -f $POOL_VERSION_FILE ]; then + CURRENT=$(cat $POOL_VERSION_FILE) +fi +if [ "$CURRENT" != "$POOL_VERSION" ]; then + # Download and install pool + rm -rf /opt/download + mkdir -p /opt/download + cd /opt/download + + wget $POOL_UPGRADE_URL + wget $POOL_UPGRADE_MANIFEST_URL + wget $POOL_UPGRADE_MANIFEST_SIG_URL + + gpg --verify manifest-*.txt.sig + if [ $? == 0 ]; then + # Install Pool + tar -xzf pool-*.tar.gz + mv $POOL_ARCH-$POOL_VERSION pool + install -m 0755 -o root -g root -t /usr/local/bin pool/* + + # Mark current version + echo $POOL_VERSION > $POOL_VERSION_FILE + else + echo "ERROR UPGRADING POOL - GPG FAILED" fi fi diff --git a/rootfs/standard/usr/share/mynode/mynode_app_versions.sh b/rootfs/standard/usr/share/mynode/mynode_app_versions.sh index 30486a68..6170e36e 100644 --- a/rootfs/standard/usr/share/mynode/mynode_app_versions.sh +++ b/rootfs/standard/usr/share/mynode/mynode_app_versions.sh @@ -12,6 +12,10 @@ LOOP_VERSION="v0.11.0-beta" LOOP_VERSION_FILE=/home/bitcoin/.mynode/loop_version LOOP_LATEST_VERSION_FILE=/home/bitcoin/.mynode/loop_version_latest +POOL_VERSION="v0.3.2-alpha" +POOL_VERSION_FILE=/home/bitcoin/.mynode/pool_version +POOL_LATEST_VERSION_FILE=/home/bitcoin/.mynode/pool_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 diff --git a/setup/setup_device.sh b/setup/setup_device.sh index 87c17513..7ae90240 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -107,6 +107,7 @@ fi # Import Keys curl https://keybase.io/roasbeef/pgp_keys.asc | gpg --import +curl https://keybase.io/bitconner/pgp_keys.asc | gpg --import curl https://raw.githubusercontent.com/JoinMarket-Org/joinmarket-clientserver/master/pubkeys/AdamGibson.asc | gpg --import gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 01EA5486DE18A882D4C2684590C8019E36C2E964 curl https://keybase.io/suheb/pgp_keys.asc | gpg --import @@ -371,6 +372,43 @@ if [ "$CURRENT" != "$LOOP_VERSION" ]; then fi fi +# Install Pool +echo "Installing pool..." +POOL_ARCH="pool-linux-armv7" +if [ $IS_X86 = 1 ]; then + POOL_ARCH="pool-linux-amd64" +fi +POOL_UPGRADE_URL=https://github.com/lightninglabs/pool/releases/download/$POOL_VERSION/$POOL_ARCH-$POOL_VERSION.tar.gz +POOL_UPGRADE_MANIFEST_URL=https://github.com/lightninglabs/pool/releases/download/$POOL_VERSION/manifest-$POOL_VERSION.txt +POOL_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightninglabs/pool/releases/download/$POOL_VERSION/manifest-$POOL_VERSION.txt.sig +CURRENT="" +if [ -f $POOL_VERSION_FILE ]; then + CURRENT=$(cat $POOL_VERSION_FILE) +fi +if [ "$CURRENT" != "$POOL_VERSION" ]; then + # Download and install pool + rm -rf /opt/download + mkdir -p /opt/download + cd /opt/download + + wget $POOL_UPGRADE_URL + wget $POOL_UPGRADE_MANIFEST_URL + wget $POOL_UPGRADE_MANIFEST_SIG_URL + + gpg --verify manifest-*.txt.sig + if [ $? == 0 ]; then + # Install Pool + tar -xzf pool-*.tar.gz + mv $POOL_ARCH-$POOL_VERSION pool + install -m 0755 -o root -g root -t /usr/local/bin pool/* + + # Mark current version + echo $POOL_VERSION > $POOL_VERSION_FILE + else + echo "ERROR UPGRADING POOL - GPG FAILED" + fi +fi + # Setup "install" location for some apps mkdir -p /opt/mynode