From 513c759e5c96ae7bb054d17c04b8f1396edaed6d Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Sun, 9 Jun 2024 22:21:08 +0200 Subject: [PATCH] #1953 Remove autopilot & keysend from SSH menus (#4605) * #1953 remove autopilot and keysend from menus * add to CHANGES --- CHANGES.md | 1 + home.admin/00settingsMenuBasics.sh | 44 -------------- home.admin/97addMobileWallet.sh | 6 +- home.admin/_provision.update.sh | 7 --- home.admin/_provision_.sh | 13 ++-- .../config.scripts/bonus.sphinxrelay.sh | 7 ++- home.admin/config.scripts/lnd.autopilot.sh | 60 ------------------- home.admin/config.scripts/lnd.check.sh | 5 -- home.admin/config.scripts/lnd.keysend.sh | 49 --------------- 9 files changed, 14 insertions(+), 178 deletions(-) delete mode 100755 home.admin/config.scripts/lnd.autopilot.sh delete mode 100755 home.admin/config.scripts/lnd.keysend.sh diff --git a/CHANGES.md b/CHANGES.md index 62f8e1873..f486b7079 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ - Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955) - Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements) +- Remove: AutoPilot & Keysend from SSH menus [details](https://github.com/raspiblitz/raspiblitz/issues/1953#issuecomment-1811553602) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) - Remove: CopyStation Script [details](https://github.com/raspiblitz/raspiblitz/issues/4538) diff --git a/home.admin/00settingsMenuBasics.sh b/home.admin/00settingsMenuBasics.sh index 81806f85f..4ed56cafd 100755 --- a/home.admin/00settingsMenuBasics.sh +++ b/home.admin/00settingsMenuBasics.sh @@ -6,7 +6,6 @@ source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf echo "services default values" -if [ ${#autoPilot} -eq 0 ]; then autoPilot="off"; fi if [ ${#autoUnlock} -eq 0 ]; then autoUnlock="off"; fi if [ ${#runBehindTor} -eq 0 ]; then runBehindTor="off"; fi if [ ${#networkUPnP} -eq 0 ]; then networkUPnP="off"; fi @@ -70,14 +69,6 @@ if [ ${touchscreen} -gt 0 ]; then touchscreenMenu='on' fi -echo "# map autopilot to on/off" -lndAutoPilotOn=$(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep -c 'autopilot.active=1') -if [ ${lndAutoPilotOn} -eq 1 ]; then - autoPilot="on" -else - autoPilot="off" -fi - echo "# map clboss to on/off" clbossMenu='off' if [ "${clboss}" == "on" ]; then @@ -102,13 +93,6 @@ if [ "${clWatchtowerClient}" == "on" ]; then clWatchtowerClientMenu='on' fi -echo "# map keysend to on/off (may take time)" -keysend="on" -source <(sudo /home/admin/config.scripts/lnd.keysend.sh status) -if [ ${keysendOn} -eq 0 ]; then - keysend="off" -fi - # show select dialog echo "run dialog ..." @@ -143,8 +127,6 @@ fi # LND & options (only when running LND) OPTIONS+=(m 'LND LIGHTNING LABS NODE' ${lndNode}) if [ "${lndNode}" == "on" ]; then - OPTIONS+=(a '-LND Channel Autopilot' ${autoPilot}) - OPTIONS+=(k '-LND Accept Keysend' ${keysend}) OPTIONS+=(c '-LND Circuitbreaker (firewall)' ${circuitbreaker}) OPTIONS+=(u '-LND Auto-Unlock' ${autoUnlock}) fi @@ -198,18 +180,6 @@ else echo "Blitz API + webUI Setting unchanged." fi -# LND AUTOPILOT process choice -choice="off"; check=$(echo "${CHOICES}" | grep -c "a") -if [ ${check} -eq 1 ]; then choice="on"; fi -if [ "${autoPilot}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then - echo "Autopilot Setting changed .." - anychange=1 - sudo /home/admin/config.scripts/lnd.autopilot.sh ${choice} - needsReboot=1 -else - echo "Autopilot Setting unchanged." -fi - # Dynamic Domain choice="off"; check=$(echo "${CHOICES}" | grep -c "y") if [ ${check} -eq 1 ]; then choice="on"; fi @@ -355,20 +325,6 @@ else echo "BackupdDevice setting unchanged." fi -# LND Keysend process choice -choice="off"; check=$(echo "${CHOICES}" | grep -c "k") -if [ ${check} -eq 1 ]; then choice="on"; fi -if [ "${keysend}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then - echo "keysend setting changed .." - anychange=1 - sudo -u admin /home/admin/config.scripts/lnd.keysend.sh ${choice} - sudo systemctl restart lnd - dialog --msgbox "Accept Keysend on LND mainnet is now ${choice}.\n\nLND restarted - you might need to unlock wallet." 7 52 - sudo -u admin /home/admin/config.scripts/lnd.unlock.sh -else - echo "keysend setting unchanged." -fi - # ZeroTier process choice choice="off"; check=$(echo "${CHOICES}" | grep -c "z") if [ ${check} -eq 1 ]; then choice="on"; fi diff --git a/home.admin/97addMobileWallet.sh b/home.admin/97addMobileWallet.sh index a85ffca17..a7f6f4557 100755 --- a/home.admin/97addMobileWallet.sh +++ b/home.admin/97addMobileWallet.sh @@ -147,12 +147,12 @@ Or scan the qr code on the LCD with your mobile phone. SENDMANY_ANDROID) # check if keysend is activated first - source <(/home/admin/config.scripts/lnd.keysend.sh status) + keysendOn=$(cat /mnt/hdd/lnd/lnd.conf | grep -c '^accept-keysend=1') if [ "${keysendOn}" == "0" ]; then - whiptail --title " KEYSEND NEEDED " --msgbox " + whiptail --title " LND KEYSEND NEEDED " --msgbox " To use the chat feature of the SendMany app, you need to activate the Keysend feature first. -Please go to MAINMENU > SERVICES and activate KEYSEND first. +Please go to MAINMENU > SYSTEM > LNDCONF and set accept-keysend=1 first. " 12 65 exit 0 fi diff --git a/home.admin/_provision.update.sh b/home.admin/_provision.update.sh index c567cc136..c3f7b5650 100755 --- a/home.admin/_provision.update.sh +++ b/home.admin/_provision.update.sh @@ -183,13 +183,6 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then # prepare lnd service cp /home/admin/assets/lnd.service /etc/systemd/system/lnd.service >> ${logFile} 2>&1 - # convert old keysend by lndExtraParameter to raspiblitz.conf setting (will be enforced by lnd.check.sh prestart) since 1.7.1 - if [ "${lndExtraParameter}" == "--accept-keysend" ]; then - echo "# MIGRATION KEYSEND from lndExtraParameter --> raspiblitz.conf" >> ${logFile} - /home/admin/config.scripts/blitz.conf.sh set lndKeysend "on" - /home/admin/config.scripts/blitz.conf.sh delete lndExtraParameter - fi - # if old lnd.conf exists ... configExists=$(sudo ls /mnt/hdd/lnd/lnd.conf | grep -c '.conf') if [ ${configExists} -eq 1 ]; then diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index 0f17e8d51..816c2eb6e 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -363,15 +363,6 @@ else echo "Provisioning Tor - keep default" >> ${logFile} fi -# AUTO PILOT -if [ "${autoPilot}" = "on" ]; then - echo "Provisioning AUTO PILOT - run config script" >> ${logFile} - /home/admin/_cache.sh set message "Setup AutoPilot" - /home/admin/config.scripts/lnd.autopilot.sh on >> ${logFile} 2>&1 -else - echo "Provisioning AUTO PILOT - keep default" >> ${logFile} -fi - # NETWORK UPNP if [ "${networkUPnP}" = "on" ]; then echo "Provisioning NETWORK UPnP - run config script" >> ${logFile} @@ -798,6 +789,10 @@ echo "Start i2pd" >> ${logFile} /home/admin/_cache.sh set message "i2pd setup" /home/admin/config.scripts/blitz.i2pd.sh on >> ${logFile} +# clean up raspiblitz config from old settings +sed -i '/^autoPilot=/d' /mnt/hdd/raspiblitz.conf +sed -i '/^lndKeysend=/d' /mnt/hdd/raspiblitz.conf + # signal setup done /home/admin/_cache.sh set message "Setup Done" diff --git a/home.admin/config.scripts/bonus.sphinxrelay.sh b/home.admin/config.scripts/bonus.sphinxrelay.sh index c565fb76a..420edfc01 100755 --- a/home.admin/config.scripts/bonus.sphinxrelay.sh +++ b/home.admin/config.scripts/bonus.sphinxrelay.sh @@ -384,7 +384,12 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then /home/admin/config.scripts/bonus.nodejs.sh on # make sure keysend is on - /home/admin/config.scripts/lnd.keysend.sh on + keysendOn=$(cat /mnt/hdd/lnd/lnd.conf | grep -c '^accept-keysend=1') + if [ "${keysendOn}" == "0" ]; then + echo "ERR: keysend is not activated in LND" + echo "Activate it in the LND config and restart LND" + exit 1 + fi echo "*** Add the 'sphinxrelay' user ***" sudo adduser --system --group --home /home/sphinxrelay sphinxrelay diff --git a/home.admin/config.scripts/lnd.autopilot.sh b/home.admin/config.scripts/lnd.autopilot.sh deleted file mode 100755 index 34814b0c6..000000000 --- a/home.admin/config.scripts/lnd.autopilot.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -if [ $# -eq 0 ]; then - echo "small config script to switch the LND auto pilot on or off" - echo "lnd.autopilot.sh [on|off]" - exit 1 -fi - -# check lnd.conf exits -lndConfExists=$(sudo ls /mnt/hdd/lnd/lnd.conf | grep -c 'lnd.conf') -if [ ${lndConfExists} -eq 0 ]; then - echo "FAIL - /mnt/hdd/lnd/lnd.conf not found" - exit 1 -fi - -# stop services -echo "making sure services are not running" -sudo systemctl stop lnd 2>/dev/null - -# check if "autopilot.active" exists -valueExists=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c 'autopilot.active=') -if [ ${valueExists} -eq 0 ]; then - echo "Adding autopilot config defaults to /mnt/hdd/lnd/lnd.conf" - sudo sed -i '$ a [autopilot]' /mnt/hdd/lnd/lnd.conf - sudo sed -i '$ a autopilot.active=0' /mnt/hdd/lnd/lnd.conf - sudo sed -i '$ a autopilot.allocation=0.6' /mnt/hdd/lnd/lnd.conf - sudo sed -i '$ a autopilot.maxchannels=5' /mnt/hdd/lnd/lnd.conf -fi - -# add default value to raspi config if needed -source /home/admin/raspiblitz.info -source /mnt/hdd/raspiblitz.conf - -# switch on -if [ "$1" = "1" ] || [ "$1" = "on" ]; then - echo "switching the LND autopilot ON" - echo "editing /mnt/hdd/lnd/lnd.conf" - sudo sed -i "s/^autopilot.active=.*/autopilot.active=1/g" /mnt/hdd/lnd/lnd.conf - echo "editing /mnt/hdd/raspiblitz.conf" - /home/admin/config.scripts/blitz.conf.sh set autoPilot "on" - echo "OK - autopilot is now ON" - echo "needs reboot to activate new setting" - exit 0 -fi - -# switch off -if [ "$1" = "0" ] || [ "$1" = "off" ]; then - echo "switching the LND autopilot OFF" - echo "editing /mnt/hdd/lnd/lnd.conf" - sudo sed -i "s/^autopilot.active=.*/autopilot.active=0/g" /mnt/hdd/lnd/lnd.conf - echo "editing /mnt/hdd/raspiblitz.conf" - /home/admin/config.scripts/blitz.conf.sh set autoPilot "off" - echo "OK - autopilot is now OFF" - echo "needs reboot to activate new setting" - exit 0 -fi - -echo "FAIL - Unknown Parameter $1" -echo "may needs reboot to run normal again" -exit 1 \ No newline at end of file diff --git a/home.admin/config.scripts/lnd.check.sh b/home.admin/config.scripts/lnd.check.sh index ed254d7b2..5d277f39c 100755 --- a/home.admin/config.scripts/lnd.check.sh +++ b/home.admin/config.scripts/lnd.check.sh @@ -213,11 +213,6 @@ if [ "$1" == "prestart" ]; then sed -i '/^externalip=*/d' ${lndConfFile} fi - # enforce LND keysend (if set in raspiblitz.conf) - if [ "${lndKeysend}" == "on" ]; then - setting ${lndConfFile} ${insertLine} "accept-keysend" "true" - fi - ##### BOLT SECTION ##### # https://github.com/lightningnetwork/lnd/blob/0aa0831619cb320dbb74883c37a80ccbdde7f320/sample-lnd.conf#L1205 sectionName="bolt" diff --git a/home.admin/config.scripts/lnd.keysend.sh b/home.admin/config.scripts/lnd.keysend.sh deleted file mode 100755 index 7ba388aee..000000000 --- a/home.admin/config.scripts/lnd.keysend.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# based on: https://github.com/rootzoll/raspiblitz/issues/1000 - -if [ $# -eq 0 ]; then - echo "activate/deactivate LND keysend feature" - echo "lnd.keysend.sh [on|off|status]" - exit 1 -fi - -# note: this script is not run during provision/recovery -# because if the lnd extra parameter is set in raspiblitz.conf, -# it will automatically be used by the service - -source /mnt/hdd/raspiblitz.conf - -parameter=$1 -if [ "${parameter}" == "on" ]; then - - # store to raspiblitz config - /home/admin/config.scripts/blitz.conf.sh delete lndExtraParameter - /home/admin/config.scripts/blitz.conf.sh set lndKeysend "on" - - echo "# OK - keysend feature is switched ON" - echo "# will be enfored by lnd.check.sh prestart" - echo "# LND or RaspiBlitz needs restart" - -elif [ "${parameter}" == "off" ]; then - - # just remove the parameter from the config file - /home/admin/config.scripts/blitz.conf.sh delete lndExtraParameter - /home/admin/config.scripts/blitz.conf.sh delete lndKeysend - sudo sed -i '/accept-keysend=.*/d' /mnt/hdd/lnd/lnd.conf 2>/dev/null - sudo sed -i '/accept-keysend=.*/d' /mnt/hdd/lnd/tlnd.conf 2>/dev/null - sudo sed -i '/accept-keysend=.*/d' /mnt/hdd/lnd/slnd.conf 2>/dev/null - - echo "# OK - keysend enforcement is switched OFF" - echo "# LND or RaspiBlitz needs restart" - -elif [ "${parameter}" == "status" ]; then - - keysendOn=$(sudo cat /mnt/hdd/raspiblitz.conf | grep -c '^lndKeysend=on') - keysendRunning=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c '^accept-keysend\=true') - echo "keysendOn=${keysendOn}" - echo "keysendRunning=${keysendRunning}" - -else - echo "err='unknown parameter'" -fi