#1654 adding circuitbreaker to SETTINGS menu (#2105)

This commit is contained in:
/rootzoll 2021-03-24 23:41:40 +01:00 committed by GitHub
parent 7618de383e
commit cb5b4d696f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 13 deletions

View file

@ -6,6 +6,7 @@
- New: Build SD card Image with parameters & FatPack [details](https://github.com/rootzoll/raspiblitz/pull/2044)
- New: Lightning Terminal 0.4.1-alpha (Loop, Pool & Faraday UI Bundle) [details](https://github.com/lightninglabs/lightning-terminal#lightning-terminal-lit)
- New: chantools 0.8.2 [details](https://github.com/guggero/chantools/blob/master/README.md)
- New: Circuitbreaker LND firewall (settings menu) [details](https://github.com/lightningequipment/circuitbreaker/blob/master/README.md)
- New: Telegraf metrics (experimental) [details](https://github.com/rootzoll/raspiblitz/issues/1369)
- New: Download whitepaper from blockchain [details](https://github.com/rootzoll/raspiblitz/pull/2017)
- Update: bitcoin-core version 0.21.0-beta [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.21.0.md)

View file

@ -119,6 +119,9 @@ fi
if [ "${chantools}" == "on" ]; then
OPTIONS+=(CHANTOOLS "ChannelTools (Fund Rescue)")
fi
if [ "${circuitbreaker}" == "on" ]; then
OPTIONS+=(CIRCUIT "Circuitbreaker (LND firewall)")
fi
# Basic Options
OPTIONS+=(INFO "RaspiBlitz Status Screen")
@ -267,6 +270,9 @@ case $CHOICE in
CHANTOOLS)
sudo /home/admin/config.scripts/bonus.chantools.sh menu
;;
CIRCUIT)
sudo /home/admin/config.scripts/bonus.circuitbreaker.sh menu
;;
SUBSCRIBE)
/home/admin/config.scripts/blitz.subscriptions.py
;;

View file

@ -15,6 +15,7 @@ if [ ${#networkUPnP} -eq 0 ]; then networkUPnP="off"; fi
if [ ${#touchscreen} -eq 0 ]; then touchscreen=0; fi
if [ ${#lcdrotate} -eq 0 ]; then lcdrotate=0; fi
if [ ${#zerotier} -eq 0 ]; then zerotier="off"; fi
if [ ${#circuitbreaker} -eq 0 ]; then circuitbreaker="off"; fi
echo "map dropboxbackup to on/off"
DropboxBackup="off"
@ -77,6 +78,7 @@ OPTIONS+=(r 'LCD Rotate' ${lcdrotateMenu})
OPTIONS+=(a 'Channel Autopilot' ${autoPilot})
OPTIONS+=(k 'Accept Keysend' ${keysend})
OPTIONS+=(n 'Testnet' ${chainValue})
OPTIONS+=(c 'Circuitbreaker (LND firewall)' ${circuitbreaker})
OPTIONS+=(u 'LND Auto-Unlock' ${autoUnlock})
OPTIONS+=(d 'StaticChannelBackup on DropBox' ${DropboxBackup})
OPTIONS+=(e 'StaticChannelBackup on USB Drive' ${LocalBackup})
@ -307,6 +309,18 @@ else
echo "LND Autounlock Setting unchanged."
fi
# lcd rotate
choice="0"; check=$(echo "${CHOICES}" | grep -c "r")
if [ ${check} -eq 1 ]; then choice="1"; fi
if [ "${lcdrotate}" != "${choice}" ]; then
echo "LCD Rotate Setting changed .."
anychange=1
sudo /home/admin/config.scripts/blitz.lcd.sh rotate ${choice}
needsReboot=1
else
echo "LCD Rotate Setting unchanged."
fi
# touchscreen
choice="0"; check=$(echo "${CHOICES}" | grep -c "s")
if [ ${check} -eq 1 ]; then choice="1"; fi
@ -322,16 +336,15 @@ else
echo "Touchscreen Setting unchanged."
fi
# lcd rotate
choice="0"; check=$(echo "${CHOICES}" | grep -c "r")
if [ ${check} -eq 1 ]; then choice="1"; fi
if [ "${lcdrotate}" != "${choice}" ]; then
echo "LCD Rotate Setting changed .."
# circuitbreaker
choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${circuitbreaker}" != "${choice}" ]; then
echo "Circuitbreaker Setting changed .."
anychange=1
sudo /home/admin/config.scripts/blitz.lcd.sh rotate ${choice}
needsReboot=1
sudo /home/admin/config.scripts/bonus.circuitbreaker.sh ${choice}
else
echo "LCD Rotate Setting unchanged."
echo "Circuitbreaker Setting unchanged."
fi
# DropBox process choice

View file

@ -369,6 +369,14 @@ else
echo "Provisioning DNS Server - keep default" >> ${logFile}
fi
# CHANTOOLS
if [ "${chantools}" == "on" ]; then
echo "Provisioning chantools - run config script" >> ${logFile}
sudo /home/admin/config.scripts/bonus.chantools.sh on >> ${logFile} 2>&1
else
echo "Provisioning chantools - keep default" >> ${logFile}
fi
# ROOT SSH KEYS
# check if a backup on HDD exists  if so, restore it
backupRootSSH=$(sudo ls /mnt/hdd/ssh/root_backup 2>/dev/null | grep -c "id_rsa")

View file

@ -6,7 +6,7 @@ pinnedVersion="v0.2.0"
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo
echo "Config script to switch the circuitbreaker on, off or update to the latest release tag or commit"
echo "bonus.circuitbreaker.sh [on|off|update|update commit]"
echo "bonus.circuitbreaker.sh [on|off|update|update commit|menu]"
echo
echo "Version to be installed by default: $pinnedVersion"
echo "Source: https://github.com/lightningequipment/circuitbreaker"
@ -21,12 +21,28 @@ if ! grep -Eq "^circuitbreaker=" /mnt/hdd/raspiblitz.conf; then
echo "circuitbreaker=off" >> /mnt/hdd/raspiblitz.conf
fi
isInstalled=$(sudo ls /etc/systemd/system/circuitbreaker.service 2>/dev/null | grep -c 'circuitbreaker.service')
# switch on
if [ "$1" = "menu" ]; then
if [ ${isInstalled} -eq 1 ]; then
whiptail --title " circuitbreaker " --msgbox "Circuitbreaker is to Lightning what firewalls are to the internet.\n
Its a service running in the background - use to monitor:
sudo journalctl -fu circuitbreaker\n
For more details and further information see:
https://github.com/lightningequipment/circuitbreaker/blob/master/README.md
" 13 78
clear
else
echo "# Circuit Breaker is not installed."
fi
exit 0
fi
# stop services
echo "# Making sure the service is not running"
sudo systemctl stop circuitbreaker 2>/dev/null
isInstalled=$(sudo ls /etc/systemd/system/circuitbreaker.service 2>/dev/null | grep -c 'circuitbreaker.service')
# switch on
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "# Installing circuitbreaker $pinnedVersion"
@ -114,9 +130,7 @@ WantedBy=multi-user.target
else
echo "# OK - the circuitbreaker.service is enabled, to start manually use: sudo systemctl start circuitbreaker"
fi
echo
echo "# Find more info at https://github.com/lightningequipment/circuitbreaker"
echo
echo "# Monitor with: 'sudo journalctl -fu circuitbreaker'"
else
echo "# Failed to install circuitbreaker "