#2160 Remove Bitcoind params from lnd.conf on Update & smaller update fixes (#2179)

This commit is contained in:
/rootzoll 2021-04-15 19:51:29 +02:00 committed by GitHub
parent 64bfc91b03
commit 09a4b6325b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 93 additions and 6 deletions

View File

@ -211,7 +211,7 @@ while :
fi
# if freshly recovered
recoveredInfoExists=$(sudo ls /home/admin/recover.flag 2>/dev/null | grep -c '.info')
recoveredInfoExists=$(sudo ls /home/admin/recover.flag 2>/dev/null | grep -c '.flag')
if [ ${recoveredInfoExists} -gt 0 ]; then
l1="FINAL RECOVER LOGIN NEEDED:\n"
l2="ssh admin@${localip}\n"

View File

@ -126,7 +126,7 @@ if [ "${copyInProgress}" = "1" ]; then
fi
# signal that after bootstrap recover user dialog is needed
recoveredInfoExists=$(sudo ls /home/admin/recover.flag 2>/dev/null | grep -c '.info')
recoveredInfoExists=$(sudo ls /home/admin/recover.flag 2>/dev/null | grep -c '.flag')
if [ ${recoveredInfoExists} -gt 0 ]; then
echo "System recovered - needs final user settings"
/home/admin/20recoverDialog.sh

View File

@ -152,6 +152,86 @@ if [ ${configExists} -eq 1 ]; then
echo "check issue #950 -> ok test.rpcbind exists" >> ${logFile}
fi
else
echo "WARN: /mnt/hdd/bitcoin/bitcoin.conf not found" >> ${logFile}
fi
# if old lnd.conf exists ...
configExists=$(sudo ls /mnt/hdd/lnd/lnd.conf | grep -c '.conf')
if [ ${configExists} -eq 1 ]; then
# remove RPC user & pass from lnd.conf ... since v1.7
# https://github.com/rootzoll/raspiblitz/issues/2160
echo "- #2160 lnd.conf --> make sure contains no RPC user/pass for bitcoind" >> ${logFile}
sudo sed -i '/^\[Bitcoind\]/d' /mnt/hdd/lnd/lnd.conf
sudo sed -i '/^bitcoind.rpchost=/d' /mnt/hdd/lnd/lnd.conf
sudo sed -i '/^bitcoind.rpcpass=/d' /mnt/hdd/lnd/lnd.conf
sudo sed -i '/^bitcoind.rpcuser=/d' /mnt/hdd/lnd/lnd.conf
sudo sed -i '/^bitcoind.zmqpubrawblock=/d' /mnt/hdd/lnd/lnd.conf
sudo sed -i '/^bitcoind.zmqpubrawtx=/d' /mnt/hdd/lnd/lnd.conf
# make sure additional values are added to [Application Options] since v1.7
echo "- lnd.conf --> checking additional [Application Options] since v1.7" >> ${logFile}
applicationOptionsLineNumber=$(sudo grep -n "\[Application Options\]" /mnt/hdd/lnd/lnd.conf | cut -d ":" -f1)
if [ "${applicationOptionsLineNumber}" != "" ]; then
applicationOptionsLineNumber="$(($applicationOptionsLineNumber+1))"
# Avoid historical graph data sync
# ignore-historical-gossip-filters=1
configParamExists=$(sudo grep -c "^ignore-historical-gossip-filters=" /mnt/hdd/lnd/lnd.conf)
if [ "${configParamExists}" == "0" ]; then
echo " - ADDING 'ignore-historical-gossip-filters'" >> ${logFile}
sudo sed -i "${applicationOptionsLineNumber}iignore-historical-gossip-filters=1" /mnt/hdd/lnd/lnd.conf
else
echo " - OK 'ignore-historical-gossip-filters' exists (${configParamExists})" >> ${logFile}
fi
# Avoid slow startup time
# sync-freelist=1
configParamExists=$(sudo grep -c "^sync-freelist=" /mnt/hdd/lnd/lnd.conf)
if [ "${configParamExists}" == "0" ]; then
echo " - ADDING 'sync-freelist'" >> ${logFile}
sudo sed -i "${applicationOptionsLineNumber}isync-freelist=1" /mnt/hdd/lnd/lnd.conf
else
echo " - OK 'sync-freelist' exists (${configParamExists})" >> ${logFile}
fi
# Avoid high startup overhead
# stagger-initial-reconnect=1
configParamExists=$(sudo grep -c "^stagger-initial-reconnect=" /mnt/hdd/lnd/lnd.conf)
if [ "${configParamExists}" == "0" ]; then
echo " - ADDING 'stagger-initial-reconnect'" >> ${logFile}
sudo sed -i "${applicationOptionsLineNumber}istagger-initial-reconnect=1" /mnt/hdd/lnd/lnd.conf
else
echo " - OK 'stagger-initial-reconnect' exists (${configParamExists})" >> ${logFile}
fi
# Delete and recreate RPC TLS certificate when details change or cert expires
# tlsautorefresh=1
configParamExists=$(sudo grep -c "^tlsautorefresh=" /mnt/hdd/lnd/lnd.conf)
if [ "${configParamExists}" == "0" ]; then
echo " - ADDING 'tlsautorefresh'" >> ${logFile}
sudo sed -i "${applicationOptionsLineNumber}itlsautorefresh=1" /mnt/hdd/lnd/lnd.conf
else
echo " - OK 'tlsautorefresh' exists (${configParamExists})" >> ${logFile}
fi
# Do not include IPs in the RPC TLS certificate
# tlsdisableautofill=1
configParamExists=$(sudo grep -c "^tlsdisableautofill=" /mnt/hdd/lnd/lnd.conf)
if [ "${configParamExists}" == "0" ]; then
echo " - ADDING 'tlsdisableautofill'" >> ${logFile}
sudo sed -i "${applicationOptionsLineNumber}itlsdisableautofill=1" /mnt/hdd/lnd/lnd.conf
else
echo " - OK 'tlsdisableautofill' exists (${configParamExists})" >> ${logFile}
fi
else
echo " - WARN: section '[Application Options]' not found in lnd.conf" >> ${logFile}
fi
else
echo "WARN: /mnt/hdd/lnd/lnd.conf not found" >> ${logFile}
fi
echo "Version Code: ${codeVersion}" >> ${logFile}
@ -159,8 +239,8 @@ echo "Version Data: ${raspiBlitzVersion}" >> ${logFile}
if [ "${raspiBlitzVersion}" != "${codeVersion}" ]; then
echo "detected version change ... starting migration script" >> ${logFile}
echo "TODO: Update Migration check ... only needed after version 1.0" >> ${logFile}
echo "OK Done - Updating version in config ..."
# nothing specific here yet
echo "OK Done - Updating version in config"
sudo sed -i "s/^raspiBlitzVersion=.*/raspiBlitzVersion='${codeVersion}'/g" ${configFile}
else
echo "OK - version of config data is up to date" >> ${logFile}

View File

@ -388,6 +388,7 @@ if [ ${isMounted} -eq 0 ]; then
sed -i "s/^message=.*/message='Done Recover'/g" ${infoFile}
echo "rebooting" >> $logFile
# set flag that system is freshly recovered and needs setup dialogs
sudo touch /home/admin/recover.flag
echo "state=recovered" >> /home/admin/recover.flag
echo "shutdown in 1min" >> $logFile
# save log file for inspection before reboot
@ -527,7 +528,7 @@ fi
# DETECT FRESHLY RECOVERED SD
################################
recoveredInfoExists=$(ls /home/admin/recover.flag | grep -c '.info')
recoveredInfoExists=$(ls /home/admin/recover.flag | grep -c '.flag')
if [ ${recoveredInfoExists} -eq 1 ]; then
sed -i "s/^state=.*/state=recovered/g" ${infoFile}
sed -i "s/^message=.*/message='login to finish'/g" ${infoFile}

View File

@ -1173,7 +1173,7 @@ fi
###################
if [ "$1" = "tempmount" ]; then
if [ ${isMounted} -eq 1 ]; then
echo "error='already mounted'"
exit 1
@ -1206,7 +1206,13 @@ if [ "$1" = "tempmount" ]; then
if [ "${hddFormat}" = "ext4" ]; then
if [ "${hddDataPartitionExt4}" == "" ]; then
echo "error='parameter is no partition'"
exit 1
fi
# do EXT4 temp mount
echo "# temp mount /dev/${hddDataPartitionExt4} --> /mnt/hdd"
sudo mkdir -p /mnt/hdd 1>/dev/null
sudo mount /dev/${hddDataPartitionExt4} /mnt/hdd