From b6c919a0e88b118aaf5da6d0f4be263fbc25292a Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 2 May 2024 18:04:44 +0200 Subject: [PATCH 01/59] fix typo --- home.admin/BlitzTUI/blitztui/memo.py | 2 +- .../data/Wordlist-Adjectives-Common-Audited-Len-3-6.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/BlitzTUI/blitztui/memo.py b/home.admin/BlitzTUI/blitztui/memo.py index 497a7adab..78eca8e1a 100644 --- a/home.admin/BlitzTUI/blitztui/memo.py +++ b/home.admin/BlitzTUI/blitztui/memo.py @@ -682,7 +682,7 @@ adjectives = [ "picky", "pied", "piggy", - "pilar", + "pillar", "pink", "plain", "plane", diff --git a/home.admin/BlitzTUI/data/Wordlist-Adjectives-Common-Audited-Len-3-6.txt b/home.admin/BlitzTUI/data/Wordlist-Adjectives-Common-Audited-Len-3-6.txt index e91e00cec..2b2309efb 100644 --- a/home.admin/BlitzTUI/data/Wordlist-Adjectives-Common-Audited-Len-3-6.txt +++ b/home.admin/BlitzTUI/data/Wordlist-Adjectives-Common-Audited-Len-3-6.txt @@ -648,7 +648,7 @@ piano picky pied piggy -pilar +pillar pink plain plane From 425442c2481954a37460e9a62846b69997f5f2d3 Mon Sep 17 00:00:00 2001 From: HODLmeTight <35168804+TrezorHannes@users.noreply.github.com> Date: Thu, 2 May 2024 18:36:00 +0200 Subject: [PATCH 02/59] lnd.conf and lnd.check.sh template adjustments (#4432) * add larger logrotation and tiny typo fix * reduce logs rotation & size --- home.admin/config.scripts/lnd.check.sh | 2 +- home.admin/config.scripts/lnd.install.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/lnd.check.sh b/home.admin/config.scripts/lnd.check.sh index 45b4284d8..ed254d7b2 100755 --- a/home.admin/config.scripts/lnd.check.sh +++ b/home.admin/config.scripts/lnd.check.sh @@ -69,7 +69,7 @@ if [ "$1" == "prestart" ]; then ##### APPLICATION OPTIONS SECTION ##### - # remove sync-freelist=1 (use =true is you want to overrule raspiblitz) + # remove sync-freelist=1 (use =true if you want to overrule raspiblitz) # https://github.com/rootzoll/raspiblitz/issues/3251 sed -i "/^# Avoid slow startup time/d" ${lndConfFile} sed -i "/^sync-freelist=1/d" ${lndConfFile} diff --git a/home.admin/config.scripts/lnd.install.sh b/home.admin/config.scripts/lnd.install.sh index 9f04b75b3..8ee436c75 100644 --- a/home.admin/config.scripts/lnd.install.sh +++ b/home.admin/config.scripts/lnd.install.sh @@ -306,13 +306,20 @@ debuglevel=info gc-canceled-invoices-on-startup=true gc-canceled-invoices-on-the-fly=true ignore-historical-gossip-filters=1 -sync-freelist=true stagger-initial-reconnect=true tlsautorefresh=1 tlsdisableautofill=1 tlscertpath=/home/bitcoin/.lnd/tls.cert tlskeypath=/home/bitcoin/.lnd/tls.key +# Set to false for nodes with larger amount of channels. This modification leads to increased +# latency during initialization, yet significantly boosts runtime performance of the daemon. +sync-freelist=true + +# Specify the maximum number of logfiles retained in rotation and the threshold size for rotation initiation. +maxlogfiles=5 +maxlogfilesize=400 + [Bitcoin] bitcoin.active=1 bitcoin.${CHAIN}=1 From 5209508584c4751eae77548e96636cb77a8502dd Mon Sep 17 00:00:00 2001 From: openoms Date: Thu, 16 May 2024 23:10:47 +0200 Subject: [PATCH 03/59] correct rootPartition and rootPartitionBytes with volume group --- home.admin/config.scripts/blitz.bootdrive.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/home.admin/config.scripts/blitz.bootdrive.sh b/home.admin/config.scripts/blitz.bootdrive.sh index 95bcb71fe..79ff3c69f 100644 --- a/home.admin/config.scripts/blitz.bootdrive.sh +++ b/home.admin/config.scripts/blitz.bootdrive.sh @@ -27,10 +27,11 @@ action=$1 ######################### # STATUS -# gather data on sd card +# gather data on SDcard / OS drive minimumSizeByte=16384000000 -rootPartition=$(sudo mount | grep " / " | cut -d " " -f 1 | cut -d "/" -f 3) -rootPartitionBytes=$(lsblk -b -o NAME,SIZE | grep "${rootPartition}" | tr -s ' ' | cut -d " " -f 2) +rootPartitionLine=$(sudo mount | grep " / " | cut -d " " -f 1) +rootPartition=$(basename ${rootPartitionLine}) +rootPartitionBytes=$(lsblk -b -o NAME,SIZE | grep "${rootPartition}" | awk '{print $2}') # make conclusions needsExpansion=0 From e63326bbea61cf5969481342e7834cba1322ee6a Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Thu, 16 May 2024 23:13:50 +0200 Subject: [PATCH 04/59] fix FulcrumAdmin symlink (#4574) --- home.admin/config.scripts/bonus.fulcrum.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/bonus.fulcrum.sh b/home.admin/config.scripts/bonus.fulcrum.sh index 9939fcfbc..cf8a9f672 100644 --- a/home.admin/config.scripts/bonus.fulcrum.sh +++ b/home.admin/config.scripts/bonus.fulcrum.sh @@ -315,8 +315,8 @@ function downloadAndVerifyBinary() { sudo rm -f /home/fulcrum/Fulcrum sudo rm -f /home/fulcrum/FulcrumAdmin # symlink - sudo ln -s /home/fulcrum/Fulcrum-${fulcrumVersion}-${build}/Fulcrum /home/fulcrum/ | - sudo ln -s /home/fulcrum/Fulcrum-${fulcrumVersion}-${build}/FulcrumAdmin /home/fulcrum/ + sudo ln -s /home/fulcrum/Fulcrum-${fulcrumVersion}-${build}/Fulcrum /home/fulcrum/ + sudo ln -s /home/fulcrum/Fulcrum-${fulcrumVersion}-${build}/FulcrumAdmin /home/fulcrum/ } function createSystemdService() { From bf9dbc0321676426e1bc25b6d54c5856578f10ea Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Fri, 17 May 2024 09:55:01 +0200 Subject: [PATCH 05/59] add GPT integrity check for amd64 (#4576) --- home.admin/_bootstrap.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index f848d471e..eecea58ad 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -337,6 +337,34 @@ else echo "No HDMI switch found. " >> $logFile fi +################################ +# GPT integrity check +################################ + +check_and_fix_gpt() { + local device=$1 + output=$(sudo gdisk -l $device 2>&1) + if echo "$output" | grep -q "PMBR size mismatch"; then + echo "GPT PMBR size mismatch detected on $device. Fixing..." >> $logFile + sgdisk -e $device + echo "Fixed GPT PMBR size mismatch on $device." >> $logFile + elif echo "$output" | grep -q "The backup GPT table is not on the end of the device"; then + echo "Backup GPT table is not at the end of $device. Fixing..." >> $logFile + sgdisk -e $device + echo "Fixed backup GPT table location on $device." >> $logFile + else + echo "No GPT issues detected on $device." >> $logFile + fi +} + +# List all block devices +devices=$(lsblk -dno NAME | grep -E '^sd|^nvme|^vd|^mmcblk') + +# Check and fix each device +for dev in $devices; do + check_and_fix_gpt /dev/$dev +done + ################################ # FS EXPAND # extend sd card to maximum capacity From b419daf43a22c98879ffc2a7f2937bde14b81e0f Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 24 May 2024 17:41:44 +0200 Subject: [PATCH 06/59] fix #4571 typo --- home.admin/_commands.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/_commands.sh b/home.admin/_commands.sh index 1741c20fe..4cdedf581 100755 --- a/home.admin/_commands.sh +++ b/home.admin/_commands.sh @@ -81,7 +81,7 @@ function blitzhelp() { echo " whitepaper download the whitepaper from the blockchain to /home/admin/bitcoin.pdf" echo " notifyme wrapper for blitz.notify.sh that will send a notification using the configured method and settings" echo " suez visualize channels (for the default ln implementation and chain when installed)" - exho " lnproxy wrap invoices with lnproxy" + echo " lnproxy wrap invoices with lnproxy" echo echo "LND:" echo " lncli LND commandline interface (when installed)" From 8c8b0b2c62f27b4927fb851cbd83ac1a66c4f451 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 24 May 2024 22:45:48 +0200 Subject: [PATCH 07/59] #4553 update to firmware to 1708097321 --- home.admin/_bootstrap.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index eecea58ad..4c3a48374 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -548,13 +548,15 @@ if [ "${baseimage}" == "raspios_arm64" ]; then isRaspberryPi5=$(cat /proc/device-tree/model 2>/dev/null | grep -c "Raspberry Pi 5") firmwareBuildNumber=$(rpi-eeprom-update | grep "CURRENT" | cut -d "(" -f2 | sed 's/[^0-9]*//g') echo "checking Firmware: isRaspberryPi5(${isRaspberryPi5}) firmwareBuildNumber(${firmwareBuildNumber})" >> $logFile - if [ ${isRaspberryPi5} -gt 0 ] && [ ${firmwareBuildNumber} -lt 1701887365 ]; then - echo "RaspberryPi 5 detected with old firmware ... do update." >> $logFile + if [ ${isRaspberryPi5} -gt 0 ] && [ ${firmwareBuildNumber} -lt 1708097321 ]; then + echo "updating Firmware" >> $logFile + echo "RaspberryPi 5 detected with old firmware (${firmwareBuildNumber}) ... do update." >> $logFile apt-get update -y apt-get upgrade -y apt-get install -y rpi-eeprom rpi-eeprom-update -a echo "Restarting ..." >> $logFile + sleep 3 reboot else echo "RaspberryPi Firmware not in th need of update." >> $logFile From e174972fe2d954cbac7f1589242e52b323271c6a Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 24 May 2024 23:17:10 +0200 Subject: [PATCH 08/59] add date as comment --- home.admin/_bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 4c3a48374..e2a1eb35f 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -548,7 +548,7 @@ if [ "${baseimage}" == "raspios_arm64" ]; then isRaspberryPi5=$(cat /proc/device-tree/model 2>/dev/null | grep -c "Raspberry Pi 5") firmwareBuildNumber=$(rpi-eeprom-update | grep "CURRENT" | cut -d "(" -f2 | sed 's/[^0-9]*//g') echo "checking Firmware: isRaspberryPi5(${isRaspberryPi5}) firmwareBuildNumber(${firmwareBuildNumber})" >> $logFile - if [ ${isRaspberryPi5} -gt 0 ] && [ ${firmwareBuildNumber} -lt 1708097321 ]; then + if [ ${isRaspberryPi5} -gt 0 ] && [ ${firmwareBuildNumber} -lt 1708097321 ]; then # Fri 16 Feb 15:28:41 UTC 2024 (1708097321) echo "updating Firmware" >> $logFile echo "RaspberryPi 5 detected with old firmware (${firmwareBuildNumber}) ... do update." >> $logFile apt-get update -y From d423c3c2d9641dda5301f8d885c0ae1d93fd0474 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 25 May 2024 14:40:07 +0200 Subject: [PATCH 09/59] add resolvconf for v1.12.0 base image --- build_sdcard.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_sdcard.sh b/build_sdcard.sh index 40fc911c0..f80b6df7e 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -369,7 +369,7 @@ echo -e "\n*** SOFTWARE UPDATE ***" # sqlite3 -> database # fdisk -> create partitions # lsb-release -> needed to know which distro version we're running to add APT sources -general_utils="policykit-1 htop git curl bash-completion vim jq dphys-swapfile bsdmainutils autossh telnet vnstat parted dosfstools fbi sysbench build-essential dialog bc python3-dialog unzip whois fdisk lsb-release smartmontools rsyslog" +general_utils="policykit-1 htop git curl bash-completion vim jq dphys-swapfile bsdmainutils autossh telnet vnstat parted dosfstools fbi sysbench build-essential dialog bc python3-dialog unzip whois fdisk lsb-release smartmontools rsyslog resolvconf" # add btrfs-progs if not bookworm on aarch64 [ "${architecture}" = "aarch64" ] && ! grep "12 (bookworm)" < /etc/os-release && general_utils="${general_utils} btrfs-progs" # python3-mako --> https://github.com/rootzoll/raspiblitz/issues/3441 From bd5f0104096398a2c33910d4b419b97367ad6ec7 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Tue, 28 May 2024 21:53:04 +0200 Subject: [PATCH 10/59] #4561 Remove Tallycoin App (#4562) * #4561 remove tallycoin app --- CHANGES.md | 4 + home.admin/00mainMenu.sh | 6 - home.admin/00settingsMenuServices.sh | 19 -- home.admin/_provision_.sh | 9 - .../tallycoin_connect_ssl.conf | 21 -- .../tallycoin_connect_tor.conf | 18 -- .../tallycoin_connect_tor_ssl.conf | 21 -- .../config.scripts/bonus.tallycoin-connect.sh | 225 ------------------ 8 files changed, 4 insertions(+), 319 deletions(-) delete mode 100644 home.admin/assets/nginx/sites-available/tallycoin_connect_ssl.conf delete mode 100644 home.admin/assets/nginx/sites-available/tallycoin_connect_tor.conf delete mode 100644 home.admin/assets/nginx/sites-available/tallycoin_connect_tor_ssl.conf delete mode 100755 home.admin/config.scripts/bonus.tallycoin-connect.sh diff --git a/CHANGES.md b/CHANGES.md index bf6102e89..3f74304a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +## What's new in Version 1.11.1 of RaspiBlitz? + +- Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) + ## What's new in Version 1.11.0 of RaspiBlitz? - New: RaspberryPi5 tested & enabling NVMe PCIe Hats diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 01df9072d..047a2ac9f 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -159,9 +159,6 @@ fi if [ "${circuitbreaker}" == "on" ]; then OPTIONS+=(CIRCUITBREAKER "Circuitbreaker (LND firewall)") fi -if [ "${tallycoinConnect}" == "on" ]; then - OPTIONS+=(TALLY "Tallycoin Connect") -fi if [ "${squeaknode}" == "on" ]; then OPTIONS+=(SQUEAKNODE "Squeaknode") fi @@ -310,9 +307,6 @@ case $CHOICE in THUB) sudo /home/admin/config.scripts/bonus.thunderhub.sh menu ;; - TALLY) - sudo /home/admin/config.scripts/bonus.tallycoin-connect.sh menu - ;; ZEROTIER) sudo /home/admin/config.scripts/bonus.zerotier.sh menu ;; diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index 1b379417e..c4122d3ba 100755 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -26,7 +26,6 @@ if [ ${#lit} -eq 0 ]; then lit="off"; fi if [ ${#lndg} -eq 0 ]; then lndg="off"; fi if [ ${#whitepaper} -eq 0 ]; then whitepaper="off"; fi if [ ${#chantools} -eq 0 ]; then chantools="off"; fi -if [ ${#tallycoinConnect} -eq 0 ]; then tallycoinConnect="off"; fi if [ ${#helipad} -eq 0 ]; then helipad="off"; fi if [ ${#lightningtipbot} -eq 0 ]; then lightningtipbot="off"; fi if [ ${#fints} -eq 0 ]; then fints="off"; fi @@ -66,7 +65,6 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then OPTIONS+=(ha 'LND ChannelTools (Fund Rescue)' ${chantools}) OPTIONS+=(xa 'LND Sphinx-Relay' ${sphinxrelay}) OPTIONS+=(fa 'LND Helipad Boostagram reader' ${helipad}) - OPTIONS+=(da 'LND Tallycoin Connect' ${tallycoinConnect}) OPTIONS+=(lb 'LND LNDK (experimental BOLT 12)' ${lndk}) fi @@ -485,23 +483,6 @@ else echo "Helipad setting unchanged." fi -# Tallycoin -choice="off"; check=$(echo "${CHOICES}" | grep -c "da") -if [ ${check} -eq 1 ]; then choice="on"; fi -if [ "${tallycoinConnect}" != "${choice}" ]; then - echo "Tallycoin Setting changed .." - anychange=1 - sudo -u admin /home/admin/config.scripts/bonus.tallycoin-connect.sh ${choice} - if [ "${choice}" = "on" ]; then - whiptail --title " Installed Tallycoin-Connect" --msgbox "\ -Tallycoin-Connect was installed.\n -Use the new 'TALLY' entry in Main Menu for more info.\n -" 10 45 - fi -else - echo "Tallycoin Setting unchanged." -fi - # LNDK choice="off"; check=$(echo "${CHOICES}" | grep -c "lb") if [ ${check} -eq 1 ]; then choice="on"; fi diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index 71b2d20cc..bc6696a26 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -721,15 +721,6 @@ else echo "Provisioning CircuitBreaker - keep default" >> ${logFile} fi -# tallycoin_connect -if [ "${tallycoinConnect}" = "on" ]; then - echo "Provisioning Tallycoin Connect - run config script" >> ${logFile} - /home/admin/_cache.sh set message "Setup Tallycoin Connect" - sudo -u admin /home/admin/config.scripts/bonus.tallycoin-connect.sh on >> ${logFile} 2>&1 -else - echo "Provisioning Tallycoin Connect - keep default" >> ${logFile} -fi - # squeaknode if [ "${squeaknode}" = "on" ]; then echo "Provisioning Squeaknode - run config script" >> ${logFile} diff --git a/home.admin/assets/nginx/sites-available/tallycoin_connect_ssl.conf b/home.admin/assets/nginx/sites-available/tallycoin_connect_ssl.conf deleted file mode 100644 index 01a31ee89..000000000 --- a/home.admin/assets/nginx/sites-available/tallycoin_connect_ssl.conf +++ /dev/null @@ -1,21 +0,0 @@ -## tallycoin_connect_ssl.conf - -server { - listen 8124 ssl http2; - listen [::]:8124 ssl http2; - server_name _; - - include /etc/nginx/snippets/ssl-params.conf; - include /etc/nginx/snippets/ssl-certificate-app-data.conf; - - include /etc/nginx/snippets/gzip-params.conf; - - access_log /var/log/nginx/access_tallycoin_connect.log; - error_log /var/log/nginx/error_tallycoin_connect.log; - - location / { - proxy_pass http://127.0.0.1:8123; - - include /etc/nginx/snippets/ssl-proxy-params.conf; - } -} diff --git a/home.admin/assets/nginx/sites-available/tallycoin_connect_tor.conf b/home.admin/assets/nginx/sites-available/tallycoin_connect_tor.conf deleted file mode 100644 index 20abe0e59..000000000 --- a/home.admin/assets/nginx/sites-available/tallycoin_connect_tor.conf +++ /dev/null @@ -1,18 +0,0 @@ -## tallycoin_connect_tor.conf - -server { - listen 8125; - listen [::]:8125; - server_name _; - - include /etc/nginx/snippets/gzip-params.conf; - - access_log /var/log/nginx/access_tallycoin_connect.log; - error_log /var/log/nginx/error_tallycoin_connect.log; - - location / { - proxy_pass http://127.0.0.1:8123; - - include /etc/nginx/snippets/ssl-proxy-params.conf; - } -} diff --git a/home.admin/assets/nginx/sites-available/tallycoin_connect_tor_ssl.conf b/home.admin/assets/nginx/sites-available/tallycoin_connect_tor_ssl.conf deleted file mode 100644 index 309d2d033..000000000 --- a/home.admin/assets/nginx/sites-available/tallycoin_connect_tor_ssl.conf +++ /dev/null @@ -1,21 +0,0 @@ -## tallycoin_connect_tor_ssl.conf - -server { - listen 8126 ssl http2; - listen [::]:8126 ssl http2; - server_name _; - - include /etc/nginx/snippets/ssl-params.conf; - include /etc/nginx/snippets/ssl-certificate-app-data-tor.conf; - - include /etc/nginx/snippets/gzip-params.conf; - - access_log /var/log/nginx/access_tallycoin_connect.log; - error_log /var/log/nginx/error_tallycoin_connect.log; - - location / { - proxy_pass http://127.0.0.1:8123; - - include /etc/nginx/snippets/ssl-proxy-params.conf; - } -} diff --git a/home.admin/config.scripts/bonus.tallycoin-connect.sh b/home.admin/config.scripts/bonus.tallycoin-connect.sh deleted file mode 100755 index bc48aa296..000000000 --- a/home.admin/config.scripts/bonus.tallycoin-connect.sh +++ /dev/null @@ -1,225 +0,0 @@ -#!/bin/bash - -# https://github.com/djbooth007/tallycoin_connect - -USERNAME=tallycoin -APP_DATA_DIR=/mnt/hdd/app-data/tallycoin-connect -HOME_DIR=/home/$USERNAME -CONFIG_FILE=$APP_DATA_DIR/tallycoin_api.key -RASPIBLITZ_INFO=/home/admin/raspiblitz.info -SERVICE_FILE=/etc/systemd/system/tallycoin-connect.service -TC_VERSION=1.8.0 - -# command info -if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then - echo "config script to switch tallycoin_connect on or off" - echo "bonus.tallycoin-connect.sh [on|off|menu]" - exit 1 -fi - -# check and load raspiblitz config to know which network is running -source $RASPIBLITZ_INFO -source /mnt/hdd/raspiblitz.conf - -# show info menu -if [ "$1" = "menu" ]; then - # get network info - localip=$(hostname -I | awk '{print $1}') - toraddress=$(sudo cat /mnt/hdd/tor/tallycoin-connect/hostname 2>/dev/null) - fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2) - - if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then - # Info with TOR - sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}" - whiptail --title " Tallycoin Connect " --msgbox "Open in your local web browser: -http://${localip}:8123\n -https://${localip}:8124 with Fingerprint: -${fingerprint}\n -Use your Password B to login.\n -Hidden Service address for TOR Browser (see LCD for QR):\n${toraddress} -" 16 72 - sudo /home/admin/config.scripts/blitz.display.sh hide - else - # Info without TOR - whiptail --title " Tallycoin Connect " --msgbox "Open in your local web browser & accept self-signed cert: -http://${localip}:8123\n -https://${localip}:8124 with Fingerprint: -${fingerprint}\n -Use your Password B to login.\n -Activate TOR to access the web interface from outside your local network. -" 15 72 - fi - echo "please wait ..." - exit 0 -fi - -# switch on -if [ "$1" = "1" ] || [ "$1" = "on" ]; then - isInstalled=$(sudo ls $HOME_DIR 2>/dev/null | grep -c 'tallycoin_connect') - if [ ${isInstalled} -eq 0 ]; then - echo "*** INSTALL TALLYCOIN CONNECT ***" - - # install nodeJS - /home/admin/config.scripts/bonus.nodejs.sh on - - # add user - sudo adduser --system --group --home /home/$USERNAME $USERNAME - - # install tallycoin_connect - cd $HOME_DIR - sudo -u $USERNAME wget https://github.com/djbooth007/tallycoin_connect/archive/refs/tags/v$TC_VERSION.tar.gz - sudo -u $USERNAME tar -xzf v$TC_VERSION.tar.gz - sudo -u $USERNAME mv tallycoin_connect{-$TC_VERSION,} - sudo -u $USERNAME rm v$TC_VERSION.tar.gz - cd tallycoin_connect - sudo -u $USERNAME cat .dockerignore | sudo -u $USERNAME xargs sudo -u $USERNAME rm -rf - sudo -u $USERNAME rm .dockerignore - sudo -u $USERNAME npm install - if ! [ $? -eq 0 ]; then - echo "FAIL - npm install did not run correctly, aborting" - exit 1 - fi - - # setup config - sudo mkdir -p $APP_DATA_DIR - sudo chown $USERNAME:$USERNAME $APP_DATA_DIR - - if [[ ! -f "$CONFIG_FILE" ]]; then - configFile=/home/admin/tallycoin_api.key - touch $configFile - sudo chmod 600 $configFile || exit 1 - passwordB=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcpassword | cut -c 13-) - passwd=$(printf $passwordB | sha256sum | tr -d ' -') - tlsCert=$(base64 /mnt/hdd/app-data/lnd/tls.cert | tr -d '=' | tr '/+' '_-' | tr -d '\n') - macaroon=$(base64 /mnt/hdd/app-data/lnd/data/chain/${network}/${chain}net/admin.macaroon | tr -d '=' | tr '/+' '_-' | tr -d '\n') - echo "{\"tls_cert\":\"$tlsCert\",\"macaroon\":\"$macaroon\",\"tallycoin_passwd\":\"$passwd\"}" > $configFile - - sudo mv $configFile $CONFIG_FILE - sudo chown $USERNAME:$USERNAME $CONFIG_FILE - fi - - ################## - # NGINX - ################## - # setup nginx symlinks - if ! [ -f /etc/nginx/sites-available/tallycoin_connect_ssl.conf ]; then - sudo cp -f /home/admin/assets/nginx/sites-available/tallycoin_connect_ssl.conf /etc/nginx/sites-available/tallycoin_connect_ssl.conf - fi - if ! [ -f /etc/nginx/sites-available/tallycoin_connect_tor.conf ]; then - sudo cp /home/admin/assets/nginx/sites-available/tallycoin_connect_tor.conf /etc/nginx/sites-available/tallycoin_connect_tor.conf - fi - if ! [ -f /etc/nginx/sites-available/tallycoin_connect_tor_ssl.conf ]; then - sudo cp /home/admin/assets/nginx/sites-available/tallycoin_connect_tor_ssl.conf /etc/nginx/sites-available/tallycoin_connect_tor_ssl.conf - fi - sudo ln -sf /etc/nginx/sites-available/tallycoin_connect_ssl.conf /etc/nginx/sites-enabled/ - sudo ln -sf /etc/nginx/sites-available/tallycoin_connect_tor.conf /etc/nginx/sites-enabled/ - sudo ln -sf /etc/nginx/sites-available/tallycoin_connect_tor_ssl.conf /etc/nginx/sites-enabled/ - sudo nginx -t - sudo systemctl reload nginx - - # open the firewall - echo "*** Updating Firewall ***" - sudo ufw allow from any to any port 8123 comment 'allow Tallycoin Connect HTTP' - sudo ufw allow from any to any port 8124 comment 'allow Tallycoin Connect HTTPS' - echo "" - - ################## - # SYSTEMD SERVICE - ################## - - echo "# Install Tallycoin Connect systemd for ${network} on ${chain}" - echo " -# Systemd unit for Tallycoin Connect - -[Unit] -Description=Tallycoin Connect daemon -Wants=lnd.service -After=lnd.service - -[Service] -WorkingDirectory=$HOME_DIR/tallycoin_connect -Environment=\"CONFIG_FILE=$CONFIG_FILE\" -ExecStart=/usr/bin/npm start -User=tallycoin -Restart=always -TimeoutSec=120 -RestartSec=30 -StandardOutput=null -StandardError=journal - -# Hardening measures -PrivateTmp=true -ProtectSystem=full -NoNewPrivileges=true -PrivateDevices=true - -[Install] -WantedBy=multi-user.target -" | sudo tee $SERVICE_FILE - sudo systemctl enable tallycoin-connect - - # setting value in raspiblitz config - /home/admin/config.scripts/blitz.conf.sh set tallycoinConnect "on" - - # Hidden Service for tallycoin-connect if Tor is active - if [ "${runBehindTor}" = "on" ]; then - # make sure to keep in sync with tor.onion-service.sh script - /home/admin/config.scripts/tor.onion-service.sh tallycoin-connect 80 8125 443 8126 - fi - source $RASPIBLITZ_INFO - if [ "${state}" == "ready" ]; then - echo "# OK - the tallycoin-connect.service is enabled, system is ready so starting service" - sudo systemctl start tallycoin-connect - else - echo "# OK - the tallycoin-connect.service is enabled, to start manually use: 'sudo systemctl start tallycoin-connect'" - fi - else - echo "*** TALLYCOIN CONNECT ALREADY INSTALLED ***" - fi - exit 0 -fi - -# switch off -if [ "$1" = "0" ] || [ "$1" = "off" ]; then - isInstalled=$(sudo ls $HOME_DIR 2>/dev/null | grep -c 'tallycoin_connect') - if [ ${isInstalled} -eq 1 ]; then - echo "*** UNINSTALL TALLYCOIN CONNECT ***" - - # remove systemd service - sudo systemctl stop tallycoin-connect - sudo systemctl disable tallycoin-connect - sudo rm -f $SERVICE_FILE - - # close ports on firewall - sudo ufw delete allow from any to any port 8123 comment 'allow Tallycoin Connect HTTP' - sudo ufw delete allow from any to any port 8124 comment 'allow Tallycoin Connect HTTPS' - - # remove nginx symlinks - sudo rm -f /etc/nginx/sites-enabled/tallycoin_connect_* - sudo nginx -t - sudo systemctl reload nginx - - # Hidden Service if Tor is active - if [ "${runBehindTor}" = "on" ]; then - /home/admin/config.scripts/tor.onion-service.sh off tallycoin-connect - fi - - # remove config - sudo rm -rf $APP_DATA_DIR - - # delete user and home directory - sudo userdel -rf $USERNAME - - # setting value in raspi blitz config - /home/admin/config.scripts/blitz.conf.sh set tallycoinConnect "off" - - echo "OK TALLYCOIN CONNECT removed." - else - echo "*** TALLYCOIN CONNECT NOT INSTALLED ***" - fi - - exit 0 -fi - -echo "FAIL - Unknown Parameter $1" -exit 1 From 3de15bed4901ec6be1dc206d0ca3fa7dd068853f Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Tue, 28 May 2024 21:56:45 +0200 Subject: [PATCH 11/59] specter update to 2.0.4 (#3709) * specter update to 2.0.0 with python 3.10 * add deadsnake GPG key without using apt-key * fix deleteData question * fix config and formatting * specter update to v2.0.1, remove default node * readd config and del user on uninstall * update config * fix merge * readd UPDATE option in menu * specter update to v2.0.2, fix config * specter update to 2.0.4 * add to change --- CHANGES.md | 3 ++- home.admin/99updateMenu.sh | 6 +++--- home.admin/config.scripts/bonus.specter.sh | 12 +++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3f74304a8..6209f946c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,6 @@ ## What's new in Version 1.11.1 of RaspiBlitz? +- Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) ## What's new in Version 1.11.0 of RaspiBlitz? @@ -83,7 +84,7 @@ - Update: Core Lightning v23.02.2 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.02.2) - Update: C-lightningREST v0.10.2 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.10.2) - Update: Electrum Server in Rust (electrs) v0.9.11 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0911-jan-5-2023) -- Update: Lightning Terminal v0.9.2-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.9.2-alpha) +- Update: Lightning Terminal v0.8.6-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.8.6-alpha) - Update: RTL v0.13.6 with update option [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.13.6) - Update: Thunderhub v0.13.16 with balance sharing disabled [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.16) - Update: LNbits 0.10.6 [details](https://github.com/lnbits/lnbits/releases/tag/0.10.6) diff --git a/home.admin/99updateMenu.sh b/home.admin/99updateMenu.sh index ea75360c1..149159954 100755 --- a/home.admin/99updateMenu.sh +++ b/home.admin/99updateMenu.sh @@ -490,9 +490,9 @@ if [ "${lndg}" == "on" ]; then fi ## Disabled for now until the base image has Python 3.10 -#if [ "${specter}" == "on" ]; then -# OPTIONS+=(SPECTER "Update Specter Desktop") -#fi +if [ "${specter}" == "on" ]; then + OPTIONS+=(SPECTER "Update Specter Desktop") +fi if [ "${BTCPayServer}" == "on" ]; then OPTIONS+=(BTCPAY "Update BTCPayServer") diff --git a/home.admin/config.scripts/bonus.specter.sh b/home.admin/config.scripts/bonus.specter.sh index b84bcd836..a781ff592 100755 --- a/home.admin/config.scripts/bonus.specter.sh +++ b/home.admin/config.scripts/bonus.specter.sh @@ -1,7 +1,7 @@ #!/bin/bash # https://github.com/cryptoadvance/specter-desktop -pinnedVersion="1.13.1" +pinnedVersion="2.0.4" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then @@ -131,7 +131,7 @@ function configure_specter { "proxy_url": "${proxy}", "only_tor": "${torOnly}", "tor_control_port": "${tor_control_port}", - "tor_status": true, + "tor_status": false, "hwi_bridge_url": "/hwi/api/" } EOF @@ -146,6 +146,8 @@ EOF echo "# Connect Specter to the default mainnet node" cat >/home/admin/default.json < creating a virtualenv" sudo -u specter virtualenv --python=python3 /home/specter/.env + sudo -u specter /home/specter/.env/bin/python3 -m pip install --upgrade pip + echo "# --> pip-installing specter" sudo -u specter /home/specter/.env/bin/python3 -m pip install --upgrade cryptoadvance.specter==$pinnedVersion || exit 1 From 4f7ce2b8a724cb9fba709849d5dc467c14d331a2 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Tue, 28 May 2024 22:25:37 +0200 Subject: [PATCH 12/59] #4589 Remove IP2Tor shoplist (#4595) * remove shop list * add CHANGES --- CHANGES.md | 1 + .../blitz.subscriptions.ip2tor.py | 46 ++++++++++++------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6209f946c..d0ad0a884 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) +- Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) ## What's new in Version 1.11.0 of RaspiBlitz? diff --git a/home.admin/config.scripts/blitz.subscriptions.ip2tor.py b/home.admin/config.scripts/blitz.subscriptions.ip2tor.py index fb9ae2fa9..e2b0401f5 100755 --- a/home.admin/config.scripts/blitz.subscriptions.ip2tor.py +++ b/home.admin/config.scripts/blitz.subscriptions.ip2tor.py @@ -632,30 +632,42 @@ def menuMakeSubscription(blitzServiceName, torAddress, torPort): # enter own shop address option choices.append(("X", "Enter a new Shop URL")) - # select dialog + # show a dialog info box d = Dialog(dialog="dialog", autowidgetsize=True) d.set_background_title("IP2TOR - Select Shop") - code, selected = d.menu( - "\nChoose your IP2Tor provider/shop:", - choices=choices, width=75, height=10, title="Select IP2Tor Shop") + d.msgbox(''' +At the moment there are no public IP2TOR services to link to. +You could run one yourself - please check the GitHub repo: +https://github.com/raulcano/docker-ip2tor-shop''', height=10, width=72) + + # select dialog + #d = Dialog(dialog="dialog", autowidgetsize=True) + #d.set_background_title("IP2TOR - Select Shop") + #code, selected = d.menu( + # "\nChoose your IP2Tor provider/shop:", + # choices=choices, width=75, height=10, title="Select IP2Tor Shop") # if user canceled - if code != d.OK: - sys.exit(0) + #if code != d.OK: + # sys.exit(0) - if selected == "A" : shopurl=choice_url_ip2torcom - if selected == "B" : shopurl=choice_url_fulmo - if selected == "Y" : shopurl=lastusedShop + #if selected == "A" : shopurl=choice_url_ip2torcom + #if selected == "B" : shopurl=choice_url_fulmo + #if selected == "Y" : shopurl=lastusedShop # input shop url - if selected == "X": - d = Dialog(dialog="dialog", autowidgetsize=True) - d.set_background_title("IP2TOR - Add new Shop") - code, shopurl = d.inputbox( - "Enter Address of the IP2TOR Shop (OR JUST PRESS OK):", - height=10, width=72, init=shopurl, - title="Shop Address") - if shopurl.find("://") > 0: shopurl = shopurl[shopurl.find("://") + 3:] + #if selected == "X": + d = Dialog(dialog="dialog", autowidgetsize=True) + d.set_background_title("IP2TOR - Add new Shop") + code, shopurl = d.inputbox( + "Enter Address of the IP2TOR Shop (OR JUST PRESS OK):", + height=10, width=72, init=shopurl, + title="Shop Address") + if shopurl.find("://") > 0: shopurl = shopurl[shopurl.find("://") + 3:] + + # if user choose cancel + if code != d.OK: + sys.exit(0) # try & get host list from shop os.system('clear') From 45dbdb3b82c23228432f089107b39907a4f0641d Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Tue, 28 May 2024 22:42:11 +0200 Subject: [PATCH 13/59] Add script for signing messages from specific address (#4582) * Add script for signing messages from specific address * use bitcoin-cli to check address * add CHANGES --- CHANGES.md | 1 + home.admin/config.scripts/lnd.signaddress.sh | 50 ++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 home.admin/config.scripts/lnd.signaddress.sh diff --git a/CHANGES.md b/CHANGES.md index d0ad0a884..77b4313cf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,6 @@ ## What's new in Version 1.11.1 of RaspiBlitz? +- New: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) diff --git a/home.admin/config.scripts/lnd.signaddress.sh b/home.admin/config.scripts/lnd.signaddress.sh new file mode 100644 index 000000000..0c27682df --- /dev/null +++ b/home.admin/config.scripts/lnd.signaddress.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# This script allows users to sign a message from a specific Bitcoin address +# either by generating a new address or using an existing one. + +# Ask if a new address should be generated or an existing one should be entered +read -p "Do you want to generate a new address? (y/n) " generate_new + +# 1.a. If generating a new address, ask for the address type +if [ "$generate_new" == "y" ]; then + echo "Generate a wallet new address. Address-types has to be one of:" + echo "1. p2wkh: Pay to witness key hash" + echo "2. np2wkh: Pay to nested witness key hash" + echo "3. p2tr: Pay to taproot pubkey" + read -p "Enter the address type (1-3 or string): " address_type + case "$address_type" in + 1|"p2wkh") + address_type="p2wkh" + ;; + 2|"np2wkh") + address_type="np2wkh" + ;; + 3|"p2tr") + address_type="p2tr" + ;; + *) + echo "Error: Invalid address type." + exit 1 + ;; + esac + address=$(lncli newaddress $address_type) + address_variable=$(echo $address | jq -r '.address') +else + # 1.b. Check if the manually entered address is valid + read -p "Enter the existing address: " address + if ! bitcoin-cli validateaddress "$address" | grep -q "isvalid\": true"; then + echo "Error: The entered address is not valid." + exit 1 + fi + address_variable=$address +fi +# 2. Ask for the message to sign and save it to a variable +read -p "Enter the message to sign: " message_to_sign + +# 3. Execute the lncli wallet addresses signmessage command +signature_js=$(lncli wallet addresses signmessage --address $address_variable --msg "$message_to_sign") +signature=$(echo $signature_js | jq -r '.signature') +echo "The address is: $address_variable" +echo "The message to sign is: $message_to_sign" +echo "The signature is: $signature" From 4932495daab7868dcaeb3265100a057ae5c4f21a Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Wed, 29 May 2024 00:11:31 +0200 Subject: [PATCH 14/59] LNbits update to v0.12.4 (#4491) * lnbits install script formatting * lnbits update to 0.12.4 --- .../nginx/sites-available/lnbits_ssl.conf | 5 + .../nginx/sites-available/lnbits_tor_ssl.conf | 5 + home.admin/config.scripts/bonus.lnbits.sh | 306 +++++++++--------- 3 files changed, 164 insertions(+), 152 deletions(-) diff --git a/home.admin/assets/nginx/sites-available/lnbits_ssl.conf b/home.admin/assets/nginx/sites-available/lnbits_ssl.conf index d8f3858d4..2ab8c93f4 100644 --- a/home.admin/assets/nginx/sites-available/lnbits_ssl.conf +++ b/home.admin/assets/nginx/sites-available/lnbits_ssl.conf @@ -19,6 +19,11 @@ server { location / { proxy_pass http://127.0.0.1:5000; + + # needed for websocket connections + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; include /etc/nginx/snippets/ssl-proxy-params.conf; } diff --git a/home.admin/assets/nginx/sites-available/lnbits_tor_ssl.conf b/home.admin/assets/nginx/sites-available/lnbits_tor_ssl.conf index e68d32e62..9b2df1433 100644 --- a/home.admin/assets/nginx/sites-available/lnbits_tor_ssl.conf +++ b/home.admin/assets/nginx/sites-available/lnbits_tor_ssl.conf @@ -19,6 +19,11 @@ server { location / { proxy_pass https://127.0.0.1:5001; + # needed for websocket connections + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include /etc/nginx/snippets/ssl-proxy-params.conf; } diff --git a/home.admin/config.scripts/bonus.lnbits.sh b/home.admin/config.scripts/bonus.lnbits.sh index df12ff57c..2d07f9bfa 100644 --- a/home.admin/config.scripts/bonus.lnbits.sh +++ b/home.admin/config.scripts/bonus.lnbits.sh @@ -3,7 +3,7 @@ # https://github.com/lnbits/lnbits # https://github.com/lnbits/lnbits/releases -tag="0.11.3" +tag="0.12.4" VERSION="${tag}" # command info @@ -129,12 +129,12 @@ if [ "$1" = "menu" ]; then # display possible problems with IP2TOR setup if [ ${#ip2torWarn} -gt 0 ]; then whiptail --title " Warning " \ - --yes-button "Back" \ - --no-button "Continue Anyway" \ - --yesno "Your IP2TOR+LetsEncrypt may have problems:\n${ip2torWarn}\n\nCheck if locally responding: https://${localIP}:${httpsPort}\n\nCheck if service is reachable over Tor:\n${toraddress}" 14 72 + --yes-button "Back" \ + --no-button "Continue Anyway" \ + --yesno "Your IP2TOR+LetsEncrypt may have problems:\n${ip2torWarn}\n\nCheck if locally responding: https://${localIP}:${httpsPort}\n\nCheck if service is reachable over Tor:\n${toraddress}" 14 72 if [ "$?" != "1" ]; then exit 0 - fi + fi fi # add info on funding source @@ -148,7 +148,7 @@ if [ "$1" = "menu" ]; then text="https://${localIP}:${httpsPort}${authMethod}" if [ ${#publicDomain} -gt 0 ]; then - text="${text} + text="${text} Public Domain: https://${publicDomain}:${httpsPort} port forwarding on router needs to be active & may change port" fi @@ -225,139 +225,140 @@ Consider adding a IP2TOR Bridge under OPTIONS." WIDTH=66 CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1")) - HEIGHT=$((CHOICE_HEIGHT+7)) + HEIGHT=$((CHOICE_HEIGHT + 7)) CHOICE=$(dialog --clear \ - --title " LNbits - Options" \ - --ok-label "Select" \ - --cancel-label "Back" \ - --menu "Choose one of the following options:" \ - $HEIGHT $WIDTH $CHOICE_HEIGHT \ - "${OPTIONS[@]}" \ - 2>&1 >/dev/tty) + --title " LNbits - Options" \ + --ok-label "Select" \ + --cancel-label "Back" \ + --menu "Choose one of the following options:" \ + $HEIGHT $WIDTH $CHOICE_HEIGHT \ + "${OPTIONS[@]}" \ + 2>&1 >/dev/tty) case $CHOICE in - IP2TOR-ON) - python /home/admin/config.scripts/blitz.subscriptions.ip2tor.py create-ssh-dialog LNBITS ${toraddress} 443 - exit 0 - ;; - IP2TOR-OFF) - clear - python /home/admin/config.scripts/blitz.subscriptions.ip2tor.py subscription-cancel ${ip2torID} - echo - echo "OK - PRESS ENTER to continue" - read key - exit 0 - ;; - HTTPS-ON) - python /home/admin/config.scripts/blitz.subscriptions.letsencrypt.py create-ssh-dialog - exit 0 - ;; - SWITCH-CL) - clear - /home/admin/config.scripts/bonus.lnbits.sh switch cl - echo "Restarting LNbits ..." - sudo systemctl restart lnbits - echo - echo "OK new funding source for LNbits active." - echo "PRESS ENTER to continue" - read key - exit 0 - ;; - SWITCH-LND) - clear - /home/admin/config.scripts/bonus.lnbits.sh switch lnd - echo "Restarting LNbits ..." - sudo systemctl restart lnbits - echo - echo "OK new funding source for LNbits active." - echo "PRESS ENTER to continue" - read key - exit 0 - ;; - BACKUP) - clear - /home/admin/config.scripts/bonus.lnbits.sh backup - echo - echo "Backup done" - echo "PRESS ENTER to continue" - read key - exit 0 - ;; - RESTORE) - clear - # check if backup exist - source <(/home/admin/_cache.sh get LNBitsDB) - if [ "${LNBitsDB}" == "PostgreSQL" ]; then - backup_target="/mnt/hdd/app-data/backup/lnbits_db" - backup_file=$(ls -t $backup_target/*.sql | head -n1) - else - backup_target="/mnt/hdd/app-data/backup/lnbits_sqlite" - backup_file=$(ls -t $backup_target/*.tar | head -n1) - fi - if [ "$backup_file" = "" ]; then - echo "ABORT - No Backup found to restore from" - exit 1 - else - # build dialog to choose backup file from menu - OPTIONS_RESTORE=() + IP2TOR-ON) + python /home/admin/config.scripts/blitz.subscriptions.ip2tor.py create-ssh-dialog LNBITS ${toraddress} 443 + exit 0 + ;; + IP2TOR-OFF) + clear + python /home/admin/config.scripts/blitz.subscriptions.ip2tor.py subscription-cancel ${ip2torID} + echo + echo "OK - PRESS ENTER to continue" + read key + exit 0 + ;; + HTTPS-ON) + python /home/admin/config.scripts/blitz.subscriptions.letsencrypt.py create-ssh-dialog + exit 0 + ;; + SWITCH-CL) + clear + /home/admin/config.scripts/bonus.lnbits.sh switch cl + echo "Restarting LNbits ..." + sudo systemctl restart lnbits + echo + echo "OK new funding source for LNbits active." + echo "PRESS ENTER to continue" + read key + exit 0 + ;; + SWITCH-LND) + clear + /home/admin/config.scripts/bonus.lnbits.sh switch lnd + echo "Restarting LNbits ..." + sudo systemctl restart lnbits + echo + echo "OK new funding source for LNbits active." + echo "PRESS ENTER to continue" + read key + exit 0 + ;; + BACKUP) + clear + /home/admin/config.scripts/bonus.lnbits.sh backup + echo + echo "Backup done" + echo "PRESS ENTER to continue" + read key + exit 0 + ;; + RESTORE) + clear + # check if backup exist + source <(/home/admin/_cache.sh get LNBitsDB) + if [ "${LNBitsDB}" == "PostgreSQL" ]; then + backup_target="/mnt/hdd/app-data/backup/lnbits_db" + backup_file=$(ls -t $backup_target/*.sql | head -n1) + else + backup_target="/mnt/hdd/app-data/backup/lnbits_sqlite" + backup_file=$(ls -t $backup_target/*.tar | head -n1) + fi + if [ "$backup_file" = "" ]; then + echo "ABORT - No Backup found to restore from" + exit 1 + else + # build dialog to choose backup file from menu + OPTIONS_RESTORE=() - counter=0 - cd $backup_target - for f in `find *.* -maxdepth 1 -type f`; do - [[ -f "$f" ]] || continue - counter=$(($counter+1)) - OPTIONS_RESTORE+=($counter "$f") - done + counter=0 + cd $backup_target + for f in $(find *.* -maxdepth 1 -type f); do + [[ -f "$f" ]] || continue + counter=$(($counter + 1)) + OPTIONS_RESTORE+=($counter "$f") + done - WIDTH_RESTORE=66 - CHOICE_HEIGHT_RESTORE=$(("${#OPTIONS_RESTORE[@]}/2+1")) - HEIGHT_RESTORE=$((CHOICE_HEIGHT_RESTORE+7)) - CHOICE_RESTORE=$(dialog --clear \ - --title " LNbits - Backup restore" \ - --ok-label "Select" \ - --cancel-label "Back" \ - --menu "Choose one of the following backups:" \ - $HEIGHT_RESTORE $WIDTH_RESTORE $CHOICE_HEIGHT_RESTORE \ - "${OPTIONS_RESTORE[@]}" \ - 2>&1 >/dev/tty) + WIDTH_RESTORE=66 + CHOICE_HEIGHT_RESTORE=$(("${#OPTIONS_RESTORE[@]}/2+1")) + HEIGHT_RESTORE=$((CHOICE_HEIGHT_RESTORE + 7)) + CHOICE_RESTORE=$(dialog --clear \ + --title " LNbits - Backup restore" \ + --ok-label "Select" \ + --cancel-label "Back" \ + --menu "Choose one of the following backups:" \ + $HEIGHT_RESTORE $WIDTH_RESTORE $CHOICE_HEIGHT_RESTORE \ + "${OPTIONS_RESTORE[@]}" \ + 2>&1 >/dev/tty) - # start restore with selected backup - clear - if [ "$CHOICE_RESTORE" != "" ]; then - backup_file=${backup_target}/${OPTIONS_RESTORE[$(($CHOICE_RESTORE*2-1))]} - /home/admin/config.scripts/bonus.lnbits.sh restore "${backup_file}" - echo - echo "Restore done" - echo "PRESS ENTER to continue" - read key - fi - exit 0 - fi - ;; - MIGRATE-DB) - clear - dialog --title "MIGRATE LNBITS" --yesno " + # start restore with selected backup + clear + if [ "$CHOICE_RESTORE" != "" ]; then + backup_file=${backup_target}/${OPTIONS_RESTORE[$(($CHOICE_RESTORE * 2 - 1))]} + /home/admin/config.scripts/bonus.lnbits.sh restore "${backup_file}" + echo + echo "Restore done" + echo "PRESS ENTER to continue" + read key + fi + exit 0 + fi + ;; + MIGRATE-DB) + clear + dialog --title "MIGRATE LNBITS" --yesno " Do you want to proceed the migration? Try to migrate your LNBits SQLite database to PostgreSQL. This can fail for unknown circumstances. Revert of this process is possible afterwards, a backup will be saved. " 12 65 - if [ $? -eq 0 ]; then - clear - /home/admin/config.scripts/bonus.lnbits.sh migrate - echo - migrateMsg - echo - echo "OK please test your LNBits installation." - echo "PRESS ENTER to continue" - read key - fi - exit 0 - ;; - *) - clear - exit 0 + if [ $? -eq 0 ]; then + clear + /home/admin/config.scripts/bonus.lnbits.sh migrate + echo + migrateMsg + echo + echo "OK please test your LNBits installation." + echo "PRESS ENTER to continue" + read key + fi + exit 0 + ;; + *) + clear + exit 0 + ;; esac exit 0 @@ -381,7 +382,7 @@ if [ "$1" = "status" ]; then # auth method is to call with a certain useer id #admin_userid=$(sudo cat /home/lnbits/lnbits/.super_user) - admin_userid=$(sudo cat /mnt/hdd/app-data/LNBits/data/.super_user); + admin_userid=$(sudo cat /mnt/hdd/app-data/LNBits/data/.super_user) echo "authMethod='/wallet?usr=${admin_userid}'" # check funding source @@ -534,7 +535,7 @@ if [ "$1" = "prestart" ]; then # protect the admin user id if exists # chmod 640 /home/lnbits/lnbits/.super_user 2>/dev/null - chmod 640 /mnt/hdd/app-data/LNBits/data/.super_user 2>/dev/null + chmod 640 /mnt/hdd/app-data/LNBits/data/.super_user 2>/dev/null echo "# OK: prestart finished" exit 0 # exit with clean code @@ -587,21 +588,22 @@ if [ "$1" = "sync" ] || [ "$1" = "repo" ]; then # pull latest code sudo -u lnbits git pull - # check if poetry in installed, if not install it + echo "# check if poetry in installed, if not install it" if ! sudo -u lnbits which poetry; then echo "# install poetry" sudo pip3 install --upgrade pip sudo pip3 install poetry fi - # do install like this + + echo "# install" sudo -u lnbits poetry install - # make sure default virtaulenv is used + echo "# make sure the default virtualenv is used" sudo apt-get remove -y python3-virtualenv 2>/dev/null sudo pip uninstall -y virtualenv 2>/dev/null sudo apt-get install -y python3-virtualenv - # restart lnbits service + echo "# restart lnbits service" sudo systemctl restart lnbits echo "# server is restarting ... maybe takes some seconds until available" exit 0 @@ -619,12 +621,6 @@ if [ "$1" = "install" ]; then exit 0 fi - echo "# *** INSTALL LNBITS ${VERSION} ***" - - # add lnbits user - echo "*** Add the 'lnbits' user ***" - sudo adduser --system --group --home /home/lnbits lnbits - # get optional github parameter githubUser="lnbits" if [ "$2" != "" ]; then @@ -634,17 +630,24 @@ if [ "$1" = "install" ]; then tag="$3" fi + echo "# *** INSTALL LNBITS ***" + echo "# githubUser=$githubUser tag=$tag" + + # add lnbits user + echo "*** Add the 'lnbits' user ***" + sudo adduser --system --group --home /home/lnbits lnbits + # install from GitHub echo "# get the github code user(${githubUser}) branch(${tag})" sudo rm -r /home/lnbits/lnbits 2>/dev/null - cd /home/lnbits || exit 1 + cd /home/lnbits || exit 1 sudo -u lnbits git clone https://github.com/${githubUser}/lnbits lnbits cd /home/lnbits/lnbits || exit 1 sudo -u lnbits git checkout ${tag} || exit 1 # to the install echo "# installing application dependencies" - cd /home/lnbits/lnbits || exit 1 + cd /home/lnbits/lnbits || exit 1 # check if poetry in installed, if not install it if ! sudo -u lnbits which poetry; then @@ -652,7 +655,8 @@ if [ "$1" = "install" ]; then sudo pip3 install --upgrade pip sudo pip3 install poetry fi - # do install like this + + echo "# install" sudo -u lnbits poetry install # make sure default virtaulenv is used @@ -681,7 +685,6 @@ if [ "$1" = "uninstall" ]; then exit 0 fi - # on if [ "$1" = "1" ] || [ "$1" = "on" ]; then @@ -790,7 +793,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # let switch command part do the detail config /home/admin/config.scripts/bonus.lnbits.sh switch ${fundingsource} - cd /home/lnbits/lnbits || exit 1 + cd /home/lnbits/lnbits || exit 1 # open firewall echo @@ -842,13 +845,13 @@ EOF # setup nginx symlinks if ! [ -f /etc/nginx/sites-available/lnbits_ssl.conf ]; then - sudo cp /home/admin/assets/nginx/sites-available/lnbits_ssl.conf /etc/nginx/sites-available/lnbits_ssl.conf + sudo cp /home/admin/assets/nginx/sites-available/lnbits_ssl.conf /etc/nginx/sites-available/lnbits_ssl.conf fi if ! [ -f /etc/nginx/sites-available/lnbits_tor.conf ]; then - sudo cp /home/admin/assets/nginx/sites-available/lnbits_tor.conf /etc/nginx/sites-available/lnbits_tor.conf + sudo cp /home/admin/assets/nginx/sites-available/lnbits_tor.conf /etc/nginx/sites-available/lnbits_tor.conf fi if ! [ -f /etc/nginx/sites-available/lnbits_tor_ssl.conf ]; then - sudo cp /home/admin/assets/nginx/sites-available/lnbits_tor_ssl.conf /etc/nginx/sites-available/lnbits_tor_ssl.conf + sudo cp /home/admin/assets/nginx/sites-available/lnbits_tor_ssl.conf /etc/nginx/sites-available/lnbits_tor_ssl.conf fi sudo ln -sf /etc/nginx/sites-available/lnbits_ssl.conf /etc/nginx/sites-enabled/ sudo ln -sf /etc/nginx/sites-available/lnbits_tor.conf /etc/nginx/sites-enabled/ @@ -1006,7 +1009,7 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then else if (whiptail --title " DELETE DATA? " --yesno "Do you want to delete\nthe LNbits Server Data?" 8 30); then deleteData=1 - else + else deleteData=0 fi fi @@ -1069,7 +1072,7 @@ if [ "$1" = "backup" ]; then else # sqlite backup backup_target="/mnt/hdd/app-data/backup/lnbits_sqlite" - backup_file="lnbits_sqlite_`date +%d`-`date +%m`-`date +%Y`_`date +%H`-`date +%M`_fs.tar" + backup_file="lnbits_sqlite_$(date +%d)-$(date +%m)-$(date +%Y)_$(date +%H)-$(date +%M)_fs.tar" if [ ! -d $backup_target ]; then sudo mkdir -p $backup_target 1>&2 fi @@ -1191,9 +1194,8 @@ if [ "$1" = "migrate" ]; then # execStartPre is not enough, wait for lnbits is finally running count=0 count_max=30 - while ! nc -zv 127.0.0.1 5000 2>/dev/null; - do - count=`expr $count + 1` + while ! nc -zv 127.0.0.1 5000 2>/dev/null; do + count=$(expr $count + 1) echo "wait for LNBIts to start (${count}s/${count_max}s)" sleep 1 if [ $count = $count_max ]; then From c0d07013fcee27b0a4926a23cfad9745bdd898ce Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Wed, 29 May 2024 13:49:16 +0200 Subject: [PATCH 15/59] Update acme.sh & fix duckdns (#4560) * fix dialog info * acme.sh 3.0.7 * use fake email if none given * format email correct * adressing #2255 --- CHANGES.md | 1 + .../blitz.subscriptions.ip2tor.py | 6 +- .../blitz.subscriptions.letsencrypt.py | 6 +- .../config.scripts/blitz.subscriptions.py | 4 +- .../config.scripts/bonus.letsencrypt.sh | 68 +++++++++---------- 5 files changed, 41 insertions(+), 44 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 77b4313cf..42597cf4f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ - New: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) +- Update: acme.sh 3.0.7 (repair duckdns.org dyndns) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) diff --git a/home.admin/config.scripts/blitz.subscriptions.ip2tor.py b/home.admin/config.scripts/blitz.subscriptions.ip2tor.py index e2b0401f5..904b4c147 100755 --- a/home.admin/config.scripts/blitz.subscriptions.ip2tor.py +++ b/home.admin/config.scripts/blitz.subscriptions.ip2tor.py @@ -622,9 +622,9 @@ def menuMakeSubscription(blitzServiceName, torAddress, torPort): if lastusedShop == choice_url_ip2torcom: lastusedShop="" # FULMO Shop - choice_url_fulmo="fulmo7x6yvgz6zs2b2ptduvzwevxmizhq23klkenslt5drxx2physlqd.onion" - choices.append(("B", "Fulmo Shop")) - if lastusedShop == choice_url_fulmo: lastusedShop="" + #choice_url_fulmo="fulmo7x6yvgz6zs2b2ptduvzwevxmizhq23klkenslt5drxx2physlqd.onion" + #choices.append(("B", "Fulmo Shop")) + #if lastusedShop == choice_url_fulmo: lastusedShop="" # add before option if different from static options if len(lastusedShop) > 0: choices.append(("Y", lastusedShop)) diff --git a/home.admin/config.scripts/blitz.subscriptions.letsencrypt.py b/home.admin/config.scripts/blitz.subscriptions.letsencrypt.py index d7c012477..c8a9d2383 100755 --- a/home.admin/config.scripts/blitz.subscriptions.letsencrypt.py +++ b/home.admin/config.scripts/blitz.subscriptions.letsencrypt.py @@ -334,8 +334,10 @@ def subscriptions_cancel(s_id): print(json.dumps(subs, indent=2)) - # todo: deinstall letsencrypt if this was last subscription - + # deinstall letsencrypt/dyndns if this was last subscription + if len(subs['subscriptions_letsencrypt']) == 0: + os.system("/home/admin/config.scripts/bonus.letsencrypt.sh off") + os.system("/home/admin/config.scripts/internet.dyndomain.sh off") def get_subscription(subscription_id): try: diff --git a/home.admin/config.scripts/blitz.subscriptions.py b/home.admin/config.scripts/blitz.subscriptions.py index eae24c06a..310c8f6e5 100755 --- a/home.admin/config.scripts/blitz.subscriptions.py +++ b/home.admin/config.scripts/blitz.subscriptions.py @@ -268,8 +268,8 @@ def main(): cfg.reload() if not cfg.run_behind_tor.value: Dialog(dialog="dialog", autowidgetsize=True).msgbox(''' - The IP2TOR service just makes sense if you run - your RaspiBlitz behind TOR. + The IP2TOR service just makes sense if you + run your RaspiBlitz behind TOR. ''', title="Info") sys.exit(0) diff --git a/home.admin/config.scripts/bonus.letsencrypt.sh b/home.admin/config.scripts/bonus.letsencrypt.sh index 456b48947..dd180ed11 100755 --- a/home.admin/config.scripts/bonus.letsencrypt.sh +++ b/home.admin/config.scripts/bonus.letsencrypt.sh @@ -12,8 +12,9 @@ fi source /mnt/hdd/raspiblitz.conf -ACME_LOAD_BASE_URL="https://codeload.github.com/acmesh-official/acme.sh/tar.gz" -ACME_VERSION="2.8.6" +# https://github.com/acmesh-official/acme.sh/releases +ACME_LOAD_BASE_URL="https://github.com/acmesh-official/acme.sh/archive/refs/tags/3.0.7.tar.gz" +ACME_VERSION="3.0.7" ACME_INSTALL_HOME="/home/admin/.acme.sh" ACME_CONFIG_HOME="/mnt/hdd/app-data/letsencrypt" @@ -21,19 +22,6 @@ ACME_CERT_HOME="${ACME_CONFIG_HOME}/certs" ACME_IS_INSTALLED=0 -# if Tor is on test that CURL is by default running over Tor -# TODO: issue https://github.com/rootzoll/raspiblitz/issues/1341 -#if [ "${runBehindTor}" == "on" ]; then -# echo "# checking if Tor proxy for CURL is working ..." -# checkTor=$(curl -s https://check.torproject.org | grep -c "Congratulations") -# if [ ${checkTor} -eq 0 ]; then -# echo "err='curl tor proxy not working'" -# exit 1 -# else -# echo "# OK Tor proxy for CURL" -# fi -#fi - ################### # FUNCTIONS ################### @@ -70,7 +58,15 @@ function acme_status() { } function acme_install() { + email="${1}" + # create a dummy email if none is provided + if [ -z "${email}" ]; then + random_number=$(shuf -i 100-999 -n 1) + random_word=$(shuf -n 1 /usr/share/dict/words) + ending="x.com" + email="${random_word}${random_number}@gm${ending}" + fi # ensure socat if ! command -v socat >/dev/null; then @@ -79,41 +75,38 @@ function acme_install() { sudo apt-get install -y socat >/dev/null 2>&1 fi + # make sure config directory exists if ! [ -d $ACME_CONFIG_HOME ]; then sudo mkdir -p $ACME_CONFIG_HOME fi sudo chown admin:admin $ACME_CONFIG_HOME - rm -f "/tmp/acme.sh_${ACME_VERSION}.tar.gz" - if ! curl --silent --fail -o "/tmp/acme.sh_${ACME_VERSION}.tar.gz" "${ACME_LOAD_BASE_URL}/${ACME_VERSION}" 2>&1; then - echo "Error ($?): Download failed from: ${ACME_LOAD_BASE_URL}/${ACME_VERSION}" - rm -f "/tmp/acme.sh_${ACME_VERSION}.tar.gz" + # download and install acme.sh + echo "# download acme.sh release ${ACME_VERSION} from ${ACME_LOAD_BASE_URL}" + rm -r /tmp/acme.sh* 2>/dev/null + if ! curl -L --silent --fail -o "/tmp/acme.sh.tar.gz" "${ACME_LOAD_BASE_URL}" 2>&1; then + echo "Error ($?): Download failed from: ${ACME_LOAD_BASE_URL}" + rm -r /tmp/acme.sh* exit 1 fi - if tar xzf "/tmp/acme.sh_${ACME_VERSION}.tar.gz" -C /tmp/; then + if tar xzf "/tmp/acme.sh.tar.gz" -C /tmp/; then cd "/tmp/acme.sh-${ACME_VERSION}" || exit - if [ -n "${email}" ]; then - ./acme.sh --install \ - --noprofile \ - --home "${ACME_INSTALL_HOME}" \ - --config-home "${ACME_CONFIG_HOME}" \ - --cert-home "${ACME_CERT_HOME}" \ - --accountemail "${email}" - else - ./acme.sh --install \ - --noprofile \ - --home "${ACME_INSTALL_HOME}" \ - --config-home "${ACME_CONFIG_HOME}" \ - --cert-home "${ACME_CERT_HOME}" - fi + echo "# installing acme.sh with email(${email})" + ./acme.sh --install \ + --noprofile \ + --home "${ACME_INSTALL_HOME}" \ + --config-home "${ACME_CONFIG_HOME}" \ + --cert-home "${ACME_CERT_HOME}" \ + --accountemail "${email}" + else + echo "# Error ($?): Extracting failed" + exit 1 fi - rm -f "/tmp/acme.sh_${ACME_VERSION}.tar.gz" - rm -Rf "/tmp/acme.sh_${ACME_VERSION}" - + rm -r /tmp/acme.sh* } function refresh_certs_with_nginx() { @@ -219,6 +212,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then sudo chmod -R 733 $ACME_CONFIG_HOME # install the acme script + echo "# acme_install" acme_install "${address}" echo "" From d21348822ca674653bac52f0beec172de5b70670 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Wed, 29 May 2024 16:16:40 +0200 Subject: [PATCH 16/59] Improve VM install & add Bitcoin Testnet Option (#4579) --- build_sdcard.sh | 25 +-- home.admin/00raspiblitz.sh | 22 +-- home.admin/_background.scan.sh | 28 +-- home.admin/_commands.sh | 12 ++ home.admin/config.scripts/bitcoin.monitor.sh | 16 +- home.admin/config.scripts/bitcoin.testnet.sh | 80 +++++++++ home.admin/config.scripts/blitz.debug.sh | 2 +- home.admin/config.scripts/blitz.hardware.sh | 22 ++- home.admin/config.scripts/blitz.vm.sh | 162 ++++++++++++++++++ .../setup.scripts/controlFinalDialog.sh | 5 + .../setup.scripts/eventBlockchainSync.sh | 2 +- 11 files changed, 315 insertions(+), 61 deletions(-) create mode 100755 home.admin/config.scripts/bitcoin.testnet.sh create mode 100755 home.admin/config.scripts/blitz.vm.sh diff --git a/build_sdcard.sh b/build_sdcard.sh index f80b6df7e..c7404c84d 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -369,7 +369,7 @@ echo -e "\n*** SOFTWARE UPDATE ***" # sqlite3 -> database # fdisk -> create partitions # lsb-release -> needed to know which distro version we're running to add APT sources -general_utils="policykit-1 htop git curl bash-completion vim jq dphys-swapfile bsdmainutils autossh telnet vnstat parted dosfstools fbi sysbench build-essential dialog bc python3-dialog unzip whois fdisk lsb-release smartmontools rsyslog resolvconf" +general_utils="sudo policykit-1 htop git curl bash-completion vim jq dphys-swapfile bsdmainutils autossh telnet vnstat parted dosfstools fbi sysbench build-essential dialog bc python3-dialog unzip whois fdisk lsb-release smartmontools rsyslog resolvconf" # add btrfs-progs if not bookworm on aarch64 [ "${architecture}" = "aarch64" ] && ! grep "12 (bookworm)" < /etc/os-release && general_utils="${general_utils} btrfs-progs" # python3-mako --> https://github.com/rootzoll/raspiblitz/issues/3441 @@ -664,18 +664,19 @@ echo -e "\n*** ADDING GROUPS FOR CREDENTIALS STORE ***" echo -e "\n*** SHELL SCRIPTS & ASSETS ***" # copy raspiblitz repo from github cd /home/admin/ || exit 1 -sudo -u admin git config --global user.name "${github_user}" -sudo -u admin git config --global user.email "johndoe@example.com" +sudo -u admin git config --global user.name "${github_user}" || exit 1 +sudo -u admin git config --global user.email "johndoe@example.com" || exit 1 +sudo -u admin git config --global http.postBuffer 524288000 || exit 1 sudo -u admin rm -rf /home/admin/raspiblitz -sudo -u admin git clone -b "${branch}" https://github.com/${github_user}/raspiblitz.git -sudo -u admin cp -r /home/admin/raspiblitz/home.admin/*.* /home/admin -sudo -u admin cp /home/admin/raspiblitz/home.admin/.tmux.conf /home/admin -sudo -u admin cp -r /home/admin/raspiblitz/home.admin/assets /home/admin/ -sudo -u admin chmod +x *.sh -sudo -u admin cp -r /home/admin/raspiblitz/home.admin/config.scripts /home/admin/ -sudo -u admin chmod +x /home/admin/config.scripts/*.sh -sudo -u admin cp -r /home/admin/raspiblitz/home.admin/setup.scripts /home/admin/ -sudo -u admin chmod +x /home/admin/setup.scripts/*.sh +sudo -u admin git clone -b "${branch}" https://github.com/${github_user}/raspiblitz.git || exit 1 +sudo -u admin cp -r /home/admin/raspiblitz/home.admin/*.* /home/admin || exit 1 +sudo -u admin cp /home/admin/raspiblitz/home.admin/.tmux.conf /home/admin || exit 1 +sudo -u admin cp -r /home/admin/raspiblitz/home.admin/assets /home/admin/ || exit 1 +sudo -u admin chmod +x *.sh || exit 1 +sudo -u admin cp -r /home/admin/raspiblitz/home.admin/config.scripts /home/admin/ || exit 1 +sudo -u admin chmod +x /home/admin/config.scripts/*.sh || exit 1 +sudo -u admin cp -r /home/admin/raspiblitz/home.admin/setup.scripts /home/admin/ || exit 1 +sudo -u admin chmod +x /home/admin/setup.scripts/*.sh || exit 1 # install newest version of BlitzPy blitzpy_wheel=$(ls -tR /home/admin/raspiblitz/home.admin/BlitzPy/dist | grep -E "any.whl" | tail -n 1) diff --git a/home.admin/00raspiblitz.sh b/home.admin/00raspiblitz.sh index fa47a2bcc..f8638cb1d 100755 --- a/home.admin/00raspiblitz.sh +++ b/home.admin/00raspiblitz.sh @@ -98,8 +98,7 @@ do network \ chain \ lightning \ - internet_localip \ - system_vm_vagrant \ + internet_localip ) # background.scan is not ready yet @@ -281,25 +280,6 @@ MAINMENU > REPAIR > REPAIR-LND > RETRYSCB #echo "# DURING SETUP: Handle System State (${state})" - # when no HDD on Vagrant - just print info & exit (admin info & exit) - if [ "${state}" == "noHDD" ] && [ ${system_vm_vagrant} != "0" ]; then - echo "***********************************************************" - echo "VAGRANT INFO" - echo "***********************************************************" - echo "To connect a HDD data disk to your VagrantVM:" - echo "- shutdown VM with command: off" - echo "- open your VirtualBox GUI and select RaspiBlitzVM" - echo "- change the 'mass storage' settings" - echo "- add a second 'Primary Slave' drive to the already existing controller" - echo "- close VirtualBox GUI and run: vagrant up & vagrant ssh" - echo "***********************************************************" - echo "You can either create a new dynamic VDI with around 900GB or download" - echo "a VDI with a presynced blockchain to speed up setup. If you dont have 900GB" - echo "space on your laptop you can store the VDI file on an external drive." - echo "***********************************************************" - exit 1 - fi - # for all critical errors (admin info & exit) if [ "${state}" == "error" ] || [ "${state}" == "errorHDD" ]; then clear diff --git a/home.admin/_background.scan.sh b/home.admin/_background.scan.sh index fd3cb5d6d..88e49c823 100755 --- a/home.admin/_background.scan.sh +++ b/home.admin/_background.scan.sh @@ -105,25 +105,11 @@ fi echo "importing: _version.info" /home/admin/_cache.sh import /home/admin/_version.info -# basic hardware info (will not change) -source <(/home/admin/_cache.sh valid \ - system_board \ - system_ram_mb \ - system_ram_gb \ -) -if [ "${stillvalid}" == "0" ]; then - source <(/home/admin/config.scripts/blitz.hardware.sh status) - /home/admin/_cache.sh set system_board "${board}" - /home/admin/_cache.sh set system_ram_mb "${ramMB}" - /home/admin/_cache.sh set system_ram_gb "${ramGB}" -fi - -# VM detect vagrant -source <(/home/admin/_cache.sh valid system_vm_vagrant) -if [ "${stillvalid}" == "0" ]; then - vagrant=$(df | grep -c "/vagrant") - /home/admin/_cache.sh set system_vm_vagrant "${vagrant}" -fi +# get hardware info +source <(/home/admin/config.scripts/blitz.hardware.sh status) +/home/admin/_cache.sh set system_board "${board}" +/home/admin/_cache.sh set system_ram_mb "${ramMB}" +/home/admin/_cache.sh set system_ram_gb "${ramGB}" # flag that init was done (will be checked on each loop) /home/admin/_cache.sh set system_init_time "$(date +%s)" @@ -171,9 +157,7 @@ do fi # ram - ram=$(free -m | grep Mem | awk '{ print $2 }') - ram_avail=$(free -m | grep Mem | awk '{ print $7 }') - /home/admin/_cache.sh set system_ram_mb "${ram}" + ram_avail=$(free -m | grep -E 'Mem|Speicher' | awk '{ print $7 }') /home/admin/_cache.sh set system_ram_available_mb "${ram_avail}" # undervoltage diff --git a/home.admin/_commands.sh b/home.admin/_commands.sh index 4cdedf581..640f625a3 100755 --- a/home.admin/_commands.sh +++ b/home.admin/_commands.sh @@ -55,6 +55,11 @@ function blitzhelp() { echo " cache check on chache system state" echo " github jumping directly into the options to change branch/repo/pr" echo + echo "Development with VM:" + echo " sync sync all repos from shared folder" + echo " sync code sync only main raspiblitz repo from shared folder" + echo " sync api sync only blitz api repo from shared folder" + echo echo "Power:" echo " restart restart the node" echo " off shutdown the node" @@ -215,6 +220,13 @@ function patch() { echo } +# command: sync +# sync VM with shared folder +function sync() { + sudo /home/admin/config.scripts/blitz.vm.sh sync ${1} + echo +} + # command: off function off() { echo "Command to power off your RaspiBlitz" diff --git a/home.admin/config.scripts/bitcoin.monitor.sh b/home.admin/config.scripts/bitcoin.monitor.sh index 38cc933a4..950628bf6 100755 --- a/home.admin/config.scripts/bitcoin.monitor.sh +++ b/home.admin/config.scripts/bitcoin.monitor.sh @@ -148,7 +148,12 @@ if [ "$2" = "info" ]; then if [ "$1" == "signet" ]; then subfolder="signet/" fi - btc_blocks_data_kb=$(sudo du -s /mnt/hdd/bitcoin/${subfolder}blocks | cut -f1) + btc_blocks_data_kb=$(sudo du -s /mnt/hdd/bitcoin/${subfolder}blocks 2>/dev/null | cut -f1) + if [ "${btc_blocks_data_kb}" == "" ]; then + btc_blocks_data_kb="0" + fi + + # print data # parse data btc_blocks_headers=$(echo "${blockchaininfo}" | jq -r '.headers') @@ -156,9 +161,14 @@ if [ "$2" = "info" ]; then btc_blocks_behind=$((${btc_blocks_headers} - ${btc_blocks_verified})) btc_sync_initialblockdownload=$(echo "${blockchaininfo}" | jq -r '.initialblockdownload' | grep -c 'true') btc_sync_progress=$(echo "${blockchaininfo}" | jq -r '.verificationprogress') - if (( $(awk 'BEGIN { print( '${btc_sync_progress}'<0.99995 ) }') )); then + if [[ "${btc_sync_progress}" == *"e-"* ]]; then + # is still very small - round up to 0.01% + btc_sync_percentage="0.01" + elif (( $(awk 'BEGIN { print( '${btc_sync_progress}'<0.99995 ) }') )); then # #3620 prevent displaying 100.00%, although incorrect because of rounding - btc_sync_percentage=$(awk 'BEGIN { printf( "%.2f%%", 100 * '${btc_sync_progress}') }') + btc_sync_percentage="${btc_sync_progress:2:2}.${btc_sync_progress:4:2}" + # remove trailing zero if present (just first one) + btc_sync_percentage="${btc_sync_percentage#0}" elif [ "${btc_blocks_headers}" != "" ] && [ "${btc_blocks_headers}" == "${btc_blocks_verified}" ]; then btc_sync_percentage="100.00" else diff --git a/home.admin/config.scripts/bitcoin.testnet.sh b/home.admin/config.scripts/bitcoin.testnet.sh new file mode 100755 index 000000000..92105829a --- /dev/null +++ b/home.admin/config.scripts/bitcoin.testnet.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +# command info +if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then + echo "# Switches on bitcoind mainnet behind the scenes to testnet." + echo "# !!! JUST USE FOR DEVELOPEMNT - NOT FOR PRODUCTION !!!" + echo "# " + echo "# bitcoin.testnet.sh [activate|revert]" + echo + exit 1 +fi + +# make sure user is root +if [ $UID -ne 0 ]; then + echo "error='run this script with sudo'" + exit 1 +fi + +echo "# Running: bitcoin.testnet.sh $*" + +if [ "$1" == "activate" ]; then + + # check if bitcoin testnet is already activated + testnetSet=$(cat /mnt/hdd/bitcoin/bitcoin.conf | grep -c "^testnet=1") + if [ $testnetSet -gt 0 ]; then + echo "error='testnet is already activated'" + exit 1 + fi + + echo "# SWITCHING TO TESTNET .." + + # make changes to bitcoin.conf + sed -i 's|^testnet=0|testnet=1|' /mnt/hdd/bitcoin/bitcoin.conf + sed -i 's/^\(main.debuglogfile=.*\)/#\1/' /mnt/hdd/bitcoin/bitcoin.conf + sed -i 's|^test.debuglogfile=/mnt/hdd/bitcoin/testnet3/debug.log|test.debuglogfile=/mnt/hdd/bitcoin/debug.log|' /mnt/hdd/bitcoin/bitcoin.conf + sed -i 's/^\(main.rpcbind=.*\)/#\1/' /mnt/hdd/bitcoin/bitcoin.conf + sed -i 's|^test.rpcbind=127.0.0.1:18332|test.rpcbind=127.0.0.1:8332|' /mnt/hdd/bitcoin/bitcoin.conf + + # restart bitcoind service + systemctl restart bitcoind.service + + echo "# OK bitcoind should now run testnet on mainnet ports" + echo "# If you want to save space you can delete old mainnet blockchain with:" + echo "# rm -rf /mnt/hdd/bitcoin/blocks" + echo "# rm -rf /mnt/hdd/bitcoin/chainstate" + + exit 0 +fi + +if [ "$1" == "revert" ]; then + + # check if bitcoin testnet is already activated + testnetSet=$(cat /mnt/hdd/bitcoin/bitcoin.conf | grep -c "^testnet=1") + if [ $testnetSet -eq 0 ]; then + echo "error='testnet is not activated'" + exit 1 + fi + + echo "# SWITCHING BACK TO MAINNET .." + + # make changes to bitcoin.conf + sed -i 's|^testnet=1|testnet=0|' /mnt/hdd/bitcoin/bitcoin.conf + sed -i 's|^#main.debuglogfile=.*|main.debuglogfile=/mnt/hdd/bitcoin/debug.log|' /mnt/hdd/bitcoin/bitcoin.conf + sed -i 's|^test.debuglogfile=/mnt/hdd/bitcoin/debug.log|test.debuglogfile=/mnt/hdd/bitcoin/testnet3/debug.log|' /mnt/hdd/bitcoin/bitcoin.conf + sed -i 's|^#main.rpcbind=.*|main.rpcbind=127.0.0.1:8332|' /mnt/hdd/bitcoin/bitcoin.conf + sed -i 's|^test.rpcbind=127.0.0.1:8332|test.rpcbind=127.0.0.1:18332|' /mnt/hdd/bitcoin/bitcoin.conf + + # restart bitcoind service + systemctl restart bitcoind.service + + echo "# OK bitcoind should now run normal mainnet again" + echo "# If you want to save space you can delete old testnet blockchain with:" + echo "# rm -rf /mnt/hdd/bitcoin/testnet3/blocks" + echo "# rm -rf /mnt/hdd/bitcoin/testnet3/chainstate" + + exit 0 +fi + +echo "error='unkown parameter'" +exit 1 \ No newline at end of file diff --git a/home.admin/config.scripts/blitz.debug.sh b/home.admin/config.scripts/blitz.debug.sh index f8e1ad31c..b05517944 100755 --- a/home.admin/config.scripts/blitz.debug.sh +++ b/home.admin/config.scripts/blitz.debug.sh @@ -464,7 +464,7 @@ sudo /home/admin/config.scripts/blitz.zram.sh status echo echo "*** HARDWARE TEST RESULTS ***" -sudo vcgencmd get_throttled +sudo vcgencmd get_throttled 2>/dev/null source <(/home/admin/_cache.sh get system_count_undervoltage) showImproveInfo=0 if [ ${#system_count_undervoltage} -gt 0 ]; then diff --git a/home.admin/config.scripts/blitz.hardware.sh b/home.admin/config.scripts/blitz.hardware.sh index dbc30baab..ebc1ca5e8 100644 --- a/home.admin/config.scripts/blitz.hardware.sh +++ b/home.admin/config.scripts/blitz.hardware.sh @@ -13,11 +13,31 @@ fi # detect known SBCs board="" -isRaspberryPi4=$(cat /proc/device-tree/model | grep -c "Raspberry Pi 4") + +# detect RaspberryPi 3 +isRaspberryPi3=$(cat /proc/device-tree/model 2>/dev/null | grep -c "Raspberry Pi 3") +if [ "${isRaspberryPi3}" == "1" ]; then + board="rp3" +fi + +# detect RaspberryPi 4 +isRaspberryPi4=$(cat /proc/device-tree/model 2>/dev/null | grep -c "Raspberry Pi 4") if [ "${isRaspberryPi4}" == "1" ]; then board="rp4" fi +# detect RaspberryPi 5 +isRaspberryPi5=$(cat /proc/device-tree/model 2>/dev/null | grep -c "Raspberry Pi 5") +if [ "${isRaspberryPi5}" == "1" ]; then + board="rp5" +fi + +# detect VM +isVM=$(grep -c 'hypervisor' /proc/cpuinfo) +if [ ${isVM} -gt 0 ]; then + board="vm" +fi + # get how many RAM (in MB) ramMB=$(awk '/MemTotal/ {printf( "%d\n", $2 / 1024 )}' /proc/meminfo) diff --git a/home.admin/config.scripts/blitz.vm.sh b/home.admin/config.scripts/blitz.vm.sh new file mode 100755 index 000000000..afc9afeec --- /dev/null +++ b/home.admin/config.scripts/blitz.vm.sh @@ -0,0 +1,162 @@ +#!/bin/bash + +# This is for developing on your RaspiBlitz VM + +# command info +if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then + echo "FOR DEVELOPMENT USE ONLY!" + echo "RaspiBlitzVM Sync with repos in /mnt/vm_shared_folder" + echo "blitz.vm.sh sync -> syncs all available repos in shared folder" + echo "blitz.vm.sh sync code -> syncs only the raspiblitz repo" + echo "blitz.vm.sh sync api -> syncs only the raspiblitz API repo" + echo "" + exit 1 +fi + +# check runnig as sudo +if [ "$EUID" -ne 0 ]; then + echo "error='please run as root'" + exit 1 +fi + +# check if running in vm +isVM=$(grep -c 'hypervisor' /proc/cpuinfo) +if [ ${isVM} -eq 0 ]; then + echo "# This script is only for RaspiBlitz running in a VM" + echo "error='not a VM'" + exit 1 +fi + +# check if shared folder exists +if [ ! -d "/mnt/vm_shared_folder" ]; then + echo "# Creating shared folder /mnt/vm_shared_folder" + mkdir /mnt/vm_shared_folder + chmod 777 /mnt/vm_shared_folder +fi + +# check if shared folder is mounted +isMounted=$(mount | grep '/mnt/vm_shared_folder') +if [ ${#isMounted} -eq 0 ]; then + echo "# Mounting shared folder /mnt/vm_shared_folder" + mount -t 9p -o trans=virtio share /mnt/vm_shared_folder + if [ $? -eq 0 ]; then + echo "# OK - shared folder mounted" + else + echo "# make sure to activate shared folder in VM settings (VirtFS)" + echo "error='mount failed'" + exit 1 + fi +fi + +# RASPIBLITZ MAIN REPO +if [ "$2" == "code" ] || [ "$2" == "" ]; then + + echo + echo "# ##### RASPIBLITZ REPO" + + #check if contains a raspiblitz MAIN repo + containsRaspiBlitzRepo=$(ls /mnt/vm_shared_folder | grep -wc 'raspiblitz') + if [ ${containsRaspiBlitzRepo} -eq 0 ]; then + + echo "# /mnt/vm_shared_folder does not contain a raspiblitz repo" + echo "# make sure to share the directory that contains the raspiblitz repo - not the repo itself" + echo "# make sure its named 'raspiblitz' and not 'raspiblitz-main' or 'raspiblitz-v1.7'" + + if [ "$2" != "" ]; then + echo "error='no raspiblitz main repo'" + exit 1 + fi + + else + + cd /home/admin + echo "# COPYING from VM SHARED FOLDER to /home/admin/" + echo "# - basic admin files" + rm -f *.sh + su - admin -c 'cp /mnt/vm_shared_folder/raspiblitz/home.admin/.tmux.conf /home/admin' + su - admin -c 'cp /mnt/vm_shared_folder/raspiblitz/home.admin/*.* /home/admin 2>/dev/null' + su - admin -c 'chmod 755 *.sh' + echo "# - asset directory" + rm -rf assets + su - admin -c 'cp -R /mnt/vm_shared_folder/raspiblitz/home.admin/assets /home/admin/assets' + echo "# - config.scripts directory" + rm -rf /home/admin/config.scripts + su - admin -c 'cp -R /mnt/vm_shared_folder/raspiblitz/home.admin/config.scripts /home/admin/config.scripts' + su - admin -c 'chmod 755 /home/admin/config.scripts/*.sh' + su - admin -c 'chmod 755 /home/admin/config.scripts/*.py' + echo "# - setup.scripts directory" + rm -rf /home/admin/setup.scripts + su - admin -c 'cp -R /mnt/vm_shared_folder/raspiblitz/home.admin/setup.scripts /home/admin/setup.scripts' + su - admin -c 'chmod 755 /home/admin/setup.scripts/*.sh' + su - admin -c 'chmod 755 /home/admin/config.scripts/*.py' + echo "# ******************************************" + + if [ "$2" != "" ]; then + exit 0 + fi + + fi +fi + +# RASPIBLITZ API REPO +if [ "$2" == "api" ] || [ "$2" == "" ]; then + + echo + echo "# ##### RASPIBLITZ API REPO" + + # check if blitzapi service is enabled + systemctl is-enabled blitzapi 2>/dev/null + notInstalled=$? + + #check if contains a raspiblitz API repo + containsApiRepo=$(ls /mnt/vm_shared_folder | grep -wc 'blitz_api') + if [ ${containsApiRepo} -eq 0 ]; then + + echo "# /mnt/vm_shared_folder does not contain a api repo" + echo "# make sure to share the directory that contains the api repo - not the repo itself" + echo "# make sure its named 'blitz_api'" + + if [ "$2" != "" ]; then + echo "error='no raspiblitz api repo'" + exit 1 + fi + + elif [ ${notInstalled} -gt 0 ]; then + + echo "# blitzapi service is not installed or enabled - skipping" + if [ "$2" != "" ]; then + echo "error='blitzapi service not enabled'" + exit 1 + fi + + else + + + echo "# TODO: Not implemented yet - use /script/updateBlitzAPI.sh instead to sync from host to VM" + + #echo "# Stopping blitzapi service" + #systemctl stop blitzapi + #echo "# COPYING from VM SHARED FOLDER to /home/blitzapi/" + #rm -rf /home/blitzapi/blitz_api + #cp -R /mnt/vm_shared_folder/blitz_api /home/blitzapi + #chown -R blitzapi:blitzapi /home/blitzapi/blitz_api + #cd /home/blitzapi/blitz_api || exit 1 + #su - blitzapi -c './venv/bin/pip install -r requirements.txt' + #echo "# Starting blitzapi service" + #systemctl start blitzapi + + if [ "$2" != "" ]; then + exit 0 + fi + + fi + +fi + +if [ "$1" == "sync" ]; then + exit 0 +fi + +# in case of unknown command +echo "error='unkown command'" +exit 1 \ No newline at end of file diff --git a/home.admin/setup.scripts/controlFinalDialog.sh b/home.admin/setup.scripts/controlFinalDialog.sh index b57eb5651..f67ce837f 100755 --- a/home.admin/setup.scripts/controlFinalDialog.sh +++ b/home.admin/setup.scripts/controlFinalDialog.sh @@ -44,12 +44,17 @@ if [ "${btc_default_blocks_data_kb}" != "" ] && [ ${btc_default_blocks_data_kb} OPTIONS=() OPTIONS+=(SELFSYNC "Run full self sync/validation (takes long)") OPTIONS+=(COPY "Copy from Computer/RaspiBlitz over LAN (3-10h)") + OPTIONS+=(TESTNET "Sync smaller Testnet (ONLY DEVELOPER)") CHOICESUB=$(dialog --backtitle "RaspiBlitz" --clear --title " Blockchain Sync/Validation " --menu "\nYour Blockchain is not fully synced yet.\nThe full validation might take multiple days to finish.\n\nHow do you want to proceed:" 13 66 7 "${OPTIONS[@]}" 2>&1 >/dev/tty) if [ "${CHOICESUB}" == "COPY" ]; then /home/admin/config.scripts/blitz.copychain.sh target fi + if [ "${CHOICESUB}" == "TESTNET" ]; then + sudo /home/admin/config.scripts/bitcoin.testnet.sh activate + fi + fi ############################################ diff --git a/home.admin/setup.scripts/eventBlockchainSync.sh b/home.admin/setup.scripts/eventBlockchainSync.sh index 654a83116..e0c01b262 100644 --- a/home.admin/setup.scripts/eventBlockchainSync.sh +++ b/home.admin/setup.scripts/eventBlockchainSync.sh @@ -28,7 +28,7 @@ actionString="Please wait - this can take some time" # formatting BLOCKCHAIN SYNC PROGRESS if [ "${btc_default_ready}" == "0" ] || [ "${btc_default_peers}" == "" ]; then - if [ ${system_count_start_blockchain} -gt 1 ]; then + if [ "${system_count_start_blockchain}" != "" ] && [ ${system_count_start_blockchain} -gt 1 ]; then syncProgress="${system_count_start_blockchain} restarts" else syncProgress="waiting for start" From d1e57d6bd2c442056344f06e175001770cf9162e Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Wed, 29 May 2024 16:17:40 +0200 Subject: [PATCH 17/59] #4586 Update LNbits & fix systemd dependency (#4596) * Update LNbits to version 0.12.8 * remove userid from url * remove IP2Tor-on option from menu * revert to old auth method * #4586 systemd wait funding source * chore: Update lnbits.service to fallback to bitcoind.service for funding source --- CHANGES.md | 1 + home.admin/config.scripts/bonus.lnbits.sh | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 42597cf4f..7902af76e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,7 @@ ## What's new in Version 1.11.1 of RaspiBlitz? - New: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) +- Update: LNbits 0.12.8 [details](https://github.com/lnbits/lnbits/releases/tag/0.12.8) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Update: acme.sh 3.0.7 (repair duckdns.org dyndns) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) diff --git a/home.admin/config.scripts/bonus.lnbits.sh b/home.admin/config.scripts/bonus.lnbits.sh index 2d07f9bfa..132fac14e 100644 --- a/home.admin/config.scripts/bonus.lnbits.sh +++ b/home.admin/config.scripts/bonus.lnbits.sh @@ -3,7 +3,7 @@ # https://github.com/lnbits/lnbits # https://github.com/lnbits/lnbits/releases -tag="0.12.4" +tag="0.12.8" VERSION="${tag}" # command info @@ -201,8 +201,6 @@ Consider adding a IP2TOR Bridge under OPTIONS." # just IP2TOR active - offer cancel or Lets Encrypt OPTIONS+=(HTTPS-ON "Add free HTTPS-Certificate for LNbits") OPTIONS+=(IP2TOR-OFF "Cancel IP2Tor Subscription for LNbits") - else - OPTIONS+=(IP2TOR-ON "Make Public with IP2Tor Subscription") fi # Change Funding Source options (only if available) @@ -802,6 +800,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then sudo ufw allow 5001 comment 'lnbits HTTPS' echo + # make sure that systemd starts funding source first + systemdDependency="bitcoind.service" + if [ "${fundingsource}" == "lnd" ]; then + systemdDependency="lnd.service" + elif [ "${fundingsource}" == "cl" ]; then + systemdDependency="lightningd.service" + fi + # install service echo "*** Install systemd ***" cat </dev/null @@ -809,8 +815,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then [Unit] Description=lnbits -Wants=bitcoind.service -After=bitcoind.service +Wants=${systemdDependency} +After=${systemdDependency} [Service] WorkingDirectory=/home/lnbits/lnbits @@ -927,6 +933,10 @@ if [ "$1" = "switch" ]; then exit 1 fi + # make lnd.service fallback + sudo sed -i 's/Wants=lnd.service/Wants=bitcoind.service/' /etc/systemd/system/lnbits.service + sudo sed -i 's/After=lnd.service/After=bitcoind.service/' /etc/systemd/system/lnbits.service + echo "##############" echo "# NOTE: If you switch the funding source of a running LNbits instance all sub account will keep balance." echo "# Make sure that the new funding source has enough sats to cover the LNbits bookeeping of sub accounts." From 770587eee2cb1496323a35af2cb925cd440dc33d Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Wed, 29 May 2024 16:42:49 +0200 Subject: [PATCH 18/59] btcpay update to v1.13.0, signed by web-flow (#4526) * btcpay update to v1.13.0, signed by web-flow * add to CHANGES --- CHANGES.md | 1 + home.admin/config.scripts/bonus.btcpayserver.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7902af76e..ac3df7a22 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ - New: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Update: LNbits 0.12.8 [details](https://github.com/lnbits/lnbits/releases/tag/0.12.8) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) +- Update: BTCPayServer 1.13.0 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.0) - Update: acme.sh 3.0.7 (repair duckdns.org dyndns) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) diff --git a/home.admin/config.scripts/bonus.btcpayserver.sh b/home.admin/config.scripts/bonus.btcpayserver.sh index 2f8570a7b..37d06dcbc 100644 --- a/home.admin/config.scripts/bonus.btcpayserver.sh +++ b/home.admin/config.scripts/bonus.btcpayserver.sh @@ -3,22 +3,22 @@ # Based on: https://gist.github.com/normandmickey/3f10fc077d15345fb469034e3697d0d0 # https://github.com/dgarage/NBXplorer/tags -NBXplorerVersion="v2.5.0" +NBXplorerVersion="v2.5.2" # https://github.com/btcpayserver/btcpayserver/releases -BTCPayVersion="v1.12.5" +BTCPayVersion="v1.13.0" # check who signed the release (person that published release) -PGPsigner="nicolasdorier" -PGPpubkeyLink="https://keybase.io/nicolasdorier/pgp_keys.asc" -PGPpubkeyFingerprint="AB4CFA9895ACA0DBE27F6B346618763EF09186FE" +#PGPsigner="nicolasdorier" +#PGPpubkeyLink="https://keybase.io/nicolasdorier/pgp_keys.asc" +#PGPpubkeyFingerprint="AB4CFA9895ACA0DBE27F6B346618763EF09186FE" # --- #PGPsigner="Kukks" #PGPpubkeyLink="https://github.com/${PGPsigner}.gpg" #PGPpubkeyFingerprint="8E5530D9D1C93097" # --- -#PGPsigner="web-flow" -#PGPpubkeyLink="https://github.com/web-flow.gpg" -#PGPpubkeyFingerprint="(4AEE18F83AFDEB23|B5690EEEBB952194)" +PGPsigner="web-flow" +PGPpubkeyLink="https://github.com/web-flow.gpg" +PGPpubkeyFingerprint="B5690EEEBB952194" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then From 28bde64e9a951f7067121274c23c9d1bc3d080f8 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Wed, 29 May 2024 16:55:38 +0200 Subject: [PATCH 19/59] add elements install script for Liquid support (#4573) --- CHANGES.md | 1 + home.admin/config.scripts/blitz.passwords.sh | 7 + home.admin/config.scripts/bonus.elements.sh | 306 +++++++++++++++++++ 3 files changed, 314 insertions(+) create mode 100755 home.admin/config.scripts/bonus.elements.sh diff --git a/CHANGES.md b/CHANGES.md index ac3df7a22..e481cf950 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,7 @@ ## What's new in Version 1.11.1 of RaspiBlitz? - New: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) +- New: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) - Update: LNbits 0.12.8 [details](https://github.com/lnbits/lnbits/releases/tag/0.12.8) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Update: BTCPayServer 1.13.0 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.0) diff --git a/home.admin/config.scripts/blitz.passwords.sh b/home.admin/config.scripts/blitz.passwords.sh index 90a07c2a1..7b6225a2f 100755 --- a/home.admin/config.scripts/blitz.passwords.sh +++ b/home.admin/config.scripts/blitz.passwords.sh @@ -402,6 +402,13 @@ elif [ "${abcd}" = "b" ]; then sudo chown mempool:mempool /home/mempool/mempool/backend/mempool-config.json fi + # elements + if [ "${elements}" == "on" ]; then + echo "# changing the password for elements" + sudo sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /home/elements/.elements/elements.conf + sudo sed -i "s/^mainchainrpcpassword=.*/mainchainrpcpassword=${newPassword}/g" /home/elements/.elements/elements.conf + fi + echo "# OK -> RPC Password B changed" echo "# Reboot is needed (will be triggered if interactive menu was called)" echo "error=''" diff --git a/home.admin/config.scripts/bonus.elements.sh b/home.admin/config.scripts/bonus.elements.sh new file mode 100755 index 000000000..8a3c8b597 --- /dev/null +++ b/home.admin/config.scripts/bonus.elements.sh @@ -0,0 +1,306 @@ +#!/bin/bash + +# set version (change if update is available) +# https://github.com/ElementsProject/elements/releases +VERSION="elements-23.2.1" +SIG_PUBKEY="BD0F3062F87842410B06A0432F656B0610604482" # Pablo Greco + +# command info +if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then + echo + echo "bonus.elements.sh install" + echo "bonus.elements.sh [on|off]" + echo "bonus.elements.sh addI2pSeedNodes" + echo "Installs $VERSION by default" + echo + exit 1 +fi + +echo "# Running: bonus.elements.sh $*" + +source /mnt/hdd/raspiblitz.conf +# elementslogpath +elementslogpath="/home/elements/.elements/liquidv1/debug.log" + +function addAlias { + echo "# Add aliases elements-cli, elementslog" + sudo -u admin touch /home/admin/_aliases + if ! grep "alias elements-cli" /home/admin/_aliases; then + echo "alias elements-cli=\"sudo -u elements /usr/local/bin/elements-cli -conf=/home/elements/.elements/elements.conf\"" | + sudo tee -a /home/admin/_aliases + fi + if ! grep "alias elementslog" /home/admin/_aliases; then + echo "alias elementslog=\"sudo -u elements tail -n 30 -f ${elementslogpath}\"" | + sudo tee -a /home/admin/_aliases + fi + if ! grep "alias elementsconf" /home/admin/_aliases; then + echo "alias elementsconf=\"sudo nano /home/elements/.elements/elements.conf\"" | + sudo tee -a /home/admin/_aliases + fi + sudo chown admin:admin /home/admin/_aliases +} + +function installBinary { + echo "*** PREPARING ELEMENTS ***" + sudo adduser --system --group --shell /bin/bash --home /home/elements elements + # copy the skeleton files for login + sudo -u elements cp -r /etc/skel/. /home/elements/ + + # add to tor group + sudo adduser elements debian-tor + + # prepare directories + sudo rm -rf /home/admin/download + sudo -u admin mkdir -p /home/admin/download/elements + cd /home/admin/download/elements || exit 1 + + echo "# Receive signer key" + gpg --recv-key ${SIG_PUBKEY} || exit 1 + + # download signed binary sha256 hash sum file + sudo -u admin wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS https://github.com/ElementsProject/elements/releases/download/${VERSION}/SHA256SUMS + # download the signed binary sha256 hash sum file and check + sudo -u admin wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS.asc https://github.com/ElementsProject/elements/releases/download/${VERSION}/SHA256SUMS.asc + + if gpg --verify SHA256SUMS.asc; then + echo + echo "****************************************" + echo "OK --> ELEMENTS MANIFEST IS CORRECT" + echo "****************************************" + echo + else + echo + echo "# BUILD FAILED --> the PGP verification failed" + exit 1 + fi + + # elementsOSversion + if [ "$(uname -m | grep -c 'arm')" -gt 0 ]; then + elementsOSversion="arm-linux-gnueabihf" + elif [ "$(uname -m | grep -c 'aarch64')" -gt 0 ]; then + elementsOSversion="aarch64-linux-gnu" + elif [ "$(uname -m | grep -c 'x86_64')" -gt 0 ]; then + elementsOSversion="x86_64-linux-gnu" + fi + + echo + echo "*** ELEMENTS v${VERSION} for ${elementsOSversion} ***" + + # download resources + binaryName="${VERSION}-${elementsOSversion}.tar.gz" + if [ ! -f "./${binaryName}" ]; then + echo "# Downloading https://github.com/ElementsProject/elements/releases/download/${VERSION}/${binaryName} ..." + sudo -u admin wget --quiet https://github.com/ElementsProject/elements/releases/download/${VERSION}/${binaryName} + fi + if [ ! -f "./${binaryName}" ]; then + echo "# FAIL # Could not download the ELEMENTS BINARY" + exit 1 + else + + # check binary checksum test + echo "- checksum test" + # get the sha256 value for the corresponding platform from signed hash sum file + elementsSHA256=$(grep -i "${binaryName}" SHA256SUMS | cut -d " " -f1) + binaryChecksum=$(sha256sum ${binaryName} | cut -d " " -f1) + echo "Valid SHA256 checksum should be: ${elementsSHA256}" + echo "Downloaded binary SHA256 checksum: ${binaryChecksum}" + if [ "${binaryChecksum}" != "${elementsSHA256}" ]; then + echo "# FAIL # Downloaded ELEMENTS BINARY not matching SHA256 checksum: ${elementsSHA256}" + rm -v ./${binaryName} + exit 1 + else + echo + echo "********************************************" + echo "OK --> VERIFIED ELEMENTS BINARY CHECKSUM" + echo "********************************************" + echo + sleep 10 + echo + fi + fi + + # install + sudo -u admin tar -xvf ${binaryName} + sudo install -m 0755 -o root -g root -t /usr/local/bin/ ${VERSION}/bin/* + sleep 3 + if ! sudo /usr/local/bin/elementsd --version | grep "Elements Core version"; then + echo + echo "# BUILD FAILED --> Was not able to install ${VERSION}" + exit 1 + fi + + addAlias + + echo "- Elements install OK" +} + +function removeService() { + if [ -f "/etc/systemd/system/elementsd.service" ]; then + /usr/local/bin/elements-cli stop + sudo systemctl stop elementsd + sudo systemctl disable elementsd + sudo rm /etc/systemd/system/elementsd.service 2>/dev/null + echo "# Elements service is stopped and disabled" + fi +} + +function installService() { + echo "# Prepare directories" + # symlink to elements home + sudo mkdir -p /mnt/hdd/app-data/.elements + # symlink + sudo rm -rf /home/elements/.elements # clean first + sudo ln -s /mnt/hdd/app-data/.elements /home/elements/ + sudo chown -R elements:elements /mnt/hdd/app-data/.elements + sudo chown -R elements:elements /home/elements/ + + echo "# Installing Elements" + # elements.conf + if [ ! -f /home/elements/.elements/elements.conf ]; then + PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-) + echo " +# Elementsd configuration +datadir=/mnt/hdd/app-data/.elements +rpcuser=raspiblitz +rpcpassword=$PASSWORD_B +rpcbind=127.0.0.1 + +# Bitcoin Core credentials +mainchainrpcuser=raspibolt +mainchainrpcpassword=$PASSWORD_B + +# Peer connection settings +onlynet=onion +proxy=127.0.0.1:9050 +debug=tor + +onlynet=i2p +i2psam=127.0.0.1:7656 +i2pacceptincoming=1 +debug=i2p + +# initial sync does not work without clearnet +# disable when synced +onlynet=ipv4 +onlynet=ipv6 +" | sudo -u elements tee /home/elements/.elements/elements.conf + else + echo "# /home/elements/.elements/elements.conf is present" + fi + + removeService + + # /etc/systemd/system/elementsd.service + # based on https://github.com/elements/elements/blob/master/contrib/init/elementsd.service + echo " +[Unit] +Description=Elements daemon + +[Service] +Environment='MALLOC_ARENA_MAX=1' +ExecStart=/usr/local/bin/elementsd -daemonwait -conf=/mnt/hdd/app-data/.elements/elements.conf +PermissionsStartOnly=true + +# Process management +#################### +Type=forking +Restart=on-failure +TimeoutStartSec=infinity +TimeoutStopSec=600 + +# Directory creation and permissions +#################################### +# Run as elements:elements +User=elements +Group=elements + +StandardOutput=null +StandardError=journal + +# Hardening measures +#################### +# Provide a private /tmp and /var/tmp. +PrivateTmp=true +# Mount /usr, /boot/ and /etc read-only for the process. +ProtectSystem=full +# Deny access to /home, /root and /run/user +ProtectHome=true +# Disallow the process and all of its children to gain +# new privileges through execve(). +NoNewPrivileges=true +# Use a new /dev namespace only populated with API pseudo devices +# such as /dev/null, /dev/zero and /dev/random. +PrivateDevices=true +# Deny the creation of writable and executable memory mappings. +MemoryDenyWriteExecute=true + +[Install] +WantedBy=multi-user.target +" | sudo tee /etc/systemd/system/elementsd.service + sudo systemctl daemon-reload + sudo systemctl enable elementsd + echo "# OK - the elementsd.service is now enabled" + + addAlias + + source <(/home/admin/_cache.sh get state) + + if [ "${state}" == "ready" ]; then + echo "# OK - the elementsd.service is enabled, system is ready so starting service" + sudo systemctl start elementsd + else + echo "# OK - the elementsdservice is enabled, to start manually use:" + echo "sudo systemctl start elementsd" + fi + + isInstalled=$(systemctl status elementsd | grep -c active) + if [ $isInstalled -gt 0 ]; then + echo "# Installed $(sudo -u elements elementsd --version | grep version)" + echo + echo "# Monitor the elementsd with:" + echo "# sudo tail -f /home/elements/.elements/debug.log" + echo + else + echo "# Installation failed" + echo "# See:" + echo "# sudo journalctl -fu elementsd" + exit 1 + fi +} + +# install +if [ "$1" = "install" ]; then + + installBinary + + exit 0 + +# switch on +elif [ "$1" = "1" ] || [ "$1" = "on" ]; then + if [ ! -f /usr/local/bin/elementsd ] || [ ! -d /home/elements ]; then + + installBinary + + fi + + installService + + # setting value in raspiblitz.conf + /home/admin/config.scripts/blitz.conf.sh set elements "on" + exit 0 + +# switch off +elif [ "$1" = "0" ] || [ "$1" = "off" ]; then + echo "# Uninstall Elements" + + removeService + + sudo userdel -rf elements + # setting value in raspiblitz.conf + /home/admin/config.scripts/blitz.conf.sh set elements "off" + exit 0 +fi + +echo "# FAIL - Unknown Parameter $1" +echo "# may need reboot to run" +exit 1 From af85242be5b4d08d9267f40fc973ec0fb0d4883f Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Wed, 29 May 2024 17:05:46 +0200 Subject: [PATCH 20/59] Add charge-lnd bonus script (#4594) * Add charge-lnd bonus script --- CHANGES.md | 5 +- home.admin/config.scripts/bonus.charge-lnd.sh | 138 ++++++++++++++++++ 2 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 home.admin/config.scripts/bonus.charge-lnd.sh diff --git a/CHANGES.md b/CHANGES.md index e481cf950..efbf63481 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,11 +1,12 @@ ## What's new in Version 1.11.1 of RaspiBlitz? -- New: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) -- New: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) - Update: LNbits 0.12.8 [details](https://github.com/lnbits/lnbits/releases/tag/0.12.8) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Update: BTCPayServer 1.13.0 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.0) - Update: acme.sh 3.0.7 (repair duckdns.org dyndns) +- Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955) +- Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) +- Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) diff --git a/home.admin/config.scripts/bonus.charge-lnd.sh b/home.admin/config.scripts/bonus.charge-lnd.sh new file mode 100644 index 000000000..429c6f086 --- /dev/null +++ b/home.admin/config.scripts/bonus.charge-lnd.sh @@ -0,0 +1,138 @@ +#!/bin/bash + +# command info +if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then + echo "# Switch charge-lnd on or off (experimental feature)" + echo "# needs to be switched on manually after every RaspiBlitz update/recovery for now" + echo "# config is stored in /mnt/hdd/app-data/charge-lnd/charge.config" + echo "# feedback: https://github.com/raspiblitz/raspiblitz/discussions/3955" + echo "# bonus.charge-lnd.sh [on|off]" + exit 1 +fi + +# switch on +if [ "$1" = "1" ] || [ "$1" = "on" ]; then + + # check if charge-lnd is already installed + isInstalled=$(sudo ls /etc/systemd/system/charge-lnd.service 2>/dev/null | grep -c 'charge-lnd.service') + if [ $isInstalled -gt 1 ]; then + echo "err='charge-lnd is already installed.'" + exit 1 + fi + + # install charge-lnd + echo "# Installing charge-lnd ..." + cd /home/bitcoin + sudo -u bitcoin git clone https://github.com/accumulator/charge-lnd.git + cd charge-lnd || exit 1 + export CHARGE_LND_ENV=/home/bitcoin/charge-lnd + sudo -u bitcoin python3 -m venv ${CHARGE_LND_ENV} + sudo -u bitcoin ${CHARGE_LND_ENV}/bin/pip3 install -r requirements.txt . + + # check if already a charge-lnd config exists + if [ -f /mnt/hdd/app-data/charge-lnd/charge.config ]; then + echo "# skipping charge-lnd config creation because it already exists." + else + + # setting up charge-lnd config + echo "Setting up charge-lnd config ..." + sudo mkdir -p /mnt/hdd/app-data/charge-lnd + echo " +[discourage-routing-out-of-balance] +chan.max_ratio = 0.1 +chan.min_capacity = 250000 +strategy = static +base_fee_msat = 2000 +fee_ppm = 690 + +[encourage-routing-to-balance] +chan.min_ratio = 0.9 +chan.min_capacity = 250000 +strategy = static +base_fee_msat = 1000 +fee_ppm = 21 + +[default-proportional] +chan.max_ratio = 0.9 +chan.min_ratio = 0.1 +chan.min_capacity = 250000 +strategy = proportional +min_fee_ppm = 21 +max_fee_ppm = 210 +base_fee_msat = 2000 +" | sudo tee /mnt/hdd/app-data/charge-lnd/charge.config + fi + + sudo chmod 770 -R /mnt/hdd/app-data/charge-lnd + sudo chown bitcoin:bitcoin -R /mnt/hdd/app-data/charge-lnd + + # setting up systemd service + echo "# Setting up charge-lnd systemd service ..." + echo " +[Unit] +Description=charge-lnd +After=lnd.service + +[Service] +ExecStart=/home/bitcoin/charge-lnd/bin/charge-lnd -c /mnt/hdd/app-data/charge-lnd/charge.config +User=bitcoin +Group=bitcoin +Type=simple +KillMode=process +TimeoutSec=60 + +[Install] +WantedBy=multi-user.target +" | sudo tee /etc/systemd/system/charge-lnd.service + + # setting up systemd timer for hourly charge-lnd service + echo "# Setting up charge-lnd systemd timer ..." + echo " +[Unit] +Description=Runs charge-lnd every hour + +[Timer] +OnBootSec=5min +OnUnitActiveSec=1h + +[Install] +WantedBy=timers.target +" | sudo tee /etc/systemd/system/charge-lnd.timer + + # enable timer because the service is only needed every hour once + sudo systemctl enable charge-lnd.timer + sudo systemctl start charge-lnd.timer + echo "# To check if timers are running use: sudo systemctl list-timers" + echo "# To check logs use: sudo journalctl -u charge-lnd" + echo "# To edit config: sudo nano /mnt/hdd/app-data/charge-lnd/charge.config" + echo "# Check options: https://github.com/accumulator/charge-lnd/blob/master/README.md" + echo "# feedback: https://github.com/raspiblitz/raspiblitz/discussions/3955" + + echo "# charge-lnd installation done." + exit 0 +fi + +# switch off +if [ "$1" = "0" ] || [ "$1" = "off" ]; then + + # check if charge-lnd is installed + isInstalled=$(sudo ls /etc/systemd/system/charge-lnd.service 2>/dev/null | grep -c 'charge-lnd.service') + if [ $isInstalled -eq 0 ]; then + echo "err='charge-lnd is not installed.'" + exit 1 + fi + + echo "# Removing charge-lnd..." + sudo systemctl stop charge-lnd.timer + sudo systemctl disable charge-lnd.timer + sudo rm /etc/systemd/system/charge-lnd.service + sudo rm /etc/systemd/system/charge-lnd.timer + sudo rm -rf /home/bitcoin/charge-lnd + sudo rm -rf /mnt/hdd/app-data/charge-lnd + + echo "# charge-lnd removal done." + exit 0 +fi + +echo "err='invalid parameter.'" +exit 1 From 1cdfc3e6f61e90d7429415c900deb2bd3a0df2d6 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Wed, 29 May 2024 23:44:05 +0200 Subject: [PATCH 21/59] feat: Add system uptime text to infoBlitz script #4108 (#4600) --- home.admin/00infoBlitz.sh | 4 +++- home.admin/_background.scan.sh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index 443278de3..d7cd1e1c7 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -19,6 +19,7 @@ source <(/home/admin/_cache.sh get \ system_ups_status \ system_ups_battery \ system_cpu_load \ + system_up_text \ system_temp_celsius \ system_temp_fahrenheit \ runBehindTor \ @@ -311,7 +312,8 @@ if [ "${blitzapi}" == "on" ]; then webuiinfo="Web Admin --> http://${internet_localip}" fi -datetime=$(date -R) +datetime=$(date +"%d %b %T %z") +datetime="${datetime} up ${system_up_text}" stty sane sleep 1 diff --git a/home.admin/_background.scan.sh b/home.admin/_background.scan.sh index 88e49c823..b9f2cd5ff 100755 --- a/home.admin/_background.scan.sh +++ b/home.admin/_background.scan.sh @@ -141,7 +141,9 @@ do # uptime just do on every run system_up=$(cat /proc/uptime | grep -o '^[0-9]\+') + system_up_text=$(uptime -p | cut -d ' ' -f 2- | cut -d ',' -f 1 | awk '{print $1 substr($2, 1, 1)}') /home/admin/_cache.sh set system_up "${system_up}" + /home/admin/_cache.sh set system_up_text "${system_up_text}" # cpu load cpu_load=$(w | head -n 1 | cut -d 'v' -f2 | cut -d ':' -f2) From 0351d2fb5e9908db48f8967efc2f7b23e69a2a83 Mon Sep 17 00:00:00 2001 From: geco91 Date: Sun, 9 Jun 2024 19:47:33 +0200 Subject: [PATCH 22/59] #4538 remove CopyStation script (#4611) --- CHANGES.md | 1 + home.admin/00infoLCD.sh | 2 +- home.admin/00raspiblitz.sh | 8 - home.admin/XXcopyStation.sh | 296 ---------------------- home.admin/setup.scripts/eventInfoWait.sh | 6 - 5 files changed, 2 insertions(+), 311 deletions(-) delete mode 100755 home.admin/XXcopyStation.sh diff --git a/CHANGES.md b/CHANGES.md index efbf63481..35f8de30d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ - Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) +- Remove: CopyStation Script [details](https://github.com/raspiblitz/raspiblitz/issues/4538) ## What's new in Version 1.11.0 of RaspiBlitz? diff --git a/home.admin/00infoLCD.sh b/home.admin/00infoLCD.sh index 8a006b935..9ba45188f 100755 --- a/home.admin/00infoLCD.sh +++ b/home.admin/00infoLCD.sh @@ -93,7 +93,7 @@ while : source <(/home/admin/config.scripts/network.aliases.sh getvars) fi - if [ "${setupPhase}" != "done" ] || [ "${state}" == "reboot" ] || [ "${state}" == "shutdown" ] || [ "${state}" == "copytarget" ] || [ "${state}" == "copysource" ] || [ "${state}" == "copystation" ]; then + if [ "${setupPhase}" != "done" ] || [ "${state}" == "reboot" ] || [ "${state}" == "shutdown" ] || [ "${state}" == "copytarget" ] || [ "${state}" == "copysource" ]; then # show status info during boot & setup & repair on LCD if [ "${state}" == "" ]; then diff --git a/home.admin/00raspiblitz.sh b/home.admin/00raspiblitz.sh index f8638cb1d..5240d10ad 100755 --- a/home.admin/00raspiblitz.sh +++ b/home.admin/00raspiblitz.sh @@ -47,14 +47,6 @@ if [ "${copyInProgress}" = "1" ]; then exit fi -# special state: copystation -if [ "${state}" = "copystation" ]; then - echo "Copy Station is Running ..." - echo "reboot to return to normal" - sudo /home/admin/XXcopyStation.sh - exit -fi - ##################################### # SSH MENU LOOP # this loop runs until user exits or diff --git a/home.admin/XXcopyStation.sh b/home.admin/XXcopyStation.sh deleted file mode 100755 index c7980e381..000000000 --- a/home.admin/XXcopyStation.sh +++ /dev/null @@ -1,296 +0,0 @@ -#!/bin/bash - -# command info -if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then - echo "# Turns the RaspiBlitz into HDD CopyStation Mode" - echo "# lightning is deactivated during CopyStationMode" - echo "# reboot RaspiBlitz to set back to normal mode" - exit 1 -fi - -####### CONFIG ############# - -# where to find the BITCOIN data directory (no trailing /) -pathBitcoinBlockchain="/mnt/hdd/bitcoin" - -# where to find the RaspiBlitz HDD template directory (no trailing /) -pathTemplateHDD="/mnt/hdd/app-storage/templateHDD" - -####### SCRIPT ############# - -# check sudo -if [ "$EUID" -ne 0 ]; then - echo "Please run as root (with sudo)" - exit 1 -fi - -# get HDD info -source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status) - -# check if HDD is mounted -if [ ${isMounted} -eq 0 ]; then - echo "error='HDD is not mounted'" - exit 1 -fi - -# check if HDD is big enough -if [ ${hddGigaBytes} -lt 800 ]; then - echo "# To run copy station (+/- 1TB needed)" - echo "error='HDD is too small'" - exit 1 -fi - -# check that path information is valid -if [ -d "$pathBitcoinBlockchain" ]; then - echo "# OK found $pathBitcoinBlockchain" -else - echo "# FAIL path of 'pathBitcoinBlockchain' does not exists: ${pathBitcoinBlockchain}" - echo "error='pathBitcoinBlockchain not found'" - exit 1 -fi - -# make sure that its running in screen -# call with '-foreground' to prevent running in screen -if [ "$1" != "-foreground" ]; then - screenPID=$(screen -ls | grep "copystation" | cut -d "." -f1 | xargs) - if [ ${#screenPID} -eq 0 ]; then - # start copystation in screen - echo "# starting copystation screen session" - screen -S copystation -dm /home/admin/XXcopyStation.sh -foreground - screen -d -r - exit 0 - else - echo "# changing into running copystation screen session" - screen -d -r - exit 0 - fi -fi - -clear -echo "# ******************************" -echo "# RASPIBLITZ COPYSTATION SCRIPT" -echo "# ******************************" -echo -echo "Make sure that no target HDD/SSDs are not connected yet .." -echo -sudo sed -i "s/^state=.*/state=copystation/g" /home/admin/raspiblitz.info 2>/dev/null -sleep 10 - -echo "*** CHECKING CONFIG" - -# check that path information is valid -if [ -d "$pathTemplateHDD" ]; then - echo "# OK found $pathTemplateHDD" -else - echo "# Creating: ${pathTemplateHDD}" - mkdir ${pathTemplateHDD} - chmod 777 ${pathTemplateHDD} -fi - -# make sure that lnd is stopped (if running) -systemctl stop lnd 2>/dev/null -systemctl stop background 2>/dev/null - -# finding system drives (the drives that should not be synced to) -echo "# OK - the following drives detected as the system drive: $datadisk" -echo - -# BASIC IDEA: -# 1. get fresh data from bitcoind --> template data -# 2. detect HDDs -# 3. sync HDDs with template data -# repeat - -echo -echo "*** RUNNING ***" -lastBlockchainUpdateTimestamp=1 -firstLoop=1 - -while : -do - - # reset external data stores (needed because local vars dont work in deeper while loops) - echo "" > /var/cache/raspiblitz/copystationHddsInfoString.tmp - rm /var/cache/raspiblitz/copystationFoundTargets.flag - - ################################################ - # 1. get fresh data from bitcoind for template data (skip on first loop) - - # only execute every 30min - nowTimestamp=$(date +%s) - secondsDiff=$(echo "${nowTimestamp}-${lastBlockchainUpdateTimestamp}" | bc) - echo "# seconds since last update from bitcoind: ${secondsDiff}" - echo - - if [ ${secondsDiff} -gt 3000 ]; then - - echo "******************************" - echo "Bitcoin Blockchain Update" - echo "******************************" - - # stop blockchains - echo "# Stopping Blockchain ..." - systemctl stop bitcoind 2>/dev/null - sleep 10 - - # sync bitcoin - echo "# Syncing Bitcoin to template folder ..." - /home/admin/_cache.sh set message "Updating Template: Bitcoin" - - # make sure the bitcoin directory in template folder exists - if [ ! -d "$pathTemplateHDD/bitcoin" ]; then - echo "# creating the bitcoin subfolder in the template folder" - mkdir ${pathTemplateHDD}/bitcoin - chmod 777 ${pathTemplateHDD}/bitcoin - fi - - # do the sync to the template folder for BITCOIN - rsync -a --info=progress2 --delete ${pathBitcoinBlockchain}/chainstate ${pathBitcoinBlockchain}/blocks ${pathTemplateHDD}/bitcoin - - # restart bitcoind (to let further setup while syncing HDDs) - echo "# Restarting Blockchain ..." - systemctl start bitcoind 2>/dev/null - - # update timer - lastBlockchainUpdateTimestamp=$(date +%s) - fi - - ################################################ - # 2. detect connected HDDs and loop thru them - - echo - echo "**************************************" - echo "SYNCING TEMPLATE -> CONNECTED HDD/SSDs" - echo "**************************************" - sleep 2 - lsblk -o NAME | grep "^[s|v]d" | while read -r detectedDrive ; do - isSystemDrive=$(echo "${datadisk}" | grep -c "${detectedDrive}") - if [ ${isSystemDrive} -eq 0 ]; then - - # remember that disks were found - touch /var/cache/raspiblitz/copystationFoundTargets.flag - - # check if drives 1st partition is named BLOCKCHAIN & in EXT4 format - isNamedBlockchain=$(lsblk -o NAME,FSTYPE,LABEL | grep "${detectedDrive}" | grep -c "BLOCKCHAIN") - isFormatExt4=$(lsblk -o NAME,FSTYPE,LABEL | grep "${detectedDrive}" | grep -c "ext4") - - # init a fresh device - if [ ${isNamedBlockchain} -eq 0 ] || [ ${isFormatExt4} -eq 0 ]; then - - echo - echo "**************************************************************" - echo "*** NEW EMPTY HDD FOUND ---> ${detectedDrive}" - echo "isNamedBlockchain: ${isNamedBlockchain}" - echo "isFormatExt4:" ${isFormatExt4} - - # check if size is OK - size=$(lsblk -o NAME,SIZE -b | grep "^${detectedDrive}" | awk '$1=$1' | cut -d " " -f 2) - echo "size: ${size}" - if [ ${size} -lt 900000000000 ]; then - echo "# THE HDD/SSD IS TOO SMALL <900GB - use at least 1TB" - /home/admin/_cache.sh set message "HDD smaller than 1TB: ${detectedDrive}" - echo - sleep 10 - else - - choice=0 - /home/admin/_cache.sh set message "Formatting new HDD: ${detectedDrive}" - - # format the HDD - echo "Starting Formatting of device ${detectedDrive} ..." - /home/admin/config.scripts/blitz.datadrive.sh format ext4 ${detectedDrive} - sleep 4 - - fi - - else - echo - echo "*** ALREADY ACTIVE HDD FOUND ---> ${detectedDrive}" - sleep 1 - fi - - ################################################ - # 3. sync HDD with template data (skip on first loop) - - partition=$(lsblk -o NAME,FSTYPE,LABEL | grep "${detectedDrive}" | grep "BLOCKCHAIN" | cut -d ' ' -f 1 | tr -cd "[:alnum:]") - if [ "${firstLoop}" != "1" ] && [ ${#partition} -gt 0 ]; then - - # temp mount device - echo "mounting: ${partition}" - mkdir /mnt/hdd2 2>/dev/null - mount -t ext4 /dev/${partition} /mnt/hdd2 - - # rsync device - mountOK=$(lsblk -o NAME,MOUNTPOINT | grep "${detectedDrive}" | grep -c "/mnt/hdd2") - if [ ${mountOK} -eq 1 ]; then - hddsInfoString=$(cat /var/cache/raspiblitz/copystationHddsInfoString.tmp | tr '\n' ' ') - /home/admin/_cache.sh set message "${hddsInfoString} ${partition}>SYNC" - rsync -a --info=progress2 --delete ${pathTemplateHDD}/* /mnt/hdd2 - chmod -R 777 /mnt/hdd2 - rm -r /mnt/hdd2/lost+found 2>/dev/null - echo "${partition}>OK" >> /var/cache/raspiblitz/copystationHddsInfoString.tmp - else - echo "# FAIL: was not able to mount --> ${partition}" - fi - - # unmount device - umount -l /mnt/hdd2 - - fi - - fi - done - - # check for flag - foundTargets=$(ls /var/cache/raspiblitz/copystationFoundTargets.flag 2>/dev/null | grep -c "copystationFoundTargets.flag") - hddsInfoString=$(cat /var/cache/raspiblitz/copystationHddsInfoString.tmp | tr '\n' ' ') - - clear - if [ "${foundTargets}" == "1" ] && [ "${firstLoop}" == "1" ]; then - - # after script found discs and did formatting ... go into full loop - echo "OK first loop done ..." - firstLoop=0 - sleep 1 - - elif [ "${foundTargets}" == "0" ]; then - - echo "**** NO TARGET HDD/SSDs CONNECTED ****" - echo - echo "Best way to start a new batch:" - echo "- Disconnect powered USB-Hub (best unplug USB cable at USB-Hub)" - echo "- Connect all HDD/SSDs to the disconnected USB-Hub" - echo "- Connect powered USB-Hub to Blitz (plug USB cable in)" - echo "- During formatting remember names of physical HDD/SSDs" - echo "- As soon as you see an OK for that HDD/SSD name you can remove it" - echo - echo "Next round starts in 30 seconds ..." - echo "To stop copystation script: CTRL+c and then 'restart'" - echo "You can close SSH terminal and script will run in background can can be re-entered." - - /home/admin/_cache.sh set message "No target HDDs connected - connect USB Hub" - firstLoop=1 - sleep 30 - - else - - echo "**** SYNC LOOP DONE ****" - echo "HDDs ready synced:" - cat /var/cache/raspiblitz/copystationHddsInfoString.tmp - echo - echo "*************************" - echo - echo "Next round starts in 25 seconds ..." - echo "To stop copystation script: CTRL+c and then 'restart'" - echo "You can close SSH terminal and script will run in background can can be re-entered." - - /home/admin/_cache.sh set message "Ready HDDs: ${hddsInfoString}" - sleep 25 - - fi - - clear - echo "starting new sync loop" - sleep 5 - -done \ No newline at end of file diff --git a/home.admin/setup.scripts/eventInfoWait.sh b/home.admin/setup.scripts/eventInfoWait.sh index f57907804..b104a2f26 100644 --- a/home.admin/setup.scripts/eventInfoWait.sh +++ b/home.admin/setup.scripts/eventInfoWait.sh @@ -147,12 +147,6 @@ ssh admin@${internet_localip} Use your Password A " 7 41 -elif [ "${eventID}" == "copystation" ] && [ "${mode}" == "lcd" ]; then - - dialog --backtitle "${backtitle}" --title " Copy-Station Mode " --cr-wrap --infobox " -${contentString}" 7 41 - - elif [ "${eventID}" == "walletlocked" ] && [ "${mode}" == "lcd" ]; then dialog --backtitle "${backtitle}" --cr-wrap --infobox " From 500e26d5002c6cb8c4a0fed6cf6ef913e20a67ed Mon Sep 17 00:00:00 2001 From: geco91 Date: Sun, 9 Jun 2024 19:54:48 +0200 Subject: [PATCH 23/59] #2314 Update lndmanage to v0.16.0 (#4612) * #2314 update lndmanage v0.16.0 * add CHANGES info --- CHANGES.md | 1 + home.admin/config.scripts/bonus.lndmanage.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 35f8de30d..62f8e1873 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Update: BTCPayServer 1.13.0 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.0) - Update: acme.sh 3.0.7 (repair duckdns.org dyndns) +- Update: lndmanage 0.16.0 [details](https://github.com/bitromortac/lndmanage) - Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955) - Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) diff --git a/home.admin/config.scripts/bonus.lndmanage.sh b/home.admin/config.scripts/bonus.lndmanage.sh index a4791fbd3..e465e508c 100755 --- a/home.admin/config.scripts/bonus.lndmanage.sh +++ b/home.admin/config.scripts/bonus.lndmanage.sh @@ -9,7 +9,7 @@ fi # set version of LND manage to install # https://github.com/bitromortac/lndmanage/releases -lndmanageVersion="0.15.0" +lndmanageVersion="0.16.0" pgpKeyDownload="https://github.com/bitromortac.gpg" gpgFingerprint="0453B9F5071261A40FDB34181965063FC13BEBE2" From 4388da48595f1feceb5ca13cba1a3697496e2639 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Sun, 9 Jun 2024 19:58:54 +0200 Subject: [PATCH 24/59] ask before reboot in UPDATE menu (#4606) * ask before reboot in UPDATE menu * correct comments --- home.admin/99updateMenu.sh | 115 +++++++++++++++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 5 deletions(-) diff --git a/home.admin/99updateMenu.sh b/home.admin/99updateMenu.sh index 149159954..4cdbb3b36 100755 --- a/home.admin/99updateMenu.sh +++ b/home.admin/99updateMenu.sh @@ -269,7 +269,28 @@ Do you really want to update LND now? if [ ${#error} -gt 0 ]; then whiptail --title "ERROR" --msgbox "${error}" 8 30 else - sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + whiptail \ + --title " LND update " \ + --yes-button "Reboot" \ + --no-button "Skip Reboot" \ + --yesno \ +"OK LND update is done. + +By default a reboot is advised to sync macaroons and the TLS certificate. +Consider rebooting later manually if encountering any problems. + " 12 50 + if [ $? -eq 0 ]; then + clear + echo "# REBOOT .." + sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + sleep 8 + exit 1 + else + echo "# SKIP REBOOT" + echo "# starting the lnd.service .." + sudo systemctl start lnd + exit 0 + fi sleep 8 fi ;; @@ -293,7 +314,28 @@ Do you really want to update LND now? if [ ${#error} -gt 0 ]; then whiptail --title "ERROR" --msgbox "${error}" 8 30 else - sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + whiptail \ + --title " LND update " \ + --yes-button "Reboot" \ + --no-button "Skip Reboot" \ + --yesno \ +"OK LND update is done. + +By default a reboot is advised to sync macaroons and the TLS certificate. +Consider rebooting later manually if encountering any problems. + " 12 50 + if [ $? -eq 0 ]; then + clear + echo "# REBOOT .." + sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + sleep 8 + exit 1 + else + echo "# SKIP REBOOT" + echo "# starting the lnd.service .." + sudo systemctl start lnd + exit 0 + fi sleep 8 fi ;; @@ -418,7 +460,28 @@ Do you really want to update Bitcoin Core now? error="" warn="" sudo -u admin /home/admin/config.scripts/bitcoin.update.sh tested - sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + whiptail \ + --title " Bitcoin Core update " \ + --yes-button "Reboot" \ + --no-button "Skip Reboot" \ + --yesno \ +"OK Bitcoin Core update is done. + +By default a reboot is advised. + " 9 40 + if [ $? -eq 0 ]; then + clear + echo "# REBOOT .." + sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + sleep 8 + exit 1 + else + echo "# SKIP REBOOT" + echo "# starting the bitcoind.service .." + sudo systemctl start bitcoind + exit 0 + fi + sleep 8 ;; RECKLESS) whiptail --title "UNTESTED Bitcoin Core update to ${bitcoinLatestVersion}" --yes-button "Cancel" \ @@ -439,11 +502,53 @@ Do you really want to update Bitcoin Core now? if [ ${#error} -gt 0 ]; then whiptail --title "ERROR" --msgbox "${error}" 8 30 fi - sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + whiptail \ + --title " Bitcoin Core update " \ + --yes-button "Reboot" \ + --no-button "Skip Reboot" \ + --yesno \ +"OK Bitcoin Core update is done. + +By default a reboot is advised. + " 9 40 + if [ $? -eq 0 ]; then + clear + echo "REBOOT .." + sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + sleep 8 + exit 1 + else + echo "# SKIP REBOOT" + echo "# starting the bitcoind.service .." + sudo systemctl start bitcoind + exit 0 + fi + sleep 8 ;; CUSTOM) sudo -u admin /home/admin/config.scripts/bitcoin.update.sh custom - sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + whiptail \ + --title " Bitcoin Core update " \ + --yes-button "Reboot" \ + --no-button "Skip Reboot" \ + --yesno \ +"OK Bitcoin Core update is done. + +By default a reboot is advised. + " 9 40 + if [ $? -eq 0 ]; then + clear + echo "# REBOOT .." + sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + sleep 8 + exit 1 + else + echo "# SKIP REBOOT" + echo "# starting the bitcoind.service .." + sudo systemctl start bitcoind + exit 0 + fi + sleep 8 ;; esac } From 0df22b05049bc9847b8215bc0bc51c941d27152c Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Sun, 9 Jun 2024 22:10:47 +0200 Subject: [PATCH 25/59] #4554 Deactivate Touchscreen Option in SSH Menu (#4609) #4554 in menu deactivate touchscreen Deactivate touchscreen provisioning script --- home.admin/00settingsMenuBasics.sh | 2 +- home.admin/_provision_.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/home.admin/00settingsMenuBasics.sh b/home.admin/00settingsMenuBasics.sh index 5b208474c..81806f85f 100755 --- a/home.admin/00settingsMenuBasics.sh +++ b/home.admin/00settingsMenuBasics.sh @@ -119,7 +119,7 @@ OPTIONS+=(A 'Blitz API + WebUI' ${blitzapi}) # LCD options (only when running with LCD screen) if [ "${displayClass}" == "lcd" ]; then - OPTIONS+=(s 'Touchscreen (experimental)' ${touchscreenMenu}) + # OPTIONS+=(s 'Touchscreen (experimental)' ${touchscreenMenu}) OPTIONS+=(r 'LCD Rotate' ${lcdrotateMenu}) fi diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index bc6696a26..0f17e8d51 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -547,14 +547,14 @@ else echo "Provisioning LCD rotate - not needed, keep default rotate on" >> ${logFile} fi -# TOUCHSCREEN -if [ "${#touchscreen}" -gt 0 ]; then - echo "Provisioning Touchscreen - run config script" >> ${logFile} - /home/admin/_cache.sh set message "Setup Touchscreen" - /home/admin/config.scripts/blitz.touchscreen.sh ${touchscreen} >> ${logFile} 2>&1 -else - echo "Provisioning Touchscreen - not active" >> ${logFile} -fi +# TOUCHSCREEN - deactivated see https://github.com/raspiblitz/raspiblitz/pull/4609#issuecomment-2144406124 +# if [ "${#touchscreen}" -gt 0 ]; then +# echo "Provisioning Touchscreen - run config script" >> ${logFile} +# /home/admin/_cache.sh set message "Setup Touchscreen" +# /home/admin/config.scripts/blitz.touchscreen.sh ${touchscreen} >> ${logFile} 2>&1 +# else +# echo "Provisioning Touchscreen - not active" >> ${logFile} +# fi # UPS if [ "${#ups}" -gt 0 ]; then From 8e6e92b37c5e8d2d3bc2a3ccb02d582f1d572c39 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Sun, 9 Jun 2024 22:20:37 +0200 Subject: [PATCH 26/59] #4541 remove text (#4608) --- home.admin/_bootstrap.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index e2a1eb35f..1b2a77eed 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -1019,7 +1019,6 @@ if [ ${isMounted} -eq 0 ]; then # system has to wait before reboot to present like seed words and other info/options to user echo "BOOTSTRAP EXIT ... waiting for final setup controller to initiate final reboot." >> $logFile - echo "------------> You may login thru web browser to continue setup." >> $logFile exit 1 else From 513c759e5c96ae7bb054d17c04b8f1396edaed6d Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Sun, 9 Jun 2024 22:21:08 +0200 Subject: [PATCH 27/59] #1953 Remove autopilot & keysend from SSH menus (#4605) * #1953 remove autopilot and keysend from menus * add to CHANGES --- CHANGES.md | 1 + home.admin/00settingsMenuBasics.sh | 44 -------------- home.admin/97addMobileWallet.sh | 6 +- home.admin/_provision.update.sh | 7 --- home.admin/_provision_.sh | 13 ++-- .../config.scripts/bonus.sphinxrelay.sh | 7 ++- home.admin/config.scripts/lnd.autopilot.sh | 60 ------------------- home.admin/config.scripts/lnd.check.sh | 5 -- home.admin/config.scripts/lnd.keysend.sh | 49 --------------- 9 files changed, 14 insertions(+), 178 deletions(-) delete mode 100755 home.admin/config.scripts/lnd.autopilot.sh delete mode 100755 home.admin/config.scripts/lnd.keysend.sh diff --git a/CHANGES.md b/CHANGES.md index 62f8e1873..f486b7079 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ - Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955) - Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) +- Remove: AutoPilot & Keysend from SSH menus [details](https://github.com/raspiblitz/raspiblitz/issues/1953#issuecomment-1811553602) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) - Remove: CopyStation Script [details](https://github.com/raspiblitz/raspiblitz/issues/4538) diff --git a/home.admin/00settingsMenuBasics.sh b/home.admin/00settingsMenuBasics.sh index 81806f85f..4ed56cafd 100755 --- a/home.admin/00settingsMenuBasics.sh +++ b/home.admin/00settingsMenuBasics.sh @@ -6,7 +6,6 @@ source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf echo "services default values" -if [ ${#autoPilot} -eq 0 ]; then autoPilot="off"; fi if [ ${#autoUnlock} -eq 0 ]; then autoUnlock="off"; fi if [ ${#runBehindTor} -eq 0 ]; then runBehindTor="off"; fi if [ ${#networkUPnP} -eq 0 ]; then networkUPnP="off"; fi @@ -70,14 +69,6 @@ if [ ${touchscreen} -gt 0 ]; then touchscreenMenu='on' fi -echo "# map autopilot to on/off" -lndAutoPilotOn=$(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep -c 'autopilot.active=1') -if [ ${lndAutoPilotOn} -eq 1 ]; then - autoPilot="on" -else - autoPilot="off" -fi - echo "# map clboss to on/off" clbossMenu='off' if [ "${clboss}" == "on" ]; then @@ -102,13 +93,6 @@ if [ "${clWatchtowerClient}" == "on" ]; then clWatchtowerClientMenu='on' fi -echo "# map keysend to on/off (may take time)" -keysend="on" -source <(sudo /home/admin/config.scripts/lnd.keysend.sh status) -if [ ${keysendOn} -eq 0 ]; then - keysend="off" -fi - # show select dialog echo "run dialog ..." @@ -143,8 +127,6 @@ fi # LND & options (only when running LND) OPTIONS+=(m 'LND LIGHTNING LABS NODE' ${lndNode}) if [ "${lndNode}" == "on" ]; then - OPTIONS+=(a '-LND Channel Autopilot' ${autoPilot}) - OPTIONS+=(k '-LND Accept Keysend' ${keysend}) OPTIONS+=(c '-LND Circuitbreaker (firewall)' ${circuitbreaker}) OPTIONS+=(u '-LND Auto-Unlock' ${autoUnlock}) fi @@ -198,18 +180,6 @@ else echo "Blitz API + webUI Setting unchanged." fi -# LND AUTOPILOT process choice -choice="off"; check=$(echo "${CHOICES}" | grep -c "a") -if [ ${check} -eq 1 ]; then choice="on"; fi -if [ "${autoPilot}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then - echo "Autopilot Setting changed .." - anychange=1 - sudo /home/admin/config.scripts/lnd.autopilot.sh ${choice} - needsReboot=1 -else - echo "Autopilot Setting unchanged." -fi - # Dynamic Domain choice="off"; check=$(echo "${CHOICES}" | grep -c "y") if [ ${check} -eq 1 ]; then choice="on"; fi @@ -355,20 +325,6 @@ else echo "BackupdDevice setting unchanged." fi -# LND Keysend process choice -choice="off"; check=$(echo "${CHOICES}" | grep -c "k") -if [ ${check} -eq 1 ]; then choice="on"; fi -if [ "${keysend}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then - echo "keysend setting changed .." - anychange=1 - sudo -u admin /home/admin/config.scripts/lnd.keysend.sh ${choice} - sudo systemctl restart lnd - dialog --msgbox "Accept Keysend on LND mainnet is now ${choice}.\n\nLND restarted - you might need to unlock wallet." 7 52 - sudo -u admin /home/admin/config.scripts/lnd.unlock.sh -else - echo "keysend setting unchanged." -fi - # ZeroTier process choice choice="off"; check=$(echo "${CHOICES}" | grep -c "z") if [ ${check} -eq 1 ]; then choice="on"; fi diff --git a/home.admin/97addMobileWallet.sh b/home.admin/97addMobileWallet.sh index a85ffca17..a7f6f4557 100755 --- a/home.admin/97addMobileWallet.sh +++ b/home.admin/97addMobileWallet.sh @@ -147,12 +147,12 @@ Or scan the qr code on the LCD with your mobile phone. SENDMANY_ANDROID) # check if keysend is activated first - source <(/home/admin/config.scripts/lnd.keysend.sh status) + keysendOn=$(cat /mnt/hdd/lnd/lnd.conf | grep -c '^accept-keysend=1') if [ "${keysendOn}" == "0" ]; then - whiptail --title " KEYSEND NEEDED " --msgbox " + whiptail --title " LND KEYSEND NEEDED " --msgbox " To use the chat feature of the SendMany app, you need to activate the Keysend feature first. -Please go to MAINMENU > SERVICES and activate KEYSEND first. +Please go to MAINMENU > SYSTEM > LNDCONF and set accept-keysend=1 first. " 12 65 exit 0 fi diff --git a/home.admin/_provision.update.sh b/home.admin/_provision.update.sh index c567cc136..c3f7b5650 100755 --- a/home.admin/_provision.update.sh +++ b/home.admin/_provision.update.sh @@ -183,13 +183,6 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then # prepare lnd service cp /home/admin/assets/lnd.service /etc/systemd/system/lnd.service >> ${logFile} 2>&1 - # convert old keysend by lndExtraParameter to raspiblitz.conf setting (will be enforced by lnd.check.sh prestart) since 1.7.1 - if [ "${lndExtraParameter}" == "--accept-keysend" ]; then - echo "# MIGRATION KEYSEND from lndExtraParameter --> raspiblitz.conf" >> ${logFile} - /home/admin/config.scripts/blitz.conf.sh set lndKeysend "on" - /home/admin/config.scripts/blitz.conf.sh delete lndExtraParameter - fi - # if old lnd.conf exists ... configExists=$(sudo ls /mnt/hdd/lnd/lnd.conf | grep -c '.conf') if [ ${configExists} -eq 1 ]; then diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index 0f17e8d51..816c2eb6e 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -363,15 +363,6 @@ else echo "Provisioning Tor - keep default" >> ${logFile} fi -# AUTO PILOT -if [ "${autoPilot}" = "on" ]; then - echo "Provisioning AUTO PILOT - run config script" >> ${logFile} - /home/admin/_cache.sh set message "Setup AutoPilot" - /home/admin/config.scripts/lnd.autopilot.sh on >> ${logFile} 2>&1 -else - echo "Provisioning AUTO PILOT - keep default" >> ${logFile} -fi - # NETWORK UPNP if [ "${networkUPnP}" = "on" ]; then echo "Provisioning NETWORK UPnP - run config script" >> ${logFile} @@ -798,6 +789,10 @@ echo "Start i2pd" >> ${logFile} /home/admin/_cache.sh set message "i2pd setup" /home/admin/config.scripts/blitz.i2pd.sh on >> ${logFile} +# clean up raspiblitz config from old settings +sed -i '/^autoPilot=/d' /mnt/hdd/raspiblitz.conf +sed -i '/^lndKeysend=/d' /mnt/hdd/raspiblitz.conf + # signal setup done /home/admin/_cache.sh set message "Setup Done" diff --git a/home.admin/config.scripts/bonus.sphinxrelay.sh b/home.admin/config.scripts/bonus.sphinxrelay.sh index c565fb76a..420edfc01 100755 --- a/home.admin/config.scripts/bonus.sphinxrelay.sh +++ b/home.admin/config.scripts/bonus.sphinxrelay.sh @@ -384,7 +384,12 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then /home/admin/config.scripts/bonus.nodejs.sh on # make sure keysend is on - /home/admin/config.scripts/lnd.keysend.sh on + keysendOn=$(cat /mnt/hdd/lnd/lnd.conf | grep -c '^accept-keysend=1') + if [ "${keysendOn}" == "0" ]; then + echo "ERR: keysend is not activated in LND" + echo "Activate it in the LND config and restart LND" + exit 1 + fi echo "*** Add the 'sphinxrelay' user ***" sudo adduser --system --group --home /home/sphinxrelay sphinxrelay diff --git a/home.admin/config.scripts/lnd.autopilot.sh b/home.admin/config.scripts/lnd.autopilot.sh deleted file mode 100755 index 34814b0c6..000000000 --- a/home.admin/config.scripts/lnd.autopilot.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -if [ $# -eq 0 ]; then - echo "small config script to switch the LND auto pilot on or off" - echo "lnd.autopilot.sh [on|off]" - exit 1 -fi - -# check lnd.conf exits -lndConfExists=$(sudo ls /mnt/hdd/lnd/lnd.conf | grep -c 'lnd.conf') -if [ ${lndConfExists} -eq 0 ]; then - echo "FAIL - /mnt/hdd/lnd/lnd.conf not found" - exit 1 -fi - -# stop services -echo "making sure services are not running" -sudo systemctl stop lnd 2>/dev/null - -# check if "autopilot.active" exists -valueExists=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c 'autopilot.active=') -if [ ${valueExists} -eq 0 ]; then - echo "Adding autopilot config defaults to /mnt/hdd/lnd/lnd.conf" - sudo sed -i '$ a [autopilot]' /mnt/hdd/lnd/lnd.conf - sudo sed -i '$ a autopilot.active=0' /mnt/hdd/lnd/lnd.conf - sudo sed -i '$ a autopilot.allocation=0.6' /mnt/hdd/lnd/lnd.conf - sudo sed -i '$ a autopilot.maxchannels=5' /mnt/hdd/lnd/lnd.conf -fi - -# add default value to raspi config if needed -source /home/admin/raspiblitz.info -source /mnt/hdd/raspiblitz.conf - -# switch on -if [ "$1" = "1" ] || [ "$1" = "on" ]; then - echo "switching the LND autopilot ON" - echo "editing /mnt/hdd/lnd/lnd.conf" - sudo sed -i "s/^autopilot.active=.*/autopilot.active=1/g" /mnt/hdd/lnd/lnd.conf - echo "editing /mnt/hdd/raspiblitz.conf" - /home/admin/config.scripts/blitz.conf.sh set autoPilot "on" - echo "OK - autopilot is now ON" - echo "needs reboot to activate new setting" - exit 0 -fi - -# switch off -if [ "$1" = "0" ] || [ "$1" = "off" ]; then - echo "switching the LND autopilot OFF" - echo "editing /mnt/hdd/lnd/lnd.conf" - sudo sed -i "s/^autopilot.active=.*/autopilot.active=0/g" /mnt/hdd/lnd/lnd.conf - echo "editing /mnt/hdd/raspiblitz.conf" - /home/admin/config.scripts/blitz.conf.sh set autoPilot "off" - echo "OK - autopilot is now OFF" - echo "needs reboot to activate new setting" - exit 0 -fi - -echo "FAIL - Unknown Parameter $1" -echo "may needs reboot to run normal again" -exit 1 \ No newline at end of file diff --git a/home.admin/config.scripts/lnd.check.sh b/home.admin/config.scripts/lnd.check.sh index ed254d7b2..5d277f39c 100755 --- a/home.admin/config.scripts/lnd.check.sh +++ b/home.admin/config.scripts/lnd.check.sh @@ -213,11 +213,6 @@ if [ "$1" == "prestart" ]; then sed -i '/^externalip=*/d' ${lndConfFile} fi - # enforce LND keysend (if set in raspiblitz.conf) - if [ "${lndKeysend}" == "on" ]; then - setting ${lndConfFile} ${insertLine} "accept-keysend" "true" - fi - ##### BOLT SECTION ##### # https://github.com/lightningnetwork/lnd/blob/0aa0831619cb320dbb74883c37a80ccbdde7f320/sample-lnd.conf#L1205 sectionName="bolt" diff --git a/home.admin/config.scripts/lnd.keysend.sh b/home.admin/config.scripts/lnd.keysend.sh deleted file mode 100755 index 7ba388aee..000000000 --- a/home.admin/config.scripts/lnd.keysend.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# based on: https://github.com/rootzoll/raspiblitz/issues/1000 - -if [ $# -eq 0 ]; then - echo "activate/deactivate LND keysend feature" - echo "lnd.keysend.sh [on|off|status]" - exit 1 -fi - -# note: this script is not run during provision/recovery -# because if the lnd extra parameter is set in raspiblitz.conf, -# it will automatically be used by the service - -source /mnt/hdd/raspiblitz.conf - -parameter=$1 -if [ "${parameter}" == "on" ]; then - - # store to raspiblitz config - /home/admin/config.scripts/blitz.conf.sh delete lndExtraParameter - /home/admin/config.scripts/blitz.conf.sh set lndKeysend "on" - - echo "# OK - keysend feature is switched ON" - echo "# will be enfored by lnd.check.sh prestart" - echo "# LND or RaspiBlitz needs restart" - -elif [ "${parameter}" == "off" ]; then - - # just remove the parameter from the config file - /home/admin/config.scripts/blitz.conf.sh delete lndExtraParameter - /home/admin/config.scripts/blitz.conf.sh delete lndKeysend - sudo sed -i '/accept-keysend=.*/d' /mnt/hdd/lnd/lnd.conf 2>/dev/null - sudo sed -i '/accept-keysend=.*/d' /mnt/hdd/lnd/tlnd.conf 2>/dev/null - sudo sed -i '/accept-keysend=.*/d' /mnt/hdd/lnd/slnd.conf 2>/dev/null - - echo "# OK - keysend enforcement is switched OFF" - echo "# LND or RaspiBlitz needs restart" - -elif [ "${parameter}" == "status" ]; then - - keysendOn=$(sudo cat /mnt/hdd/raspiblitz.conf | grep -c '^lndKeysend=on') - keysendRunning=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c '^accept-keysend\=true') - echo "keysendOn=${keysendOn}" - echo "keysendRunning=${keysendRunning}" - -else - echo "err='unknown parameter'" -fi From 36b38d511897cfefcb4312a73171096e82064b01 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Sun, 9 Jun 2024 22:21:47 +0200 Subject: [PATCH 28/59] #1712 Add setting Timezone (#4604) * #1712 adding blitz.time.sh * Add Info on CHANGES --- CHANGES.md | 1 + home.admin/99systemMenu.sh | 5 ++ home.admin/_provision_.sh | 3 + home.admin/config.scripts/blitz.time.sh | 76 +++++++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100755 home.admin/config.scripts/blitz.time.sh diff --git a/CHANGES.md b/CHANGES.md index f486b7079..52e20d1f5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,6 @@ ## What's new in Version 1.11.1 of RaspiBlitz? +- New: Set Timezone SSHMENU > SYSTEM > TIME [details](https://github.com/raspiblitz/raspiblitz/issues/1712) - Update: LNbits 0.12.8 [details](https://github.com/lnbits/lnbits/releases/tag/0.12.8) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Update: BTCPayServer 1.13.0 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.0) diff --git a/home.admin/99systemMenu.sh b/home.admin/99systemMenu.sh index 1529df77f..89536a0e0 100644 --- a/home.admin/99systemMenu.sh +++ b/home.admin/99systemMenu.sh @@ -16,6 +16,8 @@ MENU="" # adds lines to HEIGHT OPTIONS=() # adds lines to HEIGHt + CHOICE_HEIGHT OPTIONS+=(BTOP "Monitor system resources with btop") +OPTIONS+=(TIME "Set Timezone") + OPTIONS+=(${network}LOG "Monitor the debug.log for ${CHAIN}") OPTIONS+=(${network}CONF "Edit the bitcoin.conf") @@ -57,6 +59,9 @@ case $CHOICE in # run as root to allow signal sending to any process sudo btop ;; + TIME) + sudo /home/admin/config.scripts/blitz.time.sh choose-timezone + ;; ${network}LOG) if [ ${CHAIN} = signet ]; then bitcoinlogpath="/mnt/hdd/bitcoin/signet/debug.log" diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index 816c2eb6e..c12e1b767 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -61,6 +61,9 @@ echo "deprecatedrpc=addresses" >> /mnt/hdd/bitcoin/bitcoin.conf 2>/dev/null # backup SSH PubKeys /home/admin/config.scripts/blitz.ssh.sh backup +# set timezone +/home/admin/config.scripts/blitz.time.sh set-by-config >> ${logFile} + # optimize mempool if RAM >1GB kbSizeRAM=$(cat /proc/meminfo | grep "MemTotal" | sed 's/[^0-9]*//g') if [ ${kbSizeRAM} -gt 1500000 ]; then diff --git a/home.admin/config.scripts/blitz.time.sh b/home.admin/config.scripts/blitz.time.sh new file mode 100755 index 000000000..ae90eb17b --- /dev/null +++ b/home.admin/config.scripts/blitz.time.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash + +# command info +if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then + echo "RaspiBlitz Time Tools" + echo + echo "## Parameters #######" + echo "choose-timezone --> user can choose timezone from list and it gets stored to raspiblitz config" + echo "set-by-config --> resets the time on the RaspiBlitz based on the config" + exit 1 +fi + +# check if started with sudo +if [ "$EUID" -ne 0 ]; then + echo "error='missing sudo'" + exit 1 +fi + +################### +# choose-timezone +################### +if [ "$1" = "choose-timezone" ]; then + + # Prepare the list of timezones for dialog + echo "# preparing timezone list ..." + timezones=$(timedatectl list-timezones) + timezone_list=() + i=1 + for tz in $timezones; do + prefix=$(echo $tz | cut -c1) + timezone_list+=("${prefix}${i}" "$tz") + i=$((i+1)) + done + + # Use dialog to display the list and get the user selection + choice=$(dialog --clear \ + --backtitle "Timezone Selector" \ + --title "Select a Timezone" \ + --menu "Choose a timezone:" 20 60 15 \ + "${timezone_list[@]}" 2>&1 >/dev/tty) + + # Clear the screen + clear + + # Set the chosen timezone + if [ -n "$choice" ]; then + index=$(echo "$choice" | sed 's/^[A-Z]//') + selected_timezone=${timezone_list[((index * 2) - 1)]} + echo "# Setting timezone to $selected_timezone ..." + timedatectl set-timezone "$selected_timezone" + echo "# Saving timezone to raspiblitz config ..." + /home/admin/config.scripts/blitz.conf.sh set "timezone" "$selected_timezone" + else + echo "# No timezone selected" + fi + + sleep 2 + exit 0 +fi + +################### +# set-by-config +################### +if [ "$1" = "set-by-config" ]; then + source /mnt/hdd/raspiblitz.conf + if [ ${#timezone} -eq 0 ]; then + echo "# no timezone set in raspiblitz.conf ... keeping default timezone" + exit 1 + fi + echo "# Setting timezone to $timezone ..." + timedatectl set-timezone "$timezone" + exit 0 +fi + +echo "error='unknown parameter'" +exit 1 From 20650fd3e77e2a365766593780a7c96ba60728e3 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Sun, 9 Jun 2024 22:23:02 +0200 Subject: [PATCH 29/59] #2558 deprecated Sphinx-Relay (#4599) --- CHANGES.md | 1 + home.admin/00settingsMenuServices.sh | 20 ----------- home.admin/_provision_.sh | 28 --------------- .../config.scripts/blitz.subscriptions.py | 34 ------------------- .../config.scripts/bonus.sphinxrelay.sh | 6 +++- 5 files changed, 6 insertions(+), 83 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 52e20d1f5..ffb37f74a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ - Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955) - Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) +- Deprecated: Sphinx-Relay [details](https://github.com/raspiblitz/raspiblitz/issues/2558) - Remove: AutoPilot & Keysend from SSH menus [details](https://github.com/raspiblitz/raspiblitz/issues/1953#issuecomment-1811553602) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index c4122d3ba..8d9d451d2 100755 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -63,7 +63,6 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then OPTIONS+=(oa 'LND Balance of Satoshis' ${bos}) OPTIONS+=(ya 'LND PyBLOCK' ${pyblock}) OPTIONS+=(ha 'LND ChannelTools (Fund Rescue)' ${chantools}) - OPTIONS+=(xa 'LND Sphinx-Relay' ${sphinxrelay}) OPTIONS+=(fa 'LND Helipad Boostagram reader' ${helipad}) OPTIONS+=(lb 'LND LNDK (experimental BOLT 12)' ${lndk}) fi @@ -449,25 +448,6 @@ else echo "LNDg unchanged." fi -# Sphinx Relay -choice="off"; check=$(echo "${CHOICES}" | grep -c "xa") -if [ ${check} -eq 1 ]; then choice="on"; fi -if [ "${sphinxrelay}" != "${choice}" ]; then - echo "Sphinx-Relay Setting changed .." - anychange=1 - sudo -u admin /home/admin/config.scripts/bonus.sphinxrelay.sh ${choice} - if [ "${choice}" = "on" ]; then - echo "Giving service 1 minute to start up ... (please wait) ..." - sleep 60 - whiptail --title " Installed Sphinx Server" --msgbox "\ -Sphinx Server was installed.\n -Use the new 'SPHINX' entry in Main Menu for more info.\n -" 10 35 - fi -else - echo "Sphinx Relay unchanged." -fi - # Helipad choice="off"; check=$(echo "${CHOICES}" | grep -c "fa") if [ ${check} -eq 1 ]; then choice="on"; fi diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index c12e1b767..096b5af92 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -467,16 +467,6 @@ else echo "Provisioning BTCPayServer - keep default" >> ${logFile} fi -# deprecated - see: #2031 -# LNDMANAGE -#if [ "${lndmanage}" = "on" ]; then -# echo "Provisioning lndmanage - run config script" >> ${logFile} -# /home/admin/_cache.sh set message "Setup lndmanage" -# sudo -u admin /home/admin/config.scripts/bonus.lndmanage.sh on >> ${logFile} 2>&1 -#else -# echo "Provisioning lndmanage - not active" >> ${logFile} -#fi - # CUSTOM PORT echo "Provisioning LND Port" >> ${logFile} if [ ${#lndPort} -eq 0 ]; then @@ -607,15 +597,6 @@ else echo "Provisioning Balance of Satoshis - keep default" >> ${logFile} fi -## LNPROXY -#if [ "${lnproxy}" = "on" ]; then -# echo "Provisioning lnproxy - run config script" >> ${logFile} -# /home/admin/_cache.sh set message "Setup lnproxy" -# sudo -u admin /home/admin/config.scripts/bonus.lnproxy.sh on >> ${logFile} 2>&1 -#else -# echo "Provisioning lnproxy - keep default" >> ${logFile} -#fi - # thunderhub if [ "${thunderhub}" = "on" ]; then echo "Provisioning ThunderHub - run config script" >> ${logFile} @@ -688,15 +669,6 @@ else echo "Provisioning LNDg - keep default" >> ${logFile} fi -# sphinxrelay -if [ "${sphinxrelay}" = "on" ]; then - echo "Sphinx-Relay - run config script" >> ${logFile} - /home/admin/_cache.sh set message "Setup Sphinx-Relay" - sudo -u admin /home/admin/config.scripts/bonus.sphinxrelay.sh on >> ${logFile} 2>&1 -else - echo "Sphinx-Relay - keep default" >> ${logFile} -fi - # helipad if [ "${helipad}" = "on" ]; then echo "Helipad - run config script" >> ${logFile} diff --git a/home.admin/config.scripts/blitz.subscriptions.py b/home.admin/config.scripts/blitz.subscriptions.py index 310c8f6e5..ed6c30966 100755 --- a/home.admin/config.scripts/blitz.subscriptions.py +++ b/home.admin/config.scripts/blitz.subscriptions.py @@ -20,7 +20,6 @@ SERVICE_LND_REST_API = "LND-REST-API" SERVICE_LND_GRPC_API = "LND-GRPC-API" SERVICE_LNBITS = "LNBITS" SERVICE_BTCPAY = "BTCPAY" -SERVICE_SPHINX = "SPHINX" # load config cfg = RaspiBlitzConfig() @@ -209,11 +208,6 @@ The following additional information is available: print("# FAIL: unknown subscription type") time.sleep(3) - # trigger restart of relevant services so they can pickup new environment - print("# restarting services to pickup new public url (please wait) ...") - os.system("sudo systemctl restart sphinxrelay 2>/dev/null") - time.sleep(8) - # loop until no more subscriptions or user chooses CANCEL on subscription list my_subscriptions() @@ -281,7 +275,6 @@ def main(): lnd_grpc_api = False lnbits = False btcpay = False - sphinx = False try: if os.path.isfile(SUBSCRIPTIONS_FILE): os.system("sudo chown admin:admin {0}".format(SUBSCRIPTIONS_FILE)) @@ -297,8 +290,6 @@ def main(): lnbits = True if sub['active'] and sub['name'] == SERVICE_BTCPAY: btcpay = True - if sub['active'] and sub['name'] == SERVICE_SPHINX: - sphinx = True except Exception as e: print(e) @@ -309,17 +300,6 @@ def main(): if status_data.find("installed=1") > -1: btc_pay_server = True - # check if Sphinx-Relay is installed - sphinx_relay = False - try: - status_data = subprocess.run(['/home/admin/config.scripts/bonus.sphinxrelay.sh', 'status'], - stdout=subprocess.PIPE, timeout=10).stdout.decode('utf-8').strip() - except Exception as e: - print(e) - - if status_data.find("installed=1") > -1: - sphinx_relay = True - # ask user for which RaspiBlitz service the bridge should be used choices = list() choices.append(("REST", "LND REST API {0}".format("--> ALREADY BRIDGED" if lnd_rest_api else ""))) @@ -328,8 +308,6 @@ def main(): choices.append(("LNBITS", "LNbits Webinterface {0}".format("--> ALREADY BRIDGED" if lnbits else ""))) if btc_pay_server: choices.append(("BTCPAY", "BTCPay Server Webinterface {0}".format("--> ALREADY BRIDGED" if btcpay else ""))) - if sphinx_relay: - choices.append(("SPHINX", "Sphinx Relay {0}".format("--> ALREADY BRIDGED" if sphinx else ""))) choices.append(("SELF", "Create a custom IP2TOR Bridge")) d = Dialog(dialog="dialog", autowidgetsize=True) @@ -369,12 +347,6 @@ def main(): tor_address = subprocess.run(['sudo', 'cat', '/mnt/hdd/tor/btcpay/hostname'], stdout=subprocess.PIPE).stdout.decode('utf-8').strip() tor_port = 443 - if tag == "SPHINX": - # get TOR address for SPHINX - service_name = SERVICE_SPHINX - tor_address = subprocess.run(['sudo', 'cat', '/mnt/hdd/tor/sphinxrelay/hostname'], - stdout=subprocess.PIPE).stdout.decode('utf-8').strip() - tor_port = 443 if tag == "SELF": service_name = "CUSTOM" try: @@ -418,12 +390,6 @@ def main(): print("# running: {0}".format(cmd)) os.system(cmd) - # action after possibly new created bride - if service_name == SERVICE_SPHINX: - print("# restarting services to pickup new public URL (please wait) ...") - os.system("sudo systemctl restart sphinxrelay") - time.sleep(8) - sys.exit(0) if __name__ == '__main__': diff --git a/home.admin/config.scripts/bonus.sphinxrelay.sh b/home.admin/config.scripts/bonus.sphinxrelay.sh index 420edfc01..6d3c8a494 100755 --- a/home.admin/config.scripts/bonus.sphinxrelay.sh +++ b/home.admin/config.scripts/bonus.sphinxrelay.sh @@ -1,17 +1,21 @@ #!/bin/bash +# deprecated May 2024 +# see or comment on: https://github.com/raspiblitz/raspiblitz/issues/2558 + # https://github.com/stakwork/sphinx-relay # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "config script to switch Sphinx-Relay on,off or update" + echo "The Sphinx-Relay is deprecated and may be removed in future versions." + echo "Needs to be manual installed manually after every update/recover" echo "bonus.sphinxrelay.sh on [?GITHUBUSER] [?BRANCH]" echo "bonus.sphinxrelay.sh [off|status|menu|write-environment|update]" echo "# DEVELOPMENT: TO SYNC WITH YOUR FORKED GITHUB-REPO" echo "bonus.sphinxrelay.sh github sync" exit 1 fi - source /mnt/hdd/raspiblitz.conf # show info menu From 0516aa5971733be3674dcb3f9f04c27953f40a6a Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Sun, 9 Jun 2024 22:24:02 +0200 Subject: [PATCH 30/59] #2552 adding electrum sync progress to infoscreen (#4603) * #2552 getting the synced blockheight with nc * feat: Add blockheight information to electrs status command * add info in CHANGES --- CHANGES.md | 1 + home.admin/00infoBlitz.sh | 6 ++- home.admin/config.scripts/bonus.electrs.sh | 43 +++++++++++++--------- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ffb37f74a..1c3bedcd3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Update: BTCPayServer 1.13.0 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.0) - Update: acme.sh 3.0.7 (repair duckdns.org dyndns) +- Update: show progress of electrs building index on LCD - Update: lndmanage 0.16.0 [details](https://github.com/bitromortac/lndmanage) - Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955) - Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index d7cd1e1c7..c12e5e18f 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -355,7 +355,8 @@ else appInfoLine="" # Electrum Server - electrs - if [ "${ElectRS}" == "on" ]; then + fileFlagExists=$(sudo ls /mnt/hdd/app-storage/electrs/initial-sync.done 2>/dev/null | grep -c 'initial-sync.done') + if [ "${ElectRS}" == "on" ] && [ $fileFlagExists -eq 0 ]; then error="" source <(sudo /home/admin/config.scripts/bonus.electrs.sh status-sync 2>/dev/null) if [ ${#infoSync} -gt 0 ]; then @@ -364,7 +365,8 @@ else fi # Electrum Server - fulcrum - if [ "${fulcrum}" == "on" ]; then + fileFlagExists=$(sudo ls /mnt/hdd/app-storage/fulcrum/initial-sync.done 2>/dev/null | grep -c 'initial-sync.done') + if [ "${fulcrum}" == "on" ] && [ $fileFlagExists -eq 0 ]; then error="" source <(sudo /home/admin/config.scripts/bonus.fulcrum.sh status-sync 2>/dev/null) if [ ${#infoSync} -gt 0 ]; then diff --git a/home.admin/config.scripts/bonus.electrs.sh b/home.admin/config.scripts/bonus.electrs.sh index 1bca344fc..2fb54ae83 100755 --- a/home.admin/config.scripts/bonus.electrs.sh +++ b/home.admin/config.scripts/bonus.electrs.sh @@ -105,22 +105,6 @@ if [ "$1" = "status-sync" ]; then echo "serviceRunning=${serviceRunning}" if [ ${serviceRunning} -eq 1 ]; then - # Experimental try to get sync Info (electrs debug info would need more details) - #source <(/home/admin/_cache.sh get btc_mainnet_blocks_headers) - #blockchainHeight="${btc_mainnet_blocks_headers}" - #lastBlockchainHeight=$(($blockchainHeight -1)) - #syncedToBlock=$(sudo journalctl -u electrs --no-pager -n2000 | grep "height=" | tail -n1| cut -d= -f3) - #syncProgress=0 - #if [ "${syncedToBlock}" != "" ] && [ "${blockchainHeight}" != "" ] && [ "${blockchainHeight}" != "0" ]; then - # syncProgress="$(echo "$syncedToBlock" "$blockchainHeight" | awk '{printf "%.2f", $1 / $2 * 100}')" - #fi - #echo "syncProgress=${syncProgress}%" - #if [ "${syncedToBlock}" = "${blockchainHeight}" ] || [ "${syncedToBlock}" = "${lastBlockchainHeight}" ]; then - # echo "tipSynced=1" - #else - # echo "tipSynced=0" - #fi - # check if initial sync was done, by setting a file as once electrs is the first time responding on port 50001 electrumResponding=$(echo '{"jsonrpc":"2.0","method":"server.ping","params":[],"id":"electrs-check"}' | netcat -w 2 127.0.0.1 50001 | grep -c "result") if [ ${electrumResponding} -gt 1 ]; then @@ -128,6 +112,27 @@ if [ "$1" = "status-sync" ]; then fi echo "electrumResponding=${electrumResponding}" + blockheight=0 + blockheightPercent=0 + if [ ${electrumResponding} -eq 0 ]; then + + # get the synced blockheight + syncedBlock=$(echo '{"id": 1, "method": "blockchain.headers.subscribe", "params": []}' | nc -w 20 -q 1 localhost 50001 | jq '.result.height') + if [ "$syncedBlock" -eq "$syncedBlock" ] 2>/dev/null; then + blockheight=${syncedBlock} + + # calculate the progress + source <(/home/admin/_cache.sh get btc_mainnet_blocks_verified) + if [ "$btc_mainnet_blocks_verified" -eq "$btc_mainnet_blocks_verified" ] 2>/dev/null; then + blockheightPercent=$(echo "scale=2; $syncedBlock / $btc_mainnet_blocks_verified * 100" | bc) + blockheightPercent=$(printf "%.0f\n" $blockheightPercent) + fi + + fi + fi + echo "blockheight='${blockheight}'" + echo "blockheightPercent='${blockheightPercent}'" + fileFlagExists=$(sudo ls /mnt/hdd/app-storage/electrs/initial-sync.done 2>/dev/null | grep -c 'initial-sync.done') if [ ${fileFlagExists} -eq 0 ] && [ ${electrumResponding} -gt 0 ]; then # set file flag for the future @@ -137,7 +142,11 @@ if [ "$1" = "status-sync" ]; then fi if [ ${fileFlagExists} -eq 0 ]; then echo "initialSynced=0" - echo "infoSync='Building Index (please wait)'" + if [ "${blockheightPercent}" != "0" ]; then + echo "infoSync='Building Index ${blockheightPercent}% (please wait)'" + else + echo "infoSync='Building Index (please wait)'" + fi else echo "initialSynced=1" fi From e74b129f22ee6972f55f1f090b8ea32feeeb4df3 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Sun, 9 Jun 2024 22:24:35 +0200 Subject: [PATCH 31/59] Update lnd 0.17.5 & recommended bitcoin update 27.0 (#4601) * update lnd 0.17.5 & recommended bitcoin update 27.0 * fix sync screen --- home.admin/00raspiblitz.sh | 8 +++++++- home.admin/config.scripts/bitcoin.update.sh | 2 +- home.admin/config.scripts/lnd.install.sh | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/home.admin/00raspiblitz.sh b/home.admin/00raspiblitz.sh index 5240d10ad..4ff3e6902 100755 --- a/home.admin/00raspiblitz.sh +++ b/home.admin/00raspiblitz.sh @@ -177,11 +177,17 @@ do sleep 3 continue fi - else + elif [ "${lightning}" = "lnd" ]; then if [ "${btc_default_synced}" != "1" ] || [ "${ln_default_ready}" == "0" ] || [ "${ln_default_sync_chain}" == "0" ] || [ "${ln_default_sync_initial_done}" == "0" ]; then /home/admin/setup.scripts/eventBlockchainSync.sh ssh sleep 3 continue + fi + else + if [ "${btc_default_synced}" != "1" ]; then + /home/admin/setup.scripts/eventBlockchainSync.sh ssh + sleep 3 + continue fi fi fi diff --git a/home.admin/config.scripts/bitcoin.update.sh b/home.admin/config.scripts/bitcoin.update.sh index 6e6b81869..43d2667b9 100755 --- a/home.admin/config.scripts/bitcoin.update.sh +++ b/home.admin/config.scripts/bitcoin.update.sh @@ -21,7 +21,7 @@ mode="$1" # RECOMMENDED UPDATE BY RASPIBLITZ TEAM (just possible once per sd card update) # comment will be shown as "BEWARE Info" when option is chosen (can be multiple lines) -bitcoinVersion="" # example: 22.0 .. keep empty if no newer version as sd card build is available +bitcoinVersion="27.0" # example: 22.0 .. keep empty if no newer version as sd card build is available # GATHER DATA # setting download directory to the current user diff --git a/home.admin/config.scripts/lnd.install.sh b/home.admin/config.scripts/lnd.install.sh index 8ee436c75..3b26e74c3 100644 --- a/home.admin/config.scripts/lnd.install.sh +++ b/home.admin/config.scripts/lnd.install.sh @@ -4,7 +4,7 @@ ## based on https://raspibolt.github.io/raspibolt/raspibolt_40_lnd.html#lightning-lnd ## see LND releases: https://github.com/lightningnetwork/lnd/releases ### If you change here - make sure to also change interims version in lnd.update.sh #! -lndVersion="0.17.3-beta" +lndVersion="0.17.5-beta" # olaoluwa PGPauthor="roasbeef" From b4e38e8741e21eb36be961a50f64ede44e739b7d Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Mon, 10 Jun 2024 16:40:39 +0200 Subject: [PATCH 32/59] #3261 change text (#4619) --- home.admin/99updateMenu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/99updateMenu.sh b/home.admin/99updateMenu.sh index 4cdbb3b36..597a62a17 100755 --- a/home.admin/99updateMenu.sh +++ b/home.admin/99updateMenu.sh @@ -80,7 +80,7 @@ Once the LCD is white and no LEDs are blinking anymore: - Remove the Power from RaspiBlitz - Exchange the old with the new SD card - Connect Power back to the RaspiBlitz -- Follow the instructions on the LCD +- Login again per SSH or WebUI Do you have the SD card with the new version image ready and do you WANT TO START UPDATE NOW? From d746bf3353cdee63cf8d3b3bcab50b285dc46789 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Mon, 10 Jun 2024 16:41:06 +0200 Subject: [PATCH 33/59] update LIT v0.12.5 (#4617) --- CHANGES.md | 1 + home.admin/config.scripts/bonus.lit.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 1c3bedcd3..2af1be0ff 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ - Update: acme.sh 3.0.7 (repair duckdns.org dyndns) - Update: show progress of electrs building index on LCD - Update: lndmanage 0.16.0 [details](https://github.com/bitromortac/lndmanage) +- Update: Lightning Terminal v0.12.5-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.12.5-alpha) - Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955) - Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) diff --git a/home.admin/config.scripts/bonus.lit.sh b/home.admin/config.scripts/bonus.lit.sh index e562d44f7..071d68da4 100644 --- a/home.admin/config.scripts/bonus.lit.sh +++ b/home.admin/config.scripts/bonus.lit.sh @@ -1,7 +1,7 @@ #!/bin/bash # https://github.com/lightninglabs/lightning-terminal/releases -LITVERSION="0.10.1-alpha" +LITVERSION="0.12.5-alpha" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then From 5e732ce67f19037afb36d49394b4a0a208767fc0 Mon Sep 17 00:00:00 2001 From: Xavier Fiechter <31884704+xavierfiechter@users.noreply.github.com> Date: Mon, 10 Jun 2024 20:25:09 +0200 Subject: [PATCH 34/59] Labelbase Bonus Integration bonus.labelbase.sh (#4616) --- home.admin/config.scripts/bonus.labelbase.sh | 608 +++++++++++++++++++ 1 file changed, 608 insertions(+) create mode 100644 home.admin/config.scripts/bonus.labelbase.sh diff --git a/home.admin/config.scripts/bonus.labelbase.sh b/home.admin/config.scripts/bonus.labelbase.sh new file mode 100644 index 000000000..0e50b3c53 --- /dev/null +++ b/home.admin/config.scripts/bonus.labelbase.sh @@ -0,0 +1,608 @@ +#!/bin/bash +# path: /home/admin/config.scripts/bonus.labelbase.sh +APPID="labelbase" +VERSION="2.2.1" +GITHUB_REPO="https://github.com/Labelbase/Labelbase/" +GITHUB_TAG="2.2.1" +GITHUB_SIGN_AUTHOR="" +GITHUB_SIGN_PUBKEYLINK="" +GITHUB_SIGN_FINGERPRINT="" + +# Basic variables +LABELBASE_HOME="/home/${APPID}/" +LABELBASE_DJANGO="/${LABELBASE_HOME}/${APPID}/django/" +LABELBASE_ENV="${LABELBASE_HOME}ENV/" + +PORT_CLEAR="8089" +PORT_SSL="12349" +PORT_TOR_CLEAR="12350" +PORT_TOR_SSL="12351" + +# BASIC COMMANDLINE OPTIONS +# you can add more actions or parameters if needed - for example see the bonus.rtl.sh +# to see how you can deal with an app that installs multiple instances depending on +# lightning implementation or testnets - but this should be OK for a start: +if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then + echo "config script to install, update or uninstall Labelbase" + echo "bonus.labelbase.sh [on|off|menu|update|status]" + echo "# bonus.${APPID}.sh status -> status information (key=value)" + echo "# bonus.${APPID}.sh on -> install the app" + echo "# bonus.${APPID}.sh off -> uninstall the app" + echo "# bonus.${APPID}.sh menu -> SSH menu dialog" + echo "# bonus.${APPID}.sh prestart -> will be called by systemd before start" + exit 1 +fi + +# echoing comments is useful for logs - but start output with # when not a key=value +echo "# Running: 'bonus.${APPID}.sh $*'" + +# check & load raspiblitz config +source /mnt/hdd/raspiblitz.conf + +if [ -f "${LABELBASE_HOME}/exports.sh" ]; then + echo "INFO: The file '${LABELBASE_HOME}/exports.sh' already exists." + source ${LABELBASE_HOME}/exports.sh +fi + + + + +######################### +# INFO +######################### + +# this section is always executed to gather status information that +# all the following commands can use & execute on + +# check if app is already installed +isInstalled=$(sudo ls /etc/systemd/system/${APPID}.service 2>/dev/null | grep -c "${APPID}.service") + +# check if service is running +isRunning=$(systemctl status ${APPID} 2>/dev/null | grep -c 'active (running)') + +if [ "${isInstalled}" == "1" ]; then + + # gather address info (whats needed to call the app) + localIP=$(hostname -I | awk '{print $1}') + toraddress=$(sudo cat /mnt/hdd/tor/${APPID}/hostname 2>/dev/null) + fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2) + +fi + +# if the action parameter `status` was called - just stop here and output all +# status information as a key=value list +if [ "$1" = "status" ]; then + echo "appID='${APPID}'" + echo "version='${VERSION}'" + echo "githubRepo='${GITHUB_REPO}'" + echo "githubVersion='${GITHUB_TAG}'" + echo "githubSignature='${GITHUB_SIGNATURE}'" + echo "isInstalled=${isInstalled}" + echo "isRunning=${isRunning}" + if [ "${isInstalled}" == "1" ]; then + echo "portCLEAR=${PORT_CLEAR}" + echo "portSSL=${PORT_SSL}" + echo "localIP='${localIP}'" + echo "toraddress='${toraddress}'" + echo "fingerprint='${fingerprint}'" + echo "toraddress='${toraddress}'" + fi + exit +fi + +########################## +# MENU +######################### + +# The `menu` action should give at least a SSH info dialog - when an webapp show +# URL to call (http & https+fingerprint) otherwise some instruction how to start it. + +# This SSH dialog will be later called by the MAIN MENU to be available to the user +# when app is installed. + +# This menu can also have some more complex structure if you want to make it easy +# to the user to set configurations or maintenance options - example bonus.lnbits.sh + +# show info menu +if [ "$1" = "menu" ]; then + + + # set the title for the dialog + dialogTitle=" ${APPID} " + + # basic info text - for an web app how to call with http & self-signed https + dialogText="Open in your local web browser: +http://${localIP}:${PORT_CLEAR}\n +https://${localIP}:${PORT_SSL} with Fingerprint: +${fingerprint}\n +" + + # add tor info (if available) + if [ "${toraddress}" != "" ]; then + dialogText="${dialogText}Hidden Service address for Tor Browser (QRcode on LCD):\n${toraddress}" + fi + + # use whiptail to show SSH dialog & exit + whiptail --title "${dialogTitle}" --msgbox "${dialogText}" 18 67 + echo "please wait ..." + exit 0 +fi + +########################## +# ON / INSTALL +########################## + + +# This section takes care of installing the app. +# The template contains some basic steps but also look at other install scripts +# to see how special cases are solved. + +if [ "$1" = "1" ] || [ "$1" = "on" ]; then + + # dont run install if already installed + if [ ${isInstalled} -eq 1 ]; then + echo "# ${APPID}.service is already installed." + exit 1 + fi + + echo "# Installing ${APPID} ..." + + + + + + # create a dedicated user for the app + # BACKGROUND is here to seperate running apps by unix users + # and only give file write access to the rest of the system where needed. + echo "# create user" + # If the user is intended to be loeed in to add '--shell /bin/bash' + # and copy the skeleton files + sudo adduser --system --group --shell /bin/bash --home /home/${APPID} ${APPID} || exit 1 + # copy the skeleton files for login + sudo -u ${APPID} cp -r /etc/skel/. /home/${APPID}/ + + + # add user to special groups with special access rights + # BACKGROUND there are some unix groups available that will give the access to + # like for example to the lnd admin macaroons - to check all groups available use: + # `cut -d: -f1 /etc/group | sort` command on raspiblitz commandline + #echo "# add use to special groups" + #sudo /usr/sbin/usermod --append --groups lndadmin ${APPID} + + # create a data directory on /mnt/hdd/app-data/ for the app + # BACKGROUND is that any critical data that needs to survive an update should + # be stored in that app-data directory. All data there will also be part of + # any raspiblitz data migration. Also on install handle the case that there + # is already data from a pervious install available the user wants to + # continue to use and even may come from an older version from your app. + + if ! [ -d /mnt/hdd/app-data/${APPID} ]; then + + echo "# create app-data directory" + sudo mkdir /mnt/hdd/app-data/${APPID} 2>/dev/null + sudo chown ${APPID}:${APPID} -R /mnt/hdd/app-data/${APPID} + + else + + echo "# reuse existing app-directory" + sudo chown ${APPID}:${APPID} -R /mnt/hdd/app-data/${APPID} + + fi + + echo "# install from source code" + # make sure mysql/myria db is available & running + sudo apt-get install -y mariadb-server mariadb-client + sudo apt-get install -y \ + default-libmysqlclient-dev \ + build-essential \ + cron vim logrotate \ + libpcre3-dev \ + default-mysql-client \ + python3-pip \ + virtualenv + sudo systemctl enable mariadb 2>/dev/null + sudo systemctl start mariadb 2>/dev/null + + # download source code and verify + # BACKGROUND is that now you download the code from github, reset to a given version tag/commit, + # verify the author. If you app provides its source/binaries in another way, may check + # other install scripts to see how that implement code download & verify. + echo "# download the source code & verify" + sudo -u ${APPID} git clone ${GITHUB_REPO} /home/${APPID}/${APPID} + cd /home/${APPID}/${APPID} + if [ "${GITHUB_TAG}" != "" ]; then + sudo -u ${APPID} git reset --hard $GITHUB_TAG + fi + if [ "${GITHUB_SIGN_AUTHOR}" != "" ]; then + sudo -u ${APPID} /home/admin/config.scripts/blitz.git-verify.sh \ + "${GITHUB_SIGN_AUTHOR}" "${GITHUB_SIGN_PUBKEYLINK}" "${GITHUB_SIGN_FINGERPRINT}" "${GITHUB_TAG}" || exit 1 + fi + + + + # compile/install the app + # BACKGROUND on this example is a web app that compiles with NodeJS. But of course + # your app could have a complete other way to install - check other install scripts as examples. + echo "# compile/install the app" + sudo pip install --upgrade pip + sudo -u ${APPID} virtualenv -p python3 ${LABELBASE_ENV} + sudo -u ${APPID} bash -c '. /home/labelbase/ENV/bin/activate && pip install --no-cache-dir -r /home/labelbase/labelbase/django/requirements.txt' + + if [ -f "${LABELBASE_HOME}/exports.sh" ]; then + echo "INFO: The file '${LABELBASE_HOME}/exports.sh' already exists (232)." + else + sudo touch ${LABELBASE_HOME}/exports.sh + sudo chown ${APPID}:${APPID} ${LABELBASE_HOME}/exports.sh + sudo chmod 755 ${LABELBASE_HOME}/exports.sh + generate_password() { + openssl rand -base64 "${1:-16}" | tr -d '+/' | fold -w "${1:-16}" | head -n 1 + } + MYSQL_PASSWORD=$(generate_password 32) + sudo -u ${APPID} bash -c "echo 'export MYSQL_PASSWORD=${MYSQL_PASSWORD}' > /home/labelbase/exports.sh" + + + fi + source ${LABELBASE_HOME}/exports.sh + + + isActive=$(sudo ls /etc/systemd/system/${APPID}.service 2>/dev/null | grep -c '${APPID}.service') + if [ ${isActive} -eq 0 ]; then + sudo mariadb -e "DROP DATABASE IF EXISTS labelbase;" + sudo mariadb -e "CREATE DATABASE labelbase;" + sudo mariadb -e "CREATE USER 'ulabelbase'@'%' IDENTIFIED BY '$MYSQL_PASSWORD';" + sudo mariadb -e "GRANT ALL PRIVILEGES ON labelbase.* TO 'ulabelbase' IDENTIFIED BY '$MYSQL_PASSWORD';" + sudo mariadb -e "FLUSH PRIVILEGES;" + fi + +# cd ${LABELBASE_DJANGO} + +# sudo -u ${APPID} bash -c '. /home/labelbase/ENV/bin/activate && . /home/labelbase/exports.sh && /home/labelbase/labelbase/django/run.sh' + + #sudo -u ${APPID} npm install --only=prod --logLevel warn + #if ! [ $? -eq 0 ]; then +# echo "# FAIL - npm install did not run correctly - deleting code & exit" +# sudo rm -r /home/${APPID}/${APPID} +# exit 1 +# fi + + # open the ports in the firewall + echo "# updating Firewall" + sudo ufw allow ${PORT_CLEAR} comment "${APPID} HTTP" + sudo ufw allow ${PORT_SSL} comment "${APPID} HTTPS" + + + # every app should have their own systemd service that cares about starting & + # running the app in the background - see the PRESTART section for adhoc config + # please config this systemd template to your needs + echo "# create systemd service: ${APPID}.service" + echo " +[Unit] +Description=${APPID} +Wants=bitcoind +After=bitcoind + +[Service] +WorkingDirectory=/home/${APPID} +Environment=\"HOME_PATH=/mnt/hdd/app-data/${APPID}\" +ExecStartPre=-/home/admin/config.scripts/bonus.${APPID}.sh prestart +ExecStart=/home/admin/config.scripts/bonus.${APPID}.sh start +User=${APPID} +Restart=always +TimeoutSec=120 +RestartSec=30 +StandardOutput=null +StandardError=journal + +# Hardening measures +PrivateTmp=true +ProtectSystem=full +NoNewPrivileges=true +PrivateDevices=true + +[Install] +WantedBy=multi-user.target +" | sudo tee /etc/systemd/system/${APPID}.service + sudo chown root:root /etc/systemd/system/${APPID}.service + + # when tor is set on also install the hidden service + if [ "${runBehindTor}" = "on" ]; then + # activating tor hidden service + /home/admin/config.scripts/tor.onion-service.sh ${APPID} 80 ${PORT_TOR_CLEAR} 443 ${PORT_TOR_SSL} + fi + + + + + # nginx configuration + # BACKGROUND is that the plain HTTP is served by your web app, but thru the nginx proxy it will be available + # with (self-signed) HTTPS and with separate configs for Tor & Tor+HTTPS. + + echo "# setup nginx confing" + + # write the HTTPS config + echo " +server { + listen ${PORT_SSL} ssl; + listen [::]:${PORT_SSL} ssl; + server_name _; + include /etc/nginx/snippets/ssl-params.conf; + include /etc/nginx/snippets/ssl-certificate-app-data.conf; + access_log /var/log/nginx/access_${APPID}.log; + error_log /var/log/nginx/error_${APPID}.log; + location / { + proxy_pass http://127.0.0.1:${PORT_CLEAR}; + include /etc/nginx/snippets/ssl-proxy-params.conf; + } + location /static { + autoindex off; + index index.html; + root /home/labelbase/labelbase/django; + break; + } + location /media { + autoindex off; + index index.html; + root /home/labelbase/labelbase/django; + break; + } + location /attachments/attachment { + autoindex off; + index index.html; + root /home/labelbase/labelbase/django; + break; + } +} +" | sudo tee /etc/nginx/sites-available/${APPID}_ssl.conf + sudo ln -sf /etc/nginx/sites-available/${APPID}_ssl.conf /etc/nginx/sites-enabled/ + + echo " + server { + listen ${PORT_TOR_CLEAR}; + server_name localhost; + access_log /var/log/nginx/access_${APPID}.log; + error_log /var/log/nginx/error_${APPID}.log; + location / { + proxy_pass http://127.0.0.1:${PORT_CLEAR}; + include /etc/nginx/snippets/ssl-proxy-params.conf; + } + location /static { + autoindex off; + index index.html; + root /home/labelbase/labelbase/django; + break; + } + location /media { + autoindex off; + index index.html; + root /home/labelbase/labelbase/django; + break; + } + location /attachments/attachment { + autoindex off; + index index.html; + root /home/labelbase/labelbase/django; + break; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } + " | sudo tee /etc/nginx/sites-available/${APPID}_tor.conf + sudo ln -sf /etc/nginx/sites-available/${APPID}_tor.conf /etc/nginx/sites-enabled/ + + # write the Tor+HTTPS config + echo " +server { + listen ${PORT_TOR_SSL} ssl; + server_name localhost; + include /etc/nginx/snippets/ssl-params.conf; + include /etc/nginx/snippets/ssl-certificate-app-data-tor.conf; + access_log /var/log/nginx/access_${APPID}.log; + error_log /var/log/nginx/error_${APPID}.log; + location / { + proxy_pass http://127.0.0.1:${PORT_CLEAR}; + include /etc/nginx/snippets/ssl-proxy-params.conf; + } + + location /static { + autoindex off; + index index.html; + root /home/labelbase/labelbase/django; + break; + } + + location /media { + autoindex off; + index index.html; + root /home/labelbase/labelbase/django; + break; + } + + location /attachments/attachment { + autoindex off; + index index.html; + root /home/labelbase/labelbase/django; + break; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} +" | sudo tee /etc/nginx/sites-available/${APPID}_tor_ssl.conf + sudo ln -sf /etc/nginx/sites-available/${APPID}_tor_ssl.conf /etc/nginx/sites-enabled/ + + # test nginx config & activate thru reload + sudo nginx -t + sudo systemctl reload nginx + + # mark app as installed in raspiblitz config + /home/admin/config.scripts/blitz.conf.sh set ${APPID} "on" + + # enable app up thru systemd + sudo systemctl enable ${APPID} + echo "# OK - the ${APPID}.service is now enabled" + + # start app (only when blitz is ready) + source <(/home/admin/_cache.sh get state) + if [ "${state}" == "ready" ]; then + sudo systemctl start ${APPID} + echo "# OK - the ${APPID}.service is now started" + fi + + echo "# Monitor with: sudo journalctl -f -u ${APPID}" + exit 0 + + # OK so your app is now installed, but there please also check the following parts to ensure a propper integration + # into the raspiblitz system: + + # PROVISION - reinstall on updates & recovery + # Take a look at `_provision_.sh` script - you can see that there all bonus apps install scripts get called if + # they have an active entry in the raspiblitz config. This is needed so that on sd card image update or recovery + # all apps get installed again. So add your app there accordantly so its install will survive an sd card update. + + # MAINMENU - show users that app is installed + # Take a look at the `00mainmenu.sh` script - you can see there almost all bonus apps add a menu entry there if + # they are installed that then is calling this script with the `menu` parameter. Add your app accordingly. + + # SERVICES MENU - add your app for onclick install + # Take a look at the `00settingsMenuServices.sh` script - you can there almost all bonus apps added themselves + # as an option in to be easily installed & deinstalled. Add your app there accordantly. + + # DEBUGLOGS - add some status information + # Take a look at the `blitz.debug.sh` script - you can see there that apps if they are installed give some + # information on their latest logs and where to find them in the case that the user is searching for an error. + # So its best practice to also add your app there with some small info to help on debug & finding error logs. + + # PRESTART & DEINSTALL + # see the following sections of the template + +fi + + +########################## +# PRESTART +########################## + +# BACKGROUND is that this script will be called with `prestart` on every start & restart +# of this apps systemd service. This has the benefit that right before the app is started +# config parameters for this app can be updated so that it always starts with the most updated +# values. With such an "adhoc config" it is for example possible to check right before start +# what other apps are installed and configure connections. Even if those configs outdate later +# while the app is running with the next restart they will then automatically update their config +# again. If you dont need such "adhoc" config for your app - just leave it empty as it is, so +# you maybe later on have the option to use it. + +if [ "$1" = "start" ]; then + + if [ "$USER" != "${APPID}" ]; then + echo "# FAIL: run as user ${APPID}" + exit 1 + fi + + if [ -f "${LABELBASE_HOME}/exports.sh" ]; then + cd ${LABELBASE_DJANGO} + echo "LABELBASE_DJANGO, pwd is ${LABELBASE_DJANGO}" + #sudo -u ${APPID} bash -c ' + #source /home/labelbase/ENV/bin/activate && source /home/labelbase/exports.sh && /home/labelbase/labelbase/django/run_raspiblitz.sh + #' + source /home/labelbase/ENV/bin/activate && source /home/labelbase/exports.sh && /home/labelbase/ENV/bin/gunicorn labellabor.wsgi:application -b 0.0.0.0:${PORT_CLEAR} --reload + + else + echo "Error: The file '${LABELBASE_HOME}/exports.sh' does not exists." + fi + +fi + +if [ "$1" = "prestart" ]; then + + # needs to be run as the app user - stop if not run as the app user + # keep in mind that in the prestart section you cannot use `sudo` command + if [ "$USER" != "${APPID}" ]; then + echo "# FAIL: run as user ${APPID}" + exit 1 + fi + + echo "## PRESTART CONFIG START for ${APPID} (called by systemd prestart)" + + if [ -f "${LABELBASE_HOME}/exports.sh" ]; then + cd ${LABELBASE_DJANGO} + source /home/labelbase/ENV/bin/activate + source /home/labelbase/exports.sh + python manage make_config + python manage.py makemigrations --noinput + python manage.py migrate --noinput + python manage.py collectstatic --noinput + python manage.py process_tasks & + else + echo "Error: The file '${LABELBASE_HOME}/exports.sh' does not exists." + fi + + # so if you have anything to configure before service starts, do it here + echo "# no need for adhoc config needed so far" + + echo "## PRESTART CONFIG DONE for ${APPID}" + exit 0 +fi + +########################################### +# OFF / UNINSTALL +# call with parameter `delete-data` to also +# delete the persistent data directory +########################################### + +# BACKGROUND is that this section removes entries in systemd, nginx, etc and then +# deletes the user with its home directory to nuke all installed code + +# switch off +if [ "$1" = "0" ] || [ "$1" = "off" ]; then + + echo "# stop & remove systemd service" + sudo systemctl stop ${APPID} 2>/dev/null + sudo systemctl disable ${APPID}.service + sudo rm /etc/systemd/system/${APPID}.service + + echo "# remove nginx symlinks" + sudo rm -f /etc/nginx/sites-enabled/${APPID}_ssl.conf 2>/dev/null + sudo rm -f /etc/nginx/sites-enabled/${APPID}_tor.conf 2>/dev/null + sudo rm -f /etc/nginx/sites-enabled/${APPID}_tor_ssl.conf 2>/dev/null + sudo rm -f /etc/nginx/sites-available/${APPID}_ssl.conf 2>/dev/null + sudo rm -f /etc/nginx/sites-available/${APPID}_tor.conf 2>/dev/null + sudo rm -f /etc/nginx/sites-available/${APPID}_tor_ssl.conf 2>/dev/null + sudo nginx -t + sudo systemctl reload nginx + echo "# removed nginx symlinks" + + echo "# close ports on firewall" + sudo ufw deny "${PORT_CLEAR}" + sudo ufw deny "${PORT_SSL}" + + echo "# delete user" + sudo userdel -rf ${APPID} + + echo "# removing Tor hidden service (if active)" + /home/admin/config.scripts/tor.onion-service.sh off ${APPID} + + echo "# mark app as uninstalled in raspiblitz config" + /home/admin/config.scripts/blitz.conf.sh set ${APPID} "off" + + # only if 'delete-data' is an additional parameter then also the data directory gets deleted + if [ "$(echo "$@" | grep -c delete-data)" -gt 0 ]; then + echo "# found 'delete-data' parameter --> also deleting the app-data" + sudo rm -r /mnt/hdd/app-data/${APPID} + fi + + echo "# OK - Labelbase should be uninstalled now" + exit 0 + +fi + +# just a basic error message when unknown action parameter was given +echo "# FAIL - Unknown Parameter $1" +exit 1 + +# LAST NOTES: +# Best is to contribute a new app install script as a PR to the raspiblitz GitHub repo. +# Please base your PR on the `dev` branch - not on the default branch displayed. From 88168842dca774743876a7373ce51bd7c2c078dd Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Mon, 10 Jun 2024 22:11:05 +0200 Subject: [PATCH 35/59] Adding Labelbase to menus & recover (#4620) --- CHANGES.md | 1 + home.admin/00mainMenu.sh | 6 ++++++ home.admin/00settingsMenuServices.sh | 17 +++++++++++++++++ home.admin/_provision_.sh | 9 +++++++++ 4 files changed, 33 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 2af1be0ff..973d2bf23 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,7 @@ ## What's new in Version 1.11.1 of RaspiBlitz? - New: Set Timezone SSHMENU > SYSTEM > TIME [details](https://github.com/raspiblitz/raspiblitz/issues/1712) +- New: Labelbase 2.2.1 [details](https://x.com/labelbase_space) - Update: LNbits 0.12.8 [details](https://github.com/lnbits/lnbits/releases/tag/0.12.8) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Update: BTCPayServer 1.13.0 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.0) diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 047a2ac9f..5fc9bcf56 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -168,6 +168,9 @@ fi if [ "${fints}" == "on" ]; then OPTIONS+=(FINTS "Show FinTS/HBCI details") fi +if [ "${labelbase}" == "on" ]; then + OPTIONS+=(LABELBASE "Labelbase (UTXO labeling)") +fi # dont offer to switch to "testnet view for now" - so no wswitch back to mainnet needed #if [ ${chain} != "main" ]; then @@ -328,6 +331,9 @@ case $CHOICE in CIRCUITBREAKER) sudo /home/admin/config.scripts/bonus.circuitbreaker.sh menu ;; + LABELBASE) + sudo /home/admin/config.scripts/bonus.labelbase.sh menu + ;; FINTS) sudo /home/admin/config.scripts/bonus.fints.sh menu ;; diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index 8d9d451d2..a3819a156 100755 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -30,6 +30,7 @@ if [ ${#helipad} -eq 0 ]; then helipad="off"; fi if [ ${#lightningtipbot} -eq 0 ]; then lightningtipbot="off"; fi if [ ${#fints} -eq 0 ]; then fints="off"; fi if [ ${#lndk} -eq 0 ]; then lndk="off"; fi +if [ ${#labelbase} -eq 0 ]; then labelbase="off"; fi # show select dialog echo "run dialog ..." @@ -46,6 +47,7 @@ if [ "${network}" == "bitcoin" ]; then OPTIONS+=(ja 'BTC JoinMarket+JoininBox menu' ${joinmarket}) OPTIONS+=(za 'BTC Jam (JoinMarket WebUI)' ${jam}) OPTIONS+=(wa 'BTC Download Bitcoin Whitepaper' ${whitepaper}) + OPTIONS+=(ls 'BTC Labelbase' ${labelbase}) fi # available for both LND & c-lightning @@ -579,6 +581,21 @@ else echo "Whitepaper setting unchanged." fi +# labelbase process choice +choice="off"; check=$(echo "${CHOICES}" | grep -c "ls") +if [ ${check} -eq 1 ]; then choice="on"; fi +if [ "${labelbase}" != "${choice}" ]; then + echo "Labelbase setting changed .." + anychange=1 + sudo -u admin /home/admin/config.scripts/bonus.labelbase.sh ${choice} + source /mnt/hdd/raspiblitz.conf + if [ "${labelbase}" = "on" ]; then + sudo -u admin /home/admin/config.scripts/bonus.labelbase.sh menu + fi +else + echo "Labelbase setting unchanged." +fi + # fints process choice choice="off"; check=$(echo "${CHOICES}" | grep -c "fn") if [ ${check} -eq 1 ]; then choice="on"; fi diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index 096b5af92..fc4e1e8ef 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -660,6 +660,15 @@ else echo "Provisioning LIT - keep default" >> ${logFile} fi +# labelbase +if [ "${labelbase}" = "on" ]; then + echo "Provisioning Labelbase - run config script" >> ${logFile} + /home/admin/_cache.sh set message "Setup Labelbase" + sudo -u admin /home/admin/config.scripts/bonus.labelbase.sh on >> ${logFile} 2>&1 +else + echo "Provisioning Labelbase - keep default" >> ${logFile} +fi + # lndg if [ "${lndg}" = "on" ]; then echo "Provisioning LNDg - run config script" >> ${logFile} From 13acbe94b03009278ca8812b4e88c1ae9b6c1a9b Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Tue, 18 Jun 2024 21:49:58 +0200 Subject: [PATCH 36/59] Update config.yml removing the Q+A Discussion --- .github/ISSUE_TEMPLATE/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 668d274d9..af6d20b89 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,4 @@ contact_links: - - name: Need help? Ask a question in the Q&A section - url: https://github.com/raspiblitz/raspiblitz/discussions/categories/q-a - about: Community support for questions - name: Have an idea for a new app in the RaspiBlitz? Make a suggestion in the app ideas section url: https://github.com/raspiblitz/raspiblitz/discussions/categories/feature-app-ideas about: Feature and app ideas From c5c984f3e5e3b1dbc3c7e4c09076e7fa7262cc0f Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Wed, 19 Jun 2024 22:56:42 +0200 Subject: [PATCH 37/59] switch SUMMARY to cl-plugin.summars (#4625) * add summars plugin script * switch to summars plugin, remove summary plugin --- home.admin/99clMenu.sh | 2 +- .../config.scripts/cl-plugin.summars.sh | 44 ++++++++++++++++++ .../config.scripts/cl-plugin.summary.sh | 45 ------------------- 3 files changed, 45 insertions(+), 46 deletions(-) create mode 100644 home.admin/config.scripts/cl-plugin.summars.sh delete mode 100644 home.admin/config.scripts/cl-plugin.summary.sh diff --git a/home.admin/99clMenu.sh b/home.admin/99clMenu.sh index 8bce06639..e60a0c459 100644 --- a/home.admin/99clMenu.sh +++ b/home.admin/99clMenu.sh @@ -56,7 +56,7 @@ CHOICE=$(dialog --clear \ case $CHOICE in SUMMARY) clear - /home/admin/config.scripts/cl-plugin.summary.sh $CHAIN + /home/admin/config.scripts/cl-plugin.summars.sh $CHAIN echo "Press ENTER to return to main menu." read key ;; diff --git a/home.admin/config.scripts/cl-plugin.summars.sh b/home.admin/config.scripts/cl-plugin.summars.sh new file mode 100644 index 000000000..f2f4ca872 --- /dev/null +++ b/home.admin/config.scripts/cl-plugin.summars.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# command info +if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then + echo + echo "Install and show the output if the summars plugin for Core Lightning" + echo "Usage:" + echo "cl-plugin.summars.sh [testnet|mainnet|signet] [runonce]" + echo + exit 1 +fi + +source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1) + +if [ $($lightningcli_alias | grep -c "summars") -eq 0 ]; then + echo "# Starting the summars plugin" + + if [ ! -f /home/bitcoin/cl-plugins-available/summars/target/release/summars ]; then + if [ ! -f /home/bitcoin/.cargo/bin/cargo ]; then + # get Rust + sudo -u bitcoin curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sudo -u bitcoin sh -s -- -y + fi + if [ ! -d "/home/bitcoin/cl-plugins-available/summars" ]; then + sudo -u bitcoin mkdir /home/bitcoin/cl-plugins-available 2>/dev/null + cd /home/bitcoin/cl-plugins-available || exit 1 + sudo -u bitcoin git clone https://github.com/daywalker90/summars.git + fi + cd /home/bitcoin/cl-plugins-available/summars || exit 1 + sudo -u bitcoin /home/bitcoin/.cargo/bin/cargo build --release + fi + + $lightningcli_alias plugin start -H /home/bitcoin/cl-plugins-available/summars/target/release/summars 1>/dev/null +fi + +echo +echo "# Running:" +echo "${netprefix}lightning-cli -H summars summars-columns=IN_SATS,OUT_SATS,GRAPH_SATS,ALIAS summars-sort-by=IN_SATS" +echo +$lightningcli_alias -H summars summars-columns=IN_SATS,OUT_SATS,GRAPH_SATS,ALIAS summars-sort-by=IN_SATS +echo + +if [ "$(echo "$@" | grep -c "runonce")" -gt 0 ]; then + $lightningcli_alias plugin stop /home/bitcoin/cl-plugins-available/summars/target/release/summars +fi diff --git a/home.admin/config.scripts/cl-plugin.summary.sh b/home.admin/config.scripts/cl-plugin.summary.sh deleted file mode 100644 index 32dd0f629..000000000 --- a/home.admin/config.scripts/cl-plugin.summary.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# command info -if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then - echo - echo "Install and show the output if the summary plugin forCore Lightning" - echo "Usage:" - echo "cl-plugin.summary.sh [testnet|mainnet|signet] [runonce]" - echo - exit 1 -fi - -source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1) - -if [ ! -f "/home/bitcoin/cl-plugins-available/plugins/summary/summary.py" ]; then - sudo -u bitcoin mkdir /home/bitcoin/cl-plugins-available - cd /home/bitcoin/cl-plugins-available || exit 1 - sudo -u bitcoin git clone https://github.com/lightningd/plugins.git -fi -if [ $($lightningcli_alias | grep -c "summary") -eq 0 ];then - echo "# Starting the summary plugin" - # https://github.com/ElementsProject/lightning/tree/master/contrib/pylightning - sudo -u bitcoin pip install --user pylightning 1>/dev/null - # https://github.com/lightningd/plugins#dynamic-plugin-initialization - sudo -u bitcoin pip install --user -r /home/bitcoin/cl-plugins-available/plugins/summary/requirements.txt 1>/dev/null - $lightningcli_alias plugin start -H /home/bitcoin/cl-plugins-available/plugins/summary/summary.py 1>/dev/null -fi - -echo -echo "Node URI:" -ln_getinfo=$($lightningcli_alias -H getinfo 2>/dev/null) -pubkey=$(echo "$ln_getinfo" | grep "id=" | cut -d= -f2) -toraddress=$(echo "$ln_getinfo" | grep ".onion" | cut -d= -f2) -port=$(echo "$ln_getinfo" | grep "port" | tail -n1 | cut -d= -f2) -echo "${pubkey}@${toraddress}:${port}" -echo -echo "# Running:" -echo "${netprefix}lightning-cli -H summary" -echo -$lightningcli_alias -H summary -echo - -if [ "$(echo "$@" | grep -c "runonce")" -gt 0 ];then - $lightningcli_alias plugin stop /home/bitcoin/cl-plugins-available/plugins/summary/summary.py -fi From e4c51fe22ecf27f32d74063c81fb7c19c4773a18 Mon Sep 17 00:00:00 2001 From: geco91 Date: Wed, 19 Jun 2024 22:57:52 +0200 Subject: [PATCH 38/59] #4585 Dont reboot after change of Password B (#4614) --- home.admin/config.scripts/blitz.passwords.sh | 38 ++++++++++++++----- home.admin/config.scripts/bonus.faraday.sh | 1 + home.admin/config.scripts/bonus.helipad.sh | 1 + .../config.scripts/bonus.lightningtipbot.sh | 1 + home.admin/config.scripts/bonus.lnbits.sh | 1 + home.admin/config.scripts/bonus.lndk.sh | 1 + home.admin/config.scripts/bonus.loop.sh | 1 + home.admin/config.scripts/bonus.rtl.sh | 26 ++++++------- .../config.scripts/cl.install-service.sh | 1 + home.admin/config.scripts/lnd.install.sh | 1 + 10 files changed, 48 insertions(+), 24 deletions(-) diff --git a/home.admin/config.scripts/blitz.passwords.sh b/home.admin/config.scripts/blitz.passwords.sh index 7b6225a2f..3165c6be1 100755 --- a/home.admin/config.scripts/blitz.passwords.sh +++ b/home.admin/config.scripts/blitz.passwords.sh @@ -338,27 +338,31 @@ elif [ "${abcd}" = "b" ]; then sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /mnt/hdd/${network}/${network}.conf 2>/dev/null sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /home/admin/.${network}/${network}.conf 2>/dev/null - # NOTE: now other bonus apps configs that need passwordB need to be adapted manually - # bonus apps that use a "prestart" will adapt themselves on service restart after reboot + # dont reboot - starting either services manually below or they get restarted thru + # systemd dependencies like on bitcoind (Partof=...) after all configs changed + reboot=0; - # blitzweb - if ! [ -f /etc/nginx/.htpasswd ]; then - echo "${newPassword}" | sudo htpasswd -ci /etc/nginx/.htpasswd admin - else - echo "${newPassword}" | sudo htpasswd -i /etc/nginx/.htpasswd admin - fi + echo "# restart bitcoind" + sudo systemctl restart ${network}d + + # NOTE: now other bonus apps configs that need passwordB need to be adapted manually + # bonus apps that use a "prestart" will adapt themselves on service # electrs if [ "${ElectRS}" == "on" ]; then echo "# changing the RPC password for ELECTRS" RPC_USER=$(cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcuser | cut -c 9-) sudo sed -i "s/^auth = \"$RPC_USER.*\"/auth = \"$RPC_USER:${newPassword}\"/g" /home/electrs/.electrs/config.toml + echo "# restarting electrs" + sudo systemctl restart electrs.service fi # BTCPayServer if [ "${BTCPayServer}" == "on" ]; then echo "# changing the RPC password for BTCPAYSERVER" sudo sed -i "s/^btc.rpc.password=.*/btc.rpc.password=${newPassword}/g" /home/btcpay/.nbxplorer/Main/settings.config + echo "# restarting btcpay server" + sudo systemctl restart btcpayserver.service fi # JoinMarket @@ -367,12 +371,16 @@ elif [ "${abcd}" = "b" ]; then sudo sed -i "s/^rpc_password =.*/rpc_password = ${newPassword}/g" /home/joinmarket/.joinmarket/joinmarket.cfg echo "# changing the password for the 'joinmarket' user" echo "joinmarket:${newPassword}" | sudo chpasswd + echo "# restarting jopinmarket API" + sudo systemctl restart joinmarket-api.service fi # ThunderHub if [ "${thunderhub}" == "on" ]; then echo "# changing the password for ThunderHub" sudo sed -i "s/^masterPassword:.*/masterPassword: '${newPassword}'/g" /mnt/hdd/app-data/thunderhub/thubConfig.yaml + echo "# restarting thunderhub.service" + sudo systemctl restart thunderhub.service fi # LIT @@ -380,18 +388,26 @@ elif [ "${abcd}" = "b" ]; then echo "# changing the password for LIT" sudo sed -i "s/^uipassword=.*/uipassword=${newPassword}/g" /mnt/hdd/app-data/.lit/lit.conf sudo sed -i "s/^faraday.bitcoin.password=.*/faraday.bitcoin.password=${newPassword}/g" /mnt/hdd/app-data/.lit/lit.conf + echo "# restarting litd.service" + sudo systemctl restart litd.service fi # i2pd if [ "${i2pd}" == "on" ]; then echo "# changing the password for i2pd" sudo sed -i "s/^pass = .*/pass = ${newPassword}/g" /etc/i2pd/i2pd.conf + echo "# restarting i2pd.service" + sudo systemctl restart i2pd.service fi # LNDg if [ "${lndg}" == "on" ]; then echo "# changing the password for lndg" /home/admin/config.scripts/bonus.lndg.sh set-password "${newPassword}" + echo "# restarting lndg services" + sudo systemctl restart jobs-lndg.service + sudo systemctl restart rebalancer-lndg.service + sudo systemctl restart htlc-stream-lndg.service fi # mempool Explorer @@ -400,6 +416,8 @@ elif [ "${abcd}" = "b" ]; then sudo jq ".CORE_RPC.PASSWORD=\"${newPassword}\"" /home/mempool/mempool/backend/mempool-config.json > /var/cache/raspiblitz/mempool-config.json sudo mv /var/cache/raspiblitz/mempool-config.json /home/mempool/mempool/backend/mempool-config.json sudo chown mempool:mempool /home/mempool/mempool/backend/mempool-config.json + echo "# restarting mempool.service" + sudo systemctl restart mempool.service fi # elements @@ -407,11 +425,11 @@ elif [ "${abcd}" = "b" ]; then echo "# changing the password for elements" sudo sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /home/elements/.elements/elements.conf sudo sed -i "s/^mainchainrpcpassword=.*/mainchainrpcpassword=${newPassword}/g" /home/elements/.elements/elements.conf + echo "# restarting elementsd.service" + sudo systemctl restart elementsd.service fi echo "# OK -> RPC Password B changed" - echo "# Reboot is needed (will be triggered if interactive menu was called)" - echo "error=''" sleep 3 ############################ diff --git a/home.admin/config.scripts/bonus.faraday.sh b/home.admin/config.scripts/bonus.faraday.sh index 03b2de6d5..ba9a2d0fb 100755 --- a/home.admin/config.scripts/bonus.faraday.sh +++ b/home.admin/config.scripts/bonus.faraday.sh @@ -206,6 +206,7 @@ if [ "${mode}" = "on" ] || [ "${mode}" = "1" ]; then Description=faraday Wants=lnd.service After=lnd.service +PartOf=lnd.service [Service] User=faraday diff --git a/home.admin/config.scripts/bonus.helipad.sh b/home.admin/config.scripts/bonus.helipad.sh index d633b749f..f4e930bea 100644 --- a/home.admin/config.scripts/bonus.helipad.sh +++ b/home.admin/config.scripts/bonus.helipad.sh @@ -161,6 +161,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then Description=Helipad daemon Wants=lnd.service After=lnd.service +PartOf=lnd.service [Service] WorkingDirectory=$HELIPAD_BUILD_DIR/ ExecStart=$HELIPAD_BIN $HELIPAD_HTTP_PORT diff --git a/home.admin/config.scripts/bonus.lightningtipbot.sh b/home.admin/config.scripts/bonus.lightningtipbot.sh index 8fef9b883..690679f81 100644 --- a/home.admin/config.scripts/bonus.lightningtipbot.sh +++ b/home.admin/config.scripts/bonus.lightningtipbot.sh @@ -90,6 +90,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then [Unit] Description=LightningTipBot Service After=lnd.service +PartOf=lnd.service [Service] WorkingDirectory=/home/lightningtipbot/LightningTipBot diff --git a/home.admin/config.scripts/bonus.lnbits.sh b/home.admin/config.scripts/bonus.lnbits.sh index 132fac14e..5f68d9809 100644 --- a/home.admin/config.scripts/bonus.lnbits.sh +++ b/home.admin/config.scripts/bonus.lnbits.sh @@ -817,6 +817,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then Description=lnbits Wants=${systemdDependency} After=${systemdDependency} +PartOf=${systemdDependency} [Service] WorkingDirectory=/home/lnbits/lnbits diff --git a/home.admin/config.scripts/bonus.lndk.sh b/home.admin/config.scripts/bonus.lndk.sh index e02130ec1..33d8f4a17 100755 --- a/home.admin/config.scripts/bonus.lndk.sh +++ b/home.admin/config.scripts/bonus.lndk.sh @@ -46,6 +46,7 @@ protocol.custom-init=39 echo "[Unit] Description=lndk Service After=lnd.service +PartOf=lnd.service [Service] ExecStart=/home/bitcoin/lndk/target/debug/lndk --address=https://localhost:10009 --cert=/mnt/hdd/lnd/tls.cert --macaroon=/mnt/hdd/lnd/data/chain/bitcoin/mainnet/admin.macaroon diff --git a/home.admin/config.scripts/bonus.loop.sh b/home.admin/config.scripts/bonus.loop.sh index fd9257c63..52c0aac47 100755 --- a/home.admin/config.scripts/bonus.loop.sh +++ b/home.admin/config.scripts/bonus.loop.sh @@ -114,6 +114,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then [Unit] Description=Loopd Service After=lnd.service +PartOf=lnd.service [Service] WorkingDirectory=/home/loop/loop diff --git a/home.admin/config.scripts/bonus.rtl.sh b/home.admin/config.scripts/bonus.rtl.sh index 8d09931bb..b652978d6 100755 --- a/home.admin/config.scripts/bonus.rtl.sh +++ b/home.admin/config.scripts/bonus.rtl.sh @@ -48,8 +48,16 @@ echo "# RTLHTTP(${RTLHTTP})" # construct needed variable elements configEntry="${netprefix}${typeprefix}rtlWebinterface" systemdService="${netprefix}${typeprefix}RTL" +dependsOn="bitcoind" +if [ "${LNTYPE}" == "cl" ]; then + dependsOn="${netprefix}lightningd" +elif [ "${LNTYPE}" == "lnd" ]; then + dependsOn="${netprefix}lnd" +fi + echo "# configEntry(${configEntry})" echo "# systemdService(${systemdService})" +echo "# dependsOn(${dependsOn})" ########################## # MENU @@ -271,8 +279,9 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then [Unit] Description=${systemdService} Webinterface -Wants= -After= +Wants=${dependsOn}.service +After=${dependsOn}.service +PartOf=${dependsOn}.service [Service] Environment=\"RTL_CONFIG_PATH=/mnt/hdd/app-data/rtl/${systemdService}/\" @@ -297,19 +306,8 @@ WantedBy=multi-user.target " | sudo tee /etc/systemd/system/${systemdService}.service sudo chown root:root /etc/systemd/system/${systemdService}.service - # adapt systemd service template for LND - if [ "${LNTYPE}" == "lnd" ]; then - echo "# modifying ${systemdService}.service for LND" - sudo sed -i "s/^Wants=.*/Wants=${netprefix}lnd.service/g" /etc/systemd/system/${systemdService}.service - sudo sed -i "s/^After=.*/After=${netprefix}lnd.service/g" /etc/systemd/system/${systemdService}.service - fi - # adapt systemd service template for + # set up Core LightningREST (if needed) if [ "${LNTYPE}" == "cl" ]; then - echo "# modifying ${systemdService}.service for CL" - sudo sed -i "s/^Wants=.*/Wants=${netprefix}lightningd.service/g" /etc/systemd/system/${systemdService}.service - sudo sed -i "s/^After=.*/After=${netprefix}lightningd.service/g" /etc/systemd/system/${systemdService}.service - - # set up Core LightningREST /home/admin/config.scripts/cl.rest.sh on ${CHAIN} fi diff --git a/home.admin/config.scripts/cl.install-service.sh b/home.admin/config.scripts/cl.install-service.sh index 464e9d011..d36f2a37f 100644 --- a/home.admin/config.scripts/cl.install-service.sh +++ b/home.admin/config.scripts/cl.install-service.sh @@ -49,6 +49,7 @@ echo " Description=c-lightning daemon on $CHAIN Requires=${netprefix}bitcoind.service After=${netprefix}bitcoind.service +PartOf=${netprefix}bitcoind.service Wants=network-online.target After=network-online.target diff --git a/home.admin/config.scripts/lnd.install.sh b/home.admin/config.scripts/lnd.install.sh index 3b26e74c3..52abb774c 100644 --- a/home.admin/config.scripts/lnd.install.sh +++ b/home.admin/config.scripts/lnd.install.sh @@ -344,6 +344,7 @@ Description=Lightning Network Daemon on $CHAIN # Make sure lnd starts after bitcoind is ready Requires=${netprefix}bitcoind.service After=${netprefix}bitcoind.service +PartOf=${netprefix}bitcoind.service [Service] EnvironmentFile=/mnt/hdd/raspiblitz.conf From 22a95cae0852844dc507e20e917d1269e64530de Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Wed, 19 Jun 2024 23:02:41 +0200 Subject: [PATCH 39/59] Reduce use of "sudo" (#4522) --- home.admin/00infoBlitz.sh | 4 ++-- home.admin/98repairMenu.sh | 2 +- home.admin/_background.sh | 1 + home.admin/config.scripts/bitcoin.monitor.sh | 7 +++---- home.admin/config.scripts/blitz.datadrive.sh | 4 ++-- home.admin/config.scripts/network.txindex.sh | 13 ++++++++++--- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index c12e5e18f..695bb2052 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -358,7 +358,7 @@ else fileFlagExists=$(sudo ls /mnt/hdd/app-storage/electrs/initial-sync.done 2>/dev/null | grep -c 'initial-sync.done') if [ "${ElectRS}" == "on" ] && [ $fileFlagExists -eq 0 ]; then error="" - source <(sudo /home/admin/config.scripts/bonus.electrs.sh status-sync 2>/dev/null) + source <(/home/admin/config.scripts/bonus.electrs.sh status-sync 2>/dev/null) if [ ${#infoSync} -gt 0 ]; then appInfoLine="Electrum: ${infoSync}" fi @@ -368,7 +368,7 @@ else fileFlagExists=$(sudo ls /mnt/hdd/app-storage/fulcrum/initial-sync.done 2>/dev/null | grep -c 'initial-sync.done') if [ "${fulcrum}" == "on" ] && [ $fileFlagExists -eq 0 ]; then error="" - source <(sudo /home/admin/config.scripts/bonus.fulcrum.sh status-sync 2>/dev/null) + source <(/home/admin/config.scripts/bonus.fulcrum.sh status-sync 2>/dev/null) if [ ${#infoSync} -gt 0 ]; then appInfoLine="Fulcrum: ${infoSync}" fi diff --git a/home.admin/98repairMenu.sh b/home.admin/98repairMenu.sh index d22457493..66c743f7c 100755 --- a/home.admin/98repairMenu.sh +++ b/home.admin/98repairMenu.sh @@ -66,7 +66,7 @@ RaspiBlitz image to your SD card. } # get status of txindex -source <(/home/admin/config.scripts/network.txindex.sh status) +source <(sudo /home/admin/config.scripts/network.txindex.sh status) OPTIONS=() #OPTIONS+=(HARDWARE "Run Hardwaretest") diff --git a/home.admin/_background.sh b/home.admin/_background.sh index 9de0e4182..611e3a660 100755 --- a/home.admin/_background.sh +++ b/home.admin/_background.sh @@ -717,6 +717,7 @@ do if [ ${recheckRAID} -eq 1 ]; then # check if BTRTFS raid is active & scrub + logger -p info "background.sh - RAID data check" source <(/home/admin/config.scripts/blitz.datadrive.sh status) if [ "${isBTRFS}" == "1" ] && [ "${isRaid}" == "1" ]; then echo "STARTING BTRFS RAID DATA CHECK ..." diff --git a/home.admin/config.scripts/bitcoin.monitor.sh b/home.admin/config.scripts/bitcoin.monitor.sh index 950628bf6..3b9ad0b65 100755 --- a/home.admin/config.scripts/bitcoin.monitor.sh +++ b/home.admin/config.scripts/bitcoin.monitor.sh @@ -148,13 +148,12 @@ if [ "$2" = "info" ]; then if [ "$1" == "signet" ]; then subfolder="signet/" fi - btc_blocks_data_kb=$(sudo du -s /mnt/hdd/bitcoin/${subfolder}blocks 2>/dev/null | cut -f1) + + btc_blocks_data_kb=$(du -s /mnt/hdd/bitcoin/${subfolder}blocks | cut -f1) if [ "${btc_blocks_data_kb}" == "" ]; then btc_blocks_data_kb="0" fi - # print data - # parse data btc_blocks_headers=$(echo "${blockchaininfo}" | jq -r '.headers') btc_blocks_verified=$(echo "${blockchaininfo}" | jq -r '.blocks') @@ -257,7 +256,7 @@ if [ "$2" = "peer-kickstart" ]; then if [ "$(cat /mnt/hdd/raspiblitz.conf | grep -c "^runBehindTor=on")" != "0" ]; then addressFormat="tor" else - source <(sudo /home/admin/config.scripts/internet.sh status global) + source <(/home/admin/config.scripts/internet.sh status global) if [ "${ipv6}" == "off" ]; then addressFormat="ipv4" else diff --git a/home.admin/config.scripts/blitz.datadrive.sh b/home.admin/config.scripts/blitz.datadrive.sh index 030a054a5..14e444193 100755 --- a/home.admin/config.scripts/blitz.datadrive.sh +++ b/home.admin/config.scripts/blitz.datadrive.sh @@ -218,7 +218,7 @@ if [ "$1" = "status" ]; then fi # try to detect if its an SSD - isSMART=$(sudo smartctl -a /dev/${hdd} | grep -c "Serial Number:") + isSMART=$(smartctl -a /dev/${hdd} | grep -c "Serial Number:") echo "isSMART=${isSMART}" isSSD=1 isRotational=$(echo "${smartCtlA}" | grep -c "Rotation Rate:") @@ -458,7 +458,7 @@ if [ "$1" = "status" ]; then fi echo "hddRaspiVersion='${hddRaspiVersion}'" - smartCtlA=$(sudo smartctl -a /dev/${hdd} | tr -d '"') + smartCtlA=$(smartctl -a /dev/${hdd} | tr -d '"') # try to detect if its an SSD isSMART=$(echo "${smartCtlA}" | grep -c "Serial Number:") diff --git a/home.admin/config.scripts/network.txindex.sh b/home.admin/config.scripts/network.txindex.sh index 3b371ce6d..d7655bf2d 100755 --- a/home.admin/config.scripts/network.txindex.sh +++ b/home.admin/config.scripts/network.txindex.sh @@ -30,7 +30,14 @@ if [ "$1" = "status" ]; then echo "##### STATUS TXINDEX" - indexByteSize=$(sudo du -s /mnt/hdd/bitcoin/indexes/txindex 2>/dev/null | cut -f1) + # check user is root + if [ "$EUID" -ne 0 ]; then + logger "FAIL: network.txindex.sh status needs sudo" + echo "error='missing sudo'" + exit 1 + fi + + indexByteSize=$(du -s /mnt/hdd/bitcoin/indexes/txindex 2>/dev/null | cut -f1) if [ "${indexByteSize}" == "" ]; then indexByteSize=0 fi @@ -44,8 +51,8 @@ if [ "$1" = "status" ]; then # try to gather if still indexing source <(/home/admin/_cache.sh get btc_mainnet_blocks_headers) blockchainHeight="${btc_mainnet_blocks_headers}" - indexedToBlock=$(sudo tail -n 200 /mnt/hdd/${network}${pathAdd}/debug.log | grep "Syncing txindex with block chain from height" | tail -n 1 | cut -d " " -f 9 | sed 's/[^0-9]*//g') - indexFinished=$(sudo tail -n 200 /mnt/hdd/${network}${pathAdd}/debug.log | grep -c "txindex is enabled at height") + indexedToBlock=$(tail -n 200 /mnt/hdd/${network}${pathAdd}/debug.log | grep "Syncing txindex with block chain from height" | tail -n 1 | cut -d " " -f 9 | sed 's/[^0-9]*//g') + indexFinished=$(tail -n 200 /mnt/hdd/${network}${pathAdd}/debug.log | grep -c "txindex is enabled at height") if [ ${#indexedToBlock} -eq 0 ] || [ ${indexFinished} -gt 0 ] || [ "${indexedToBlock}" = "${blockchainHeight}" ]; then echo "isIndexed=1" From 8a16a8ffe04893c8c15578888928a49fc82cc875 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Fri, 21 Jun 2024 17:16:37 +0200 Subject: [PATCH 40/59] btcpay nbxplorer update: try to webflow key (#4627) --- home.admin/config.scripts/bonus.btcpayserver.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/home.admin/config.scripts/bonus.btcpayserver.sh b/home.admin/config.scripts/bonus.btcpayserver.sh index 37d06dcbc..fdac17454 100644 --- a/home.admin/config.scripts/bonus.btcpayserver.sh +++ b/home.admin/config.scripts/bonus.btcpayserver.sh @@ -861,12 +861,19 @@ if [ "$1" = "update" ]; then TAG=$(git tag | sort -V | tail -1) echo "# Reset to the latest release tag: $TAG" sudo -u btcpay git reset --hard $TAG + PGPsigner="nicolasdorier" PGPpubkeyLink="https://keybase.io/nicolasdorier/pgp_keys.asc" PGPpubkeyFingerprint="AB4CFA9895ACA0DBE27F6B346618763EF09186FE" - - sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh \ - "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1 + if ! sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh \ + "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}"; then + # try with webflow + PGPsigner="web-flow" + PGPpubkeyLink="https://github.com/web-flow.gpg" + PGPpubkeyFingerprint="B5690EEEBB952194" + sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh \ + "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1 + fi echo "# Build NBXplorer $TAG" # from the build.sh with path From b6c8bc17da4b3070139c59486648654006eb0128 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 28 Jun 2024 11:58:29 +0200 Subject: [PATCH 41/59] Update codeVersion to 1.11.1rc1 --- home.admin/_version.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/_version.info b/home.admin/_version.info index a1e3c8e37..743172305 100644 --- a/home.admin/_version.info +++ b/home.admin/_version.info @@ -1,3 +1,3 @@ # RaspiBlitz Version - always [major].[main].[sub] (sub can be a string like '2rc1') -codeVersion="1.11.0" +codeVersion="1.11.1rc1" # keep last line with comment ---> IF YOU HAVE A NEW VERSION BRANCH > EDIT ALSO build_sdcard.sh \ No newline at end of file From 9a2de6cad5f39a76b7a19af49b1ab735822a1e95 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:32:37 +0200 Subject: [PATCH 42/59] update amd64 base image to debian-12.6.0-amd64-netinst.iso (#4637) * update amd64 base image to debian-12.6.0-amd64-netinst.iso * add resolvconf and nameservers for the amd64 build --- CHANGES.md | 1 + ci/amd64/debian/build.amd64-debian.pkr.hcl | 4 ++-- ci/amd64/debian/scripts/networking.sh | 13 +++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 973d2bf23..f99710145 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ - New: Set Timezone SSHMENU > SYSTEM > TIME [details](https://github.com/raspiblitz/raspiblitz/issues/1712) - New: Labelbase 2.2.1 [details](https://x.com/labelbase_space) +- Update: amd64 base image: debian-12.6.0-amd64-netinst.iso - Update: LNbits 0.12.8 [details](https://github.com/lnbits/lnbits/releases/tag/0.12.8) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Update: BTCPayServer 1.13.0 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.0) diff --git a/ci/amd64/debian/build.amd64-debian.pkr.hcl b/ci/amd64/debian/build.amd64-debian.pkr.hcl index d42f688d4..7bcdbfcbb 100644 --- a/ci/amd64/debian/build.amd64-debian.pkr.hcl +++ b/ci/amd64/debian/build.amd64-debian.pkr.hcl @@ -1,5 +1,5 @@ -variable "iso_name" { default = "debian-12.5.0-amd64-netinst.iso" } -variable "iso_checksum" { default = "013f5b44670d81280b5b1bc02455842b250df2f0c6763398feb69af1a805a14f" } +variable "iso_name" { default = "debian-12.6.0-amd64-netinst.iso" } +variable "iso_checksum" { default = "ade3a4acc465f59ca2496344aab72455945f3277a52afc5a2cae88cdc370fa12" } variable "pack" { default = "lean" } variable "github_user" { default = "raspiblitz" } diff --git a/ci/amd64/debian/scripts/networking.sh b/ci/amd64/debian/scripts/networking.sh index a574c6900..26f72814f 100644 --- a/ci/amd64/debian/scripts/networking.sh +++ b/ci/amd64/debian/scripts/networking.sh @@ -1,9 +1,14 @@ #!/bin/sh -eux # Disable Predictable Network Interface names and use eth0 -sed -i 's/en[[:alnum:]]*/eth0/g' /etc/network/interfaces; -sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \1"/g' /etc/default/grub; -update-grub; +sed -i 's/en[[:alnum:]]*/eth0/g' /etc/network/interfaces +sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \1"/g' /etc/default/grub +update-grub # Adding a 2 sec delay to the interface up, to make the dhclient happy -echo "pre-up sleep 2" >> /etc/network/interfaces +echo "pre-up sleep 2" >>/etc/network/interfaces + +# needed for resolvconf installed in build_sdcard.sh +apt-get install resolvconf -y +echo 'nameserver 1.1.1.1' >/etc/resolv.conf +echo 'nameserver 8.8.8.8' >>/etc/resolv.conf From 40e970d8284d89f000dd54a522d0b704cd322311 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Sat, 6 Jul 2024 15:58:38 +0200 Subject: [PATCH 43/59] i2p: limit addseednodes to 21 new peers, format script (#4641) * i2p: limit addseednodes to 21 new peers, format script --- home.admin/config.scripts/blitz.i2pd.sh | 106 +++++++++++++----------- 1 file changed, 58 insertions(+), 48 deletions(-) diff --git a/home.admin/config.scripts/blitz.i2pd.sh b/home.admin/config.scripts/blitz.i2pd.sh index 24a7f1251..384880fa6 100644 --- a/home.admin/config.scripts/blitz.i2pd.sh +++ b/home.admin/config.scripts/blitz.i2pd.sh @@ -9,7 +9,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "blitz.i2pd.sh install -> Install i2pd" echo "blitz.i2pd.sh on -> Switch on i2pd" echo "blitz.i2pd.sh off -> Uninstall i2pd" - echo "blitz.i2pd.sh addseednodes -> Add all I2P seed nodes from: https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt" + echo "blitz.i2pd.sh addseednodes -> Add 21 randonly selected I2P seed nodes from: https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt" echo "blitz.i2pd.sh status -> I2P related logs from bitcoind, bitcoin-cli -netinfo 4 and webconsole access" exit 1 fi @@ -38,44 +38,44 @@ function add_repo { source /etc/os-release DIST=$ID case $ID in - debian|ubuntu|raspbian) - if [[ -n $DEBIAN_CODENAME ]]; then - VERSION_CODENAME=$DEBIAN_CODENAME - fi - if [[ -n $UBUNTU_CODENAME ]]; then - VERSION_CODENAME=$UBUNTU_CODENAME - fi - if [[ -z $VERSION_CODENAME ]]; then - echo "Couldn't find VERSION_CODENAME in your /etc/os-release file. Did your system supported? Please report issue to me by writing to email: 'r4sas i2pd.xyz'" - exit 1 - fi - RELEASE=$VERSION_CODENAME + debian | ubuntu | raspbian) + if [[ -n $DEBIAN_CODENAME ]]; then + VERSION_CODENAME=$DEBIAN_CODENAME + fi + if [[ -n $UBUNTU_CODENAME ]]; then + VERSION_CODENAME=$UBUNTU_CODENAME + fi + if [[ -z $VERSION_CODENAME ]]; then + echo "Couldn't find VERSION_CODENAME in your /etc/os-release file. Did your system supported? Please report issue to me by writing to email: 'r4sas i2pd.xyz'" + exit 1 + fi + RELEASE=$VERSION_CODENAME ;; - *) - if [[ -z $ID_LIKE || "$ID_LIKE" != "debian" && "$ID_LIKE" != "ubuntu" ]]; then - echo "Your system is not supported by this script. Currently it supports debian-like and ubuntu-like systems." - exit 1 - else - DIST=$ID_LIKE - case $ID_LIKE in - debian) - if [[ "$ID" == "kali" ]]; then - if [[ "$VERSION" == "2019"* || "$VERSION" == "2020"* ]]; then - RELEASE="buster" - elif [[ "$VERSION" == "2021"* || "$VERSION" == "2022"* ]]; then - RELEASE="bullseye" - fi - else - RELEASE=$DEBIAN_CODENAME - fi - ;; - ubuntu) - RELEASE=$UBUNTU_CODENAME - ;; - esac - fi - ;; - esac + *) + if [[ -z $ID_LIKE || "$ID_LIKE" != "debian" && "$ID_LIKE" != "ubuntu" ]]; then + echo "Your system is not supported by this script. Currently it supports debian-like and ubuntu-like systems." + exit 1 + else + DIST=$ID_LIKE + case $ID_LIKE in + debian) + if [[ "$ID" == "kali" ]]; then + if [[ "$VERSION" == "2019"* || "$VERSION" == "2020"* ]]; then + RELEASE="buster" + elif [[ "$VERSION" == "2021"* || "$VERSION" == "2022"* ]]; then + RELEASE="bullseye" + fi + else + RELEASE=$DEBIAN_CODENAME + fi + ;; + ubuntu) + RELEASE=$UBUNTU_CODENAME + ;; + esac + fi + ;; + esac if [[ -z $RELEASE ]]; then echo "Couldn't detect your system release. Please report issue to me by writing to email: 'r4sas i2pd.xyz'" exit 1 @@ -111,7 +111,7 @@ echo "# Running: 'blitz.i2pd.sh $*'" source /mnt/hdd/raspiblitz.conf # make sure to be present in PATH -if ! echo "$PATH" | grep "/usr/sbin"; then +if ! echo "$PATH" | grep "/usr/sbin" >/dev/null; then export PATH=$PATH:/usr/sbin echo "PATH=\$PATH:/usr/sbin" | sudo tee -a /etc/profile fi @@ -222,20 +222,30 @@ fi if [ "$1" = "addseednodes" ]; then - /home/admin/config.scripts/blitz.i2pd.sh on + if ! sudo -u bitcoin bitcoin-cli -netinfo 4 | grep i2p; then + /home/admin/config.scripts/blitz.i2pd.sh on + fi + echo "Add 21 randomly selected I2P seed nodes from: https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt" + echo "Monitor in a new terminal with:" + echo "watch sudo -u bitcoin bitcoin-cli -netinfo 4" + echo "This will take some time ..." - echo "Add all I2P seed nodes from: https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt" + # Fetch and filter the list of seed nodes i2pSeedNodeList=$(curl -sS https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/seeds/nodes_main.txt | grep .b32.i2p:0) - for i2pSeedNode in ${i2pSeedNodeList}; do - bitcoin-cli addnode "$i2pSeedNode" "onetry" - done - echo - echo "# Display sudo tail -n 100 /mnt/hdd/bitcoin/debug.log | grep i2p" - sudo tail -n 100 /mnt/hdd/bitcoin/debug.log | grep i2p + # Shuffle the list and pick the first 21 nodes + selectedNodes=$(echo "$i2pSeedNodeList" | shuf | head -n 21) + + # Add each selected node + for i2pSeedNode in ${selectedNodes}; do + echo "# Add i2p seed node: ${i2pSeedNode} by running:" + echo "bitcoin-cli addnode $i2pSeedNode onetry" + sudo -u bitcoin bitcoin-cli addnode "$i2pSeedNode" "onetry" + done + echo echo "# Display bitcoin-cli -netinfo 4" - bitcoin-cli -netinfo 4 + sudo -u bitcoin bitcoin-cli -netinfo 4 exit 0 fi From 205890368915126eac1d8e53fddc37972d56c69d Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 10 Jul 2024 13:28:20 +0200 Subject: [PATCH 44/59] #4642 WebUI master branch during RC phase --- home.admin/config.scripts/blitz.fatpack.sh | 5 ++++- home.admin/config.scripts/blitz.web.ui.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/blitz.fatpack.sh b/home.admin/config.scripts/blitz.fatpack.sh index 09d5d962a..21d64f533 100755 --- a/home.admin/config.scripts/blitz.fatpack.sh +++ b/home.admin/config.scripts/blitz.fatpack.sh @@ -95,7 +95,10 @@ sudo -u admin curl https://raw.githubusercontent.com/bitcoin/bitcoin/master/cont echo "* Adding Raspiblitz API ..." sudo /home/admin/config.scripts/blitz.web.api.sh on "${defaultAPIuser}" "${defaultAPIrepo}" "blitz-${branch}" || exit 1 echo "* Adding Raspiblitz WebUI ..." -sudo /home/admin/config.scripts/blitz.web.ui.sh on "${defaultWEBUIuser}" "${defaultWEBUIrepo}" "release/${branch}" || exit 1 + +# change back when final release to: +# sudo /home/admin/config.scripts/blitz.web.ui.sh on "${defaultWEBUIuser}" "${defaultWEBUIrepo}" "release/${branch}" || exit 1 +sudo /home/admin/config.scripts/blitz.web.ui.sh on "${defaultWEBUIuser}" "${defaultWEBUIrepo}" "master" || exit 1 # set build code as new www default sudo rm -r /home/admin/assets/nginx/www_public diff --git a/home.admin/config.scripts/blitz.web.ui.sh b/home.admin/config.scripts/blitz.web.ui.sh index 9564d6595..d5878c89d 100755 --- a/home.admin/config.scripts/blitz.web.ui.sh +++ b/home.admin/config.scripts/blitz.web.ui.sh @@ -64,7 +64,10 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then source <(sudo /home/admin/build_sdcard.sh -EXPORT) GITHUB_USER="${defaultWEBUIuser}" GITHUB_REPO="${defaultWEBUIrepo}" - GITHUB_BRANCH="release/${githubBranch}" + + # change back when final release to: GITHUB_BRANCH="release/${githubBranch}" + GITHUB_BRANCH="master" + GITHUB_COMMITORTAG="" else # get parameters From eaeb96ae149f05efa983c38728aeb43314d6b83d Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Wed, 10 Jul 2024 22:57:30 +0200 Subject: [PATCH 45/59] v1.11.1rc1 release (#4645) * v1.11.1rc1 release * fix headlines --- CHANGES.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index f99710145..5723fc1cb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,8 @@ -## What's new in Version 1.11.1 of RaspiBlitz? +## What's new in Version 1.11.1rc1 of RaspiBlitz? - New: Set Timezone SSHMENU > SYSTEM > TIME [details](https://github.com/raspiblitz/raspiblitz/issues/1712) - New: Labelbase 2.2.1 [details](https://x.com/labelbase_space) +- New: Redesign WebUI Setup & Recovery - Update: amd64 base image: debian-12.6.0-amd64-netinst.iso - Update: LNbits 0.12.8 [details](https://github.com/lnbits/lnbits/releases/tag/0.12.8) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) @@ -19,6 +20,14 @@ - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) - Remove: CopyStation Script [details](https://github.com/raspiblitz/raspiblitz/issues/4538) +### 1.11.1rc1 Release Candidate (JUST USE FOR TESTING, HIGHER RISK OF LOSING FUNDS!) + +- **MINIMAL SD CARD IMAGE ⮕ [raspiblitz-min-v1.11.1rc1-2024-07-10.img.gz](https://github.com/raspiblitz/raspiblitz/actions/runs/9879783635/artifacts/1688105079)** +- SHA-256: be73a1c4fffa3c2e87a6284bddf362066bb26ea2174ee507bef2c71bf959254b (zip-file) + +- **FATPACK SD CARD IMAGE ⮕ [raspiblitz-fat-v1.11.1rc1-2024-07-10.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.11.1rc1-2024-07-10.img.gz)** +- SHA-256: a4ef4dc4bf987abc81832e8c83cb182df3e8ca634744c3655a8630b0b2dd4f5c + ## What's new in Version 1.11.0 of RaspiBlitz? - New: RaspberryPi5 tested & enabling NVMe PCIe Hats From 9f7c479b0d5c7db018846a78bd8d996f1886c7b7 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Sun, 21 Jul 2024 00:04:44 +0200 Subject: [PATCH 46/59] #4649 correct electrs installed status (#4651) #4649 old installed/configured status --- home.admin/config.scripts/bonus.electrs.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/home.admin/config.scripts/bonus.electrs.sh b/home.admin/config.scripts/bonus.electrs.sh index 2fb54ae83..e80edfb8c 100755 --- a/home.admin/config.scripts/bonus.electrs.sh +++ b/home.admin/config.scripts/bonus.electrs.sh @@ -32,16 +32,18 @@ if [ "$1" = "status" ]; then if [ "${ElectRS}" = "on" ]; then echo "configured=1" + echo "installed=1" else echo "configured=0" + echo "installed=0" echo "infoSync='Service not installed'" fi - if id "electrs" &>/dev/null; then - echo "installed=1" - else - echo "installed=0" - fi + #if id "electrs" &>/dev/null; then + # echo "installed=1" + #else + # echo "installed=0" + #fi serviceInstalled=$(sudo systemctl status electrs --no-page 2>/dev/null | grep -c "electrs.service - Electrs") serviceRunning=$(sudo systemctl status electrs --no-page 2>/dev/null | grep -c "active (running)") From 544e49ecf86c6a08570154018cfba6d633745982 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 22 Jul 2024 10:43:57 +0200 Subject: [PATCH 47/59] make sure to update os on release --- home.admin/config.scripts/blitz.preparerelease.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/home.admin/config.scripts/blitz.preparerelease.sh b/home.admin/config.scripts/blitz.preparerelease.sh index 54b497dad..f4057dcae 100755 --- a/home.admin/config.scripts/blitz.preparerelease.sh +++ b/home.admin/config.scripts/blitz.preparerelease.sh @@ -38,12 +38,6 @@ echo "cpu=${cpu}" >> /home/admin/raspiblitz.info echo "blitzapi=${blitzapi}" >> /home/admin/raspiblitz.info echo "displayClass=${displayClass}" >> /home/admin/raspiblitz.info -# make sure that every install runs API with own secret= -echo -echo "deleting old API conf ..." -sudo rm /home/blitzapi/blitz_api/.env 2>/dev/null -echo "OK" - # https://github.com/rootzoll/raspiblitz/issues/1371 echo echo "deactivate local WIFI ..." @@ -53,7 +47,8 @@ echo "OK" # make sure that every install runs API with own secret # https://github.com/raspiblitz/raspiblitz/issues/4469 echo -# check if redis is enabled +echo "deleting old API conf ..." +sudo rm /home/blitzapi/blitz_api/.env 2>/dev/null REDIS_ENABLED=$(sudo systemctl is-enabled redis 2>/dev/null | grep -c enabled) if [ ${REDIS_ENABLED} -gt 0 ]; then echo "disable redis for initial start ..." @@ -70,6 +65,11 @@ echo "reset DNS confs ..." echo -e "nameserver 1.1.1.1\nnameserver 84.200.69.80" | sudo tee /etc/resolv.conf > /dev/null echo "OK" +# update system +echo "update OS ..." +sudo apt-get update -y +sudo apt-get upgrade -f -y + # SSH Pubkeys (make unique for every sd card image install) echo echo "deleting SSH Pub keys ..." From a68069d3eeb587d3166accc7566326b490bbf071 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 22 Jul 2024 11:08:05 +0200 Subject: [PATCH 48/59] softer update OS during release --- home.admin/config.scripts/blitz.preparerelease.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/blitz.preparerelease.sh b/home.admin/config.scripts/blitz.preparerelease.sh index f4057dcae..10d7d5ac7 100755 --- a/home.admin/config.scripts/blitz.preparerelease.sh +++ b/home.admin/config.scripts/blitz.preparerelease.sh @@ -68,7 +68,7 @@ echo "OK" # update system echo "update OS ..." sudo apt-get update -y -sudo apt-get upgrade -f -y +sudo apt-get upgrade -y # SSH Pubkeys (make unique for every sd card image install) echo From 4d4385a84081ca2fa08625c9e378dbb9671ef589 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 22 Jul 2024 13:22:15 +0200 Subject: [PATCH 49/59] only security updates on release --- home.admin/config.scripts/blitz.preparerelease.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/blitz.preparerelease.sh b/home.admin/config.scripts/blitz.preparerelease.sh index 10d7d5ac7..184eccbf4 100755 --- a/home.admin/config.scripts/blitz.preparerelease.sh +++ b/home.admin/config.scripts/blitz.preparerelease.sh @@ -65,10 +65,11 @@ echo "reset DNS confs ..." echo -e "nameserver 1.1.1.1\nnameserver 84.200.69.80" | sudo tee /etc/resolv.conf > /dev/null echo "OK" -# update system +# update system (only security updates with minimal risk of breaking changes) echo "update OS ..." sudo apt-get update -y -sudo apt-get upgrade -y +sudo apt-get upgrade -o Dir::Etc::SourceList=/etc/apt/sources.list.d/security.list -y +sudo apt-get upgrade openssh-server -y # SSH Pubkeys (make unique for every sd card image install) echo From d9b091be1a565b6cf8c20bafceeeead55ec22343 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 22 Jul 2024 17:43:55 +0200 Subject: [PATCH 50/59] ensuring the system is in a consistent state for release --- home.admin/config.scripts/blitz.preparerelease.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home.admin/config.scripts/blitz.preparerelease.sh b/home.admin/config.scripts/blitz.preparerelease.sh index 184eccbf4..fb17057db 100755 --- a/home.admin/config.scripts/blitz.preparerelease.sh +++ b/home.admin/config.scripts/blitz.preparerelease.sh @@ -66,10 +66,12 @@ echo -e "nameserver 1.1.1.1\nnameserver 84.200.69.80" | sudo tee /etc/resolv.con echo "OK" # update system (only security updates with minimal risk of breaking changes) +echo echo "update OS ..." sudo apt-get update -y sudo apt-get upgrade -o Dir::Etc::SourceList=/etc/apt/sources.list.d/security.list -y sudo apt-get upgrade openssh-server -y +sudo dpkg --configure -a # SSH Pubkeys (make unique for every sd card image install) echo From e7bb32a4858a31ab8abc903347d692dde53c3b8a Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Tue, 23 Jul 2024 23:29:21 +0200 Subject: [PATCH 51/59] #4654 pyblock 2.7.1 (#4655) Update PyBlock to 2.7.1 --- CHANGES.md | 1 + home.admin/_commands.sh | 4 ++-- home.admin/config.scripts/bonus.pyblock.sh | 13 +++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5723fc1cb..ce4308763 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ - Update: show progress of electrs building index on LCD - Update: lndmanage 0.16.0 [details](https://github.com/bitromortac/lndmanage) - Update: Lightning Terminal v0.12.5-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.12.5-alpha) +- Update: PyBlock 2.7.1 [details](https://github.com/curly60e/pyblock/blob/master/README.md) - Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955) - Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) diff --git a/home.admin/_commands.sh b/home.admin/_commands.sh index 640f625a3..417466c2b 100755 --- a/home.admin/_commands.sh +++ b/home.admin/_commands.sh @@ -357,8 +357,8 @@ function bos() { # switch to the pyblock user for PyBLOCK function pyblock() { if [ $(grep -c "pyblock=on" < /mnt/hdd/raspiblitz.conf) -eq 1 ]; then - cd /home/pyblock - sudo -u pyblock /home/pyblock/.local/bin/pyblock + cd /home/pyblock/pyblock + sudo -u pyblock poetry run python -m pybitblock.console else echo "PyBlock is not installed - to install run:" echo "/home/admin/config.scripts/bonus.pyblock.sh on" diff --git a/home.admin/config.scripts/bonus.pyblock.sh b/home.admin/config.scripts/bonus.pyblock.sh index 1d92a4082..239e52675 100644 --- a/home.admin/config.scripts/bonus.pyblock.sh +++ b/home.admin/config.scripts/bonus.pyblock.sh @@ -41,18 +41,23 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # install hexyl sudo apt-get install -y hexyl html2text + ## WORKAROUND: see https://github.com/raspiblitz/raspiblitz/issues/4383 # install via pip # sudo -u pyblock pip3 install pybitblock # install from github sudo -u pyblock git clone https://github.com/curly60e/pyblock.git cd pyblock - sudo -u pyblock git checkout v2.2.3 - sudo -u pyblock sed -i 's/jq = "1.2.2"/jq = "1.2.3"/' pyproject.toml - sudo -u pyblock pip install . + sudo -u pyblock git checkout v2.7.1 + sudo -u pyblock sed -i 's/^python =.*$/python = ">=3.11,<4.0"/' pyproject.toml + sudo -u pyblock poetry lock + sudo -u pyblock poetry install + envPath=$(sudo -u pyblock poetry env info --path) + sudo -u pyblock ${envPath}/bin/pip uninstall -y typer click + sudo -u pyblock ${envPath}/bin/pip install typer==0.4.0 click==8.0.0 # set PATH for the user - sudo bash -c "echo 'PATH=\$PATH:/home/pyblock/.local/bin/' >> /home/pyblock/.profile" + sudo bash -c "echo 'PATH=\$PATH:${envPath}/bin' >> /home/pyblock/.profile" # add user to group with admin access to lnd sudo /usr/sbin/usermod --append --groups lndadmin pyblock From cd424ac955d784cf0c11ce95a8f9185cabcc0710 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Tue, 23 Jul 2024 23:30:11 +0200 Subject: [PATCH 52/59] #4642 dont use release branches on RCs (#4656) --- home.admin/config.scripts/blitz.fatpack.sh | 21 ++++++++++++++------- home.admin/config.scripts/blitz.web.api.sh | 10 +++++++++- home.admin/config.scripts/blitz.web.ui.sh | 11 ++++++++--- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/home.admin/config.scripts/blitz.fatpack.sh b/home.admin/config.scripts/blitz.fatpack.sh index 21d64f533..61449dcd6 100755 --- a/home.admin/config.scripts/blitz.fatpack.sh +++ b/home.admin/config.scripts/blitz.fatpack.sh @@ -92,13 +92,20 @@ sudo -u admin curl -H "Accept: application/json; indent=4" https://bitnodes.io/a # Fallback Nodes List from Bitcoin Core sudo -u admin curl https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/seeds/nodes_main.txt -o /home/admin/fallback.bitcoin.nodes -echo "* Adding Raspiblitz API ..." -sudo /home/admin/config.scripts/blitz.web.api.sh on "${defaultAPIuser}" "${defaultAPIrepo}" "blitz-${branch}" || exit 1 -echo "* Adding Raspiblitz WebUI ..." - -# change back when final release to: -# sudo /home/admin/config.scripts/blitz.web.ui.sh on "${defaultWEBUIuser}" "${defaultWEBUIrepo}" "release/${branch}" || exit 1 -sudo /home/admin/config.scripts/blitz.web.ui.sh on "${defaultWEBUIuser}" "${defaultWEBUIrepo}" "master" || exit 1 +# use dev branch when its an Release Candidate +source <(/home/admin/_cache.sh get codeVersion) +if [[ "$codeVersion" == *"rc"* ]]; then + echo "# RELEASE CANDIDATE: using development branches for WebUI & API" + echo "* Adding Raspiblitz API ..." + sudo /home/admin/config.scripts/blitz.web.api.sh on "${defaultAPIuser}" "${defaultAPIrepo}" "dev" || exit 1 + echo "* Adding Raspiblitz WebUI ..." + sudo /home/admin/config.scripts/blitz.web.ui.sh on "${defaultWEBUIuser}" "${defaultWEBUIrepo}" "master" || exit 1 +else + echo "* Adding Raspiblitz API ..." + sudo /home/admin/config.scripts/blitz.web.api.sh on "${defaultAPIuser}" "${defaultAPIrepo}" "blitz-${branch}" || exit 1 + echo "* Adding Raspiblitz WebUI ..." + sudo /home/admin/config.scripts/blitz.web.ui.sh on "${defaultWEBUIuser}" "${defaultWEBUIrepo}" "release/${branch}" || exit 1 +fi # set build code as new www default sudo rm -r /home/admin/assets/nginx/www_public diff --git a/home.admin/config.scripts/blitz.web.api.sh b/home.admin/config.scripts/blitz.web.api.sh index b5b9891ab..da9c862ce 100644 --- a/home.admin/config.scripts/blitz.web.api.sh +++ b/home.admin/config.scripts/blitz.web.api.sh @@ -178,7 +178,15 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "# activeBranch detected by build_sdcard.sh: ${activeBranch}" GITHUB_USER="${defaultAPIuser}" GITHUB_REPO="${defaultAPIrepo}" - GITHUB_BRANCH="blitz-${githubBranch}" + # use dev branch when its an Release Candidate + source <(/home/admin/_cache.sh get codeVersion) + if [[ "$codeVersion" == *"rc"* ]]; then + echo "# RELEASE CANDIDATE: using dev branch" + GITHUB_BRANCH="dev" + else + GITHUB_BRANCH="blitz-${githubBranch}" + fi + GITHUB_COMMITORTAG="" else # get parameters diff --git a/home.admin/config.scripts/blitz.web.ui.sh b/home.admin/config.scripts/blitz.web.ui.sh index d5878c89d..158508009 100755 --- a/home.admin/config.scripts/blitz.web.ui.sh +++ b/home.admin/config.scripts/blitz.web.ui.sh @@ -65,9 +65,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then GITHUB_USER="${defaultWEBUIuser}" GITHUB_REPO="${defaultWEBUIrepo}" - # change back when final release to: GITHUB_BRANCH="release/${githubBranch}" - GITHUB_BRANCH="master" - + # use master branch when its an Release Candidate + source <(/home/admin/_cache.sh get codeVersion) + if [[ "$codeVersion" == *"rc"* ]]; then + echo "# RELEASE CANDIDATE: using master branch" + GITHUB_BRANCH="master" + else + GITHUB_BRANCH="release/${githubBranch}" + fi GITHUB_COMMITORTAG="" else # get parameters From 1183448f4fc57c6655bd5c283b94a32a6255589c Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 24 Jul 2024 00:41:05 +0200 Subject: [PATCH 53/59] version bump v1.11.1rc2 --- home.admin/_version.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/_version.info b/home.admin/_version.info index 743172305..273ab7201 100644 --- a/home.admin/_version.info +++ b/home.admin/_version.info @@ -1,3 +1,3 @@ # RaspiBlitz Version - always [major].[main].[sub] (sub can be a string like '2rc1') -codeVersion="1.11.1rc1" +codeVersion="1.11.1rc2" # keep last line with comment ---> IF YOU HAVE A NEW VERSION BRANCH > EDIT ALSO build_sdcard.sh \ No newline at end of file From 1e5ea5ff6f4656dc0e6b2daa160f44bc57a242fe Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Wed, 24 Jul 2024 12:00:26 +0200 Subject: [PATCH 54/59] #4654 pyblock 2.7.2 (#4657) * Update pyblock to v2.7.2 --- CHANGES.md | 2 +- home.admin/config.scripts/bonus.pyblock.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ce4308763..8e1f634e3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,7 +11,7 @@ - Update: show progress of electrs building index on LCD - Update: lndmanage 0.16.0 [details](https://github.com/bitromortac/lndmanage) - Update: Lightning Terminal v0.12.5-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.12.5-alpha) -- Update: PyBlock 2.7.1 [details](https://github.com/curly60e/pyblock/blob/master/README.md) +- Update: PyBlock 2.7.2 [details](https://github.com/curly60e/pyblock/blob/master/README.md) - Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955) - Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) diff --git a/home.admin/config.scripts/bonus.pyblock.sh b/home.admin/config.scripts/bonus.pyblock.sh index 239e52675..d3e22cd82 100644 --- a/home.admin/config.scripts/bonus.pyblock.sh +++ b/home.admin/config.scripts/bonus.pyblock.sh @@ -48,13 +48,13 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # install from github sudo -u pyblock git clone https://github.com/curly60e/pyblock.git cd pyblock - sudo -u pyblock git checkout v2.7.1 + sudo -u pyblock git checkout v2.7.2 sudo -u pyblock sed -i 's/^python =.*$/python = ">=3.11,<4.0"/' pyproject.toml sudo -u pyblock poetry lock sudo -u pyblock poetry install envPath=$(sudo -u pyblock poetry env info --path) - sudo -u pyblock ${envPath}/bin/pip uninstall -y typer click - sudo -u pyblock ${envPath}/bin/pip install typer==0.4.0 click==8.0.0 + # sudo -u pyblock ${envPath}/bin/pip uninstall -y typer click + # sudo -u pyblock ${envPath}/bin/pip install typer==0.4.0 click==8.0.0 # set PATH for the user sudo bash -c "echo 'PATH=\$PATH:${envPath}/bin' >> /home/pyblock/.profile" From d2bcb4c34a6c2ee9dd5dc21fb123e9809688e9b2 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 24 Jul 2024 12:19:58 +0200 Subject: [PATCH 55/59] release v1.11.1rc2 --- CHANGES.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8e1f634e3..8f2147188 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -## What's new in Version 1.11.1rc1 of RaspiBlitz? +## What's new in Version 1.11.1rc2 of RaspiBlitz? - New: Set Timezone SSHMENU > SYSTEM > TIME [details](https://github.com/raspiblitz/raspiblitz/issues/1712) - New: Labelbase 2.2.1 [details](https://x.com/labelbase_space) @@ -21,13 +21,13 @@ - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) - Remove: CopyStation Script [details](https://github.com/raspiblitz/raspiblitz/issues/4538) -### 1.11.1rc1 Release Candidate (JUST USE FOR TESTING, HIGHER RISK OF LOSING FUNDS!) +### 1.11.1rc2 Release Candidate (JUST USE FOR TESTING, HIGHER RISK OF LOSING FUNDS!) -- **MINIMAL SD CARD IMAGE ⮕ [raspiblitz-min-v1.11.1rc1-2024-07-10.img.gz](https://github.com/raspiblitz/raspiblitz/actions/runs/9879783635/artifacts/1688105079)** -- SHA-256: be73a1c4fffa3c2e87a6284bddf362066bb26ea2174ee507bef2c71bf959254b (zip-file) +- **MINIMAL SD CARD IMAGE ⮕ [raspiblitz-min-v1.11.1rc2-2024-07-24.img.gz](https://github.com/raspiblitz/raspiblitz/actions/runs/10067746544/artifacts/1732856482)** +- SHA-256: fad674e874ed262fff2fdc3588babd7217e1d900ca44b906ce80d35bbfacc6df (zip-file) -- **FATPACK SD CARD IMAGE ⮕ [raspiblitz-fat-v1.11.1rc1-2024-07-10.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.11.1rc1-2024-07-10.img.gz)** -- SHA-256: a4ef4dc4bf987abc81832e8c83cb182df3e8ca634744c3655a8630b0b2dd4f5c +- **FATPACK SD CARD IMAGE ⮕ [raspiblitz-fat-v1.11.1rc2-2024-07-24.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.11.1rc2-2024-07-24.img.gz)** +- SHA-256: faf75fcad96899ee34ef2ad1046c7690576d3626f51f79deb98f928a07cf769b ## What's new in Version 1.11.0 of RaspiBlitz? From 0134325bfedd4fe2634c8f757c0f83126e60de68 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 24 Jul 2024 23:46:30 +0200 Subject: [PATCH 56/59] v1.11.1rc3 --- home.admin/_version.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/_version.info b/home.admin/_version.info index 273ab7201..c221a72ea 100644 --- a/home.admin/_version.info +++ b/home.admin/_version.info @@ -1,3 +1,3 @@ # RaspiBlitz Version - always [major].[main].[sub] (sub can be a string like '2rc1') -codeVersion="1.11.1rc2" +codeVersion="1.11.1rc3" # keep last line with comment ---> IF YOU HAVE A NEW VERSION BRANCH > EDIT ALSO build_sdcard.sh \ No newline at end of file From 0f1b1fc4338045f121f2ab53cc1d9d075c797729 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 26 Jul 2024 12:44:03 +0200 Subject: [PATCH 57/59] chore: Update RaspiBlitz to version 1.11.1rc3 --- CHANGES.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8f2147188..010916b16 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -## What's new in Version 1.11.1rc2 of RaspiBlitz? +## What's new in Version 1.11.1rc3 of RaspiBlitz? - New: Set Timezone SSHMENU > SYSTEM > TIME [details](https://github.com/raspiblitz/raspiblitz/issues/1712) - New: Labelbase 2.2.1 [details](https://x.com/labelbase_space) @@ -21,13 +21,13 @@ - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) - Remove: CopyStation Script [details](https://github.com/raspiblitz/raspiblitz/issues/4538) -### 1.11.1rc2 Release Candidate (JUST USE FOR TESTING, HIGHER RISK OF LOSING FUNDS!) +### 1.11.1rc3 Release Candidate (JUST USE FOR TESTING, HIGHER RISK OF LOSING FUNDS!) - **MINIMAL SD CARD IMAGE ⮕ [raspiblitz-min-v1.11.1rc2-2024-07-24.img.gz](https://github.com/raspiblitz/raspiblitz/actions/runs/10067746544/artifacts/1732856482)** -- SHA-256: fad674e874ed262fff2fdc3588babd7217e1d900ca44b906ce80d35bbfacc6df (zip-file) +- SHA-256: b1bfd979c263526264105132752c1adf7d3e31a303b2e6c25b79501db47b968e (zip-file) -- **FATPACK SD CARD IMAGE ⮕ [raspiblitz-fat-v1.11.1rc2-2024-07-24.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.11.1rc2-2024-07-24.img.gz)** -- SHA-256: faf75fcad96899ee34ef2ad1046c7690576d3626f51f79deb98f928a07cf769b +- **FATPACK SD CARD IMAGE ⮕ [raspiblitz-fat-v1.11.1rc3-2024-07-25.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.11.1rc3-2024-07-25.img.gz)** +- SHA-256: d280c99fc1ed55a7eb8540c3c0f361e55482af9c989715d15c9e834444d074ce ## What's new in Version 1.11.0 of RaspiBlitz? From 62a34a6105e50a1968489e3687dfc0391f4c3c6d Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Mon, 29 Jul 2024 20:16:24 +0200 Subject: [PATCH 58/59] #4660 More flexible interims tested Bitcoin Core update option (#4661) * #4660 set 27.1 as tested update * #4660 allow tested updates on every sub release --- home.admin/_provision_.sh | 2 +- home.admin/config.scripts/bitcoin.update.sh | 75 ++++++++++++++++++--- 2 files changed, 66 insertions(+), 11 deletions(-) diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index fc4e1e8ef..b41c2cecc 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -222,7 +222,7 @@ echo "### RUNNING PROVISIONING SERVICES ###" >> ${logFile} # BITCOIN INTERIMS UPDATE if [ ${#bitcoinInterimsUpdate} -gt 0 ]; then - /home/admin/_cache.sh set message "Provisioning Bitcoin Core update" + /home/admin/_cache.sh set message "Bitcoin Core update" if [ "${bitcoinInterimsUpdate}" == "reckless" ]; then # recklessly update Bitcoin Core to latest release on GitHub echo "Provisioning Bitcoin Core reckless interims update" >> ${logFile} diff --git a/home.admin/config.scripts/bitcoin.update.sh b/home.admin/config.scripts/bitcoin.update.sh index 43d2667b9..ecf497c6e 100755 --- a/home.admin/config.scripts/bitcoin.update.sh +++ b/home.admin/config.scripts/bitcoin.update.sh @@ -19,9 +19,8 @@ echo "# Running: bitcoin.update.sh $*" # 1. parameter [info|tested|reckless] mode="$1" -# RECOMMENDED UPDATE BY RASPIBLITZ TEAM (just possible once per sd card update) -# comment will be shown as "BEWARE Info" when option is chosen (can be multiple lines) -bitcoinVersion="27.0" # example: 22.0 .. keep empty if no newer version as sd card build is available +# RECOMMENDED UPDATE BY RASPIBLITZ TEAM (latest tested version available) +bitcoinVersion="27.1" # example: 22.0 .. keep empty if no newer version as sd card build is available # GATHER DATA # setting download directory to the current user @@ -59,6 +58,39 @@ function displayInfo() { echo "bitcoinLatestVersion='${bitcoinLatestVersion}'" } +# COMAPRE TWO VERSION STRINGS +# 0 = first version string is equal +# 1 = first version string is older +# 2 = first version string is newer +function version_compare() { + if [[ $1 == $2 ]] + then + echo "equal" + return 0 + fi + IFS='.' read -r -a ver1 <<< "$1" + IFS='.' read -r -a ver2 <<< "$2" + len1=${#ver1[@]} + len2=${#ver2[@]} + max_len=$((len1>len2?len1:len2)) + for ((i=0; i part2)) + then + # newer + return 2 + fi + done + # equal + return 0 +} + if [ "${mode}" = "info" ]; then displayInfo exit 1 @@ -69,20 +101,43 @@ if [ "${mode}" = "tested" ]; then echo "# bitcoin.update.sh tested" + # check if a tested update is available + if [ ${#bitcoinVersion} -eq 0 ]; then + echo "# warn='no tested update available'" + echo "# thats OK on update from older versions" + /home/admin/config.scripts/blitz.conf.sh delete bitcoinInterimsUpdate 2>/dev/null + exit 1 + fi + # check for optional second parameter: forced update version - # --> only does the tested update if its the given version - # this is needed for recovery/update. fixedBitcoinVersion="$2" if [ ${#fixedBitcoinVersion} -gt 0 ]; then - echo "# checking for fixed version update: askedFor(${bitcoinVersion}) available(${bitcoinVersion})" - if [ "${fixedBitcoinVersion}" != "${bitcoinVersion}" ]; then - echo "# warn='required update version does not match'" - echo "# this is normal when the recovery script of a new RaspiBlitz version checks for an old update - just ignore" + echo "# checking for fixed version update: installed(${installedVersion}) requested(${fixedBitcoinVersion}) available(${bitcoinVersion})" + version_compare "${fixedBitcoinVersion}" "${bitcoinVersion}" + result=$? + if [ "${result}" -eq 2 ]; then + echo "# WARNING: requested version is newer then available tested --> ABORT (already up2date)" exit 1 else - echo "# OK - update version is matching" + echo "# requested version is older or equal --> OK install available tested version" fi fi + + # check against installed version + version_compare "${installedVersion}" "${bitcoinVersion}" + result=$? + if [ "${result}" -eq 2 ]; then + # this can happen if bitcoin install script already has a higher version then the tested version set by this script (see above) + echo "# installed version is newer then to be updated version --> ABORT" + echo + exit 1 + fi + if [ "${result}" -eq 0 ]; then + echo "# version is already installed --> ABORT" + echo + exit 1 + fi + pathVersion=${bitcoinVersion} elif [ "${mode}" = "reckless" ]; then From ed675f628d0426ffe48614a07680638a2e9a80c5 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jul 2024 20:22:02 +0200 Subject: [PATCH 59/59] RaspiBlitz v1.11.1 --- CHANGES.md | 11 ++--------- home.admin/_version.info | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 010916b16..9c35071f2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -## What's new in Version 1.11.1rc3 of RaspiBlitz? +## What's new in Version 1.11.1 of RaspiBlitz? - New: Set Timezone SSHMENU > SYSTEM > TIME [details](https://github.com/raspiblitz/raspiblitz/issues/1712) - New: Labelbase 2.2.1 [details](https://x.com/labelbase_space) @@ -12,6 +12,7 @@ - Update: lndmanage 0.16.0 [details](https://github.com/bitromortac/lndmanage) - Update: Lightning Terminal v0.12.5-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.12.5-alpha) - Update: PyBlock 2.7.2 [details](https://github.com/curly60e/pyblock/blob/master/README.md) +- Update: Bitcoin Core 27.1 (as tested update) [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-27.1.md) - Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955) - Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) @@ -21,14 +22,6 @@ - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) - Remove: CopyStation Script [details](https://github.com/raspiblitz/raspiblitz/issues/4538) -### 1.11.1rc3 Release Candidate (JUST USE FOR TESTING, HIGHER RISK OF LOSING FUNDS!) - -- **MINIMAL SD CARD IMAGE ⮕ [raspiblitz-min-v1.11.1rc2-2024-07-24.img.gz](https://github.com/raspiblitz/raspiblitz/actions/runs/10067746544/artifacts/1732856482)** -- SHA-256: b1bfd979c263526264105132752c1adf7d3e31a303b2e6c25b79501db47b968e (zip-file) - -- **FATPACK SD CARD IMAGE ⮕ [raspiblitz-fat-v1.11.1rc3-2024-07-25.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.11.1rc3-2024-07-25.img.gz)** -- SHA-256: d280c99fc1ed55a7eb8540c3c0f361e55482af9c989715d15c9e834444d074ce - ## What's new in Version 1.11.0 of RaspiBlitz? - New: RaspberryPi5 tested & enabling NVMe PCIe Hats diff --git a/home.admin/_version.info b/home.admin/_version.info index c221a72ea..4b006854d 100644 --- a/home.admin/_version.info +++ b/home.admin/_version.info @@ -1,3 +1,3 @@ # RaspiBlitz Version - always [major].[main].[sub] (sub can be a string like '2rc1') -codeVersion="1.11.1rc3" +codeVersion="1.11.1" # keep last line with comment ---> IF YOU HAVE A NEW VERSION BRANCH > EDIT ALSO build_sdcard.sh \ No newline at end of file