From 5099b037f3c7b9075d8748346d3d9b0187780a49 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:52:29 +0200 Subject: [PATCH] add pip3 config set global.break-system-packages true for non-venv installs (#4700) * charge-lnd: activate venv in systemd service * add pip3 config set global.break-system-packages true for non-venv installs --- home.admin/config.scripts/bonus.charge-lnd.sh | 2 +- home.admin/config.scripts/bonus.lnbits.sh | 2 ++ home.admin/config.scripts/bonus.suez.sh | 2 ++ home.admin/config.scripts/cl-plugin.backup.sh | 2 ++ home.admin/config.scripts/cl.install.sh | 4 +++- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/bonus.charge-lnd.sh b/home.admin/config.scripts/bonus.charge-lnd.sh index 429c6f086..9fbfff966 100644 --- a/home.admin/config.scripts/bonus.charge-lnd.sh +++ b/home.admin/config.scripts/bonus.charge-lnd.sh @@ -74,7 +74,7 @@ Description=charge-lnd After=lnd.service [Service] -ExecStart=/home/bitcoin/charge-lnd/bin/charge-lnd -c /mnt/hdd/app-data/charge-lnd/charge.config +ExecStart=bash -c '. /home/bitcoin/charge-lnd/bin/activate; /home/bitcoin/charge-lnd/bin/charge-lnd -c /mnt/hdd/app-data/charge-lnd/charge.config' User=bitcoin Group=bitcoin Type=simple diff --git a/home.admin/config.scripts/bonus.lnbits.sh b/home.admin/config.scripts/bonus.lnbits.sh index 5f68d9809..1cf5e9b19 100644 --- a/home.admin/config.scripts/bonus.lnbits.sh +++ b/home.admin/config.scripts/bonus.lnbits.sh @@ -589,6 +589,7 @@ if [ "$1" = "sync" ] || [ "$1" = "repo" ]; then echo "# check if poetry in installed, if not install it" if ! sudo -u lnbits which poetry; then echo "# install poetry" + sudo pip3 config set global.break-system-packages true sudo pip3 install --upgrade pip sudo pip3 install poetry fi @@ -650,6 +651,7 @@ if [ "$1" = "install" ]; then # check if poetry in installed, if not install it if ! sudo -u lnbits which poetry; then echo "# install poetry" + sudo pip3 config set global.break-system-packages true sudo pip3 install --upgrade pip sudo pip3 install poetry fi diff --git a/home.admin/config.scripts/bonus.suez.sh b/home.admin/config.scripts/bonus.suez.sh index 911a0f01e..ec9c35a21 100644 --- a/home.admin/config.scripts/bonus.suez.sh +++ b/home.admin/config.scripts/bonus.suez.sh @@ -35,6 +35,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then cd /home/bitcoin || exit 1 # poetry + sudo pip3 config set global.break-system-packages true sudo pip3 install --upgrade pip sudo pip3 install poetry @@ -80,6 +81,7 @@ if [ "$1" = "update" ]; then echo "# UPDATE SUEZ" cd /home/bitcoin || exit 1 # dependency + sudo pip3 config set global.break-system-packages true sudo pip3 install --upgrade pip sudo pip3 install poetry # download source code diff --git a/home.admin/config.scripts/cl-plugin.backup.sh b/home.admin/config.scripts/cl-plugin.backup.sh index f94c80e5e..c836af816 100644 --- a/home.admin/config.scripts/cl-plugin.backup.sh +++ b/home.admin/config.scripts/cl-plugin.backup.sh @@ -40,9 +40,11 @@ function install() { if [ $($lightningcli_alias plugin list 2>/dev/null | grep -c "/${plugin}") -eq 0 ]; then echo "# Checking dependencies" # upgrade pip + sudo pip3 config set global.break-system-packages true sudo pip3 install --upgrade pip # pip dependencies + sudo -u bitcoin pip3 config set global.break-system-packages true sudo -u bitcoin pip3 install pyln-client tqdm psutil # poetry diff --git a/home.admin/config.scripts/cl.install.sh b/home.admin/config.scripts/cl.install.sh index 14b29eb9d..c6d892ef5 100644 --- a/home.admin/config.scripts/cl.install.sh +++ b/home.admin/config.scripts/cl.install.sh @@ -46,10 +46,12 @@ function installDependencies() { # for clnrest (since v23.11) sudo apt-get install -y python3-json5 python3-flask python3-gunicorn # upgrade pip + sudo pip3 config set global.break-system-packages true sudo pip3 install --upgrade pip # for clnrest - pip3 install mako + sudo pip3 install mako cd /home/bitcoin/lightning || exit 1 + sudo -u bitcoin pip3 config set global.break-system-packages true sudo -u bitcoin pip3 install --user -r plugins/clnrest/requirements.txt # poetry sudo pip3 install poetry