RTL install fix (#3739)

* c-lightning-REST update to 0.10.2, fmt
* rtl: npm insatll with --legacy-peer-deps
* purge c-lightning-REST as well with RTL
This commit is contained in:
openoms 2023-04-07 14:35:11 +02:00 committed by GitHub
parent c6a202ede0
commit 48f4054a9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 84 additions and 84 deletions

View File

@ -14,7 +14,7 @@
- Update: Bitcoin Core v24.0.1 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.1.md) - 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.0-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.16.0-beta) - Update: LND v0.16.0-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.16.0-beta)
- Update: Core Lightning v23.02 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.02) - Update: Core Lightning v23.02 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.02)
- Update: C-lightningREST v0.10.1 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.10.1) - Update: C-lightningREST v0.10.2 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.10.2)
- Update: Electrum Server in Rust (electrs) v0.9.11 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0911-jan-5-2023) - Update: Electrum Server in Rust (electrs) v0.9.11 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0911-jan-5-2023)
- Update: Lightning Terminal v0.8.6-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.8.6-alpha) - Update: Lightning Terminal v0.8.6-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.8.6-alpha)
- Update: RTL v0.13.6 with update option [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.13.6) - Update: RTL v0.13.6 with update option [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.13.6)

View File

@ -162,7 +162,7 @@ if [ "$1" = "install" ]; then
# install # install
echo "# Running npm install ..." echo "# Running npm install ..."
export NG_CLI_ANALYTICS=false export NG_CLI_ANALYTICS=false
sudo -u rtl npm install --omit=dev sudo -u rtl npm install --omit=dev --legacy-peer-deps
if ! [ $? -eq 0 ]; then if ! [ $? -eq 0 ]; then
echo "# FAIL - npm install did not run correctly - deleting code and exit" echo "# FAIL - npm install did not run correctly - deleting code and exit"
sudo rm -r /home/rtl/RTL sudo rm -r /home/rtl/RTL
@ -251,7 +251,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
fi fi
echo "# Updating Firewall" echo "# Updating Firewall"
sudo ufw allow ${RTLHTTP} comment "${systemdService} HTTP" sudo ufw allow "${RTLHTTP}" comment "${systemdService} HTTP"
sudo ufw allow $((RTLHTTP + 1)) comment "${systemdService} HTTPS" sudo ufw allow $((RTLHTTP + 1)) comment "${systemdService} HTTPS"
echo echo
@ -546,17 +546,17 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
# only if 'purge' is an additional parameter (other instances/services might need this) # only if 'purge' is an additional parameter (other instances/services might need this)
if [ "$(echo "$@" | grep -c purge)" -gt 0 ]; then if [ "$(echo "$@" | grep -c purge)" -gt 0 ]; then
home/admin/config.scripts/bonus.rtl.sh uninstall /home/admin/config.scripts/bonus.rtl.sh uninstall
if [ $LNTYPE = cl ]; then if [ $LNTYPE = cl ]; then
/home/admin/config.scripts/cl.rest.sh off ${CHAIN} /home/admin/config.scripts/cl.rest.sh off ${CHAIN} purge
fi fi
echo "# Delete all configs" echo "# Delete all configs"
sudo rm -rf /mnt/hdd/app-data/rtl sudo rm -rf /mnt/hdd/app-data/rtl
fi fi
# close ports on firewall # close ports on firewall
sudo ufw deny "${RTLHTTP}" sudo ufw delete allow "${RTLHTTP}"
sudo ufw deny $((RTLHTTP + 1)) sudo ufw delete allow $((RTLHTTP + 1))
# needed for API/WebUI as signal that install ran thru # needed for API/WebUI as signal that install ran thru
echo "result='OK'" echo "result='OK'"
@ -589,7 +589,7 @@ if [ "$1" = "update" ]; then
# https://github.com/Ride-The-Lightning/RTL#or-update-existing-dependencies # https://github.com/Ride-The-Lightning/RTL#or-update-existing-dependencies
echo "# Running npm install ..." echo "# Running npm install ..."
export NG_CLI_ANALYTICS=false export NG_CLI_ANALYTICS=false
sudo -u rtl npm install --omit=dev sudo -u rtl npm install --omit=dev --legacy-peer-deps
if ! [ $? -eq 0 ]; then if ! [ $? -eq 0 ]; then
echo "# FAIL - npm install did not run correctly - deleting code and exit" echo "# FAIL - npm install did not run correctly - deleting code and exit"
sudo rm -r /home/rtl/RTL sudo rm -r /home/rtl/RTL
@ -605,7 +605,7 @@ if [ "$1" = "update" ]; then
sudo -u rtl git pull -p sudo -u rtl git pull -p
echo "# Running npm install ..." echo "# Running npm install ..."
export NG_CLI_ANALYTICS=false export NG_CLI_ANALYTICS=false
sudo -u rtl npm install --only=prod --logLevel warn sudo -u rtl npm install --omit=dev --legacy-peer-deps
if ! [ $? -eq 0 ]; then if ! [ $? -eq 0 ]; then
echo "# FAIL - npm install did not run correctly - deleting code and exit" echo "# FAIL - npm install did not run correctly - deleting code and exit"
sudo rm -r /home/rtl/RTL sudo rm -r /home/rtl/RTL
@ -615,7 +615,7 @@ if [ "$1" = "update" ]; then
echo echo
fi fi
currentRTLcommit=$( currentRTLcommit=$(
cd /home/rtl/RTL cd /home/rtl/RTL || exit 1
git describe --tags git describe --tags
) )
echo "# Updated RTL to $currentRTLcommit" echo "# Updated RTL to $currentRTLcommit"

View File

@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
# https://github.com/Ride-The-Lightning/c-lightning-REST/releases/ # https://github.com/Ride-The-Lightning/c-lightning-REST/releases/
CLRESTVERSION="v0.10.1" CLRESTVERSION="v0.10.2"
# help # help
if [ $# -eq 0 ]||[ "$1" = "-h" ]||[ "$1" = "--help" ];then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Core-Lightning-REST install script" echo "Core-Lightning-REST install script"
echo "The default version is: $CLRESTVERSION" echo "The default version is: $CLRESTVERSION"
echo "mainnet | testnet | signet instances can run parallel" echo "mainnet | testnet | signet instances can run parallel"
@ -29,7 +29,7 @@ source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
echo "# Running 'cl.rest.sh $*'" echo "# Running 'cl.rest.sh $*'"
if [ "$1" = connect ];then if [ "$1" = connect ]; then
if ! systemctl is-active --quiet ${netprefix}clrest; then if ! systemctl is-active --quiet ${netprefix}clrest; then
/home/admin/config.scripts/cl.rest.sh on ${CHAIN} /home/admin/config.scripts/cl.rest.sh on ${CHAIN}
fi fi
@ -58,74 +58,74 @@ if [ "$1" = connect ];then
# deactivated # deactivated
function showStepByStepQR() { function showStepByStepQR() {
clear clear
echo echo
sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}" sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
echo "The Tor address is shown as a QRcode below and on the LCD" echo "The Tor address is shown as a QRcode below and on the LCD"
echo "Scan it to your phone with a QR scanner app and paste it to: 'Host'" echo "Scan it to your phone with a QR scanner app and paste it to: 'Host'"
echo echo
echo "Host: ${toraddress}" echo "Host: ${toraddress}"
echo "REST Port: 443" echo "REST Port: 443"
echo echo
qrencode -t ANSIUTF8 "${toraddress}" qrencode -t ANSIUTF8 "${toraddress}"
echo echo
echo echo
echo "Alternatively to connect through the LAN the address is:" echo "Alternatively to connect through the LAN the address is:"
echo "https://${localip}" echo "https://${localip}"
echo "REST Port: ${portprefix}6100" echo "REST Port: ${portprefix}6100"
echo echo
echo "# Press enter to continue to show the Macaroon" echo "# Press enter to continue to show the Macaroon"
read key read key
sudo /home/admin/config.scripts/blitz.display.sh hide sudo /home/admin/config.scripts/blitz.display.sh hide
sudo /home/admin/config.scripts/blitz.display.sh qr "${hex_macaroon}" sudo /home/admin/config.scripts/blitz.display.sh qr "${hex_macaroon}"
clear clear
echo echo
echo "The Macaroon is shown as a QRcode below and on the LCD" echo "The Macaroon is shown as a QRcode below and on the LCD"
echo "Scan it to your phone with a QR scanner app and paste it to: 'Macaroon (Hex format)'" echo "Scan it to your phone with a QR scanner app and paste it to: 'Macaroon (Hex format)'"
echo echo
echo "Macaroon: ${hex_macaroon}" echo "Macaroon: ${hex_macaroon}"
echo echo
qrencode -t ANSIUTF8 "${hex_macaroon}" qrencode -t ANSIUTF8 "${hex_macaroon}"
echo echo
echo "# Press enter to hide the QRcode from the LCD" echo "# Press enter to hide the QRcode from the LCD"
read key read key
sudo /home/admin/config.scripts/blitz.display.sh hide sudo /home/admin/config.scripts/blitz.display.sh hide
exit 0 exit 0
} }
function showClRestQr() { function showClRestQr() {
# c-lightning-rest://http://your_hidden_service.onion:your_port?&macaroon=your_macaroon_file_in_HEX&protocol=http # c-lightning-rest://http://your_hidden_service.onion:your_port?&macaroon=your_macaroon_file_in_HEX&protocol=http
clear clear
echo echo
sudo /home/admin/config.scripts/blitz.display.sh qr "${clresttor}" sudo /home/admin/config.scripts/blitz.display.sh qr "${clresttor}"
echo "The string to connect over Tor is shown as a QRcode below and on the LCD" echo "The string to connect over Tor is shown as a QRcode below and on the LCD"
echo "Scan it to Zeus using the c-lightning-REST option" echo "Scan it to Zeus using the c-lightning-REST option"
echo echo
echo "c-lightning-REST connection string:" echo "c-lightning-REST connection string:"
echo "${clresttor}" echo "${clresttor}"
echo echo
qrencode -t ANSIUTF8 "${clresttor}" qrencode -t ANSIUTF8 "${clresttor}"
echo echo
echo "# Press enter to show the string to connect over LAN" echo "# Press enter to show the string to connect over LAN"
read key read key
sudo /home/admin/config.scripts/blitz.display.sh hide sudo /home/admin/config.scripts/blitz.display.sh hide
sudo /home/admin/config.scripts/blitz.display.sh qr "${clrestlan}" sudo /home/admin/config.scripts/blitz.display.sh qr "${clrestlan}"
clear clear
echo echo
echo "The string to connect over the local the network is shown as a QRcode below and on the LCD" echo "The string to connect over the local the network is shown as a QRcode below and on the LCD"
echo "Scan it to Zeus using the c-lightning-REST option" echo "Scan it to Zeus using the c-lightning-REST option"
echo "This will only work if your node si connected to the same network" echo "This will only work if your node si connected to the same network"
echo "To connect reemotely consider using a VPN like ZeroTier or Tailscale" echo "To connect reemotely consider using a VPN like ZeroTier or Tailscale"
echo echo
echo "c-lightning-REST connection string:" echo "c-lightning-REST connection string:"
echo "${clrestlan}" echo "${clrestlan}"
echo echo
qrencode -t ANSIUTF8 "${clrestlan}" qrencode -t ANSIUTF8 "${clrestlan}"
echo echo
echo "# Press enter to hide the QRcode from the LCD" echo "# Press enter to hide the QRcode from the LCD"
read key read key
sudo /home/admin/config.scripts/blitz.display.sh hide sudo /home/admin/config.scripts/blitz.display.sh hide
exit 0 exit 0
} }
showClRestQr showClRestQr
@ -138,14 +138,14 @@ if [ "$1" = on ]; then
sudo systemctl stop ${netprefix}clrest sudo systemctl stop ${netprefix}clrest
sudo systemctl disable ${netprefix}clrest sudo systemctl disable ${netprefix}clrest
if [ ! -f /home/bitcoin/c-lightning-REST/cl-rest.js ];then if [ ! -f /home/bitcoin/c-lightning-REST/cl-rest.js ]; then
cd /home/bitcoin || exit 1 cd /home/bitcoin || exit 1
sudo -u bitcoin git clone https://github.com/saubyk/c-lightning-REST sudo -u bitcoin git clone https://github.com/saubyk/c-lightning-REST
cd c-lightning-REST || exit 1 cd c-lightning-REST || exit 1
sudo -u bitcoin git reset --hard $CLRESTVERSION sudo -u bitcoin git reset --hard $CLRESTVERSION
sudo -u bitcoin /home/admin/config.scripts/blitz.git-verify.sh \ sudo -u bitcoin /home/admin/config.scripts/blitz.git-verify.sh \
"${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" "${CLRESTVERSION}" || exit 1 "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" "${CLRESTVERSION}" || exit 1
sudo -u bitcoin npm install sudo -u bitcoin npm install
fi fi
@ -163,10 +163,10 @@ if [ "$1" = on ]; then
\"RPCCOMMANDS\": [\"*\"] \"RPCCOMMANDS\": [\"*\"]
}" | sudo -u bitcoin tee ./${CLNETWORK}/cl-rest-config.json }" | sudo -u bitcoin tee ./${CLNETWORK}/cl-rest-config.json
# copy clrest to a CLNETWORK subdor to make parallel networks possible # copy clrest to a CLNETWORK subdir to make parallel networks possible
sudo -u bitcoin mkdir /home/bitcoin/c-lightning-REST/${CLNETWORK} sudo -u bitcoin mkdir /home/bitcoin/c-lightning-REST/${CLNETWORK}
sudo -u bitcoin cp -r /home/bitcoin/c-lightning-REST/* \ sudo -u bitcoin cp -r /home/bitcoin/c-lightning-REST/* \
/home/bitcoin/c-lightning-REST/${CLNETWORK} /home/bitcoin/c-lightning-REST/${CLNETWORK}
echo " echo "
# systemd unit for c-lightning-REST for ${CHAIN} # systemd unit for c-lightning-REST for ${CHAIN}
@ -209,7 +209,7 @@ WantedBy=multi-user.target
echo echo
fi fi
if [ "$1" = off ];then if [ "$1" = off ]; then
echo "# Removing c-lightning-REST for ${CHAIN}" echo "# Removing c-lightning-REST for ${CHAIN}"
sudo systemctl stop ${netprefix}clrest sudo systemctl stop ${netprefix}clrest
sudo systemctl disable ${netprefix}clrest sudo systemctl disable ${netprefix}clrest
@ -217,7 +217,7 @@ if [ "$1" = off ];then
echo "# Deny port ${portprefix}6100 through the firewall" echo "# Deny port ${portprefix}6100 through the firewall"
sudo ufw deny "${portprefix}6100" sudo ufw deny "${portprefix}6100"
/home/admin/config.scripts/tor.onion-service.sh off ${netprefix}clrest /home/admin/config.scripts/tor.onion-service.sh off ${netprefix}clrest
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then if [ "$(echo "$@" | grep -c purge)" -gt 0 ]; then
echo "# Removing the source code and binaries" echo "# Removing the source code and binaries"
sudo rm -rf /home/bitcoin/c-lightning-REST sudo rm -rf /home/bitcoin/c-lightning-REST
fi fi