From 547e0456a96e7e602d2df57bb48b6f651fcb2a49 Mon Sep 17 00:00:00 2001 From: openoms Date: Sun, 10 Sep 2023 20:58:00 +0200 Subject: [PATCH 01/11] docs: fix steps for the ready made images --- ci/README.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ci/README.md b/ci/README.md index 47f372aa4..02edd2d6d 100644 --- a/ci/README.md +++ b/ci/README.md @@ -38,8 +38,12 @@ * Find the latest successful build of the default amd64 image: https://github.com/rootzoll/raspiblitz/actions/workflows/amd64-lean-image.yml?query=workflow%3Aamd64-lean-image-build+branch%3Adev+is%3Asuccess++ ``` - # unzip to the same directory + # unpack the artifact to the same directory unzip ./raspiblitz-amd64-image-*.zip + # unpack the image + gzip -dkv raspiblitz-amd64-debian-lean.qcow2.gz + # install qemu-utils + sudo apt install -y qemu-utils ``` ## Write the image to a disk connected with USB ### Option 1 - requires less disk space @@ -47,7 +51,6 @@ https://github.com/rootzoll/raspiblitz/actions/workflows/amd64-lean-image.yml?qu * the .qcow2 volume is 8.1 GB * identify the connected disk with `lsblk` e.g., `/dev/sdk` ``` - sudo apt install -y qemu-utils disk="/dev/sdk" sudo qemu-img dd if=./raspiblitz-amd64-debian-lean.qcow2 of=${disk} bs=4M ``` @@ -55,10 +58,6 @@ https://github.com/rootzoll/raspiblitz/actions/workflows/amd64-lean-image.yml?qu #### Convert the .qcow2 volume to a raw disk image * the raw .img is 30GB ``` - # unzip - gzip -dkv raspiblitz-amd64-debian-lean.qcow2.gz - # install qemu-utils - sudo apt install -y qemu-utils # convert qemu-img convert ./raspiblitz-amd64-debian-lean.qcow2 ./raspiblitz-amd64-debian-lean.img ``` @@ -77,9 +76,7 @@ https://github.com/rootzoll/raspiblitz/actions/workflows/amd64-lean-image.yml?qu * username: `admin` * password: `raspiblitz` * start a terminal for guidance -* alternatively connect with ssh over the LAN - * username: `admin` - * password: `raspiblitz` +* alternatively connect with ssh over the LAN with the same username and password ### Extend the root partition (optional - recommended) * The default image is 30GB. The partition can be extended to the full size of the disk. From a394ba59a35a325d259ff91097f178ac90bf730e Mon Sep 17 00:00:00 2001 From: openoms Date: Mon, 11 Sep 2023 12:50:32 +0200 Subject: [PATCH 02/11] add missing make command --- ci/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/README.md b/ci/README.md index 02edd2d6d..422bdc819 100644 --- a/ci/README.md +++ b/ci/README.md @@ -169,7 +169,7 @@ with the [Makefile](https://github.com/rootzoll/raspiblitz/blob/dev/Makefile) * libvirt / virsh / virt-manager (https://virt-manager.org/) * written to disk and booted with legacy boot (non-UEFI / CSM mode) ``` - amd64-lean-server-legacyboot-image + make amd64-lean-server-legacyboot-image ``` ## Notes for the lean server image without Gnome desktop From ea41275b5d1291568cc4ec2d5cd68bdbac1673e1 Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Wed, 20 Sep 2023 04:24:04 -0400 Subject: [PATCH 03/11] Fix pip error: This environment is externally managed on Debian 12 (#4153) * add support for debian12: - remove python lock which prevents pip from installing modules - make admin home directory readable --- build_sdcard.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build_sdcard.sh b/build_sdcard.sh index f3f04c3ab..343c76c50 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -377,6 +377,11 @@ else exit 1 fi +# remove any debian python protection from pip installing modules +if [ -f rm /usr/lib/python3.*/EXTERNALLY-MANAGED ]; then + rm /usr/lib/python3.*/EXTERNALLY-MANAGED +fi + # make sure /usr/bin/pip exists (and calls pip3 in Debian Buster) update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 # 1. libs (for global python scripts) From 2c235f3b5377d22a3e1e8cf0ab92ed5b68d97bdc Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Wed, 20 Sep 2023 10:29:15 +0200 Subject: [PATCH 04/11] fix adduser + maintenance tasks (#4172) * fix: add --shell /bin/bash to adduser * joininbox update to v0.8.1 and install fixes * CLN update to v23.08.1 * bos update to 15.8.14, improve menu * lnproxy: deactivate in menu and provision * copy the skeleton files for user used with login * deprecate loop single install further do not install in any case the uninstall option is still used * deprecate faraday single install further do not install in any case the uninstall option is still used * deprecate pool single install further do not install in any case the uninstall option is still used * bos: minimize changes to script * only add --bash oprion to users intended for login * add info to CHANGES * add sudo to non-privileged scripts * bos: don't download source * ci: run apt update before qemu install --- CHANGES.md | 8 +++- build_sdcard.sh | 12 ++++-- ci/amd64/packer.build.amd64-debian.sh | 9 +++- home.admin/00mainMenu.sh | 15 ++----- home.admin/00settingsMenuServices.sh | 2 +- home.admin/99updateMenu.sh | 4 -- home.admin/_provision_.sh | 43 ++++--------------- .../config.scripts/bonus.bitcoinminds.sh | 6 ++- home.admin/config.scripts/bonus.bos.sh | 12 +++--- home.admin/config.scripts/bonus.joinmarket.sh | 15 +++---- home.admin/config.scripts/bonus.lit.sh | 6 ++- home.admin/config.scripts/bonus.pyblock.sh | 7 ++- .../bonus.stacking-sats-kraken.sh | 5 ++- home.admin/config.scripts/bonus.template.sh | 6 ++- home.admin/config.scripts/cl.install.sh | 2 +- 15 files changed, 74 insertions(+), 78 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2cec40723..12723df6b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,7 +3,7 @@ - Update: RaspiOS base image from 2023-05-03 - Update: Bitcoin Core v25.0.0 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-25.0.md) - Update: LND v0.16.4-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.16.4-beta) -- Update: Core Lightning v23.08 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.08) +- Update: Core Lightning v23.08.1 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.08.1) - Update: Suez - Channel Visualization for LND & CLN [details](https://github.com/prusnak/suez) - Update: Electrum Server in Rust (electrs) v0.10.0 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0100-jul-22-2023) - Update: C-lightningREST v0.10.5 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.10.5) @@ -16,8 +16,14 @@ - Update: BTCPayServer 1.10.3 (postgres by default with sqlite migration) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.10.3) - Update: Specter Desktop 1.13.1 [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v1.13.1) - Update: Kindle-Display 0.5.1 [details](https://github.com/dennisreimann/kindle-display/) +- Update: JoinMarket v0.9.10 [details](https://github.com/JoinMarket-Org/joinmarket-clientserver/releases/tag/v0.9.10) +- Update: JoininBox v0.8.1 [details](https://github.com/openoms/joininbox/releases/tag/v0.8.1) +- Update: Balance of Satoshis 15.11.0 (bos) [details](https://github.com/alexbosworth/balanceofsatoshis/blob/master/CHANGELOG.md#15110) - Fix: Homebanking Interface FinTS/HBCI (experimental) [details](https://github.com/rootzoll/raspiblitz/issues/1186) - Remove: Spark Wallet and Sparko CLN plugin (not maintained anymore) +- Remove: Faraday, Loop, Pool single installs - used in the LiT package instead +- Remove: deactivate LNproxy in the menu and in provision +- Info: the users not intended to be logged in will not be available to change into (manage them from admin with sudo) ## What's new in Version 1.9.0 of RaspiBlitz? diff --git a/build_sdcard.sh b/build_sdcard.sh index 343c76c50..4b7afbdca 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -399,7 +399,9 @@ echo -e "\n*** PREPARE ${baseimage} ***" # make sure the pi user is present if [ "$(compgen -u | grep -c pi)" -eq 0 ];then echo "# Adding the user pi" - adduser --system --group --home /home/pi pi + adduser --system --group --shell /bin/bash --home /home/pi pi + # copy the skeleton files for login + sudo -u pi cp -r /etc/skel/. /home/pi/ adduser pi sudo fi @@ -542,7 +544,9 @@ service rsyslog restart echo -e "\n*** ADDING MAIN USER admin ***" # based on https://raspibolt.org/system-configuration.html#add-users # using the default password 'raspiblitz' -adduser --system --group --home /home/admin admin +adduser --system --group --shell /bin/bash --home /home/admin admin +# copy the skeleton files for login +sudo -u admin cp -r /etc/skel/. /home/admin/ echo "admin:raspiblitz" | chpasswd adduser admin sudo chsh admin -s /bin/bash @@ -560,7 +564,9 @@ fi echo -e "\n*** ADDING SERVICE USER bitcoin" # based on https://raspibolt.org/guide/raspberry-pi/system-configuration.html # create user and set default password for user -adduser --system --group --home /home/bitcoin bitcoin +adduser --system --group --shell /bin/bash --home /home/bitcoin bitcoin +# copy the skeleton files for login +sudo -u bitcoin cp -r /etc/skel/. /home/bitcoin/ echo "bitcoin:raspiblitz" | chpasswd # make home directory readable chmod 755 /home/bitcoin diff --git a/ci/amd64/packer.build.amd64-debian.sh b/ci/amd64/packer.build.amd64-debian.sh index 163f1bb89..b2ea9ecb1 100644 --- a/ci/amd64/packer.build.amd64-debian.sh +++ b/ci/amd64/packer.build.amd64-debian.sh @@ -1,5 +1,7 @@ #!/bin/bash -e +sudo apt-get update + # install packer if ! packer version 2>/dev/null; then curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - @@ -11,8 +13,11 @@ else echo "# Packer is installed" fi + + # install qemu -echo -e "\nInstalling qemu..." +echo "# Install qemu ..." +sudo apt-get update sudo apt-get install -y qemu-system # set vars @@ -20,7 +25,7 @@ source ../set_variables.sh set_variables "$@" # Build the image -echo -e "\nBuilding the image..." +echo "# Build the image ..." cd debian packer init -upgrade . command="PACKER_LOG=1 packer build ${vars} -only=qemu packer.build.amd64-debian.hcl" diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 8a7619adb..a43ab1e7a 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -126,9 +126,9 @@ fi if [ "${bos}" == "on" ]; then OPTIONS+=(BOS "Balance of Satoshis") fi -if [ "${lnproxy}" == "on" ]; then - OPTIONS+=(LNPROXY "lnproxy server") -fi +#if [ "${lnproxy}" == "on" ]; then +# OPTIONS+=(LNPROXY "lnproxy server") +#fi if [ "${pyblock}" == "on" ]; then OPTIONS+=(PYBLOCK "PyBlock") fi @@ -281,9 +281,6 @@ case $CHOICE in LIGHTNINGTIPBOT) /home/admin/config.scripts/bonus.lightningtipbot.sh menu ;; - LOOP) - /home/admin/config.scripts/bonus.loop.sh menu - ;; MEMPOOL) /home/admin/config.scripts/bonus.mempool.sh menu ;; @@ -296,9 +293,6 @@ case $CHOICE in JAM) /home/admin/config.scripts/bonus.jam.sh menu ;; - FARADAY) - sudo /home/admin/config.scripts/bonus.faraday.sh menu - ;; BOS) sudo /home/admin/config.scripts/bonus.bos.sh menu ;; @@ -317,9 +311,6 @@ case $CHOICE in ZEROTIER) sudo /home/admin/config.scripts/bonus.zerotier.sh menu ;; - POOL) - sudo /home/admin/config.scripts/bonus.pool.sh menu - ;; SPHINX) sudo /home/admin/config.scripts/bonus.sphinxrelay.sh menu ;; diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index 5e80866e0..c8c3678cd 100755 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -68,7 +68,7 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then OPTIONS+=(la 'LND LIT (loop, pool, faraday)' ${lit}) OPTIONS+=(gb 'LND LNDg (auto-rebalance, auto-fees)' ${lndg}) OPTIONS+=(oa 'LND Balance of Satoshis' ${bos}) - OPTIONS+=(lp 'LND lnproxy server' ${lnproxy}) + #OPTIONS+=(lp 'LND lnproxy server' ${lnproxy}) OPTIONS+=(ya 'LND PyBLOCK' ${pyblock}) OPTIONS+=(ha 'LND ChannelTools (Fund Rescue)' ${chantools}) OPTIONS+=(xa 'LND Sphinx-Relay' ${sphinxrelay}) diff --git a/home.admin/99updateMenu.sh b/home.admin/99updateMenu.sh index 0014cc7c2..6199fe1e3 100755 --- a/home.admin/99updateMenu.sh +++ b/home.admin/99updateMenu.sh @@ -269,10 +269,6 @@ Do you really want to update LND now? if [ ${#error} -gt 0 ]; then whiptail --title "ERROR" --msgbox "${error}" 8 30 else - # if loop was installed before reinstall - if [ "${loop}" == "on" ]; then - sudo -u admin /home/admin/config.scripts/bonus.loop.sh on - fi /home/admin/config.scripts/blitz.shutdown.sh reboot sleep 8 fi diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index fdbd8612f..bc1aa872f 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -425,15 +425,6 @@ else echo "Provisioning clWatchtowerClient - keep default" >> ${logFile} fi -#LOOP - install only if LiT won't be installed -if [ "${loop}" = "on" ] && [ "${lit}" != "on" ]; then - echo "Provisioning Lightning Loop - run config script" >> ${logFile} - /home/admin/_cache.sh set message "Setup Lightning Loop" - sudo -u admin /home/admin/config.scripts/bonus.loop.sh on >> ${logFile} 2>&1 -else - echo "Provisioning Lightning Loop - keep default" >> ${logFile} -fi - #BTC RPC EXPLORER if [ "${BTCRPCexplorer}" = "on" ]; then echo "Provisioning BTCRPCexplorer - run config script" >> ${logFile} @@ -594,15 +585,6 @@ else echo "Provisioning Specter - keep default" >> ${logFile} fi -# Faraday -if [ "${faraday}" = "on" ]; then - echo "Provisioning Faraday - run config script" >> ${logFile} - /home/admin/_cache.sh set message "Setup Faraday" - sudo -u admin /home/admin/config.scripts/bonus.faraday.sh on >> ${logFile} 2>&1 -else - echo "Provisioning Faraday - keep default" >> ${logFile} -fi - # BOS if [ "${bos}" = "on" ]; then echo "Provisioning Balance of Satoshis - run config script" >> ${logFile} @@ -612,14 +594,14 @@ 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 +## 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 @@ -675,15 +657,6 @@ else echo "Provisioning Stacking Sats Kraken - keep default" >> ${logFile} fi -# Pool - install only if LiT won't be installed -if [ "${pool}" = "on" ] && [ "${lit}" != "on" ]; then - echo "Provisioning Pool - run config script" >> ${logFile} - /home/admin/_cache.sh set message "Setup Pool" - sudo -u admin /home/admin/config.scripts/bonus.pool.sh on >> ${logFile} 2>&1 -else - echo "Provisioning Pool - keep default" >> ${logFile} -fi - # lit (make sure to be installed after RTL) if [ "${lit}" = "on" ]; then echo "Provisioning LIT - run config script" >> ${logFile} diff --git a/home.admin/config.scripts/bonus.bitcoinminds.sh b/home.admin/config.scripts/bonus.bitcoinminds.sh index 6b11df744..9dc31ef8e 100644 --- a/home.admin/config.scripts/bonus.bitcoinminds.sh +++ b/home.admin/config.scripts/bonus.bitcoinminds.sh @@ -36,7 +36,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "" # create user - sudo adduser --system --group --home /home/bitcoinminds bitcoinminds + USERNAME=bitcoinminds + echo "# add the user: ${USERNAME}" + sudo adduser --system --group --shell /bin/bash --home /home/${USERNAME} ${USERNAME} + echo "Copy the skeleton files for login" + sudo -u ${USERNAME} cp -r /etc/skel/. /home/${USERNAME}/ # add local directory to path and set PATH for the user sudo bash -c "echo 'PATH=\$PATH:/home/bitcoinminds/.local/bin' >> /home/bitcoinminds/.profile" diff --git a/home.admin/config.scripts/bonus.bos.sh b/home.admin/config.scripts/bonus.bos.sh index 84f1d4a7d..1bf82b9b0 100755 --- a/home.admin/config.scripts/bonus.bos.sh +++ b/home.admin/config.scripts/bonus.bos.sh @@ -4,7 +4,7 @@ # https://github.com/alexbosworth/balanceofsatoshis/blob/master/package.json#L85 # https://www.npmjs.com/package/balanceofsatoshis -BOSVERSION="15.8.14" +BOSVERSION="15.11.0" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then @@ -194,7 +194,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then /home/admin/config.scripts/bonus.nodejs.sh on # create bos user - sudo adduser --system --group --home /home/bos bos + USERNAME=bos + echo "# add the user: ${USERNAME}" + sudo adduser --system --group --shell /bin/bash --home /home/${USERNAME} ${USERNAME} + echo "Copy the skeleton files for login" + sudo -u ${USERNAME} cp -r /etc/skel/. /home/${USERNAME}/ echo "# Create data folder on the disk" # move old data if present @@ -211,10 +215,6 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then sudo -u bos npm config set prefix '/home/bos/.npm-global' sudo bash -c "echo 'PATH=$PATH:/home/bos/.npm-global/bin' >> /home/bos/.bashrc" - # download source code - sudo -u bos git clone https://github.com/alexbosworth/balanceofsatoshis.git /home/bos/balanceofsatoshis - cd /home/bos/balanceofsatoshis - # make sure symlink to central app-data directory exists ***" sudo rm -rf /home/bos/.lnd # not a symlink.. delete it silently # create symlink diff --git a/home.admin/config.scripts/bonus.joinmarket.sh b/home.admin/config.scripts/bonus.joinmarket.sh index 016250ca8..48eefdfb8 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.8" # installs JoinMarket v0.9.9 +JBTAG="v0.8.1" # installs JoinMarket v0.9.10 # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then @@ -56,8 +56,11 @@ if [ "$1" = "install" ]; then echo "# cleaning before install" sudo userdel -rf joinmarket 2>/dev/null - echo "# add the 'joinmarket' user" - adduser --system --group --home /home/joinmarket joinmarket + USERNAME=joinmarket + echo "# add the user: ${USERNAME}" + sudo adduser --system --group --shell /bin/bash --home /home/${USERNAME} ${USERNAME} + echo "Copy the skeleton files for login" + sudo -u ${USERNAME} cp -r /etc/skel/. /home/${USERNAME}/ # add to sudo group (required for installation) adduser joinmarket sudo || exit 1 @@ -69,9 +72,6 @@ if [ "$1" = "install" ]; then sudo -u joinmarket mkdir -p /home/joinmarket/.ssh chmod -R 700 /home/joinmarket/.ssh - # install the command-line fuzzy finder (https://github.com/junegunn/fzf) - bash -c "echo 'source /usr/share/doc/fzf/examples/key-bindings.bash' >> /home/joinmarket/.bashrc" - echo "# adding JoininBox" sudo rm -rf /home/joinmarket/joininbox sudo -u joinmarket git clone https://github.com/openoms/joininbox.git /home/joinmarket/joininbox @@ -115,8 +115,7 @@ if [ "$1" = "install" ]; then echo # install a command-line fuzzy finder (https://github.com/junegunn/fzf) apt -y install fzf - bash -c "echo 'source /usr/share/doc/fzf/examples/key-bindings.bash' >> \ - /home/joinmarket/.bashrc" + echo 'source /usr/share/doc/fzf/examples/key-bindings.bash' | sudo -u joinmarket tee -a /home/joinmarket/.bashrc # install tmux apt -y install tmux diff --git a/home.admin/config.scripts/bonus.lit.sh b/home.admin/config.scripts/bonus.lit.sh index fab4dd3ee..e562d44f7 100644 --- a/home.admin/config.scripts/bonus.lit.sh +++ b/home.admin/config.scripts/bonus.lit.sh @@ -90,7 +90,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then if [ ${isInstalled} -eq 0 ]; then # create dedicated user - sudo adduser --system --group --home /home/lit lit + USERNAME=lit + echo "# add the user: ${USERNAME}" + sudo adduser --system --group --shell /bin/bash --home /home/${USERNAME} ${USERNAME} + echo "Copy the skeleton files for login" + sudo -u ${USERNAME} cp -r /etc/skel/. /home/${USERNAME}/ # make sure symlink to central app-data directory exists sudo rm -rf /home/lit/.lnd # not a symlink.. delete it silently # create symlink diff --git a/home.admin/config.scripts/bonus.pyblock.sh b/home.admin/config.scripts/bonus.pyblock.sh index dd25a69e1..e04e4e45b 100644 --- a/home.admin/config.scripts/bonus.pyblock.sh +++ b/home.admin/config.scripts/bonus.pyblock.sh @@ -29,7 +29,12 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "*** INSTALL pyblocks***" # create pyblock user - sudo adduser --system --group --home /home/pyblock pyblock + USERNAME=pyblock + echo "# add the user: ${USERNAME}" + sudo adduser --system --group --shell /bin/bash --home /home/${USERNAME} ${USERNAME} + echo "Copy the skeleton files for login" + sudo -u ${USERNAME} cp -r /etc/skel/. /home/${USERNAME}/ + cd /home/pyblock sudo -u pyblock mkdir /home/pyblock/config diff --git a/home.admin/config.scripts/bonus.stacking-sats-kraken.sh b/home.admin/config.scripts/bonus.stacking-sats-kraken.sh index 44d3fbeda..59f87d95d 100755 --- a/home.admin/config.scripts/bonus.stacking-sats-kraken.sh +++ b/home.admin/config.scripts/bonus.stacking-sats-kraken.sh @@ -28,7 +28,10 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then /home/admin/config.scripts/bonus.nodejs.sh on # add user - sudo adduser --system --group --home /home/$USERNAME $USERNAME + echo "# add the user: ${USERNAME}" + sudo adduser --system --group --shell /bin/bash --home /home/${USERNAME} ${USERNAME} + echo "Copy the skeleton files for login" + sudo -u ${USERNAME} cp -r /etc/skel/. /home/${USERNAME}/ # install stacking-sats-kraken cd $HOME_DIR diff --git a/home.admin/config.scripts/bonus.template.sh b/home.admin/config.scripts/bonus.template.sh index ff84ec988..5662e9950 100755 --- a/home.admin/config.scripts/bonus.template.sh +++ b/home.admin/config.scripts/bonus.template.sh @@ -161,7 +161,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # 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" - sudo adduser --system --group --home /home/${APPID} ${APPID} || exit 1 + # 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 diff --git a/home.admin/config.scripts/cl.install.sh b/home.admin/config.scripts/cl.install.sh index f57c0d76e..88ddb8b39 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.08" +CLVERSION="v23.08.1" # install the latest master by using the last commit id # https://github.com/ElementsProject/lightning/commit/master From 93e8b5aa14afd458eecc1e6eb77f4d44b17f3856 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 20 Sep 2023 12:56:53 +0200 Subject: [PATCH 05/11] #4171 fix provision of api/webui --- home.admin/_provision_.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index bc1aa872f..ec85fa964 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -40,6 +40,7 @@ if [ ${configExists} -eq 0 ]; then fi # import config values +source ${infoFile} source ${configFile} ########################## @@ -705,7 +706,7 @@ fi # homer if [ "${homer}" = "on" ]; then echo "Provisioning Homer - run config script" >> ${logFile} - sudo sed -i "s/^message=.*/message='Setup Homer'/g" ${infoFile} + /home/admin/_cache.sh set message "Setup Homer" sudo -u admin /home/admin/config.scripts/bonus.homer.sh on >> ${logFile} 2>&1 else echo "Provisioning Homer - keep default" >> ${logFile} @@ -732,7 +733,7 @@ fi # squeaknode if [ "${squeaknode}" = "on" ]; then echo "Provisioning Squeaknode - run config script" >> ${logFile} - sudo sed -i "s/^message=.*/message='Setup Squeaknode '/g" ${infoFile} + /home/admin/_cache.sh set message "Setup Squeaknode" sudo -u admin /home/admin/config.scripts/bonus.squeaknode.sh on >> ${logFile} 2>&1 else echo "Provisioning Squeaknode - keep default" >> ${logFile} @@ -741,7 +742,7 @@ fi # itchysats if [ "${itchysats}" = "on" ]; then echo "Provisioning ItchySats - run config script" >> ${logFile} - sudo sed -i "s/^message=.*/message='Setup ItchySats'/g" ${infoFile} + /home/admin/_cache.sh set message "Setup ItchySats" sudo -u admin /home/admin/config.scripts/bonus.itchysats.sh on --download >> ${logFile} 2>&1 else echo "ItchySats - keep default" >> ${logFile} From 850d90b41689054bc6f80001d65cdb1067d864fe Mon Sep 17 00:00:00 2001 From: code-byter <10854537+code-byter@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:45:15 +0200 Subject: [PATCH 06/11] Fix typos in CONTRIBUTING.md (#4178) --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 87514c123..f8c4379b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,12 +2,12 @@ Everybody is welcome to join, improve, and extend the RaspiBlitz - it's a work in progress. Check the issues if you wanna help out or add new ideas. You can find the scripts used for RaspiBlitz interactions on the device at /home/admin or in this Git repo's subfolder home.admin. ## Understanding Blitz project -RaspiBlitz is insipired by the [RaspiBolt guide](https://raspibolt.github.io/raspibolt/). Tutorial on how to build a lightning node on the RaspberryPi. So much thx to Stadicus :) +RaspiBlitz is inspired by the [RaspiBolt guide](https://raspibolt.github.io/raspibolt/). Tutorial on how to build a lightning node on the RaspberryPi. So much thx to Stadicus :) To start your Deep Dive into the RaspiBlitz project, watch [this video](https://www.youtube.com/watch?v=QXUGg45CWLo). ### Blitz philosophy -* DIY community development, if you are unhappy with the code, fork and pull request, this will make you you DYOR instead of depending on the developers. +* DIY community development, if you are unhappy with the code, fork and pull request, this will make you DYOR instead of depending on the developers. * If you ask when the next release will be available, we don't know, but if you contribute, it might be faster. * Be sure to contribute back, every little help is wanted. @@ -49,7 +49,7 @@ and is also an effective way to request assistance if and when you need it. 1. Make sure it is compatible with Blitz philosophy. 1. Fork the repo 1. Commit changes on the new branch -1. Open a pull request (PR are made to the `dev` branch unless indicated otherwise by a collaborator. +1. Open a pull request (PRs are made to the `dev` branch unless indicated otherwise by a collaborator. #### Review From a92552865769984612ca3126344182b7d09cec06 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 20 Sep 2023 21:48:38 +0200 Subject: [PATCH 07/11] #4171 fix blitzapi config on fatpack --- home.admin/_provision.setup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home.admin/_provision.setup.sh b/home.admin/_provision.setup.sh index dc5da4935..4d377566b 100755 --- a/home.admin/_provision.setup.sh +++ b/home.admin/_provision.setup.sh @@ -39,6 +39,11 @@ if [ "${confExists}" != "1" ]; then exit 6 fi +# make sure raspiblitz.conf has an blitzapi entry when setup thru fatpack image (blitzapi=on in raspiblitz.info) +if [ "${blitzapi}" == "on" ]; then + /home/admin/config.scripts/blitz.config.sh blitzapi on >> ${logFile} +fi + ################################### # Preserve SSH keys # just copy dont link anymore From a3c2ef9b6e49f0a1da8a0d16c2a88f9d7e340feb Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 20 Sep 2023 21:54:33 +0200 Subject: [PATCH 08/11] #4171 fix blitz config on fatpack --- home.admin/_provision.setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/_provision.setup.sh b/home.admin/_provision.setup.sh index 4d377566b..459e400ea 100755 --- a/home.admin/_provision.setup.sh +++ b/home.admin/_provision.setup.sh @@ -41,7 +41,7 @@ fi # make sure raspiblitz.conf has an blitzapi entry when setup thru fatpack image (blitzapi=on in raspiblitz.info) if [ "${blitzapi}" == "on" ]; then - /home/admin/config.scripts/blitz.config.sh blitzapi on >> ${logFile} + /home/admin/config.scripts/blitz.conf.sh set blitzapi on >> ${logFile} fi ################################### From a9f927238837354c55619d9af418cfe218758ba5 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 21 Sep 2023 18:45:54 +0200 Subject: [PATCH 09/11] #4149 add copytruncate to logrotate config --- build_sdcard.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build_sdcard.sh b/build_sdcard.sh index 4b7afbdca..c8fce9a49 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -507,6 +507,9 @@ echo "# Optimizing log files: rotate daily max 100M, keep 4 days & compress old" sed -i "s/^weekly/daily size 100M/g" /etc/logrotate.conf sed -i "s/^#compress/compress/g" /etc/logrotate.conf +# add the option "copytruncate" to /etc/logrotate.conf below the line staring with "# global options do" +sed -i '/# global options do/a \copytruncate' /etc/logrotate.conf + # SPECIAL FOR SYSLOG: /etc/logrotate.d/rsyslog # to test config run: sudo logrotate -v /etc/logrotate.d/rsyslog rm /etc/logrotate.d/rsyslog 2>/dev/null @@ -530,6 +533,7 @@ echo " missingok compress delaycompress + copytruncate sharedscripts postrotate service logrotate restart From e97b35a3b0eb6c07898bfb8f644ae355b764746d Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 21 Sep 2023 22:26:38 +0200 Subject: [PATCH 10/11] #4149 remove manual logrotate start --- home.admin/_bootstrap.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 1ddbfeecc..ba69bd369 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -167,9 +167,6 @@ sleep 5 # CLEANING BOOT SYSTEM ################################ -# force a rotation of every log on boot -logrotate -f /etc/logrotate.d/rsyslog - # Emergency cleaning logs when over 1GB (to prevent SD card filling up) # see https://github.com/rootzoll/raspiblitz/issues/418#issuecomment-472180944 echo "*** Checking Log Size ***" From b8e42f062febefc82723249f7ae2b137f255b41f Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 21 Sep 2023 22:36:59 +0200 Subject: [PATCH 11/11] add failed services info to debug --- home.admin/config.scripts/blitz.debug.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home.admin/config.scripts/blitz.debug.sh b/home.admin/config.scripts/blitz.debug.sh index c2e515b7e..7cbfe8c92 100755 --- a/home.admin/config.scripts/blitz.debug.sh +++ b/home.admin/config.scripts/blitz.debug.sh @@ -85,6 +85,11 @@ echo "chainnetwork: ${network} / ${chain}" uptime echo +echo "*** FAILED SERVICES ***" +echo "list any servcies with problems: sudo systemctl list-units --failed" +sudo systemctl list-units --failed +echo + echo "*** SETUPPHASE / BOOTSTRAP ***" echo "see logs: cat /home/admin/raspiblitz.log" echo "setupPhase--> ${setupPhase}"