#1953 Remove autopilot & keysend from SSH menus (#4605)

* #1953 remove autopilot and keysend from menus

* add to CHANGES
This commit is contained in:
/rootzoll 2024-06-09 22:21:08 +02:00 committed by GitHub
parent 8e6e92b37c
commit 513c759e5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 14 additions and 178 deletions

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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