From 91ba149d98f699c79d851734f0628a8778aafc40 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Tue, 1 Aug 2023 00:39:43 +0200 Subject: [PATCH] specter update to v1.13.1 (#4035) * specter update to 1.13.1 --- CHANGES.md | 2 +- home.admin/config.scripts/bonus.specter.sh | 110 ++++++++++++--------- 2 files changed, 64 insertions(+), 48 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 04690a704..cdb873cd8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,7 +13,7 @@ - Update: Thunderhub v0.13.19 [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.19) - Update: LNbits 0.10.9 [details](https://github.com/lnbits/lnbits/releases/tag/0.10.9) - Update: BTCPayServer 1.10.3 (postgres by default with sqlite migration) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.10.3) -- Update: Balance of Satoshis 15.8.14 (bos) [details](https://github.com/alexbosworth/balanceofsatoshis/blob/master/CHANGELOG.md#15814) +- Update: Specter Desktop 1.13.1 [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v1.13.1) - Fix: Homebanking Interface FinTS/HBCI (experimental) [details](https://github.com/rootzoll/raspiblitz/issues/1186) ## What's new in Version 1.9.0 of RaspiBlitz? diff --git a/home.admin/config.scripts/bonus.specter.sh b/home.admin/config.scripts/bonus.specter.sh index 415953537..020719cdb 100755 --- a/home.admin/config.scripts/bonus.specter.sh +++ b/home.admin/config.scripts/bonus.specter.sh @@ -1,20 +1,21 @@ #!/bin/bash # https://github.com/cryptoadvance/specter-desktop -pinnedVersion="1.8.1" +pinnedVersion="1.13.1" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then - echo "config script to switch Specter Desktop on, off, configure or update" - echo "bonus.specter.sh [status|on|off|config|update] " - echo "installing the version $pinnedVersion by default" - exit 1 + echo "config script to switch Specter Desktop on, off, configure or update" + echo "bonus.specter.sh [status|on|config|update] " + echo "bonus.specter.sh off <--delete-data|--keep-data>" + echo "installing the version $pinnedVersion by default" + exit 1 fi echo "# bonus.specter.sh $1 $2" source /mnt/hdd/raspiblitz.conf -if [ $# -gt 1 ];then +if [ $# -gt 1 ]; then CHAIN=$2 chain=${CHAIN::-3} fi @@ -109,7 +110,7 @@ source <(grep -E "^blockfilterindex=.*" /mnt/hdd/${network}/${network}.conf) function configure_specter { echo "# --> creating App-config" - if [ "${runBehindTor}" = "on" ];then + if [ "${runBehindTor}" = "on" ]; then proxy="socks5h://localhost:9050" torOnly="true" tor_control_port="9051" @@ -118,7 +119,7 @@ function configure_specter { torOnly="false" tor_control_port="" fi - cat > /home/admin/config.json </home/admin/config.json < /home/admin/default.json </home/admin/default.json < /home/admin/raspiblitz_${chain}net.json </home/admin/raspiblitz_${chain}net.json </dev/null # move old Specter data to app-data (except .env) @@ -258,7 +261,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "# --> Installing udev-rules for hardware-wallets" # Ledger - cat > /home/admin/20-hw1.rules </home/admin/20-hw1.rules < /home/admin/51-coinkite.rules </home/admin/51-coinkite.rules < Install specter systemd service" - cat > /home/admin/specter.service </home/admin/specter.service < OK - the specter service is now enabled" + + source <(/home/admin/_cache.sh get state) + if [ "${state}" == "ready" ]; then + # start service + echo "# --> starting service ..." + sudo systemctl start specter + echo "# --> OK - the specter service is now started" + fi - echo "# --> OK - the specter service is now enabled and started" else echo "# --> specter already installed." fi # setting value in raspi blitz config /home/admin/config.scripts/blitz.conf.sh set specter "on" - + # Hidden Service for SERVICE if Tor is active if [ "${runBehindTor}" = "on" ]; then # make sure to keep in sync with tor.network.sh script @@ -402,7 +413,7 @@ EOF echo "# blockfilterindex is already active" fi - # needed for API/WebUI as signal that install ran thru + # needed for API/WebUI as signal that install ran thru echo "result='OK'" exit 0 fi @@ -420,16 +431,17 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then fi isInstalled=$(sudo ls /etc/systemd/system/specter.service 2>/dev/null | grep -c 'specter.service') - if [ ${isInstalled} -eq 0 ]; then - echo "error='was not installed'" - exit 1 + if [ ${isInstalled} -gt 0 ]; then + # removing base systemd service & code + echo "# --> REMOVING the specter.service" + sudo systemctl stop specter + sudo systemctl disable specter + sudo rm /etc/systemd/system/specter.service + else + echo "# --> The specter.service is not installed." fi - # removing base systemd service & code - echo "# --> REMOVING Specter Desktop" - sudo systemctl stop specter - sudo systemctl disable specter - sudo rm /etc/systemd/system/specter.service + # pip uninstall sudo -u specter /home/specter/.env/bin/python3 -m pip uninstall --yes cryptoadvance.specter 1>&2 # get delete data status - either by parameter or if not set by user dialog @@ -441,16 +453,19 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then deleteData="0" fi if [ "${deleteData}" == "" ]; then - deleteData=whiptail --defaultno --yesno "Do you want to delete all Data related to specter? This includes also Bitcoin-Core-Wallets managed by specter?" 0 0 + if (whiptail --title "Delete Data?" --yes-button "Keep Data" --no-button "Delete Data" --yesno "Do you want to delete all data related to Specter? This includes the Bitcoin Core wallets managed by Specter." 0 0); then + deleteData="0" + else + deleteData="1" + fi fi # execute on delete data if [ "${deleteData}" == "1" ]; then echo "# --> Removing wallets in core" bitcoin-cli listwallets | jq -r .[] | tail -n +2 - for i in $(bitcoin-cli listwallets | jq -r .[] | tail -n +2) - do - name=$(echo $i | cut -d"/" -f2) + for i in $(bitcoin-cli listwallets | jq -r .[] | tail -n +2); do + name=$(echo $i | cut -d"/" -f2) bitcoin-cli unloadwallet specter/$name done echo "# --> Removing the /mnt/hdd/app-data/.specter" @@ -461,10 +476,10 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then fi echo "# --> Removing the specter user and home directory" - sudo userdel -rf specter + sudo userdel -rf specter 2>/dev/null echo "# --> OK Specter Desktop removed." - - # needed for API/WebUI as signal that install ran thru + + # needed for API/WebUI as signal that install ran thru echo "result='OK'" exit 0 fi @@ -472,6 +487,7 @@ fi # update if [ "$1" = "update" ]; then echo "# --> UPDATING Specter Desktop " + sudo -u specter /home/specter/.env/bin/python3 -m pip install --upgrade pip sudo -u specter /home/specter/.env/bin/python3 -m pip install --upgrade cryptoadvance.specter echo "# --> Updated to the latest in https://pypi.org/project/cryptoadvance.specter/#history ***" echo "# --> Restarting the specter.service"