Merge branch 'v1.5' into add-macaroon-store

This commit is contained in:
frennkie 2020-05-02 22:36:39 +02:00 committed by GitHub
commit b684e6c1ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 167 additions and 152 deletions

6
FAQ.md
View file

@ -5,8 +5,8 @@
Beside many small improvements and changes, these are most important changes: Beside many small improvements and changes, these are most important changes:
- Update: LND version 0.9.2-beta (optional update to 0.10.0-beta) - Update: LND version 0.9.2-beta (optional update to 0.10.0-beta)
- Update: bitcoin-core version 19.1-beta - Update: bitcoin-core version 0.19.1-beta
- Update: Loop 0.5.1 - Update: Loop 0.5.1 or 0.6.0 (based in LND version)
- Update: RTL 0.7.0 (Loop In and Out integration) - Update: RTL 0.7.0 (Loop In and Out integration)
- Update: BTCPayServer v1.0.4.2 - Update: BTCPayServer v1.0.4.2
- Update: LNbits v0.1 [details](https://twitter.com/lnbits/status/1253700293440741377?s=20) - Update: LNbits v0.1 [details](https://twitter.com/lnbits/status/1253700293440741377?s=20)
@ -17,7 +17,7 @@ Beside many small improvements and changes, these are most important changes:
- New: Specter Desktop (connect DIY Specter-Wallet or ColdCard) [details](https://github.com/cryptoadvance/specter-desktop/blob/master/README.md) - New: Specter Desktop (connect DIY Specter-Wallet or ColdCard) [details](https://github.com/cryptoadvance/specter-desktop/blob/master/README.md)
- New: JoinMarket [details](https://github.com/JoinMarket-Org/joinmarket-clientserver) - New: JoinMarket [details](https://github.com/JoinMarket-Org/joinmarket-clientserver)
- New: Activate 'Keysend' on LND by Service Menu [details](https://github.com/rootzoll/raspiblitz/issues/1000) - New: Activate 'Keysend' on LND by Service Menu [details](https://github.com/rootzoll/raspiblitz/issues/1000)
- New: SendMany App (wallet & chat over keysend) - New: SendMany App (wallet & chat over keysend) [details](https://github.com/fusion44/sendmany/blob/master/README.md)
- New: Reset SSH cert if SSH login not working [details](FAQ.md#how-can-i-repair-my-ssh-login) - New: Reset SSH cert if SSH login not working [details](FAQ.md#how-can-i-repair-my-ssh-login)
- New: Make it easier to Copy The Blockchain over Network from running Blitz - New: Make it easier to Copy The Blockchain over Network from running Blitz
- New: Forwarding Fee Report on Main Menu - New: Forwarding Fee Report on Main Menu

View file

@ -2,7 +2,7 @@
*Build your own Lightning Node on a RaspberryPi with a nice Display.* *Build your own Lightning Node on a RaspberryPi with a nice Display.*
`Version 1.5 with lnd 0.9.2-beta and bitcoin 0.19.1 or litecoin 0.17.1.` `Version 1.5 with lnd 0.9.2-beta (0.10.0-beta optional) and bitcoin 0.19.1 or litecoin 0.17.1.`
![RaspiBlitz](pictures/raspiblitz.jpg) ![RaspiBlitz](pictures/raspiblitz.jpg)
@ -37,6 +37,7 @@ You can connect the following Wallet-Apps to your RaspiBlitz:
* **Zeus** (Android & iOS-TestFlight) [details](https://zeusln.app) * **Zeus** (Android & iOS-TestFlight) [details](https://zeusln.app)
* **Shango** (Android & iOS-TestFlight) [details](https://github.com/neogeno/shango-lightning-wallet) * **Shango** (Android & iOS-TestFlight) [details](https://github.com/neogeno/shango-lightning-wallet)
* **Fully Noded** (iOS) [details](https://apps.apple.com/us/app/fully-noded/id1436425586) * **Fully Noded** (iOS) [details](https://apps.apple.com/us/app/fully-noded/id1436425586)
* **SendMany** (Android) [details](https://github.com/fusion44/sendmany/blob/master/README.md)
Also much more features like Touchscreen, Autopilot, DynDNS, SSH-Tunneling, UPS Support, ... Also much more features like Touchscreen, Autopilot, DynDNS, SSH-Tunneling, UPS Support, ...
@ -48,15 +49,7 @@ If you start at home ordering the parts from Amazon (see shopping list below) th
## Hardware Needed ## Hardware Needed
The RaspiBlitz is build from the following minimal parts: All parts together are at around 150-250 USD - based on shops and location.
* RaspBerryPi 3B/4B
* 500GB USB HDD or SSD
* LCD-Display HAT
* 16GB Micro SD-Card
* Power supply >=3A (stable output is important)
**All parts together are at around 150-200 USD - based on shops and location.**
### Buy a ready-2-go RaspiBlitz (Germany, EU and International) ### Buy a ready-2-go RaspiBlitz (Germany, EU and International)
@ -64,48 +57,17 @@ If you like to support the RaspiBlitz project you can order a ready-2-go RaspiBl
### Amazon Shopping List (buy parts & build it yourself) ### Amazon Shopping List (buy parts & build it yourself)
*Please try to use the exact hardware models that are recommended in the shopping lists, because we have multiple reports were for example other SSD or SSD cases/controllers lead to problems. The idea of the shopping lists is to provide you the best tested hardware components that work together - improvement recommendations are always welcome.* The cheapest way is to buy and assemble the single parts yourself. There are two packages.
The cheapest way is to buy and assemble the single parts yourself. The new shopping list comes in three different packages: Minimal, Standard & Maximal: *Please try to use the exact hardware models that are recommended in the shopping lists, because we have multiple reports were for example other SSD or SSD cases/controllers lead to problems. The idea of the shopping lists is to provide you the best tested hardware components that work together - improvement recommendations are always welcome.*
#### Package: Standard (around 250 USD) #### Package: Standard (around 250 USD)
*The "Standard Package" is most tested and recommended if you can effort it. It aims to give you the best economic value to run all the RaspiBlitz features at a good performance and even allows you to self-validate your blockchain in under 3 days.* *The "Standard Package" is most tested and recommended if you can effort it. It aims to give you the best economic value to run all the RaspiBlitz features at a good performance and even allows you to self-validate your blockchain in under 3 days.*
* RaspBerry Pi 4 2GB [amazon](https://geni.us/raspiblitz-4-2gb) * RaspBerry Pi 4 2GB (or 4GB) [amazon](https://geni.us/raspiblitz-4-2gb)
* RaspBerry Power Supply [amazon](https://geni.us/raspiblitz-ps) * RaspBerry Power Supply [amazon](https://geni.us/raspiblitz-ps)
* 500GB SSD: [amazon](https://geni.us/raspiblitz-500gb-ssd)
* SSD-Case: [amazon](https://geni.us/raspiblitz-ssd-case)
* Micro SD-Card 32GB: [amazon](https://geni.us/raspiblitz-sc-card)
* LCD-Display: [amazon](https://geni.us/raspiblitz-touchscreen)
* RaspberryPi Heatsink Case: [amazon](https://geni.us/heatsink-raspi4)
#### Package: Minimal (around 180 USD)
*The minimal package aims for the cheapest price and allows you to use old hardware. It will always be possible to run all the basic features of a Bitcoin- & Lightning-Fullnode, but the system might be too slow to validate the blockchain history by itself and run some resource intensive extended services.*
Basic Parts for all minimal variants:
* 1TB Hard Drive: [amazon](https://geni.us/raspiblitz-hdd)
* Micro SD-Card 16GB: [amazon](https://geni.us/raspiblitz-sd-card16gb)
* LCD-Display: [amazon](https://geni.us/raspiblitz-touchscreen)
If you have already a used RaspberryPi 3 B+ you can reuse with the following parts:
* RaspBerry Pi 3: [amazon](https://geni.us/raspiblitz-rpi3)
* Heatsink-Case RP3: [amazon](https://geni.us/raspiblitz-heatsink)
* Power >=3A: [amazon](https://geni.us/raspiblitz-3A-power)
Or if you order new go with the RaspberryPi 4 2GB and the following parts:
* RaspBerry Pi 4 2GB [amazon](https://geni.us/raspiblitz-4-2gb)
* RaspBerry Power Supply [amazon](https://geni.us/raspiblitz-ps)
* RaspberryPi Heatsink Case: [amazon](https://geni.us/heatsink-raspi4)
#### Package: Maximal
*The maximal package is still in the works ... if you want to prepare for it, take the standard package as a base and choose the RaspberryPi4 with 4GB and a high quality 1TB SSD instead of 500GB.*
* 1TB SSD: [amazon](https://geni.us/raspiblitz-1000gb-san) * 1TB SSD: [amazon](https://geni.us/raspiblitz-1000gb-san)
* RaspBerry Pi 4 4GB: [amazon](https://geni.us/raspiblitz-4-4gb)
* RaspBerry Power Supply [amazon](https://geni.us/raspiblitz-ps)
* SSD-Case: [amazon](https://geni.us/raspiblitz-ssd-case) * SSD-Case: [amazon](https://geni.us/raspiblitz-ssd-case)
* Micro SD-Card 32GB: [amazon](https://geni.us/raspiblitz-sc-card) * Micro SD-Card 32GB: [amazon](https://geni.us/raspiblitz-sc-card)
* LCD-Display: [amazon](https://geni.us/raspiblitz-touchscreen) * LCD-Display: [amazon](https://geni.us/raspiblitz-touchscreen)
@ -113,7 +75,26 @@ Or if you order new go with the RaspberryPi 4 2GB and the following parts:
*You can even pay your RaspiBlitz Amazon Shopping with Bitcoin & Lightning through [Bitrefill](https://blog.bitrefill.com/its-here-buy-amazon-vouchers-with-bitcoin-on-bitrefill-bb2a4449724a).* *You can even pay your RaspiBlitz Amazon Shopping with Bitcoin & Lightning through [Bitrefill](https://blog.bitrefill.com/its-here-buy-amazon-vouchers-with-bitcoin-on-bitrefill-bb2a4449724a).*
* [What other case options do I have?](FAQ.md#what-other-case-options-do-i-have) #### Package: Minimal (around 180 USD)
*The minimal package aims for the cheapest price and allows you to use old hardware. It will always be possible to run all the basic features of a Bitcoin- & Lightning-Fullnode, but the system might be too slow to validate the blockchain history by itself and run some resource intensive extended services.*
Basic Parts:
* 1TB Hard Drive: [amazon](https://geni.us/raspiblitz-hdd)
* Micro SD-Card 16GB: [amazon](https://geni.us/raspiblitz-sd-card16gb)
* LCD-Display: [amazon](https://geni.us/raspiblitz-touchscreen)
When RaspberryPi 3 --> add following parts:
* RaspBerry Pi 3: [amazon](https://geni.us/raspiblitz-rpi3)
* Heatsink-Case RP3: [amazon](https://geni.us/raspiblitz-heatsink)
* Powersupply >=3A: [amazon](https://geni.us/raspiblitz-3A-power)
When RaspberryPi 4 2GB --> add following parts:
* RaspBerry Pi 4 2GB [amazon](https://geni.us/raspiblitz-4-2gb)
* RaspBerry Power Supply [amazon](https://geni.us/raspiblitz-ps)
* RaspberryPi Heatsink Case: [amazon](https://geni.us/heatsink-raspi4)
[What other case options do I have?](FAQ.md#what-other-case-options-do-i-have)
## Assemble your RaspiBlitz ## Assemble your RaspiBlitz

View file

@ -471,6 +471,33 @@ if [ "${ElectRS}" != "${choice}" ]; then
echo "ElectRS Setting changed .." echo "ElectRS Setting changed .."
anychange=1 anychange=1
extraparameter="" extraparameter=""
if [ "${choice}" = "on" ]; then
# check on HDD size
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
if [ ${hddGigaBytes} -lt 800 ]; then
whiptail --title " HDD/SSD TOO SMALL " --msgbox "\
Since v1.5 we recommend at least a 1TB HDD/SSD if you want to run ElectRS.\n
This is due to the eletcrum index that will grow over time and needs space.\n
To migrate to a bigger HDD/SSD check RaspiBlitz README on 'migration'.\n
" 14 50
else
/home/admin/config.scripts/bonus.electrs.sh on ${extraparameter}
errorOnInstall=$?
if [ ${errorOnInstall} -eq 0 ]; then
sudo systemctl start electrs
whiptail --title " Installed ElectRS Server " --msgbox "\
The index database needs to be created before Electrum Server can be used.\n
This can take hours/days depending on your RaspiBlitz. Monitor the progress on the LCD.\n
When finished use the new 'ELECTRS' entry in Main Menu for more info.\n
" 14 50
else
l1="!!! FAIL on ElectRS install !!!"
l2="Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/bonus.electrs.sh on"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi
fi
fi
if [ "${choice}" = "off" ]; then if [ "${choice}" = "off" ]; then
whiptail --title "Delete Electrum Index?" \ whiptail --title "Delete Electrum Index?" \
--yes-button "Keep Index" \ --yes-button "Keep Index" \
@ -479,24 +506,9 @@ if [ "${ElectRS}" != "${choice}" ]; then
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
extraparameter="deleteindex" extraparameter="deleteindex"
fi fi
/home/admin/config.scripts/bonus.electrs.sh off ${extraparameter}
fi fi
/home/admin/config.scripts/bonus.electrs.sh ${choice} ${extraparameter}
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
sudo systemctl start electrs
whiptail --title " Installed ElectRS Server " --msgbox "\
The index database needs to be created before Electrum Server can be used.\n
This can take hours/days depending on your RaspiBlitz. Monitor the progress on the LCD.\n
When finished use the new 'ELECTRS' entry in Main Menu for more info.\n
" 14 50
else
l1="!!! FAIL on ElectRS install !!!"
l2="Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/bonus.electrs.sh on"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi
fi
else else
echo "ElectRS Setting unchanged." echo "ElectRS Setting unchanged."
fi fi

View file

@ -22,7 +22,7 @@ while [ ${#result} -eq 0 ]
l2="one word, keep characters basic & not too long" l2="one word, keep characters basic & not too long"
dialog --backtitle "RaspiBlitz - Setup (${network}/${chain})" --inputbox "$l1$l2" 11 52 2>$_temp dialog --backtitle "RaspiBlitz - Setup (${network}/${chain})" --inputbox "$l1$l2" 11 52 2>$_temp
result=$( cat $_temp | tr -dc '[:alnum:]-.' | tr -d ' ' ) result=$( cat $_temp | tr -dc '[:alnum:]-.' | tr -d ' ' )
shred $_temp shred -u $_temp
echo "processing ..." echo "processing ..."
sleep 3 sleep 3
done done

View file

@ -183,10 +183,10 @@ if [ ${walletExists} -eq 0 ]; then
############################ ############################
# let user enter password c # let user enter password c
sudo shred /home/admin/.pass.tmp 2>/dev/null sudo shred -u /home/admin/.pass.tmp 2>/dev/null
sudo /home/admin/config.scripts/blitz.setpassword.sh x "Set your Password C for the LND Wallet Unlock" /home/admin/.pass.tmp sudo /home/admin/config.scripts/blitz.setpassword.sh x "Set your Password C for the LND Wallet Unlock" /home/admin/.pass.tmp
passwordC=`sudo cat /home/admin/.pass.tmp` passwordC=`sudo cat /home/admin/.pass.tmp`
sudo shred /home/admin/.pass.tmp 2>/dev/null sudo shred -u /home/admin/.pass.tmp 2>/dev/null
# make sure passwordC is set # make sure passwordC is set
if [ ${#passwordC} -eq 0 ]; then if [ ${#passwordC} -eq 0 ]; then
@ -200,7 +200,7 @@ if [ ${walletExists} -eq 0 ]; then
source /home/admin/python3-env-lnd/bin/activate source /home/admin/python3-env-lnd/bin/activate
python3 /home/admin/config.scripts/lnd.initwallet.py new ${passwordC} > /home/admin/.seed.tmp python3 /home/admin/config.scripts/lnd.initwallet.py new ${passwordC} > /home/admin/.seed.tmp
source /home/admin/.seed.tmp source /home/admin/.seed.tmp
sudo shred /home/admin/.pass.tmp 2>/dev/null sudo shred -u /home/admin/.pass.tmp 2>/dev/null
# in case of error - retry # in case of error - retry
if [ ${#err} -gt 0 ]; then if [ ${#err} -gt 0 ]; then
@ -320,10 +320,10 @@ or having a complete LND rescue-backup from your old node.
clear clear
# let user enter password c # let user enter password c
sudo shred /home/admin/.pass.tmp 2>/dev/null sudo shred -u /home/admin/.pass.tmp 2>/dev/null
sudo /home/admin/config.scripts/blitz.setpassword.sh x "Set your Password C for the LND Wallet Unlock" /home/admin/.pass.tmp sudo /home/admin/config.scripts/blitz.setpassword.sh x "Set your Password C for the LND Wallet Unlock" /home/admin/.pass.tmp
passwordC=`sudo cat /home/admin/.pass.tmp` passwordC=`sudo cat /home/admin/.pass.tmp`
sudo shred /home/admin/.pass.tmp 2>/dev/null sudo shred -u /home/admin/.pass.tmp 2>/dev/null
# get seed word list # get seed word list
if [ "${CHOICE}" == "SEED+SCB" ] || [ "${CHOICE}" == "ONLYSEED" ]; then if [ "${CHOICE}" == "SEED+SCB" ] || [ "${CHOICE}" == "ONLYSEED" ]; then
@ -334,7 +334,7 @@ or having a complete LND rescue-backup from your old node.
# dialog to enter # dialog to enter
dialog --backtitle "RaspiBlitz - LND Recover" --inputbox "Please enter/paste the SEED WORD LIST:\n(just the words, seperated by spaces, in correct order as numbered)" 9 78 2>/home/admin/.seed.tmp dialog --backtitle "RaspiBlitz - LND Recover" --inputbox "Please enter/paste the SEED WORD LIST:\n(just the words, seperated by spaces, in correct order as numbered)" 9 78 2>/home/admin/.seed.tmp
wordstring=$( cat /home/admin/.seed.tmp | sed 's/[^a-zA-Z0-9 ]//g' ) wordstring=$( cat /home/admin/.seed.tmp | sed 's/[^a-zA-Z0-9 ]//g' )
shred /home/admin/.seed.tmp shred -u /home/admin/.seed.tmp
echo "processing ... ${wordstring}" echo "processing ... ${wordstring}"
# check correct number of words # check correct number of words
@ -374,10 +374,10 @@ During wallet creation LND offers to set an extra password
to protect the seed words. Most users did not set this. to protect the seed words. Most users did not set this.
" 11 65 " 11 65
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
sudo shred /home/admin/.pass.tmp 2>/dev/null sudo shred -u /home/admin/.pass.tmp 2>/dev/null
sudo /home/admin/config.scripts/blitz.setpassword.sh x "Enter extra Password D" /home/admin/.pass.tmp sudo /home/admin/config.scripts/blitz.setpassword.sh x "Enter extra Password D" /home/admin/.pass.tmp
passwordD=`sudo cat /home/admin/.pass.tmp` passwordD=`sudo cat /home/admin/.pass.tmp`
sudo shred /home/admin/.pass.tmp 2>/dev/null sudo shred -u /home/admin/.pass.tmp 2>/dev/null
fi fi
fi fi

View file

@ -72,10 +72,12 @@ OPTIONS=(HARDWARE "Run Hardwaretest" \
RESET-CHAIN "Delete Blockchain & Re-Download" \ RESET-CHAIN "Delete Blockchain & Re-Download" \
RESET-LND "Delete LND & start new node/wallet" \ RESET-LND "Delete LND & start new node/wallet" \
RESET-HDD "Delete HDD Data but keep Blockchain" \ RESET-HDD "Delete HDD Data but keep Blockchain" \
RESET-ALL "Delete HDD completly to start fresh" RESET-ALL "Delete HDD completly to start fresh" \
DELETE-ELEC "Delete Electrum Index" \
DELETE-INDEX "Delete Bitcoin Transaction-Index"
) )
CHOICE=$(whiptail --clear --title "Repair Options" --menu "" 15 62 8 "${OPTIONS[@]}" 2>&1 >/dev/tty) CHOICE=$(whiptail --clear --title "Repair Options" --menu "" 18 62 11 "${OPTIONS[@]}" 2>&1 >/dev/tty)
clear clear
case $CHOICE in case $CHOICE in
@ -120,7 +122,7 @@ case $CHOICE in
l3="one word, keep characters basic & not too long" l3="one word, keep characters basic & not too long"
dialog --backtitle "RaspiBlitz - Setup (${network}/${chain})" --inputbox "$l1$l2$l3" 13 52 2>$_temp dialog --backtitle "RaspiBlitz - Setup (${network}/${chain})" --inputbox "$l1$l2$l3" 13 52 2>$_temp
result=$( cat $_temp | tr -dc '[:alnum:]-.' | tr -d ' ' ) result=$( cat $_temp | tr -dc '[:alnum:]-.' | tr -d ' ' )
shred $_temp shred -u $_temp
echo "processing ..." echo "processing ..."
sleep 3 sleep 3
done done
@ -153,6 +155,14 @@ case $CHOICE in
sudo shutdown now sudo shutdown now
exit 1; exit 1;
;; ;;
DELETE-ELEC)
/home/admin/config.scripts/bonus.electrs.sh off deleteindex
exit 1;
;;
DELETE-INDEX)
/home/admin/config.scripts/network.txindex.sh delete
exit 1;
;;
COPY-SOURCE) COPY-SOURCE)
copyHost copyHost
;; ;;

View file

@ -9,8 +9,8 @@ clear
# Basic Options # Basic Options
OPTIONS=(RELEASE "RaspiBlitz Release Update/Recovery" \ OPTIONS=(RELEASE "RaspiBlitz Release Update/Recovery" \
PATCH "Patch RaspiBlitz v${codeVersion}" \ LND "Interim LND Update Options" \
LND "Update LND Release Options" PATCH "Patch RaspiBlitz v${codeVersion}"
) )
CHOICE=$(whiptail --clear --title "Update Options" --menu "" 10 55 3 "${OPTIONS[@]}" 2>&1 >/dev/tty) CHOICE=$(whiptail --clear --title "Update Options" --menu "" 10 55 3 "${OPTIONS[@]}" 2>&1 >/dev/tty)
@ -208,11 +208,20 @@ Do you really want to update LND now?
echo "# cancel update" echo "# cancel update"
exit 1 exit 1
fi fi
# if loop is installed remove
if [ "${loop}" == "on" ]; then
sudo -u admin /home/admin/config.scripts/bonus.loop.sh on
fi
error="" error=""
warn=""
source <(sudo -u admin /home/admin/config.scripts/lnd.update.sh verified) source <(sudo -u admin /home/admin/config.scripts/lnd.update.sh verified)
if [ ${#error} -gt 0 ]; then if [ ${#error} -gt 0 ]; then
whiptail --title "ERROR" --msgbox "${error}" 8 30 whiptail --title "ERROR" --msgbox "${error}" 8 30
else else
# if loop was installed before reinstall
if [ "${loop}" == "on" ]; then
sudo -u admin /home/admin/config.scripts/bonus.loop.sh on
fi
/home/admin/XXshutdown.sh reboot /home/admin/XXshutdown.sh reboot
sleep 8 sleep 8
fi fi

View file

@ -56,7 +56,7 @@ else
exit 1 exit 1
fi fi
address=$(cat $_temp | xargs) address=$(cat $_temp | xargs)
shred $_temp shred -u $_temp
if [ ${#address} -eq 0 ]; then if [ ${#address} -eq 0 ]; then
echo "FAIL - not a valid address (${address})" echo "FAIL - not a valid address (${address})"
echo "Press ENTER to return to main menu." echo "Press ENTER to return to main menu."

View file

@ -29,7 +29,7 @@ dialog --title "Open a Connection to a Peer" \
--backtitle "Lightning ( ${network} | ${chain} )" \ --backtitle "Lightning ( ${network} | ${chain} )" \
--inputbox "$l1\n$l2\n$l3" 10 60 2>$_temp --inputbox "$l1\n$l2\n$l3" 10 60 2>$_temp
_input=$(cat $_temp | xargs ) _input=$(cat $_temp | xargs )
shred $_temp shred -u $_temp
if [ ${#_input} -eq 0 ]; then if [ ${#_input} -eq 0 ]; then
clear clear
echo echo

View file

@ -26,7 +26,7 @@ l2="1 ${network} = 100 000 000 SAT"
dialog --title "Pay thru Lightning Network" \ dialog --title "Pay thru Lightning Network" \
--inputbox "$l1\n$l2" 9 50 2>$_temp --inputbox "$l1\n$l2" 9 50 2>$_temp
amount=$(cat $_temp | xargs | tr -dc '0-9') amount=$(cat $_temp | xargs | tr -dc '0-9')
shred $_temp shred -u $_temp
if [ ${#amount} -eq 0 ]; then if [ ${#amount} -eq 0 ]; then
clear clear
echo echo

View file

@ -96,7 +96,7 @@ l3="max available : ${confirmedBalance}"
dialog --title "Funding of Channel" \ dialog --title "Funding of Channel" \
--inputbox "$l1\n$l2\n$l3" 10 60 2>$_temp --inputbox "$l1\n$l2\n$l3" 10 60 2>$_temp
amount=$(cat $_temp | xargs | tr -dc '0-9') amount=$(cat $_temp | xargs | tr -dc '0-9')
shred $_temp shred -u $_temp
if [ ${#amount} -eq 0 ]; then if [ ${#amount} -eq 0 ]; then
echo echo
echo "no valid amount entered - returning to menu ..." echo "no valid amount entered - returning to menu ..."

View file

@ -49,7 +49,7 @@ l3="To try it out go to: ${testSite}"
dialog --title "Pay thru Lightning Network" \ dialog --title "Pay thru Lightning Network" \
--inputbox "$l1\n$l2\n$l3" 10 70 2>$_temp --inputbox "$l1\n$l2\n$l3" 10 70 2>$_temp
invoice=$(cat $_temp | xargs) invoice=$(cat $_temp | xargs)
shred $_temp shred -u $_temp
if [ ${#invoice} -eq 0 ]; then if [ ${#invoice} -eq 0 ]; then
clear clear
echo echo

View file

@ -19,7 +19,7 @@ dialog --title "Create a forwarding event report" \
--backtitle "Lightning ( ${network} | ${chain} )" \ --backtitle "Lightning ( ${network} | ${chain} )" \
--inputbox "$l1\n$l2" 10 60 7 2>$_temp --inputbox "$l1\n$l2" 10 60 7 2>$_temp
_input=$(cat $_temp | xargs ) _input=$(cat $_temp | xargs )
shred $_temp shred -u $_temp
if [ ${#_input} -eq 0 ]; then if [ ${#_input} -eq 0 ]; then
exit 1 exit 1
fi fi

View file

@ -156,8 +156,7 @@ fi
if [ "${command}" == "hide" ]; then if [ "${command}" == "hide" ]; then
sudo killall -3 fbi sudo killall -3 fbi
shred /home/admin/qr.png 2> /dev/null shred -u /home/admin/qr.png 2> /dev/null
rm -f /home/admin/qr.png 2> /dev/null
exit 0 exit 0
fi fi

View file

@ -78,22 +78,13 @@ if [ "${abcd}" = "a" ]; then
# if no password given by parameter - ask by dialog # if no password given by parameter - ask by dialog
if [ ${#newPassword} -eq 0 ]; then if [ ${#newPassword} -eq 0 ]; then
clear
# ask user for new password A (first time) # ask user for new password A (first time)
dialog --backtitle "RaspiBlitz - Setup"\ password1=$(whiptail --passwordbox "\nSet new Admin/SSH Password A:\n(min 8chars, 1word, chars+number, no specials)" 10 52 "" --title "Password A" --backtitle "RaspiBlitz - Setup" 3>&1 1>&2 2>&3)
--insecure --passwordbox "Set new Master/Admin Password A:\n(min 8chars, 1word, chars+number, no specials)" 10 52 2>$_temp
# get user input
password1=$( cat $_temp )
shred $_temp
# ask user for new password A (second time) # ask user for new password A (second time)
dialog --backtitle "RaspiBlitz - Setup"\ password2=$(whiptail --passwordbox "\nRe-Enter Password A:\n(This is new password to login per SSH)" 10 52 "" --title "Password A" --backtitle "RaspiBlitz - Setup" 3>&1 1>&2 2>&3)
--insecure --passwordbox "Re-Enter Password A:\n(This is new password to login per SSH)" 10 52 2>$_temp
# get user input
password2=$( cat $_temp )
shred $_temp
# check if passwords match # check if passwords match
if [ "${password1}" != "${password2}" ]; then if [ "${password1}" != "${password2}" ]; then
@ -146,21 +137,13 @@ elif [ "${abcd}" = "b" ]; then
# if no password given by parameter - ask by dialog # if no password given by parameter - ask by dialog
if [ ${#newPassword} -eq 0 ]; then if [ ${#newPassword} -eq 0 ]; then
# ask user for new password A (first time) clear
dialog --backtitle "RaspiBlitz - Setup"\
--insecure --passwordbox "Please enter your RPC Password B:\n(min 8chars, 1word, chars+number, no specials)" 10 52 2>$_temp
# get user input # ask user for new password A (first time)
password1=$( cat $_temp ) password1=$(whiptail --passwordbox "\nPlease enter your RPC Password B:\n(min 8chars, 1word, chars+number, no specials)" 10 52 "" --title "Password A" --backtitle "RaspiBlitz - Setup" 3>&1 1>&2 2>&3)
shred $_temp
# ask user for new password A (second time) # ask user for new password A (second time)
dialog --backtitle "RaspiBlitz - Setup"\ password2=$(whiptail --passwordbox "\nRe-Enter Password B:\n" 10 52 "" --title "Password A" --backtitle "RaspiBlitz - Setup" 3>&1 1>&2 2>&3)
--insecure --passwordbox "Re-Enter Password B:\n" 10 52 2>$_temp
# get user input
password2=$( cat $_temp )
shred $_temp
# check if passwords match # check if passwords match
if [ "${password1}" != "${password2}" ]; then if [ "${password1}" != "${password2}" ]; then
@ -312,34 +295,24 @@ elif [ "${abcd}" = "x" ]; then
# second parameter is the flexible text # second parameter is the flexible text
text=$2 text=$2
resultFile=$3 resultFile=$3
shred $3 2>/dev/null shred -u $3 2>/dev/null
# ask user for new password (first time) # ask user for new password (first time)
dialog --backtitle "RaspiBlitz"\ password1=$(whiptail --passwordbox "\n${text}:\n(min 8chars, 1word, chars+number, no specials)" 10 52 "" --backtitle "RaspiBlitz" 3>&1 1>&2 2>&3)
--insecure --passwordbox "${text}:\n(min 8chars, 1word, chars+number, no specials)" 10 52 2>$_temp
# get user input
password1=$( cat $_temp )
shred $_temp
# ask user for new password A (second time) # ask user for new password A (second time)
dialog --backtitle "RaspiBlitz - Setup"\ password2=$(whiptail --passwordbox "\nRe-Enter the Password:\n(to test if typed in correctly)" 10 52 "" --backtitle "RaspiBlitz" 3>&1 1>&2 2>&3)
--insecure --passwordbox "Re-Enter the Password:\n(to test if typed in correctly)" 10 52 2>$_temp
# get user input
password2=$( cat $_temp )
shred $_temp
# check if passwords match # check if passwords match
if [ "${password1}" != "${password2}" ]; then if [ "${password1}" != "${password2}" ]; then
dialog --backtitle "RaspiBlitz - Setup" --msgbox "FAIL -> Passwords dont Match\nPlease try again ..." 6 52 dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Passwords dont Match\nPlease try again ..." 6 52
sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3"
exit 1 exit 1
fi fi
# password zero # password zero
if [ ${#password1} -eq 0 ]; then if [ ${#password1} -eq 0 ]; then
dialog --backtitle "RaspiBlitz - Setup" --msgbox "FAIL -> Password cannot be empty\nPlease try again ..." 6 52 dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password cannot be empty\nPlease try again ..." 6 52
sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3"
exit 1 exit 1
fi fi
@ -347,14 +320,14 @@ elif [ "${abcd}" = "x" ]; then
# check that password does not contain bad characters # check that password does not contain bad characters
clearedResult=$(echo "${password1}" | tr -dc '[:alnum:]-.' | tr -d ' ') clearedResult=$(echo "${password1}" | tr -dc '[:alnum:]-.' | tr -d ' ')
if [ ${#clearedResult} != ${#password1} ] || [ ${#clearedResult} -eq 0 ]; then if [ ${#clearedResult} != ${#password1} ] || [ ${#clearedResult} -eq 0 ]; then
dialog --backtitle "RaspiBlitz - Setup" --msgbox "FAIL -> Contains bad characters (spaces, special chars)\nPlease try again ..." 6 52 dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Contains bad characters (spaces, special chars)\nPlease try again ..." 6 52
sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3"
exit 1 exit 1
fi fi
# password longer than 8 # password longer than 8
if [ ${#password1} -lt 8 ]; then if [ ${#password1} -lt 8 ]; then
dialog --backtitle "RaspiBlitz - Setup" --msgbox "FAIL -> Password length under 8\nPlease try again ..." 6 52 dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password length under 8\nPlease try again ..." 6 52
sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3"
exit 1 exit 1
fi fi

View file

@ -143,7 +143,7 @@ Check 'sudo nginx -t' for a detailed error message.
# Options (available without TOR) # Options (available without TOR)
OPTIONS=( \ OPTIONS=( \
CONNECT "How to Connect" \ CONNECT "How to Connect" \
INDEX "Delete/Rebuild Index" \ INDEX "Delete&Rebuild Index" \
STATUS "ElectRS Status Info" STATUS "ElectRS Status Info"
) )
@ -455,6 +455,12 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
# setting value in raspiblitz config # setting value in raspiblitz config
sudo sed -i "s/^ElectRS=.*/ElectRS=off/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^ElectRS=.*/ElectRS=off/g" /mnt/hdd/raspiblitz.conf
# if second parameter is "deleteindex"
if [ "$2" == "deleteindex" ]; then
echo "# deleting electrum index"
sudo rm -rf /mnt/hdd/app-storage/electrs/
fi
isInstalled=$(sudo ls /etc/systemd/system/electrs.service 2>/dev/null | grep -c 'electrs.service') isInstalled=$(sudo ls /etc/systemd/system/electrs.service 2>/dev/null | grep -c 'electrs.service')
if [ ${isInstalled} -eq 1 ]; then if [ ${isInstalled} -eq 1 ]; then
@ -470,10 +476,6 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
sudo rm -rf /home/electrs/.rustup sudo rm -rf /home/electrs/.rustup
sudo rm -rf /home/electrs/.profile sudo rm -rf /home/electrs/.profile
if [ "$2" == "deleteindex" ]; then
sudo rm -rf /mnt/hdd/app-storage/electrs/
fi
echo "# OK ElectRS removed." echo "# OK ElectRS removed."
## Disable BTCEXP_ADDRESS_API if BTC-RPC-Explorer is active ## Disable BTCEXP_ADDRESS_API if BTC-RPC-Explorer is active

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# https://github.com/arcbtc/lnbits # https://github.com/lnbits/lnbits
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
@ -90,13 +90,13 @@ if [ "$1" = "write-macaroons" ]; then
fi fi
# set tls.cert path (use | as separator to avoid escaping file path slashes) # set tls.cert path (use | as separator to avoid escaping file path slashes)
sudo -u lnbits sed -i "s|^LND_CERT=.*|LND_CERT=/home/lnbits/.lnd/tls.cert|g" /home/lnbits/lnbits/.env sudo -u lnbits sed -i "s|^LND_REST_CERT=.*|LND_REST_CERT=/home/lnbits/.lnd/tls.cert|g" /home/lnbits/lnbits/.env
# set macaroon path info in .env # set macaroon path info in .env
sudo -u lnbits sed -i "s|^LND_ADMIN_MACAROON=.*|LND_ADMIN_MACAROON=/home/lnbits/.lnd/data/chain/${network}/${chain}net/admin.macaroon|g" /home/lnbits/lnbits/.env sudo sed -i "s|^LND_REST_ADMIN_MACAROON=.*|LND_REST_ADMIN_MACAROON=/home/lnbits/.lnd/data/chain/${network}/${chain}net/admin.macaroon|g" /home/lnbits/lnbits/.env
sudo -u lnbits sed -i "s|^LND_INVOICE_MACAROON=.*|LND_INVOICE_MACAROON=/home/lnbits/.lnd/data/chain/${network}/${chain}net/invoice.macaroon|g" /home/lnbits/lnbits/.env sudo sed -i "s|^LND_REST_INVOICE_MACAROON=.*|LND_REST_INVOICE_MACAROON=/home/lnbits/.lnd/data/chain/${network}/${chain}net/invoice.macaroon|g" /home/lnbits/lnbits/.env
sudo -u lnbits sed -i "s|^LND_READ_MACAROON=.*|LND_READ_MACAROON=/home/lnbits/.lnd/data/chain/${network}/${chain}net/read.macaroon|g" /home/lnbits/lnbits/.env sudo sed -i "s|^LND_REST_READ_MACAROON=.*|LND_REST_READ_MACAROON=/home/lnbits/.lnd/data/chain/${network}/${chain}net/read.macaroon|g" /home/lnbits/lnbits/.env
echo "# OK - macaroon path info written to /home/lnbits/lnbits/.env" echo "# OK - macaroons written to /home/lnbits/lnbits/.env"
exit 0 exit 0
fi fi
@ -132,20 +132,19 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo -u lnbits touch /home/lnbits/lnbits/.env sudo -u lnbits touch /home/lnbits/lnbits/.env
sudo bash -c "echo 'FLASK_APP=lnbits' >> /home/lnbits/lnbits/.env" sudo bash -c "echo 'FLASK_APP=lnbits' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'FLASK_ENV=production' >> /home/lnbits/lnbits/.env" sudo bash -c "echo 'FLASK_ENV=production' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'LNBITS_BACKEND_WALLET_CLASS=LndWallet' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'LND_GRPC_ENDPOINT=127.0.0.1' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'LND_GRPC_PORT=10009' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'LNBITS_FORCE_HTTPS=0' >> /home/lnbits/lnbits/.env" sudo bash -c "echo 'LNBITS_FORCE_HTTPS=0' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'LND_CERT=' >> /home/lnbits/lnbits/.env" sudo bash -c "echo 'LNBITS_BACKEND_WALLET_CLASS=LndRestWallet' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'LND_ADMIN_MACAROON=' >> /home/lnbits/lnbits/.env" sudo bash -c "echo 'LND_REST_ENDPOINT=https://127.0.0.1:8080' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'LND_INVOICE_MACAROON=' >> /home/lnbits/lnbits/.env" sudo bash -c "echo 'LND_REST_CERT=' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'LND_READ_MACAROON=' >> /home/lnbits/lnbits/.env" sudo bash -c "echo 'LND_REST_ADMIN_MACAROON=' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'LND_REST_INVOICE_MACAROON=' >> /home/lnbits/lnbits/.env"
sudo bash -c "echo 'LND_REST_READ_MACAROON=' >> /home/lnbits/lnbits/.env"
/home/admin/config.scripts/bonus.lnbits.sh write-macaroons /home/admin/config.scripts/bonus.lnbits.sh write-macaroons
# set database path to HDD data so that its survives updates and migrations # set database path to HDD data so that its survives updates and migrations
sudo mkdir /mnt/hdd/app-data/LNBits 2>/dev/null sudo mkdir /mnt/hdd/app-data/LNBits 2>/dev/null
sudo chown lnbits:lnbits -R /mnt/hdd/app-data/LNBits sudo chown lnbits:lnbits -R /mnt/hdd/app-data/LNBits
sudo bash -c "echo 'LNBITS_DATA_FOLDER=/mnt/hdd/app-data/LNBits' >> sudo /home/lnbits/lnbits/.env" sudo bash -c "echo 'LNBITS_DATA_FOLDER=/mnt/hdd/app-data/LNBits' >> /home/lnbits/lnbits/.env"
# to the install # to the install
echo "# installing application dependencies" echo "# installing application dependencies"

View file

@ -227,8 +227,7 @@ fi
# clean up # clean up
/home/admin/config.scripts/blitz.lcd.sh hide /home/admin/config.scripts/blitz.lcd.sh hide
shred ${imagePath} 2> /dev/null shred -u ${imagePath} 2> /dev/null
rm -f ${imagePath} 2> /dev/null
echo "------------------------------" echo "------------------------------"
echo "If the connection was not working:" echo "If the connection was not working:"

View file

@ -42,7 +42,12 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo -u bitcoin git clone https://github.com/lightninglabs/loop.git sudo -u bitcoin git clone https://github.com/lightninglabs/loop.git
cd /home/bitcoin/loop cd /home/bitcoin/loop
# https://github.com/lightninglabs/loop/releases # https://github.com/lightninglabs/loop/releases
sudo -u bitcoin git reset --hard v0.5.1-beta source <(sudo -u admin /home/admin/config.scripts/lnd.update.sh info)
if [ ${lndInstalledVersionMain} -lt 10 ]; then
sudo -u bitcoin git reset --hard v0.5.1-beta
else
sudo -u bitcoin git reset --hard v0.6.0-beta
fi
cd /home/bitcoin/loop/cmd cd /home/bitcoin/loop/cmd
go install ./... go install ./...

View file

@ -31,7 +31,7 @@ Follow the steps described at the following link
to get the DropBox-Authtoken from your account: to get the DropBox-Authtoken from your account:
https://github.com/rootzoll/raspiblitz/#b-dropbox-backup-target" 11 70 2>/home/admin/.tmp https://github.com/rootzoll/raspiblitz/#b-dropbox-backup-target" 11 70 2>/home/admin/.tmp
authtoken=$(cat /home/admin/.tmp) authtoken=$(cat /home/admin/.tmp)
shred /home/admin/.tmp shred -u /home/admin/.tmp
fi fi
# quick check on authtoken # quick check on authtoken
@ -104,8 +104,7 @@ elif [ "${MODE}" == "upload" ]; then
--header "Content-Type: application/octet-stream" \ --header "Content-Type: application/octet-stream" \
--data-binary @$SOURCEFILE > /home/admin/.dropbox.tmp --data-binary @$SOURCEFILE > /home/admin/.dropbox.tmp
safeResponse=$(sed 's/[^a-zA-Z0-9 ]//g' /home/admin/.dropbox.tmp) safeResponse=$(sed 's/[^a-zA-Z0-9 ]//g' /home/admin/.dropbox.tmp)
sudo shred /home/admin/.dropbox.tmp sudo shred -u /home/admin/.dropbox.tmp
sudo rm /home/admin/.dropbox.tmp 2>/dev/null
success=$(echo "${safeResponse}" | grep -c 'servermodified') success=$(echo "${safeResponse}" | grep -c 'servermodified')
sizeZero=$(echo "${safeResponse}" | grep -c 'size 0') sizeZero=$(echo "${safeResponse}" | grep -c 'size 0')

View file

@ -50,7 +50,7 @@ The RaspiBlitz will call this URL regularly.
4 service freedns.afraid.org use 'DirectURL' 4 service freedns.afraid.org use 'DirectURL'
" 10 52 2>./.tmp " 10 52 2>./.tmp
dynUpdateUrl=$( cat ./.tmp ) dynUpdateUrl=$( cat ./.tmp )
shred ./.tmp shred -u ./.tmp
fi fi

View file

@ -57,7 +57,7 @@ Password C will be stored on the device.
sudo /home/admin/config.scripts/lnd.autounlock.sh on sudo /home/admin/config.scripts/lnd.autounlock.sh on
exit 1 exit 1
fi fi
shred ./.tmp shred -u ./.tmp
fi fi
# config file # config file

View file

@ -114,11 +114,13 @@ if [ "${mode}" = "verified" ]; then
fi fi
fi fi
# clean & change into download directory echo
echo "# clean & change into download directory"
sudo rm -r ${downloadDir}/* sudo rm -r ${downloadDir}/*
cd "${downloadDir}" cd "${downloadDir}"
# extract the SHA256 hash from the manifest file for the corresponding platform echo
echo "# extract the SHA256 hash from the manifest file for the corresponding platform"
sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndUpdateVersion}/manifest-v${lndUpdateVersion}.txt sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndUpdateVersion}/manifest-v${lndUpdateVersion}.txt
checkDownload=$(ls manifest-v${lndUpdateVersion}.txt 2>/dev/null | grep -c manifest-v${lndUpdateVersion}.txt) checkDownload=$(ls manifest-v${lndUpdateVersion}.txt 2>/dev/null | grep -c manifest-v${lndUpdateVersion}.txt)
if [ ${checkDownload} -eq 0 ]; then if [ ${checkDownload} -eq 0 ]; then
@ -128,7 +130,8 @@ if [ "${mode}" = "verified" ]; then
lndSHA256=$(grep -i "linux-${cpuArchitecture}" manifest-v$lndUpdateVersion.txt | cut -d " " -f1) lndSHA256=$(grep -i "linux-${cpuArchitecture}" manifest-v$lndUpdateVersion.txt | cut -d " " -f1)
echo "# SHA256 hash: $lndSHA256" echo "# SHA256 hash: $lndSHA256"
# get LND binary echo
echo "# get LND binary"
binaryName="lnd-linux-${cpuArchitecture}-v${lndUpdateVersion}.tar.gz" binaryName="lnd-linux-${cpuArchitecture}-v${lndUpdateVersion}.tar.gz"
sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndUpdateVersion}/${binaryName} sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndUpdateVersion}/${binaryName}
checkDownload=$(ls ${binaryName} 2>/dev/null | grep -c ${binaryName}) checkDownload=$(ls ${binaryName} 2>/dev/null | grep -c ${binaryName})
@ -137,7 +140,8 @@ if [ "${mode}" = "verified" ]; then
exit 1 exit 1
fi fi
# check binary was not manipulated (checksum test) echo
echo "# check binary was not manipulated (checksum test)"
sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndUpdateVersion}/manifest-v${lndUpdateVersion}.txt.sig sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndUpdateVersion}/manifest-v${lndUpdateVersion}.txt.sig
sudo -u admin wget -N -O "${downloadDir}/pgp_keys.asc" ${lndUpdatePGPpkeys} sudo -u admin wget -N -O "${downloadDir}/pgp_keys.asc" ${lndUpdatePGPpkeys}
binaryChecksum=$(sha256sum ${binaryName} | cut -d " " -f1) binaryChecksum=$(sha256sum ${binaryName} | cut -d " " -f1)
@ -146,26 +150,32 @@ if [ "${mode}" = "verified" ]; then
exit 1 exit 1
fi fi
# check gpg finger print echo
echo "# getting gpg finger print"
gpg ./pgp_keys.asc gpg ./pgp_keys.asc
fingerprint=$(sudo gpg "${downloadDir}/pgp_keys.asc" 2>/dev/null | grep "${lndUpdatePGPcheck}" -c) fingerprint=$(sudo gpg "${downloadDir}/pgp_keys.asc" 2>/dev/null | grep "${lndUpdatePGPcheck}" -c)
if [ ${fingerprint} -lt 1 ]; then if [ ${fingerprint} -lt 1 ]; then
echo "error='PGP author check failed'" echo "error='PGP author check failed'"
exit 1
fi fi
echo "fingerprint='${fingerprint}'"
echo
echo "# chacking gpg finger print"
gpg --import ./pgp_keys.asc gpg --import ./pgp_keys.asc
sleep 3 sleep 3
verifyResult=$(gpg --verify manifest-v${lndUpdateVersion}.txt.sig 2>&1) verifyResult=$(gpg --verify manifest-v${lndUpdateVersion}.txt.sig 2>&1)
goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c) goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c)
echo "# goodSignature(${goodSignature})" echo "goodSignature='${goodSignature}'"
correctKey=$(echo ${verifyResult} | tr -d " \t\n\r" | grep "${lndUpdatePGPcheck}" -c) correctKey=$(echo ${verifyResult} | tr -d " \t\n\r" | grep "${lndUpdatePGPcheck}" -c)
echo "# correctKey(${correctKey})" echo "correctKey='${correctKey}'"
if [ ${correctKey} -lt 1 ] || [ ${goodSignature} -lt 1 ]; then if [ ${correctKey} -lt 1 ] || [ ${goodSignature} -lt 1 ]; then
echo "error='PGP verify fail'" echo "error='PGP verify fail'"
exit 1 exit 1
fi fi
# note: install will be done the same as reckless further down # note: install will be done the same as reckless further down
lndInterimsUpdateNew="${$lndUpdateVersion}" lndInterimsUpdateNew="${lndUpdateVersion}"
fi fi

View file

@ -88,5 +88,22 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
exit 0 exit 0
fi fi
###################
# delete (and make sure all using apps are deinstalled)
# on version update check all bonus scripts that this network.txindex.sh on
###################
if [ "$1" = "delete" ]; then
echo "# deinstalling apps needing txindex ..."
sudo -u admin /home/admin/config.scripts/bonus.btc-rpc-explorer.sh off
echo "# changing config ..."
sudo systemctl stop ${network}d
sudo sed -i "s/^txindex=.*/txindex=0/g" /mnt/hdd/${network}/${network}.conf
echo "# deleting tx index ..."
sudo rm -r /mnt/hdd/${network}/indexes/txindex
sudo systemctl restart ${network}d
exit 0
fi
echo "FAIL - Unknown Parameter $1" echo "FAIL - Unknown Parameter $1"
exit 1 exit 1