From 75171c09e36f715054b55d9ae7f52fa4d57e3b13 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Thu, 11 May 2023 17:12:28 +0200 Subject: [PATCH 1/2] merge prepare v1.9.0rc5 (#3824) * extend sd card before fatpack (#3783) * Fatpack sd card expand (#3784) * extend sd card before fatpack * fix expansion detection * Bump lnbits to 0.10.5 and add path to poetry in systemd script (#3787) * fix: don't reinstall same CLN version + fmt (#3796) * fix: lnd check for rpcmiddleware (#3804) * fix: joininbox update, hide jm api error from lcd (#3801) * fix: hide jm api error from lcd * joininbox update to v0.7.8 * fix: remove lnbits user when off, improve checks (#3798) * reduce bitcoind memory usage w MALLOC_ARENA_MAX=1 (#3780) * Misc fixed towards v1.9.0 (#3808) * get web api info * #3772 increase curl timeout * #3805 change "Please Login" * #3807 fix cln jrpc socket access (#3815) * Btcpay 193 (#3812) * Update BTCPay v1.9.3 * btcpay verify with web-flow * lnbits 0.10.6 update (#3814) * Fatpack: LCD on & cl-plugin.cln-grpc OFF (#3817) * make sure fatpack is LCD activated * remove cl-plugin.cln-grpc.sh by default * #3793 fix socket jrpc * lndmanage 0.15.0 (#3818) --------- Co-authored-by: Stephan Oeste Co-authored-by: openoms <43343391+openoms@users.noreply.github.com> --- CHANGES.md | 6 +- home.admin/00infoBlitz.sh | 2 +- home.admin/00settingsMenuBasics.sh | 6 - home.admin/_bootstrap.sh | 8 +- home.admin/_provision.setup.sh | 4 - home.admin/_provision_.sh | 4 +- home.admin/assets/bitcoind.service | 1 + home.admin/config.scripts/bitcoin.install.sh | 1 + home.admin/config.scripts/blitz.debug.sh | 7 +- home.admin/config.scripts/blitz.fatpack.sh | 5 +- home.admin/config.scripts/blitz.git-verify.sh | 1 + home.admin/config.scripts/blitz.web.api.sh | 32 +++- home.admin/config.scripts/blitz.web.ui.sh | 29 ++++ .../config.scripts/bonus.btcpayserver.sh | 23 ++- home.admin/config.scripts/bonus.joinmarket.sh | 2 +- home.admin/config.scripts/bonus.lit.sh | 57 ++++--- home.admin/config.scripts/bonus.lnbits.sh | 38 +++-- home.admin/config.scripts/bonus.lndmanage.sh | 2 +- home.admin/config.scripts/cl.check.sh | 143 ++++++++++-------- .../config.scripts/cl.install-service.sh | 5 +- home.admin/config.scripts/cl.install.sh | 2 +- home.admin/config.scripts/cl.update.sh | 9 +- home.admin/config.scripts/internet.sh | 4 +- home.admin/config.scripts/lnd.check.sh | 53 +++---- 24 files changed, 268 insertions(+), 176 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2d24b95dd..5967e3fbd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,14 +19,14 @@ - 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.2 [details](https://github.com/lnbits/lnbits/releases/tag/0.10.2) -- Update: BTCPayServer 1.9.1 (postgres by default with sqlite migration) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.9.1) +- Update: LNbits 0.10.6 [details](https://github.com/lnbits/lnbits/releases/tag/0.10.6) +- Update: BTCPayServer 1.9.3 (postgres by default with sqlite migration) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.9.3) - Update: ItchySats 0.7.0 [details](https://github.com/itchysats/itchysats/releases/tag/0.7.0) - Update: Channel Tools (chantools) v0.10.5 [details](https://github.com/guggero/chantools/releases/tag/v0.10.5) - Update: JoinMarket v0.9.9 [details](https://github.com/JoinMarket-Org/joinmarket-clientserver/releases/tag/v0.9.9) - Update: JoininBox v0.7.7 [details](https://github.com/openoms/joininbox/releases/tag/v0.7.7) - Update: Balance of Satoshis 13.15.0 (bos) [details](https://github.com/alexbosworth/balanceofsatoshis/blob/master/CHANGELOG.md#13150) -- Update: lndmanage 0.14.2 [details](https://github.com/bitromortac/lndmanage) +- Update: lndmanage 0.15.0 [details](https://github.com/bitromortac/lndmanage) - Update: Circuitbreaker with webUI [details](https://github.com/lightningequipment/circuitbreaker/blob/master/README.md) - Update: Suez - Channel Visualization for LND & CL [details](https://github.com/prusnak/suez) - Update: Tallycoin Connect v1.8.0 [details](https://github.com/djbooth007/tallycoin_connect/releases/tag/v1.8.0) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index bd525df63..b21abb556 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -276,7 +276,7 @@ ${color_yellow}${ln_publicColor}${ln_external}${color_gray}" if [ "${joinmarket}" = "on" ];then # show JoinMarket stats in place of the LND URI only if the Yield Generator is running if [ "$(sudo -u joinmarket pgrep -f "yg-privacyenhanced.py" 2>/dev/null | wc -l)" -gt 2 ] || \ - [ "$(curl -ksX GET https://127.0.0.1:28183/api/v1/session | jq .maker_running)" = true ]; then + [ "$(curl -ksX GET https://127.0.0.1:28183/api/v1/session | jq .maker_running 2>/dev/null)" = true ]; then trap 'rm -f "$JMstats"' EXIT JMstats=$(mktemp -p /dev/shm) diff --git a/home.admin/00settingsMenuBasics.sh b/home.admin/00settingsMenuBasics.sh index 1535eba41..78e115982 100755 --- a/home.admin/00settingsMenuBasics.sh +++ b/home.admin/00settingsMenuBasics.sh @@ -440,14 +440,8 @@ if [ "${clNode}" != "${choice}" ]; then /home/admin/config.scripts/cl.install.sh on signet fi - # make sure that cln-grpc is on for the WebAPI - echo "# install the cln-grpc plugin" - /home/admin/config.scripts/cl-plugin.cln-grpc.sh install - /home/admin/config.scripts/cl-plugin.cln-grpc.sh on - else echo "# turning OFF" - /home/admin/config.scripts/cl-plugin.cln-grpc.sh off /home/admin/config.scripts/cl.install.sh off mainnet /home/admin/config.scripts/cl.install.sh off testnet /home/admin/config.scripts/cl.install.sh off signet diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index a822a46dc..24c5a5354 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -457,11 +457,11 @@ if [ ${isMounted} -eq 0 ]; then /home/admin/config.scripts/blitz.datadrive.sh status >> ${logFile} # determine correct setup phase - infoMessage="Please Login for Setup" + infoMessage="Please start Setup" setupPhase="setup" if [ "${hddGotMigrationData}" != "" ]; then - infoMessage="Please Login for Migration" + infoMessage="Please start Migration" setupPhase="migration" # check if lightning is outdated migrationMode="normal" @@ -480,10 +480,10 @@ if [ ${isMounted} -eq 0 ]; then # TODO: improve version/update detection later isRecovery=$(echo "${hddRaspiVersion}" | grep -c "${codeVersion}") if [ "${isRecovery}" == "1" ]; then - infoMessage="Please Login for Recovery" + infoMessage="Please start Recovery" setupPhase="recovery" else - infoMessage="Please Login for Update" + infoMessage="Please start Update" setupPhase="update" fi diff --git a/home.admin/_provision.setup.sh b/home.admin/_provision.setup.sh index 2e2ea9b58..721820668 100755 --- a/home.admin/_provision.setup.sh +++ b/home.admin/_provision.setup.sh @@ -342,10 +342,6 @@ if [ "${lightning}" == "cl" ]; then /home/admin/_cache.sh set message "Core Lightning Setup" /home/admin/config.scripts/cl.install.sh on mainnet >> ${logFile} - echo "# switch cln-grpc on" >> ${logFile} - /home/admin/config.scripts/cl-plugin.cln-grpc.sh install >> ${logFile} - /home/admin/config.scripts/cl-plugin.cln-grpc.sh on >> ${logFile} - # OLD WALLET FROM CLIGHTNING RESCUE if [ "${clrescue}" != "" ]; then diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index 0c272b30c..905ebca48 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -315,9 +315,6 @@ if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ] || [ "${tcl}" == "on" ] || # if already installed by fatpack will skip echo "Provisioning Core Lightning Binary - run config script" >> ${logFile} /home/admin/config.scripts/cl.install.sh install >> ${logFile} 2>&1 - echo "Provisioning cl-plugin.cln-grpc.sh - run config script" >> ${logFile} - /home/admin/config.scripts/cl-plugin.cln-grpc.sh install >> ${logFile} - /home/admin/config.scripts/cl-plugin.cln-grpc.sh on >> ${logFile} else echo "Provisioning Core Lightning Binary - not active" >> ${logFile} fi @@ -346,6 +343,7 @@ else echo "Provisioning CL Signet - not active" >> ${logFile} fi + # TOR if [ "${runBehindTor}" == "on" ]; then echo "Provisioning TOR - run config script" >> ${logFile} diff --git a/home.admin/assets/bitcoind.service b/home.admin/assets/bitcoind.service index b8446426b..5062983f8 100644 --- a/home.admin/assets/bitcoind.service +++ b/home.admin/assets/bitcoind.service @@ -10,6 +10,7 @@ Wants=network-online.target #OnFailure=systemd-sendmail@%n [Service] +Environment='MALLOC_ARENA_MAX=1' ExecStartPre=-/home/admin/config.scripts/blitz.systemd.sh log blockchain STARTED ExecStart=/usr/local/bin/bitcoind -daemonwait \ -conf=/mnt/hdd/bitcoin/bitcoin.conf \ diff --git a/home.admin/config.scripts/bitcoin.install.sh b/home.admin/config.scripts/bitcoin.install.sh index b7cb5157c..d89fa3586 100644 --- a/home.admin/config.scripts/bitcoin.install.sh +++ b/home.admin/config.scripts/bitcoin.install.sh @@ -254,6 +254,7 @@ After=network-online.target Wants=network-online.target [Service] +Environment='MALLOC_ARENA_MAX=1' ExecStart=/usr/local/bin/bitcoind -${CHAIN} \\ -daemonwait \\ -conf=/mnt/hdd/bitcoin/bitcoin.conf \\ diff --git a/home.admin/config.scripts/blitz.debug.sh b/home.admin/config.scripts/blitz.debug.sh index a3743fc5c..d47b10c09 100755 --- a/home.admin/config.scripts/blitz.debug.sh +++ b/home.admin/config.scripts/blitz.debug.sh @@ -238,10 +238,11 @@ echo "--> CHECK CONFIG: sudo nginx -t" sudo nginx -t 2>&1 echo +echo "*** BLITZAPI STATUS ***" +/home/admin/config.scripts/blitz.web.api.sh info if [ $(sudo systemctl status blitzapi 2>/dev/null | grep -c "blitzapi.service") -lt 1 ]; then echo "- BLITZAPI is not running" else - echo "*** BLITZAPI SYSTEMD STATUS ***" sudo systemctl status blitzapi -n2 --no-pager echo @@ -251,6 +252,10 @@ else echo fi +echo "*** BLITZ WebUI STATUS ***" +/home/admin/config.scripts/blitz.web.ui.sh info +echo + if [ "${touchscreen}" == "" ] || [ "${touchscreen}" == "0" ] || [ "${touchscreen}" == "off" ]; then echo "- TOUCHSCREEN is OFF by config" else diff --git a/home.admin/config.scripts/blitz.fatpack.sh b/home.admin/config.scripts/blitz.fatpack.sh index 8beaafaaa..3d0e8e3eb 100755 --- a/home.admin/config.scripts/blitz.fatpack.sh +++ b/home.admin/config.scripts/blitz.fatpack.sh @@ -9,6 +9,9 @@ if [ "$EUID" -ne 0 ] exit 1 fi +# make sure LCD is on (default for fatpack) +/home/admin/config.scripts/blitz.display.sh set-display lcd + # check if sd card needs expansion before fatpack source <(sudo /home/admin/config.scripts/blitz.bootdrive.sh status) if [ "${needsExpansion}" == "1" ]; then @@ -71,8 +74,6 @@ echo "* Adding LND ..." echo "* Adding Core Lightning ..." /home/admin/config.scripts/cl.install.sh install || exit 1 -echo "* Adding the cln-grpc plugin ..." -/home/admin/config.scripts/cl-plugin.cln-grpc.sh install || exit 1 # *** AUTO UPDATE FALLBACK NODE LIST FROM INTERNET (only in fatpack) echo "*** FALLBACK NODE LIST ***" diff --git a/home.admin/config.scripts/blitz.git-verify.sh b/home.admin/config.scripts/blitz.git-verify.sh index 91ebc6a58..eb0706d96 100644 --- a/home.admin/config.scripts/blitz.git-verify.sh +++ b/home.admin/config.scripts/blitz.git-verify.sh @@ -43,6 +43,7 @@ if [ $? -ne 0 ]; then fi fi +echo "# importing key of ${PGPsigner}" gpg --import --import-options show-only /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc fingerprint=$(gpg --show-keys --keyid-format LONG /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc 2>/dev/null | grep "${PGPpubkeyFingerprint}" -c) if [ "${fingerprint}" -lt 1 ]; then diff --git a/home.admin/config.scripts/blitz.web.api.sh b/home.admin/config.scripts/blitz.web.api.sh index e90abb981..82f91752d 100644 --- a/home.admin/config.scripts/blitz.web.api.sh +++ b/home.admin/config.scripts/blitz.web.api.sh @@ -12,6 +12,7 @@ FALLACK_BRANCH="dev" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then echo "Manage RaspiBlitz Web API" + echo "blitz.web.api.sh info" echo "blitz.web.api.sh on [GITHUBUSER] [REPO] [BRANCH] [?COMMITORTAG]" echo "blitz.web.api.sh on DEFAULT" echo "blitz.web.api.sh update-config" @@ -20,6 +21,34 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; exit 1 fi +################### +# INFO +################### +if [ "$1" = "info" ]; then + + # check if installed + cd /home/blitzapi/blitz_api + if [ "$?" != "0" ]; then + echo "installed=0" + exit 1 + fi + echo "installed=1" + + # get github origin repo from repo directory with git command + origin=$(sudo -u blitzapi git config --get remote.origin.url) + echo "repo='${origin}'" + + # get github branch from repo directory with git command + branch=$(sudo -u blitzapi git rev-parse --abbrev-ref HEAD) + echo "branch='${branch}'" + + # get github commit from repo directory with git command + commit=$(sudo -u blitzapi git rev-parse HEAD) + echo "commit='${commit}'" + + exit 0 +fi + ################### # UPDATE CONFIG ################### @@ -98,9 +127,6 @@ if [ "$1" = "update-config" ]; then sed -i "s/^ln_node=.*/ln_node=cln_jrpc/g" ./.env sed -i "s#^cln_jrpc_path=.*#cln_jrpc_path=\"/mnt/hdd/app-data/.lightning/bitcoin/lightning-rpc\"#g" ./.env - # make sure cln-grpc is on - # sudo /home/admin/config.scripts/cl-plugin.cln-grpc.sh on mainnet - # get hex values of pem files # hexClient=$(sudo xxd -p -c2000 /home/bitcoin/.lightning/bitcoin/client.pem) # hexClientKey=$(sudo xxd -p -c2000 /home/bitcoin/.lightning/bitcoin/client-key.pem) diff --git a/home.admin/config.scripts/blitz.web.ui.sh b/home.admin/config.scripts/blitz.web.ui.sh index 65b392812..13502db38 100755 --- a/home.admin/config.scripts/blitz.web.ui.sh +++ b/home.admin/config.scripts/blitz.web.ui.sh @@ -9,6 +9,7 @@ FALLACK_BRANCH="master" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then echo "Manage RaspiBlitz WebUI" + echo "blitz.web.ui.sh info" echo "blitz.web.ui.sh on [GITHUBUSER] [REPO] [BRANCH] [?COMMITORTAG]" echo "blitz.web.ui.sh on DEFAULT" echo "blitz.web.ui.sh update" @@ -16,6 +17,34 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; exit 0 fi +################### +# INFO +################### +if [ "$1" = "info" ]; then + + # check if installed + cd /home/blitzapi/blitz_web + if [ "$?" != "0" ]; then + echo "installed=0" + exit 1 + fi + echo "installed=1" + + # get github origin repo from repo directory with git command + origin=$(sudo git config --get remote.origin.url) + echo "repo='${origin}'" + + # get github branch from repo directory with git command + branch=$(sudo git rev-parse --abbrev-ref HEAD) + echo "branch='${branch}'" + + # get github commit from repo directory with git command + commit=$(sudo git rev-parse HEAD) + echo "commit='${commit}'" + + exit 0 +fi + # check if started with sudo if [ "$EUID" -ne 0 ]; then echo "error='run as root'" diff --git a/home.admin/config.scripts/bonus.btcpayserver.sh b/home.admin/config.scripts/bonus.btcpayserver.sh index 625487456..9b4bae5ba 100644 --- a/home.admin/config.scripts/bonus.btcpayserver.sh +++ b/home.admin/config.scripts/bonus.btcpayserver.sh @@ -5,12 +5,12 @@ # https://github.com/dgarage/NBXplorer/tags NBXplorerVersion="v2.3.62" # https://github.com/btcpayserver/btcpayserver/releases -BTCPayVersion="v1.9.1" +BTCPayVersion="v1.9.3" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "Config script to switch BTCPay Server on or off" - echo "Usage:" + echo "bonus.btcpayserver.sh menu" echo "bonus.btcpayserver.sh [install|uninstall]" echo "bonus.btcpayserver.sh [on|off|menu|write-tls-macaroon|cln-lightning-rpc-access]" echo "installs BTCPayServer $BTCPayVersion with NBXplorer $NBXplorerVersion" @@ -405,12 +405,19 @@ if [ "$1" = "install" ]; then cd btcpayserver || exit 1 sudo -u btcpay git reset --hard $BTCPayVersion #sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh "web-flow" "https://github.com/web-flow.gpg" "4AEE18F83AFDEB23" || exit 1 - 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" + + echo "# verify signature of ${PGPsigner}" sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1 echo "# Build BTCPayServer $BTCPayVersion" @@ -434,14 +441,16 @@ if [ "$1" = "uninstall" ]; then fi # clear dotnet cache - /home/btcpay/dotnet/dotnet nuget locals all --clear + /home/btcpay/dotnet/dotnet nuget locals all --clear 2>/dev/null # remove dotnet - sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/share/dotnet 2>/dev/null # nuke user sudo userdel -rf btcpay 2>/dev/null + echo "# uninstall done" + exit 0 fi diff --git a/home.admin/config.scripts/bonus.joinmarket.sh b/home.admin/config.scripts/bonus.joinmarket.sh index 36cfdc503..bce8aa9a1 100755 --- a/home.admin/config.scripts/bonus.joinmarket.sh +++ b/home.admin/config.scripts/bonus.joinmarket.sh @@ -6,7 +6,7 @@ # https://github.com/openoms/joininbox # https://github.com/openoms/joininbox/tags -JBTAG="v0.7.7" # installs JoinMarket v0.9.9 +JBTAG="v0.7.8" # installs JoinMarket v0.9.9 # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then diff --git a/home.admin/config.scripts/bonus.lit.sh b/home.admin/config.scripts/bonus.lit.sh index d624e2e4d..49c88fb5c 100644 --- a/home.admin/config.scripts/bonus.lit.sh +++ b/home.admin/config.scripts/bonus.lit.sh @@ -5,10 +5,10 @@ LITVERSION="0.9.2-alpha" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then - echo "config script to switch the Lightning Terminal Service on or off" - echo "installs the version $LITVERSION" - echo "bonus.lit.sh [on|off|menu]" - exit 1 + echo "config script to switch the Lightning Terminal Service on or off" + echo "installs the version $LITVERSION" + echo "bonus.lit.sh [on|off|menu]" + exit 1 fi # check who signed the release in https://github.com/lightninglabs/lightning-terminal/releases @@ -78,16 +78,16 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # switching off single installs of pool, loop or faraday if installed if [ "${loop}" = "on" ]; then - echo "# Replacing single install of: LOOP" - /home/admin/config.scripts/bonus.loop.sh off + echo "# Replacing single install of: LOOP" + /home/admin/config.scripts/bonus.loop.sh off fi if [ "${pool}" = "on" ]; then - echo "# Replacing single install of: POOL" - /home/admin/config.scripts/bonus.pool.sh off + echo "# Replacing single install of: POOL" + /home/admin/config.scripts/bonus.pool.sh off fi if [ "${faraday}" = "on" ]; then - echo "# Replacing single install of: FARADAY" - /home/admin/config.scripts/bonus.faraday.sh off + echo "# Replacing single install of: FARADAY" + /home/admin/config.scripts/bonus.faraday.sh off fi isInstalled=$(sudo ls /etc/systemd/system/litd.service 2>/dev/null | grep -c 'litd.service') @@ -96,7 +96,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # create dedicated user sudo adduser --disabled-password --gecos "" lit # make sure symlink to central app-data directory exists - sudo rm -rf /home/lit/.lnd # not a symlink.. delete it silently + sudo rm -rf /home/lit/.lnd # not a symlink.. delete it silently # create symlink sudo ln -s "/mnt/hdd/app-data/lnd/" "/home/lit/.lnd" @@ -160,21 +160,21 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then uname -m exit 1 else - echo "OK running on $(uname -m) architecture." + echo "OK running on $(uname -m) architecture." fi - downloadDir="/home/admin/download/lit" # edit your download directory + downloadDir="/home/admin/download/lit" # edit your download directory rm -rf "${downloadDir}" mkdir -p "${downloadDir}" cd "${downloadDir}" || exit 1 # extract the SHA256 hash from the manifest file for the corresponding platform wget -N https://github.com/lightninglabs/lightning-terminal/releases/download/v${LITVERSION}/manifest-v${LITVERSION}.txt - if [ ${isARM} -eq 1 ] ; then + if [ ${isARM} -eq 1 ]; then OSversion="armv7" - elif [ ${isAARCH64} -eq 1 ] ; then + elif [ ${isAARCH64} -eq 1 ]; then OSversion="arm64" - elif [ ${isX86_64} -eq 1 ] ; then + elif [ ${isX86_64} -eq 1 ]; then OSversion="amd64" fi SHA256=$(grep -i "linux-$OSversion" manifest-v$LITVERSION.txt | cut -d " " -f1) @@ -198,8 +198,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "# check gpg finger print" gpg --show-keys --keyid-format LONG ./pgp_keys.asc - fingerprint=$(gpg --show-keys --keyid-format LONG "./pgp_keys.asc" 2>/dev/null \ - | grep "${PGPcheck}" -c) + fingerprint=$(gpg --show-keys --keyid-format LONG "./pgp_keys.asc" 2>/dev/null | + grep "${PGPcheck}" -c) if [ ${fingerprint} -lt 1 ]; then echo "" echo "# BUILD WARNING --> LiT PGP author not as expected" @@ -209,7 +209,10 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then fi gpg --import ./pgp_keys.asc sleep 3 - verifyResult=$(LANG=en_US.utf8; gpg --verify manifest-v${LITVERSION}.sig manifest-v${LITVERSION}.txt 2>&1) + verifyResult=$( + LANG=en_US.utf8 + gpg --verify manifest-v${LITVERSION}.sig manifest-v${LITVERSION}.txt 2>&1 + ) goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c) echo "goodSignature(${goodSignature})" correctKey=$(echo ${verifyResult} | tr -d " \t\n\r" | grep "${GPGcheck}" -c) @@ -235,17 +238,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then ########### # config # ########### - - # check if lnd.conf has rpcmiddleware.enable entry under section Application Options - entryExists=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c "rpcmiddleware.enable=") - if [ "${entryExists}" == "0" ]; then - echo "# add rpcmiddleware.enable=true to lnd.conf" - sudo sed -i "/^\[Application Options\]$/arpcmiddleware.enable=true" /mnt/hdd/lnd/lnd.conf + # check if lnd.conf has rpcmiddleware.enable entry under [rpcmiddleware] + if sudo grep rpcmiddleware /mnt/hdd/lnd/lnd.conf; then + sudo sed -i "s/^rpcmiddleware.enable=.*/rpcmiddleware.enable=true/g" /mnt/hdd/lnd/lnd.conf + else + sudo bash -c "echo '[rpcmiddleware]' >> /mnt/hdd/lnd/lnd.conf" + sudo bash -c "echo 'rpcmiddleware.enable=true' >> /mnt/hdd/lnd/lnd.conf" fi - # make sure lnd.conf has rpcmiddleware.enable=true - sudo sed -i "s/^rpcmiddleware.enable=.*/rpcmiddleware.enable=true/g" /mnt/hdd/lnd/lnd.conf - if [ "${runBehindTor}" = "on" ]; then echo "# Connect to the Pool, Loop and Terminal server through Tor" LOOPPROXY="loop.server.proxy=127.0.0.1:9050" @@ -408,4 +408,3 @@ fi echo "FAIL - Unknown Parameter $1" echo "may need reboot to run normal again" exit 1 - diff --git a/home.admin/config.scripts/bonus.lnbits.sh b/home.admin/config.scripts/bonus.lnbits.sh index 1337f7b6c..3d18c9e88 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.10.4.1" +tag="0.10.6" VERSION="${tag}" # command info @@ -14,7 +14,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "bonus.lnbits.sh [install|uninstall] [?GITHUBUSER] [?BRANCH|?TAG]" echo "bonus.lnbits.sh on [lnd|tlnd|slnd|cl|tcl|scl]" echo "bonus.lnbits.sh switch [lnd|tlnd|slnd|cl|tcl|scl]" - echo "bonus.lnbits.sh off" + echo "bonus.lnbits.sh off <--keep-data|--delete-data>" echo "bonus.lnbits.sh status" echo "bonus.lnbits.sh menu" echo "bonus.lnbits.sh prestart" @@ -580,7 +580,11 @@ if [ "$1" = "sync" ] || [ "$1" = "repo" ]; then sudo -u lnbits git pull # check if poetry in installed, if not install it - sudo -u lnbits which poetry || sudo -u lnbits curl -sSL https://install.python-poetry.org | sudo -u lnbits python3 - + if ! sudo -u lnbits which poetry; then + echo "# install poetry" + sudo pip3 install --upgrade pip + sudo pip3 install poetry + fi # do install like this sudo -u lnbits poetry install @@ -597,13 +601,12 @@ sudo systemctl stop lnbits 2>/dev/null if [ "$1" = "install" ]; then # check if already installed - isInstalled=$(compgen -u | grep -c lnbits) - if [ "${isInstalled}" != "0" ]; then + if compgen -u | grep -w lnbits; then echo "result='already installed'" exit 0 fi - echo "# *** INSTALL LNBIS ${VERSION} ***" + echo "# *** INSTALL LNBITS ${VERSION} ***" # add lnbits user echo "*** Add the 'lnbits' user ***" @@ -661,12 +664,18 @@ if [ "$1" = "uninstall" ]; then fi -# install +# on if [ "$1" = "1" ] || [ "$1" = "on" ]; then - # check if code is already installed - isInstalled=$(compgen -u | grep -c lnbits) - if [ "${isInstalled}" == "0" ]; then + # check if already installed + if compgen -u | grep -w lnbits; then + # check poetry if the user exists + if ! sudo -u lnbits which poetry; then + echo "# Fix faulty installation" + /home/admin/config.scripts/bonus.lnbits.sh off --keep-data + /home/admin/config.scripts/bonus.lnbits.sh install || exit 1 + fi + else echo "# Installing code base & dependencies first .." /home/admin/config.scripts/bonus.lnbits.sh install || exit 1 fi @@ -987,12 +996,12 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then sudo systemctl stop lnbits sudo systemctl disable lnbits sudo rm /etc/systemd/system/lnbits.service - echo "OK lnbits.service removed." + echo "# OK lnbits.service removed." else - echo "lnbits.service is not installed." + echo "# lnbits.service is not installed." fi - echo "Cleaning up LNbits install ..." + echo "# Cleaning up LNbits install ..." sudo ufw delete allow 5000 sudo ufw delete allow 5001 @@ -1020,6 +1029,9 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then echo "# keeping data" fi + echo "# Remove the lnbits user" + sudo userdel -rf lnbits 2>/dev/null + # setting value in raspi blitz config /home/admin/config.scripts/blitz.conf.sh set LNBits "off" diff --git a/home.admin/config.scripts/bonus.lndmanage.sh b/home.admin/config.scripts/bonus.lndmanage.sh index 5337e6430..a4791fbd3 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.14.2" +lndmanageVersion="0.15.0" pgpKeyDownload="https://github.com/bitromortac.gpg" gpgFingerprint="0453B9F5071261A40FDB34181965063FC13BEBE2" diff --git a/home.admin/config.scripts/cl.check.sh b/home.admin/config.scripts/cl.check.sh index 3894a3748..300af6753 100644 --- a/home.admin/config.scripts/cl.check.sh +++ b/home.admin/config.scripts/cl.check.sh @@ -6,6 +6,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; echo "# script to check CL states" echo "# cl.check.sh basic-setup" echo "# cl.check.sh prestart [mainnet|testnet|signet]" + echo "# cl.check.sh poststart [mainnet|testnet|signet]" echo exit 1 fi @@ -17,71 +18,95 @@ source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2) ###################################################################### # PRESTART -# is executed by systemd cl services everytime before cl is started +# is executed by systemd cl services everytime BEFORE cl is started # so it tries to make sure the config is in valid shape ###################################################################### -# make sure plugins are loaded https://github.com/rootzoll/raspiblitz/issues/2953 -if [ $(grep -c "^plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" < ${CLCONF}) -eq 0 ];then - echo "plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" | tee -a ${CLCONF} -fi +if [ "$1" == "prestart" ]; then -# do not announce 127.0.0.1 https://github.com/rootzoll/raspiblitz/issues/2634 -if [ $(grep -c "^announce-addr=127.0.0.1" < ${CLCONF}) -gt 0 ];then - sed -i "/^announce-addr=127.0.0.1/d" ${CLCONF} -fi - -if [ $(grep -c "^sparko" < ${CLCONF}) -gt 0 ];then - if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ]\ - || [ "$(eval echo \$${netprefix}sparko)" != "on" ]; then - echo "# The Sparko plugin is not present but in config" - sed -i "/^sparko/d" ${CLCONF} - rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/sparko + # make sure plugins are loaded https://github.com/rootzoll/raspiblitz/issues/2953 + if [ $(grep -c "^plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" < ${CLCONF}) -eq 0 ];then + echo "plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" | tee -a ${CLCONF} fi + + # do not announce 127.0.0.1 https://github.com/rootzoll/raspiblitz/issues/2634 + if [ $(grep -c "^announce-addr=127.0.0.1" < ${CLCONF}) -gt 0 ];then + sed -i "/^announce-addr=127.0.0.1/d" ${CLCONF} + fi + + if [ $(grep -c "^sparko" < ${CLCONF}) -gt 0 ];then + if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ]\ + || [ "$(eval echo \$${netprefix}sparko)" != "on" ]; then + echo "# The Sparko plugin is not present but in config" + sed -i "/^sparko/d" ${CLCONF} + rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/sparko + fi + fi + + if [ $(grep -c "^clboss" < ${CLCONF}) -gt 0 ];then + if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/clboss ]\ + || [ "$(eval echo \$${netprefix}clboss)" != "on" ]; then + echo "# The clboss plugin is not present but in config" + sed -i "/^clboss/d" ${CLCONF} + rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/clboss + fi + fi + + if [ $(grep -c "^http-pass" < ${CLCONF}) -gt 0 ];then + if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]\ + || [ "${clHTTPplugin}" != "on" ]; then + echo "# The clHTTPplugin is not present but in config" + sed -i "/^http-pass/d" ${CLCONF} + rm -rf /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin + fi + fi + + if [ $(grep -c "^feeadjuster" < ${CLCONF}) -gt 0 ];then + if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py ]\ + || [ "$(eval echo \$${netprefix}feeadjuster)" != "on" ]; then + echo "# The feeadjuster plugin is not present but in config" + sed -i "/^feeadjuster/d" ${CLCONF} + rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py + fi + fi + + # https://github.com/rootzoll/raspiblitz/issues/3007 + # add for test networks as well if needed on mainnet + if [ "${blitzapi}" = "on" ] || \ + [ "${LNBitsFunding}" = "${netprefix}cl" ] || \ + [ "${BTCPayServer}" = "on" ]; then + if [ $(grep -c "^rpc-file-mode=0660" < ${CLCONF}) -eq 0 ]; then + echo "rpc-file-mode=0660" | tee -a ${CLCONF} + fi + fi + + if [ $(grep -c "^grpc-port" < ${CLCONF}) -gt 0 ];then + if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc ]\ + || [ "$(eval echo \$${netprefix}cln-grpc-port)" = "off" ]; then + echo "# The cln-grpc plugin is not present but in config" + sed -i "/^grpc-port/d" ${CLCONF} + rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc + fi + fi + + + exit 0 fi -if [ $(grep -c "^clboss" < ${CLCONF}) -gt 0 ];then - if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/clboss ]\ - || [ "$(eval echo \$${netprefix}clboss)" != "on" ]; then - echo "# The clboss plugin is not present but in config" - sed -i "/^clboss/d" ${CLCONF} - rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/clboss - fi +###################################################################### +# POSTSTART +# is executed by systemd cl services everytime AFTER cl is started +# takes care of things that are just available when CL is running +###################################################################### + +if [ "$1" == "poststart" ]; then + + # log info + info=$(ls -la /mnt/hdd/app-data/.lightning/bitcoin/lightning-rpc) + logger "${info}" + + exit 0 fi -if [ $(grep -c "^http-pass" < ${CLCONF}) -gt 0 ];then - if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]\ - || [ "${clHTTPplugin}" != "on" ]; then - echo "# The clHTTPplugin is not present but in config" - sed -i "/^http-pass/d" ${CLCONF} - rm -rf /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin - fi -fi - -if [ $(grep -c "^feeadjuster" < ${CLCONF}) -gt 0 ];then - if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py ]\ - || [ "$(eval echo \$${netprefix}feeadjuster)" != "on" ]; then - echo "# The feeadjuster plugin is not present but in config" - sed -i "/^feeadjuster/d" ${CLCONF} - rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py - fi -fi - -# https://github.com/rootzoll/raspiblitz/issues/3007 -# add for test networks as well if needed on mainnet -if [ "${blitzapi}" = "on" ] || \ - [ "${LNBitsFunding}" = "${netprefix}cl" ] || \ - [ "${BTCPayServer}" = "on" ]; then - if [ $(grep -c "^rpc-file-mode=0660" < ${CLCONF}) -eq 0 ]; then - echo "rpc-file-mode=0660" | tee -a ${CLCONF} - fi -fi - -if [ $(grep -c "^grpc-port" < ${CLCONF}) -gt 0 ];then - if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc ]\ - || [ "$(eval echo \$${netprefix}cln-grpc-port)" = "off" ]; then - echo "# The cln-grpc plugin is not present but in config" - sed -i "/^grpc-port/d" ${CLCONF} - rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc - fi -fi +echo "# Unkonwn Parameter $1 or missing" +exit 1 diff --git a/home.admin/config.scripts/cl.install-service.sh b/home.admin/config.scripts/cl.install-service.sh index 98e79aaca..047b9cf86 100644 --- a/home.admin/config.scripts/cl.install-service.sh +++ b/home.admin/config.scripts/cl.install-service.sh @@ -61,9 +61,8 @@ After=network-online.target [Service] ExecStartPre=-/home/admin/config.scripts/cl.check.sh prestart $CHAIN -ExecStart=/bin/sh -c '${passwordInput}/usr/local/bin/lightningd \\ - --conf=${CLCONF} ${encryptedHSMoption} \\ - --pid-file=/run/lightningd/${netprefix}lightningd.pid' +ExecStart=/bin/sh -c '${passwordInput}/usr/local/bin/lightningd --conf=${CLCONF} ${encryptedHSMoption} --pid-file=/run/lightningd/${netprefix}lightningd.pid --rpc-file-mode 0660' +ExecStartPost=-/home/admin/config.scripts/cl.check.sh poststart $CHAIN # Creates /run/lightningd owned by bitcoin RuntimeDirectory=lightningd diff --git a/home.admin/config.scripts/cl.install.sh b/home.admin/config.scripts/cl.install.sh index 424d576e3..250717d91 100644 --- a/home.admin/config.scripts/cl.install.sh +++ b/home.admin/config.scripts/cl.install.sh @@ -2,7 +2,7 @@ # https://lightning.readthedocs.io/ # https://github.com/ElementsProject/lightning/releases -CLVERSION=v23.02.2 +CLVERSION="v23.02.2" # install the latest master by using the last commit id # https://github.com/ElementsProject/lightning/commit/master diff --git a/home.admin/config.scripts/cl.update.sh b/home.admin/config.scripts/cl.update.sh index f01bf3600..91903700c 100644 --- a/home.admin/config.scripts/cl.update.sh +++ b/home.admin/config.scripts/cl.update.sh @@ -19,7 +19,7 @@ fi mode="$1" # RECOMMENDED UPDATE BY RASPIBLITZ TEAM -# comment will be shown as "BEWARE Info" when option is choosen (can be multiple lines) +# comment will be shown as "BEWARE Info" when option is choosen (can be multiple lines) clUpdateVersion="" # example: 0.12.1 .. keep empty if no newer version as sd card build is available clUpdateComment="Please keep in mind that downgrading afterwards is not tested. Also not all additional apps are fully tested with the this update - but it looked good on first tests." @@ -65,7 +65,7 @@ if [ "${mode}" = "verified" ]; then # check for optional second parameter: forced update version # --> only does the verified update if its the given version - # this is needed for recovery/update. + # this is needed for recovery/update. fixedUpdateVersion="$2" if [ ${#fixedUpdateVersion} -gt 0 ]; then echo "# checking for fixed version update: askedFor(${fixedUpdateVersion}) available(${clUpdateVersion})" @@ -78,9 +78,8 @@ if [ "${mode}" = "verified" ]; then echo "# OK - update version is matching" fi fi - - if [ ${#clUpdateVersion} -gt 0 ];then + if [ ${#clUpdateVersion} -gt 0 ]; then /home/admin/config.scripts/cl.install.sh update v${clUpdateVersion} else /home/admin/config.scripts/cl.install.sh on @@ -100,7 +99,7 @@ if [ "${mode}" = "reckless" ]; then echo "# cl.update.sh reckless" # only update if the latest release is different from the installed - if [ "v${clInstalledVersion}" = "${clLatestVersion}" ]; then + if [ "${clInstalledVersion}" = "${clLatestVersion}" ]; then # attention to leading 'v' echo "# clInstalledVersion = clLatestVersion (${clLatestVersion:1})" echo "# There is no need to update again." diff --git a/home.admin/config.scripts/internet.sh b/home.admin/config.scripts/internet.sh index fb0f3d9a8..bbe6f4ab6 100755 --- a/home.admin/config.scripts/internet.sh +++ b/home.admin/config.scripts/internet.sh @@ -181,9 +181,9 @@ if [ ${runGlobal} -eq 1 ]; then globalIP="" echo "# getting public IP from third party service" if [ "${ipv6}" == "on" ]; then - globalIP=$(curl -s -f -S -m 5 http://v6.ipv6-test.com/api/myip.php 2>/dev/null) + globalIP=$(curl -s -f -S -m 10 http://v6.ipv6-test.com/api/myip.php 2>/dev/null) else - globalIP=$(curl -s -f -S -m 5 http://v4.ipv6-test.com/api/myip.php 2>/dev/null) + globalIP=$(curl -s -f -S -m 10 http://v4.ipv6-test.com/api/myip.php 2>/dev/null) fi echo "## curl returned: ${globalIP}" echo "## curl exit code: ${?}" diff --git a/home.admin/config.scripts/lnd.check.sh b/home.admin/config.scripts/lnd.check.sh index 22f9f2205..cf248b7d3 100755 --- a/home.admin/config.scripts/lnd.check.sh +++ b/home.admin/config.scripts/lnd.check.sh @@ -22,8 +22,7 @@ echo "# lndConfFile(${lndConfFile})" # so it tries to make sure the config is in valid shape ###################################################################### -function setting() # FILE LINENUMBER NAME VALUE -{ +function setting() { # FILE LINENUMBER NAME VALUE FILE=$1 LINENUMBER=$2 NAME=$3 @@ -118,7 +117,6 @@ if [ "$1" == "prestart" ]; then echo "# ${network}.node insert/update" setting ${lndConfFile} ${insertLine} "${network}\.node" "${network}d" - ##### BITCOIND OPTIONS SECTION ##### # [bitcoind] @@ -164,7 +162,7 @@ if [ "$1" == "prestart" ]; then RPCPSW=$(cat /mnt/hdd/${network}/${network}.conf | grep "^${network}d.rpcpassword=" | cut -d "=" -f2 | tail -n 1) fi if [ "${RPCPSW}" == "" ]; then - 1>&2 echo "FAIL: 'rpcpassword' not found in /mnt/hdd/${network}/${network}.conf" + echo 1>&2 "FAIL: 'rpcpassword' not found in /mnt/hdd/${network}/${network}.conf" exit 11 fi setting ${lndConfFile} ${insertLine} "${network}d\.rpcpass" "${RPCPSW}" @@ -175,7 +173,7 @@ if [ "$1" == "prestart" ]; then RPCUSER=$(cat /mnt/hdd/${network}/${network}.conf | grep "^${network}d.rpcuser=" | cut -d "=" -f2 | tail -n 1) fi if [ "${RPCUSER}" == "" ]; then - 1>&2 echo "FAIL: 'rpcuser' not found in /mnt/hdd/${network}/${network}.conf" + echo 1>&2 "FAIL: 'rpcuser' not found in /mnt/hdd/${network}/${network}.conf" exit 12 fi setting ${lndConfFile} ${insertLine} "${network}d\.rpcuser" "${RPCUSER}" @@ -258,7 +256,7 @@ if [ "$1" == "prestart" ]; then # limit workers to the number of cores setting ${lndConfFile} ${insertLine} "workers.write" "${cores}" setting ${lndConfFile} ${insertLine} "workers.sig" "${cores}" -fi + fi ##### TOR SECTION ##### @@ -296,7 +294,7 @@ fi # take care of incompatible settings https://github.com/rootzoll/raspiblitz/issues/2787#issuecomment-991245694 if [ $(cat ${lndConfFile} | grep -c "^tor.skip-proxy-for-clearnet-targets=true") -gt 0 ] || - [ $(cat ${lndConfFile} | grep -c "^tor.skip-proxy-for-clearnet-targets=1") -gt 0 ]; then + [ $(cat ${lndConfFile} | grep -c "^tor.skip-proxy-for-clearnet-targets=1") -gt 0 ]; then setting ${lndConfFile} ${insertLine} "tor.streamisolation" "false" fi @@ -308,7 +306,7 @@ fi ##### RPCMIDDLEWARE SECTION ##### # [rpcmiddleware] - sectionName="[Rr]pcmiddleware" + sectionName="rpcmiddleware" echo "# [${sectionName}] config ..." # make sure lnd config has a [rpcmiddleware] section @@ -337,7 +335,6 @@ fi # SET/UPDATE rpcmiddleware.enable setting ${lndConfFile} ${insertLine} "rpcmiddleware.enable" "true" - echo "# OK PRESTART DONE" ###################################################################### @@ -411,25 +408,25 @@ elif [ "$1" == "basic-setup" ]; then echo "err='$(netprefix)lnd.conf: blockchain network in $(netprefix)lnd.conf (${lndNetwork}) is different from raspiblitz.conf (${network})'" fi -# # get chain from config (TESTNET / MAINNET) -# lndChain="" -# source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.mainnet" | sed 's/^[a-z]*\.//g') -# source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.testnet" | sed 's/^[a-z]*\.//g') -# if [ "${mainnet}" == "1" ] && [ "${testnet}" == "1" ]; then -# echo "err='lnd.conf: mainnet and testnet are set active at the same time'" -# elif [ "${mainnet}" == "1" ]; then -# lndChain="main" -# elif [ "${testnet}" == "1" ]; then -# lndChain="test" -# else -# echo "err='lnd.conf: neither testnet or mainnet is set active (raspiblitz needs one of them active in lnd.conf)'" -# fi -# echo "chain='${lndChain}'" -# -# # check if chain is same the raspiblitz config -# if [ "${chain}" != "${lndChain}" ]; then -# echo "err='lnd.conf: testnet/mainnet in lnd.conf (${lndChain}) is different from raspiblitz.conf (${chain})'" -# fi + # # get chain from config (TESTNET / MAINNET) + # lndChain="" + # source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.mainnet" | sed 's/^[a-z]*\.//g') + # source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.testnet" | sed 's/^[a-z]*\.//g') + # if [ "${mainnet}" == "1" ] && [ "${testnet}" == "1" ]; then + # echo "err='lnd.conf: mainnet and testnet are set active at the same time'" + # elif [ "${mainnet}" == "1" ]; then + # lndChain="main" + # elif [ "${testnet}" == "1" ]; then + # lndChain="test" + # else + # echo "err='lnd.conf: neither testnet or mainnet is set active (raspiblitz needs one of them active in lnd.conf)'" + # fi + # echo "chain='${lndChain}'" + # + # # check if chain is same the raspiblitz config + # if [ "${chain}" != "${lndChain}" ]; then + # echo "err='lnd.conf: testnet/mainnet in lnd.conf (${lndChain}) is different from raspiblitz.conf (${chain})'" + # fi # check for admin macaroon exist (on HDD) adminMacaroonExists=$(sudo ls /mnt/hdd/lnd/data/chain/${network}/${chain}net/admin.macaroon 2>/dev/null | grep -c 'admin.macaroon') From 19244f43f021770bf5a295361b1313c5f63cb54f Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Thu, 11 May 2023 19:41:46 +0200 Subject: [PATCH 2/2] 1.9.0rc5 merge (#3826) * extend sd card before fatpack (#3783) * Fatpack sd card expand (#3784) * extend sd card before fatpack * fix expansion detection * Bump lnbits to 0.10.5 and add path to poetry in systemd script (#3787) * fix: don't reinstall same CLN version + fmt (#3796) * fix: lnd check for rpcmiddleware (#3804) * fix: joininbox update, hide jm api error from lcd (#3801) * fix: hide jm api error from lcd * joininbox update to v0.7.8 * fix: remove lnbits user when off, improve checks (#3798) * reduce bitcoind memory usage w MALLOC_ARENA_MAX=1 (#3780) * Misc fixed towards v1.9.0 (#3808) * get web api info * #3772 increase curl timeout * #3805 change "Please Login" * #3807 fix cln jrpc socket access (#3815) * Btcpay 193 (#3812) * Update BTCPay v1.9.3 * btcpay verify with web-flow * lnbits 0.10.6 update (#3814) * Fatpack: LCD on & cl-plugin.cln-grpc OFF (#3817) * make sure fatpack is LCD activated * remove cl-plugin.cln-grpc.sh by default * #3793 fix socket jrpc * lndmanage 0.15.0 (#3818) * 1.9.0rc5 merge (#3825) * update build manual * debug report info * Bitbanana Info * #3614 more debug log lines of BTC & LN mainnet * rc5 downloads --------- Co-authored-by: Stephan Oeste Co-authored-by: openoms <43343391+openoms@users.noreply.github.com> --- CHANGES.md | 1 + FAQ.dev.md | 50 ++++++++++++++++--- FAQ.md | 13 ++++- README.md | 8 +-- home.admin/97addMobileWallet.sh | 17 ++----- home.admin/_version.info | 2 +- home.admin/config.scripts/blitz.debug.sh | 22 ++++---- home.admin/config.scripts/bonus.lndconnect.sh | 2 +- 8 files changed, 74 insertions(+), 41 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5967e3fbd..0705352f8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ - New: ↬lnproxy cli shortcut and server [details](https://github.com/lnproxy) - New: Homebanking Interface FinTS/HBCI (experimental) [details](https://github.com/rootzoll/raspiblitz/issues/1186) - New on WebUI: Jam (JoinMarket Web UI) v0.1.5 [details](https://github.com/joinmarket-webui/joinmarket-webui/releases/tag/v0.1.5) +- New on WebUI: Generate/Download Debug Report from Settings - Update: Bitcoin Core v24.0.1 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.1.md) - Update: LND v0.16.2-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.16.2-beta) - Update: Core Lightning v23.02.2 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.02.2) diff --git a/FAQ.dev.md b/FAQ.dev.md index d63ae01f4..57a85be3a 100644 --- a/FAQ.dev.md +++ b/FAQ.dev.md @@ -2,9 +2,13 @@ ### What is the process of creating a new SD card image release? -Work notes for the process of producing a new SD card image release: +Checklist before making a SD card image release: + +* "Versioning" number is upfates in your RaspiBlitz Source Code (_version.info) +* Latest code is merged in release branch + +Creating the base minimal sd card: -* Make sure you have the "Versioning" final in your RaspiBlitz Source Code * Start [`Ubuntu LIVE`](http://releases.ubuntu.com/18.04.3/ubuntu-18.04.3-desktop-amd64.iso) from USB stick * Under Settings: best to set correct keyboard language & power settings to prevent monitor turn off * Connect to a secure WiFi (hardware switch on) or LAN @@ -33,6 +37,9 @@ Work notes for the process of producing a new SD card image release: * Login new with `ssh admin@[IP-OF-RASPIBLITZ]` (pw: raspiblitz) and run `release` * Disconnect WiFi/LAN on build laptop (hardware switch off) and shutdown * Remove `Ubuntu LIVE` USB stick and cut power from the RaspberryPi + +Creating the image of sd card: + * Connect USB stick with latest `TAILS` (make it stay offline) * Boot Tails with extra setting of Admin-Passwort and remember (use later for sudo) * Menu > Systemtools > Settings > Energy -> best to set monitor to never turn off @@ -43,18 +50,45 @@ Work notes for the process of producing a new SD card image release: * Take the SD card from the RaspberryPi and connect with an external SD card reader to the laptop * Click on `boot` volume once in the file manger * Connect the NTFS USB stick, open in file manager and delete old files - - * To make a raw image from sd card - second way (UI with progress): * Search "Laufwerke" or "Drives" on Tails Apps * Create image named `raspiblitz.img` to USB storage * Open Terminal and cd into directory of NTFS USB stick under `/media/amnesia` * `shasum -a 256 ./pishrink.sh` should be `e46e1e1e3c6e3555f9fff5435e2305e99b98aaa8dc28db1814cf861fbb472a69` * `chmod +x ./pishrink.sh | sudo ./pishrink.sh ./raspiblitz.img` -* `gzip -c ./raspiblitz.img > ./raspiblitz-vX.X-YEAR-MONTH-DAY.img.gz` -* Then run `shasum -a 256 *.gz > sha256.txt` -* Sign with `gpg --output raspiblitz-vX.X-YEAR-MONTH-DAY.img.gz.sig --detach-sign *.gz` -* Shutdown build computer +* `gzip -c ./raspiblitz.img > ./raspiblitz-min/fat-vX.X.X-YEAR-MONTH-DAY.img.gz` +* `shasum -a 256 ./raspiblitz-min/fat-vX.X.X-YEAR-MONTH-DAY.img.gz > ./raspiblitz-min/fat-vX.X.X-YEAR-MONTH-DAY.img.gz.sha` +* make analog copy/note of checksum +* Sign with `gpg --output raspiblitz-min/fat-vX.X.X-YEAR-MONTH-DAY.img.gz.sig --detach-sign raspiblitz-min/fat-vX.X.X-YEAR-MONTH-DAY.img.gz` + +Prepare template for subversion update later: + +* `mv ./raspiblitz.img ./raspiblitz-min-vX.X.X.img` +* `shasum -a 256 ./raspiblitz-min-vX.X.img > ./raspiblitz-min-vX.X.X.img.sha` +* make analog copy/note of checksum + +Creating a fatpack sd card from the minimal image: + +* Start TAILS live image +* On NTFS USB Stick (Open in Terminal) check hash of raspiblitz-min-vX.X.X.img wit analog note: +* `shasum -a 256 ./raspiblitz-min-vX.X.X.img` +* Right-Click the file and write to a min 32GB sd card +* On `bootfs` in FileManger (Open in Terminal): +* `touch stop` & `exit` terminal +* Shutdown TAILS & eject sd card +* Bootup UBUNTU LIVE +* Connect a RaspiBlitz (without HDD) to network, insert sd card and power up +* Find the IP of the RaspiBlitz (arp -a or check router) +* In terminal `ssh admin@[IP-OF-RASPIBLITZ]` +* Update to latest code with `patch code` +* the following only if its a `fatpack`: + * run command `fatpack` + * if it reboot, ssh in again & again run command `fatpack` + * check that script ended without errors +* do the creation & signing of the image file like in chapter above + +Publishing the images: + * Connect the NTFS USB stick to MacOS (it is just read-only) * Run tests on the new image * Upload the new image to the Download Server - put sig-file next to it diff --git a/FAQ.md b/FAQ.md index b551110b3..afaaa2928 100644 --- a/FAQ.md +++ b/FAQ.md @@ -307,14 +307,23 @@ You can also put an empty file just called `hdmi` (without any ending) onto the ### How do I generate a Debug Report? -If your RaspiBlitz is not working correctly and you like to get help from the community, it's good to provide more debug information, so others can better diagnose your problem - please follow the following steps to generate a debug report: +If your RaspiBlitz is not working correctly and you like to get help from the community, it's good to provide more debug information, so others can better diagnose your problem. + +When you use the WebUI in the browser than you can follow the steps: + +- Login into the WebUI and enter the Dashboard (needs to be fully snyced) +- In the left navigation bar - choose "Settings" +- Under "Generate Debug Report" click "Generate" +- This might take some minutes, but then a Text-File will be offered for download + + You can also get a debug report thru the SSH menus: - SSH into your raspiblitz as admin user with your password A - If you see the menu - use CTRL+C to get to the terminal - To generate debug report run: `debug`, optionally create a link with `debug -l` - Then copy all output beginning with `*** RASPIBLITZ LOGS ***` and share this -*PLEASE NOTICE: It's possible that these logs can contain private information (like IPs, node IDs, ...) - just share publicly what you feel OK with.* +*PLEASE NOTICE: Most private information (like IPs, node IDs, ...) will filtered from debug logs, but this might not catch all sensitive information - so recheck content yourself before you share publicly.* ### I have the full blockchain on another storage. How do I copy it to the RaspiBlitz? diff --git a/README.md b/README.md index a9b1b73d8..6019743f7 100644 --- a/README.md +++ b/README.md @@ -167,8 +167,8 @@ This is the sd card image you should choose if your at the beginning of your Ras *WARNING: THIS IS STILL A RELEASE CANDIDATE VERSION
JUST USE FOR TESTING, HIGHER RISK OF LOSING FUNDS!* -- __FATPACK SD CARD IMAGE ⮕ [raspiblitz-fat-v1.9.0rc2-2023-02-07.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.9.0rc2-2023-02-07.img.gz)__ -- SHA-256: f49582e362046893c5dfbabdf73d7f85d919145bf339c72980f61ba79668a476 +- __FATPACK SD CARD IMAGE ⮕ [raspiblitz-fat-v1.9.0rc5-2023-05-11.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.9.0rc5-2023-05-11.img.gz)__ +- SHA-256: - GPG 64-bit (main): 1C73 060C 7C17 6461 & (sub): AA9D D1B5 CC56 47DA - Signature-File: n/a - Torrent: n/a @@ -181,8 +181,8 @@ This is the sd card image for RaspiBlitz users that are already more experienced *WARNING: THIS IS STILL A RELEASE CANDIDATE VERSION
JUST USE FOR TESTING, HIGHER RISK OF LOSING FUNDS!* -- __MINIMAL SD CARD IMAGE ⮕ [raspiblitz-min-v1.9.0rc2-2023-02-07.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-min-v1.9.0rc2-2023-02-07.img.gz)__ -- SHA-256: 2a037ee3bce7d2092d6faa67f5bd74a135abe257a5af52c380b4ae68d4ad13f3 +- __MINIMAL SD CARD IMAGE ⮕ [raspiblitz-min-v1.9.0rc5-2023-05-11.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-min-v1.9.0rc5-2023-05-11.img.gz)__ +- SHA-256: - GPG 64-bit (main): 1C73 060C 7C17 6461 & (sub): AA9D D1B5 CC56 47DA - Signature-File: n/a - Torrent: n/a diff --git a/home.admin/97addMobileWallet.sh b/home.admin/97addMobileWallet.sh index 124fa5552..7a3096e15 100755 --- a/home.admin/97addMobileWallet.sh +++ b/home.admin/97addMobileWallet.sh @@ -73,7 +73,7 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then OPTIONS+=(ZEUS_IOS "Zeus to LND (iOS)") OPTIONS+=(ZEUS_ANDROID "Zeus to LND (Android)") OPTIONS+=(ZAP_IOS "Zap to LND (iOS)") - OPTIONS+=(ZAP_ANDROID "Zap to LND (Android)") + OPTIONS+=(ZAP_ANDROID "Zap/Bitbanana to LND (Android)") OPTIONS+=(SPHINX "Sphinx Chat to LND (Android/iOS)") OPTIONS+=(SENDMANY_ANDROID "SendMany to LND (Android)") OPTIONS+=(FULLYNODED_LND "Fully Noded to LND REST (iOS+Tor)") @@ -139,21 +139,10 @@ Or scan the qr code on the LCD with your mobile phone. exit 0; ;; ZAP_ANDROID) - appstoreLink="https://play.google.com/store/apps/details?id=zapsolutions.zap" - sudo /home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/app_zap.png - whiptail --title "Install Zap on your Android Phone" \ + whiptail --title "Install Zap/Bitbanana on your Android Phone" \ --yes-button "Continue" \ --no-button "StoreLink" \ - --yesno "Open the Android Play Store on your mobile phone.\n\nSearch for --> 'zap bitcoin app'\n\nCheck that logo is like on LCD and author is: Zap\nWhen app is installed and started --> Continue." 12 65 - if [ $? -eq 1 ]; then - sudo /home/admin/config.scripts/blitz.display.sh qr ${appstoreLink} - whiptail --title " App Store Link " --msgbox "\ -To install app open the following link:\n -${appstoreLink}\n -Or scan the qr code on the LCD with your mobile phone. -" 11 70 - fi - sudo /home/admin/config.scripts/blitz.display.sh hide + --yesno "Open the Android Play Store on your mobile phone.\n\nSearch for --> 'bitbanana' (for updated fork)\nSearch for --> 'zap bitcoin app' (for original)\n\nWhen app is installed and started --> Continue." 12 65 /home/admin/config.scripts/bonus.lndconnect.sh zap-android tor exit 0; ;; diff --git a/home.admin/_version.info b/home.admin/_version.info index 9a7e4fe60..b57f7e1e6 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.9.0rc4" +codeVersion="1.9.0rc5" # keep last line with comment \ 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 d47b10c09..591435771 100755 --- a/home.admin/config.scripts/blitz.debug.sh +++ b/home.admin/config.scripts/blitz.debug.sh @@ -102,12 +102,12 @@ echo "*** BLOCKCHAIN (MAINNET) SYSTEMD STATUS ***" sudo systemctl status ${network}d -n2 --no-pager echo echo "*** LAST BLOCKCHAIN (MAINNET) ERROR LOGS ***" -echo "sudo journalctl -u ${network}d -b --no-pager -n8" -sudo journalctl -u ${network}d -b --no-pager -n8 +echo "sudo journalctl -u ${network}d -b --no-pager -n20" +sudo journalctl -u ${network}d -b --no-pager -n20 echo -echo "*** LAST BLOCKCHAIN (MAINNET) 20 INFO LOGS ***" -echo "sudo tail -n 20 /mnt/hdd/${network}/debug.log" -sudo tail -n 20 /mnt/hdd/${network}${pathAdd}/debug.log +echo "*** LAST BLOCKCHAIN (MAINNET) INFO LOGS ***" +echo "sudo tail -n 50 /mnt/hdd/${network}/debug.log" +sudo tail -n 50 /mnt/hdd/${network}${pathAdd}/debug.log echo echo "*** LND (MAINNET) SYSTEMD STATUS ***" @@ -118,9 +118,9 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ] || [ "${lnd}" == "1" ]; t echo "sudo journalctl -u lnd -b --no-pager -n12" sudo journalctl -u lnd -b --no-pager -n12 echo - echo "*** LAST 30 LND (MAINNET) INFO LOGS ***" - echo "sudo tail -n 30 /mnt/hdd/lnd/logs/${network}/mainnet/lnd.log" - sudo tail -n 30 /mnt/hdd/lnd/logs/${network}/mainnet/lnd.log + echo "*** LAST LND (MAINNET) INFO LOGS ***" + echo "sudo tail -n 50 /mnt/hdd/lnd/logs/${network}/mainnet/lnd.log" + sudo tail -n 50 /mnt/hdd/lnd/logs/${network}/mainnet/lnd.log else echo "- OFF by config -" fi @@ -130,10 +130,10 @@ echo "*** CORE LIGHTNING (MAINNET) SYSTEMD STATUS ***" if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ] || [ "${cl}" == "1" ]; then sudo systemctl status lightningd -n2 --no-pager echo - echo "*** LAST 30 CORE LIGHTNING (MAINNET) INFO LOGS ***" + echo "*** LAST CORE LIGHTNING (MAINNET) INFO LOGS ***" echo "For details also use command --> cllog" - echo "sudo tail -n 30 /home/bitcoin/.lightning/${network}/cl.log" - sudo tail -n 30 /home/bitcoin/.lightning/${network}/cl.log + echo "sudo tail -n 50 /home/bitcoin/.lightning/${network}/cl.log" + sudo tail -n 50 /home/bitcoin/.lightning/${network}/cl.log else echo "- not activated -" fi diff --git a/home.admin/config.scripts/bonus.lndconnect.sh b/home.admin/config.scripts/bonus.lndconnect.sh index 86439d0b5..fd1d65d8f 100755 --- a/home.admin/config.scripts/bonus.lndconnect.sh +++ b/home.admin/config.scripts/bonus.lndconnect.sh @@ -81,7 +81,7 @@ if [ "${targetWallet}" = "zap-ios" ]; then fi elif [ "${targetWallet}" = "zap-android" ]; then - connectInfo="- start the Zap Wallet --> SETUP WALLET\n or choose new Wallet in app menu\n- scan the QR code \n- confirm host address" + connectInfo="- start the Zap/Bitbanana Wallet --> SETUP WALLET\n or choose new Wallet in app menu\n- scan the QR code \n- confirm host address" # ZAP uses gRPC ports port="10009" if [ ${#ip2torGRPC_IP} -gt 0 ]; then