mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-11-20 10:56:38 +01:00
Compare commits
26 Commits
4893-postg
...
4872-proxm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a03a70593 | ||
|
|
5d61034626 | ||
|
|
3dc1351a8b | ||
|
|
6ae2f64b4e | ||
|
|
b9f7388d87 | ||
|
|
360afc810b | ||
|
|
f4dd97a6a7 | ||
|
|
81517e2742 | ||
|
|
9e8a40642d | ||
|
|
fe02f757d2 | ||
|
|
850f32381e | ||
|
|
1c146b9281 | ||
|
|
b87e73c89c | ||
|
|
8b1a4b3939 | ||
|
|
7b75f66aeb | ||
|
|
1b2fcf48ee | ||
|
|
f771465338 | ||
|
|
fd2d369264 | ||
|
|
b55616ce87 | ||
|
|
e833fd42a6 | ||
|
|
45df8b3e72 | ||
|
|
a64e31f725 | ||
|
|
7c91ee99a7 | ||
|
|
d37eebdd96 | ||
|
|
c5def56588 | ||
|
|
7013a78472 |
25
CHANGES.md
25
CHANGES.md
@@ -1,18 +1,19 @@
|
||||
## What's new in Version 1.11.4 of RaspiBlitz?
|
||||
## What's new in Version 1.12.0 of RaspiBlitz?
|
||||
|
||||
ReleaseCandidate: https://raspiblitz.fulmo.org/images/raspiblitz-min-v1.11.4rc1-2024-12-18.img.gz
|
||||
Features:
|
||||
|
||||
Small AlbyHub feature release with security/bug-fixing relevant updates.
|
||||
- Update: RaspberryOS arm64 base image 2024-11-19 (Debian 12 Bookworm) [details](https://downloads.raspberrypi.com/raspios_full_arm64/release_notes.txt)
|
||||
- Update: amd64 base image: debian-12.8.0-amd64-netinst.iso [details](https://www.debian.org/releases/stable/amd64/release-notes/ch-whats-new.en.html)
|
||||
- Update: Specter Desktop 2.0.5 [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.5)
|
||||
- Update: Fulcrum Electrum server v1.11.1 (CLI install script with status menu) [details](https://github.com/cculianu/Fulcrum/releases/tag/v1.11.1)
|
||||
|
||||
- New: AlbyHub v1.12.0 (SSH & WebUI) [details](https://github.com/getAlby)
|
||||
- New: SSH-Option to tirn on/off LNbits AdminUI [details](https://github.com/raspiblitz/raspiblitz/issues/4876)
|
||||
- Update: LND v0.18.3-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.18.3-beta)
|
||||
- Update: Core Lightning v24.11 [details](https://github.com/ElementsProject/lightning/releases/tag/v24.11)
|
||||
|
||||
## What's new in Version 1.11.3 of RaspiBlitz?
|
||||
|
||||
Optimized now to run also on plain debian12 linux for Proxmox/VM & x86 systems.
|
||||
|
||||
Containing Features:
|
||||
|
||||
- New: Publicpool - Open Source Solo Bitcoin Mining (SSH Menu) [details](https://www.youtube.com/watch?v=QbOsH04Z9xM)
|
||||
- New: Tailscale (SSH menu > SETTINGS) [details](https://en.wikipedia.org/wiki/Tailscale)
|
||||
- New: Telegraf Metrics for InfluxDB/Grafana (SSH menu > SETTINGS) [details](https://github.com/raspiblitz/raspiblitz/tree/dev/home.admin/assets/telegraf/README.md)
|
||||
@@ -30,6 +31,16 @@ Optimized now to run also on plain debian12 linux for Proxmox/VM & x86 systems.
|
||||
- Update: CLBOSS 0.13.3 [details](https://github.com/ZmnSCPxj/clboss/releases/tag/v0.13.3)
|
||||
- Update: Electrum Server in Rust (electrs) v0.10.6 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0106-sep-29-2024)
|
||||
|
||||
Download RaspberryPi images:
|
||||
|
||||
- Minimal:
|
||||
https://raspiblitz.fulmo.org/images/raspiblitz-min-v1.11.3-2024-11-03.img.gz
|
||||
SHA-256-Checksum: 199fd4e671a49feb39420156031201c9118121d33ec6f9990fb9724de5be02c4
|
||||
|
||||
- Fatpack:
|
||||
https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.11.3-2024-11-03.img.gz
|
||||
SHA-256-Checksum: 65e523562768b21dcda85b96003c559a665015889402a3cea27638e6c5e290bd
|
||||
|
||||
## What's new in Version 1.11.2 of RaspiBlitz?
|
||||
|
||||
This is just a quick patch release for v1.11.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 
|
||||
|
||||
_Build your own Bitcoin & Lightning Fullnode on a RaspberryPi with an optional Display._
|
||||
_Build your own Bitcoin & Lightning Fullnode on a RaspberryPi with an optional Display._ ([API](https://github.com/fusion44/blitz_api)|[WebUI](https://github.com/raspiblitz/raspiblitz-web))
|
||||
|
||||

|
||||
|
||||
@@ -35,4 +35,4 @@ This is main RaspiBlitz repo containing the **bash & python** scripts to build t
|
||||
- [API](https://github.com/fusion44/blitz_api) (Python FastAPI)
|
||||
- [Documentation](https://github.com/raspiblitz/raspiblitz-docs) (Docusaurus)
|
||||
|
||||
To get started with RaspiBlitz Development check the [Community Development](CONTRIBUTING.md) notes.
|
||||
To get started with RaspiBlitz Development check the [Community Development](CONTRIBUTING.md) notes.
|
||||
|
||||
@@ -329,7 +329,9 @@ isDebianInHosts=$(grep -c "debian" /etc/hosts)
|
||||
if [ ${isDebianInHosts} -eq 0 ]; then
|
||||
echo "# Adding debian to /etc/hosts"
|
||||
echo "127.0.1.1 debian" | tee -a /etc/hosts > /dev/null
|
||||
systemctl restart networking
|
||||
if [ "${baseimage}" != "raspios_arm64" ]; then
|
||||
systemctl restart networking
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "*** Remove unnecessary packages ***"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
variable "iso_name" { default = "debian-12.7.0-amd64-netinst.iso" }
|
||||
variable "iso_checksum" { default = "8fde79cfc6b20a696200fc5c15219cf6d721e8feb367e9e0e33a79d1cb68fa83" }
|
||||
variable "iso_name" { default = "debian-12.8.0-amd64-netinst.iso" }
|
||||
variable "iso_checksum" { default = "04396d12b0f377958a070c38a923c227832fa3b3e18ddc013936ecf492e9fbb3" }
|
||||
|
||||
variable "pack" { default = "lean" }
|
||||
variable "github_user" { default = "raspiblitz" }
|
||||
@@ -10,7 +10,7 @@ variable "boot" { default = "uefi" }
|
||||
variable "preseed_file" { default = "preseed.cfg" }
|
||||
variable "hostname" { default = "raspiblitz-amd64" }
|
||||
|
||||
variable "disk_size" { default = "30000" }
|
||||
variable "disk_size" { default = "27000" }
|
||||
variable "memory" { default = "4096" }
|
||||
variable "cpus" { default = "4" }
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
variable "pack" { default = "lean" }
|
||||
variable "github_user" { default = "raspiblitz" }
|
||||
variable "branch" { default = "dev" }
|
||||
variable "image_link" { default = "https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64.img.xz" }
|
||||
variable "image_checksum" { default = "7e53a46aab92051d523d7283c080532bebb52ce86758629bf1951be9b4b0560f" }
|
||||
variable "image_link" { default = "https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2024-11-19/2024-11-19-raspios-bookworm-arm64.img.xz" }
|
||||
variable "image_checksum" { default = "ea6e68c48d14c3d78af5471c0b288bbf6522fdd775241f74d8295d106d344300" }
|
||||
variable "image_size" { default = "24G" }
|
||||
|
||||
source "arm" "raspiblitz-arm64-rpi" {
|
||||
|
||||
@@ -65,7 +65,7 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
||||
OPTIONS+=(ra 'LND RTL Webinterface' ${rtlWebinterface})
|
||||
OPTIONS+=(ta 'LND ThunderHub' ${thunderhub})
|
||||
OPTIONS+=(la 'LND LIT (loop, pool, faraday)' ${lit})
|
||||
OPTIONS+=(ah 'LND AlbyHub (App Connector)' ${albyhub})
|
||||
OPTIONS+=(ah 'LND AlbyHub (early access)' ${albyhub})
|
||||
OPTIONS+=(gb 'LND LNDg (auto-rebalance, auto-fees)' ${lndg})
|
||||
OPTIONS+=(oa 'LND Balance of Satoshis' ${bos})
|
||||
OPTIONS+=(ya 'LND PyBLOCK' ${pyblock})
|
||||
@@ -627,7 +627,7 @@ else
|
||||
echo "Publicpool setting unchanged."
|
||||
fi
|
||||
|
||||
# albyhub process choice
|
||||
# publicpool process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "ah")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${albyhub}" != "${choice}" ]; then
|
||||
|
||||
@@ -36,25 +36,7 @@ elif [ $LNTYPE = lnd ];then
|
||||
dialog --title 'Info' --msgbox 'You need to turn OFF the LND AutoPilot first,\nso that closed channels are not opening up again.\nYou find the AutoPilot -----> SERVICES section' 7 55
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# User choice for close type
|
||||
close_type=$(dialog --clear \
|
||||
--title "LND Channel Close Type" \
|
||||
--menu "Choose how to close channels:" \
|
||||
14 54 3 \
|
||||
"COOP" "Attempt Cooperative Close" \
|
||||
"FORCE" "Force Close Channels" \
|
||||
2>&1 >/dev/tty)
|
||||
|
||||
# Set command based on user choice
|
||||
if [ "$close_type" = "COOP" ]; then
|
||||
command="$lncli_alias closeallchannels"
|
||||
elif [ "$close_type" = "FORCE" ]; then
|
||||
command="$lncli_alias closeallchannels --force"
|
||||
else
|
||||
echo "Invalid choice. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
command="$lncli_alias closeallchannels --force"
|
||||
fi
|
||||
|
||||
clear
|
||||
@@ -103,7 +85,7 @@ echo "# RESULT:"
|
||||
if [ ${#command} -gt 0 ]; then
|
||||
if [ $LNTYPE = cl ];then
|
||||
cl_closeall
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
${command}
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -384,25 +384,30 @@ done
|
||||
# extend sd card to maximum capacity
|
||||
################################
|
||||
|
||||
source <(/home/admin/config.scripts/blitz.bootdrive.sh status)
|
||||
if [ "${needsExpansion}" == "1" ] && [ "${fsexpanded}" == "0" ]; then
|
||||
echo "FSEXPAND needed ... starting process" >> $logFile
|
||||
/home/admin/config.scripts/blitz.bootdrive.sh status >> $logFile
|
||||
/home/admin/config.scripts/blitz.bootdrive.sh fsexpand >> $logFile
|
||||
systemInitReboot=1
|
||||
/home/admin/_cache.sh set message "FSEXPAND"
|
||||
elif [ "${tooSmall}" == "1" ]; then
|
||||
echo "# FAIL #######" >> $logFile
|
||||
echo "SDCARD TOO SMALL 16GB minimum" >> $logFile
|
||||
echo "##############" >> $logFile
|
||||
/home/admin/_cache.sh set state "sdtoosmall"
|
||||
echo "System stopped. Please cut power." >> $logFile
|
||||
sleep 6000
|
||||
shutdown -r now
|
||||
slepp 100
|
||||
exit 1
|
||||
isBootingFromSD=$(lsblk | grep mmcblk0 | grep -c "/boot")
|
||||
if [ ${isBootingFromSD} -gt 0 ]; then
|
||||
source <(/home/admin/config.scripts/blitz.bootdrive.sh status)
|
||||
if [ "${needsExpansion}" == "1" ] && [ "${fsexpanded}" == "0" ]; then
|
||||
echo "FSEXPAND needed ... starting process" >> $logFile
|
||||
/home/admin/config.scripts/blitz.bootdrive.sh status >> $logFile
|
||||
/home/admin/config.scripts/blitz.bootdrive.sh fsexpand >> $logFile
|
||||
systemInitReboot=1
|
||||
/home/admin/_cache.sh set message "FSEXPAND"
|
||||
elif [ "${tooSmall}" == "1" ]; then
|
||||
echo "# FAIL #######" >> $logFile
|
||||
echo "SDCARD TOO SMALL 16GB minimum" >> $logFile
|
||||
echo "##############" >> $logFile
|
||||
/home/admin/_cache.sh set state "sdtoosmall"
|
||||
echo "System stopped. Please cut power." >> $logFile
|
||||
sleep 6000
|
||||
shutdown -r now
|
||||
sleep 100
|
||||
exit 1
|
||||
else
|
||||
echo "No FS EXPAND needed. needsExpansion(${needsExpansion}) fsexpanded(${fsexpanded})" >> $logFile
|
||||
fi
|
||||
else
|
||||
echo "No FS EXPAND needed. needsExpansion(${needsExpansion}) fsexpanded(${fsexpanded})" >> $logFile
|
||||
echo "Not running on an SD card. Skipping FS EXPAND check." >> $logFile
|
||||
fi
|
||||
|
||||
# now that HDD/SSD is connected ... if relevant data from a previous RaspiBlitz was available
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# RaspiBlitz Version - always [major].[main].[sub] (sub can be a string like '2rc1')
|
||||
codeVersion="1.11.4"
|
||||
codeVersion="1.11.3"
|
||||
codeRelease="dev"
|
||||
# keep last line with comment ---> IF YOU HAVE A NEW VERSION BRANCH > EDIT ALSO build_sdcard.sh
|
||||
Binary file not shown.
Binary file not shown.
@@ -67,13 +67,23 @@ if [ "${action}" == "fsexpand" ]; then
|
||||
if [ -x ${resizeRaspbian} ]; then
|
||||
echo "# RUNNING EXPAND RASPBERRYPI: ${resizeRaspbian}"
|
||||
sudo $resizeRaspbian --expand-rootfs 1>&2
|
||||
sudo touch /forcefsck
|
||||
echo "# DONE - please reboot"
|
||||
else
|
||||
echo "# FAIL to execute on ${baseimage}: ${resizeRaspbian}"
|
||||
echo "err='expand failed'"
|
||||
exit 1
|
||||
fi
|
||||
elif [ "${baseimage}" = "armbian" ]; then
|
||||
resizeArmbian="/usr/lib/armbian/armbian-resize-filesystem"
|
||||
if [ -x ${resizeArmbian} ]; then
|
||||
echo "# RUNNING EXPAND ARMBIAN: ${resizeArmbian}"
|
||||
sudo $resizeArmbian start 1>&2
|
||||
echo "# DONE - please reboot"
|
||||
else
|
||||
echo "# FAIL to execute on ${baseimage}: ${resizeArmbian}"
|
||||
echo "err='expand failed'"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "#FAIL no implementation for: ${baseimage}"
|
||||
echo "err='missing implementation'"
|
||||
|
||||
@@ -131,8 +131,6 @@ sudo cp -a /home/blitzapi/blitz_web/build/* /home/admin/assets/nginx/www_public
|
||||
sudo chown admin:admin /home/admin/assets/nginx/www_public
|
||||
sudo rm -r /home/blitzapi/blitz_web/build/*
|
||||
|
||||
echo "* Adding Code&Compile for WEBUI-APP: ALBYHUB"
|
||||
/home/admin/config.scripts/bonus.albyhub.sh install || exit 1
|
||||
echo "* Adding Code&Compile for WEBUI-APP: LNBITS"
|
||||
/home/admin/config.scripts/bonus.lnbits.sh install || exit 1
|
||||
echo "* Adding Code&Compile for WEBUI-APP: JAM"
|
||||
|
||||
@@ -98,25 +98,6 @@ sudo systemctl disable ssh
|
||||
sudo rm /etc/ssh/ssh_host_*
|
||||
echo "OK"
|
||||
|
||||
# force locale - see #4861
|
||||
# next major release should make sure to be set during sd build card
|
||||
echo
|
||||
echo "Forcing locales ..."
|
||||
sudo sed -i '/^en_US.UTF-8/s/^#//' /etc/locale.gen
|
||||
sudo sed -i '/^en_GB.UTF-8/s/^/#/' /etc/locale.gen
|
||||
sudo locale-gen
|
||||
echo -e "LANG=en_US.UTF-8\nLANGUAGE=en_US.UTF-8\nLC_ALL=en_US.UTF-8" | sudo tee /etc/default/locale > /dev/null
|
||||
|
||||
# make sure file system is clean and ready for release
|
||||
echo
|
||||
echo "fsck on first boot ..."
|
||||
sudo touch /forcefsck
|
||||
if [ -e /dev/mmcblk0 ]; then
|
||||
echo "fsck on /dev/mmcblk0 ..."
|
||||
sudo umount /dev/mmcblk0p1
|
||||
sudo fsck -fy /dev/mmcblk0p1
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Will shutdown now."
|
||||
echo "Wait until Raspberry LEDs show no activity anymore."
|
||||
|
||||
105
home.admin/config.scripts/blitz.rerelease.sh
Executable file
105
home.admin/config.scripts/blitz.rerelease.sh
Executable file
@@ -0,0 +1,105 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Just run this script once after a fresh sd card build
|
||||
# to prepare the image for release as a downloadable sd card image
|
||||
# call with parameter `-quick` to skip skip os update
|
||||
|
||||
# determine correct raspberrypi boot drive path (that easy to access when sd card is insert into laptop)
|
||||
raspi_bootdir=""
|
||||
if [ -d /boot/firmware ]; then
|
||||
raspi_bootdir="/boot/firmware"
|
||||
elif [ -d /boot ]; then
|
||||
raspi_bootdir="/boot"
|
||||
fi
|
||||
echo "# raspi_bootdir(${raspi_bootdir})"
|
||||
|
||||
# write release info to to version file
|
||||
echo "writing codeRelease commit ro version file:"
|
||||
releaseCommit=$(git -C /home/admin/raspiblitz rev-parse --short HEAD)
|
||||
sed -i 's/^codeRelease=".*"/codeRelease="${releaseCommit}"/' /home/admin/_version.info
|
||||
cat /home/admin/_version.info
|
||||
echo
|
||||
|
||||
# stop background services
|
||||
sudo systemctl stop background.service
|
||||
sudo systemctl stop background.scan.service
|
||||
|
||||
# remove stop flag (if exists)
|
||||
echo "deleting stop flag .."
|
||||
sudo rm ${raspi_bootdir}/stop 2>/dev/null
|
||||
|
||||
# cleaning logs
|
||||
echo "deleting raspiblitz & system logs .."
|
||||
sudo rm -rf /var/log/journal/* 2>/dev/null
|
||||
sudo rm /var/log/redis/* 2>/dev/null
|
||||
sudo rm /var/log/private/* 2>/dev/null
|
||||
sudo rm /var/log/nginx/* 2>/dev/null
|
||||
sudo rm /home/admin/*.log 2>/dev/null
|
||||
logger -p info "****** RASPIBLITZ RELEASE ******"
|
||||
echo "OK"
|
||||
|
||||
# clean raspiblitz.info toward the values set by sd card build script
|
||||
echo "cleaning raspiblitz.info"
|
||||
source /home/admin/raspiblitz.info
|
||||
echo "baseimage=${baseimage}" > /home/admin/raspiblitz.info
|
||||
echo "cpu=${cpu}" >> /home/admin/raspiblitz.info
|
||||
echo "blitzapi=${blitzapi}" >> /home/admin/raspiblitz.info
|
||||
echo "displayClass=${displayClass}" >> /home/admin/raspiblitz.info
|
||||
|
||||
# https://github.com/rootzoll/raspiblitz/issues/1371
|
||||
echo
|
||||
echo "deactivate local WIFI ..."
|
||||
sudo nmcli radio wifi off
|
||||
echo "OK"
|
||||
|
||||
# make sure that every install runs API with own secret
|
||||
# https://github.com/raspiblitz/raspiblitz/issues/4469
|
||||
echo
|
||||
echo "deleting old API conf ..."
|
||||
sudo rm /home/blitzapi/blitz_api/.env 2>/dev/null
|
||||
REDIS_ENABLED=$(sudo systemctl is-enabled redis 2>/dev/null | grep -c enabled)
|
||||
if [ ${REDIS_ENABLED} -gt 0 ]; then
|
||||
echo "disable redis for initial start ..."
|
||||
sudo systemctl stop redis 2>/dev/null
|
||||
sudo systemctl disable redis 2>/dev/null
|
||||
fi
|
||||
echo "deleting redis data (if still there) ..."
|
||||
sudo rm /var/lib/redis/dump.rdb 2>/dev/null
|
||||
echo "OK"
|
||||
|
||||
# https://github.com/rootzoll/raspiblitz/issues/1068#issuecomment-599267503
|
||||
echo
|
||||
echo "reset DNS confs ..."
|
||||
echo -e "nameserver 1.1.1.1\nnameserver 84.200.69.80" | sudo tee /etc/resolv.conf > /dev/null
|
||||
echo "OK"
|
||||
|
||||
# make sure Tor respo signing keys are uptodate #4648
|
||||
wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/torproject.gpg >/dev/null
|
||||
|
||||
# update system (only security updates with minimal risk of breaking changes)
|
||||
if [ "$1" != "-quick" ]; then
|
||||
echo
|
||||
echo "update OS ..."
|
||||
sudo apt-get update -y
|
||||
sudo apt-get upgrade -o Dir::Etc::SourceList=/etc/apt/sources.list.d/security.list -y
|
||||
sudo apt-get upgrade openssh-server -y
|
||||
sudo dpkg --configure -a
|
||||
else
|
||||
echo
|
||||
echo "skipping OS update ..."
|
||||
fi
|
||||
|
||||
# SSH Pubkeys (make unique for every sd card image install)
|
||||
echo
|
||||
echo "deleting SSH Pub keys ..."
|
||||
echo "keys will get recreated and sshd reactivated on fresh bootup, by _bootstrap.sh service"
|
||||
sudo systemctl stop ssh
|
||||
sudo systemctl disable ssh
|
||||
sudo rm /etc/ssh/ssh_host_*
|
||||
echo "OK"
|
||||
|
||||
echo
|
||||
echo "Will shutdown now."
|
||||
echo "Wait until Raspberry LEDs show no activity anymore."
|
||||
echo "Then remove SD card and make an release image from it."
|
||||
sudo shutdown now
|
||||
@@ -7,7 +7,7 @@
|
||||
APPID="albyhub" # one-word lower-case no-specials
|
||||
|
||||
# https://github.com/getAlby/hub/releases
|
||||
VERSION="1.12.0"
|
||||
VERSION="1.10.4"
|
||||
|
||||
# port numbers the app should run on
|
||||
# delete if not an web app
|
||||
@@ -19,10 +19,8 @@ PORT_TOR_SSL="8032"
|
||||
# BASIC COMMANDLINE OPTIONS
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo "# bonus.${APPID}.sh status -> status information (key=value)"
|
||||
echo "# bonus.${APPID}.sh install -> install the app"
|
||||
echo "# bonus.${APPID}.sh uninstall -> uninstall the app"
|
||||
echo "# bonus.${APPID}.sh on -> activate the app"
|
||||
echo "# bonus.${APPID}.sh off [delete-data] -> deactivate the app"
|
||||
echo "# bonus.${APPID}.sh on -> install the app"
|
||||
echo "# bonus.${APPID}.sh off [delete-data] -> uninstall the app"
|
||||
echo "# bonus.${APPID}.sh menu -> SSH menu dialog"
|
||||
echo "# bonus.${APPID}.sh prestart -> prestart used by systemd"
|
||||
exit 1
|
||||
@@ -93,16 +91,15 @@ fi
|
||||
if [ "$1" = "status" ]; then
|
||||
echo "appID='${APPID}'"
|
||||
echo "version='${VERSION}'"
|
||||
echo "installed=${isRunning}" # installed means towards webui on or off
|
||||
echo "isInstalled=${isInstalled}"
|
||||
echo "isRunning=${isRunning}"
|
||||
if [ "${isInstalled}" == "1" ]; then
|
||||
echo "localIP='${localIP}'"
|
||||
echo "portCLEAR=${PORT_CLEAR}"
|
||||
echo "portSSL=${PORT_SSL}"
|
||||
echo "localIP='${localIP}'"
|
||||
echo "toraddress='${toraddress}'"
|
||||
echo "fingerprint='${fingerprint}'"
|
||||
echo "httpPort='${PORT_CLEAR}'"
|
||||
echo "httpsPort='${PORT_SSL}'"
|
||||
echo "httpsForced='1'"
|
||||
echo "httpsSelfsigned='1'"
|
||||
echo "authMethod='userdefined'"
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
@@ -133,7 +130,7 @@ if [ "$1" = "menu" ]; then
|
||||
http://${localIP}:${PORT_CLEAR}\n
|
||||
https://${localIP}:${PORT_SSL} with Fingerprint:
|
||||
${fingerprint}\n
|
||||
The Alby Hub password is managed separate from RaspiBlitz - make sure to manage it safely.\n
|
||||
The Alby Hub password is managed seperate from RaspiBlitz - make sure to manage it safely.\n
|
||||
"
|
||||
|
||||
# use whiptail to show SSH dialog & exit
|
||||
@@ -143,10 +140,22 @@ The Alby Hub password is managed separate from RaspiBlitz - make sure to manage
|
||||
fi
|
||||
|
||||
##########################
|
||||
# INSTALL
|
||||
# ON / INSTALL
|
||||
##########################
|
||||
|
||||
if [ "$1" = "install" ]; then
|
||||
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
|
||||
# dont run install if already installed
|
||||
if [ ${isInstalled} -eq 1 ]; then
|
||||
echo "# ${APPID}.service is already installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check if lnd service is installed
|
||||
if [ $(sudo ls /etc/systemd/system/lnd.service 2>/dev/null | grep -c 'lnd.service') -eq 0 ]; then
|
||||
echo "error='LND needs to be installed'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# Installing ${APPID} ..."
|
||||
|
||||
@@ -166,7 +175,7 @@ if [ "$1" = "install" ]; then
|
||||
sudo wget -O albyhub-server.tar.bz2 https://github.com/getAlby/hub/releases/download/v$VERSION/albyhub-Server-Linux-aarch64.tar.bz2
|
||||
else
|
||||
echo "# Downloading Alby Hub for x86"
|
||||
sudo wget -O albyhub-server.tar.bz2 https://github.com/getAlby/hub/releases/download/v$VERSION/albyhub-Server-Linux-x86_64.tar.bz2
|
||||
sudo wget -O albyhub-server.tar.bz2 https://github.com/getAlby/hub/releases/download/v$VERSION/albyhub-Server-Linux-x86_64.tar.bz2
|
||||
fi
|
||||
|
||||
# extract archives
|
||||
@@ -178,9 +187,9 @@ if [ "$1" = "install" ]; then
|
||||
fi
|
||||
|
||||
# cleanup
|
||||
sudo rm -f albyhub-server.tar.bz2
|
||||
rm -f albyhub-server.tar.bz2
|
||||
|
||||
# set permissions
|
||||
# Setze die Berechtigungen für das Verzeichnis und die Dateien
|
||||
sudo chmod -R 755 /home/${APPID}/lib
|
||||
sudo chown -R root:root /home/${APPID}/lib
|
||||
|
||||
@@ -188,40 +197,8 @@ if [ "$1" = "install" ]; then
|
||||
echo "/home/${APPID}/lib" | sudo tee /etc/ld.so.conf.d/${APPID}.conf
|
||||
sudo ldconfig
|
||||
|
||||
echo "# Install ${APPID} done"
|
||||
exit 0
|
||||
|
||||
fi
|
||||
|
||||
##########################
|
||||
# ON
|
||||
##########################
|
||||
|
||||
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
|
||||
# dont run install if already installed
|
||||
if [ ${isInstalled} -eq 1 ]; then
|
||||
echo "# ${APPID}.service is already installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check if lnd service is available (LND is needed as a base)
|
||||
if [ $(sudo ls /etc/systemd/system/lnd.service 2>/dev/null | grep -c 'lnd.service') -eq 0 ]; then
|
||||
echo "error='LND needs to be installed'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check if code is already installed
|
||||
isInstalled=$(compgen -u | grep -c ${APPID})
|
||||
if [ "${isInstalled}" == "0" ]; then
|
||||
echo "# Installing code base & dependencies first .."
|
||||
/home/admin/config.scripts/bonus.albyhub.sh install || { echo "error='install failed'"; exit 1; }
|
||||
fi
|
||||
|
||||
echo "# ACTIVATE Alby-Hub"
|
||||
|
||||
# prepare data directory
|
||||
sudo mkdir -p /mnt/hdd/app-data/${APPID} 2>/dev/null
|
||||
sudo mkdir -p /mnt/hdd/app-data/${APPID}
|
||||
sudo chown -R ${APPID}:${APPID} /mnt/hdd/app-data/${APPID}
|
||||
|
||||
# open the ports in the firewall
|
||||
@@ -230,7 +207,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
sudo ufw allow ${PORT_SSL} comment "${APPID} HTTPS"
|
||||
|
||||
# prepare env file
|
||||
echo "# prepare env file --> ${ENVFILE}"
|
||||
echo "# prepare env file --> ${ENVFILE}"
|
||||
sudo touch ${ENVFILE}
|
||||
sudo chown ${APPID}:${APPID} ${ENVFILE}
|
||||
sudo chmod 770 ${ENVFILE}
|
||||
@@ -252,7 +229,7 @@ ExecStartPre=-/home/admin/config.scripts/bonus.${APPID}.sh prestart
|
||||
EnvironmentFile=${ENVFILE}
|
||||
ExecStart=/home/${APPID}/bin/${APPID}
|
||||
# Hack to ensure Alby Hub never uses more than 90% CPU
|
||||
CPUQuota=90%sudo
|
||||
CPUQuota=90%sudo
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -268,8 +245,8 @@ WantedBy=multi-user.target
|
||||
# nginx configuration
|
||||
# BACKGROUND is that the plain HTTP is served by your web app, but thru the nginx proxy it will be available
|
||||
# with (self-signed) HTTPS and with separate configs for Tor & Tor+HTTPS.
|
||||
|
||||
echo "# setup nginx config"
|
||||
|
||||
echo "# setup nginx confing"
|
||||
|
||||
# write the HTTPS config
|
||||
echo "
|
||||
@@ -340,10 +317,7 @@ server {
|
||||
/home/admin/config.scripts/blitz.conf.sh set ${APPID} "on"
|
||||
|
||||
echo "# Monitor with: sudo journalctl -f -u ${APPID}"
|
||||
echo "# OK actvation done"
|
||||
|
||||
# needed for API/WebUI as signal that install ran thru
|
||||
echo "result='OK'"
|
||||
echo "# OK install done"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -374,6 +348,13 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||
sudo ufw deny "${PORT_CLEAR}"
|
||||
sudo ufw deny "${PORT_SSL}"
|
||||
|
||||
# remove libraries again
|
||||
sudo rm /etc/ld.so.conf.d/albyhub.conf
|
||||
sudo ldconfig
|
||||
|
||||
echo "# delete user and directories"
|
||||
sudo userdel -rf ${APPID}
|
||||
|
||||
echo "# removing Tor hidden service (if active)"
|
||||
/home/admin/config.scripts/tor.onion-service.sh off ${APPID}
|
||||
|
||||
@@ -387,32 +368,6 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||
fi
|
||||
|
||||
echo "# OK - app should be uninstalled now"
|
||||
# needed for API/WebUI as signal that install ran thru
|
||||
echo "result='OK'"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
########################################
|
||||
# UNINSTALL (remove from system)
|
||||
########################################
|
||||
|
||||
if [ "$1" = "uninstall" ]; then
|
||||
|
||||
isActive=$(sudo ls /etc/systemd/system/${APPID}.service 2>/dev/null | grep -c '${APPID}.service')
|
||||
if [ "${isActive}" != "0" ]; then
|
||||
echo "# cannot uninstall if still 'on'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# remove libraries again
|
||||
sudo rm /etc/ld.so.conf.d/albyhub.conf
|
||||
sudo ldconfig
|
||||
|
||||
# nuke user
|
||||
sudo userdel -rf ${APPID} 2>/dev/null
|
||||
|
||||
echo "# uninstall ${APPID} done"
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
@@ -812,6 +812,9 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||
fi
|
||||
echo "# OK BTCPayServer deactivated."
|
||||
|
||||
echo "# delete the btcpay user home directory"
|
||||
sudo userdel -rf btcpay 2>/dev/null
|
||||
|
||||
# needed for API/WebUI as signal that install ran thru
|
||||
echo "result='OK'"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://github.com/cculianu/Fulcrum/releases
|
||||
fulcrumVersion="1.10.0"
|
||||
fulcrumVersion="1.11.1"
|
||||
|
||||
portTCP="50021"
|
||||
portSSL="50022"
|
||||
|
||||
@@ -226,14 +226,6 @@ Consider adding a IP2TOR Bridge under OPTIONS."
|
||||
OPTIONS+=(MIGRATE-DB "Migrate SQLite to PostgreSQL database")
|
||||
fi
|
||||
|
||||
# Admin UI
|
||||
activatedAdminUI=$(sudo grep -c "LNBITS_ADMIN_UI=true" $lnbitsConfig)
|
||||
if [ ${activatedAdminUI} -eq 0 ]; then
|
||||
OPTIONS+=(ADMINUI "Activate 'Admin UI'")
|
||||
else
|
||||
OPTIONS+=(ADMINUI "Deactivate 'Admin UI'")
|
||||
fi
|
||||
|
||||
WIDTH=66
|
||||
CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1"))
|
||||
HEIGHT=$((CHOICE_HEIGHT + 7))
|
||||
@@ -294,24 +286,6 @@ Consider adding a IP2TOR Bridge under OPTIONS."
|
||||
read key
|
||||
exit 0
|
||||
;;
|
||||
ADMINUI)
|
||||
clear
|
||||
echo
|
||||
if [ ${activatedAdminUI} -eq 0 ]; then
|
||||
echo "Activate Admin UI"
|
||||
sudo sed -i "/^LNBITS_ADMIN_UI=/d" $lnbitsConfig
|
||||
sudo bash -c "echo 'LNBITS_ADMIN_UI=true' >> ${lnbitsConfig}"
|
||||
else
|
||||
echo "Deactivate Admin UI"
|
||||
sudo sed -i "/^LNBITS_ADMIN_UI=/d" $lnbitsConfig
|
||||
sudo bash -c "echo 'LNBITS_ADMIN_UI=false' >> ${lnbitsConfig}"
|
||||
fi
|
||||
echo "Restarting LNbits ..."
|
||||
sudo systemctl restart lnbits
|
||||
echo "PRESS ENTER to continue"
|
||||
read key
|
||||
exit 0
|
||||
;;
|
||||
RESTORE)
|
||||
clear
|
||||
# check if backup exist
|
||||
@@ -806,17 +780,16 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
echo "# preparing env file"
|
||||
# delete old .env file or old symbolic link
|
||||
sudo rm /home/lnbits/lnbits/.env 2>/dev/null
|
||||
|
||||
# make sure .env file exists at data drive
|
||||
if [ ! -f $lnbitsConfig ]; then
|
||||
sudo -u lnbits touch $lnbitsConfig
|
||||
sudo bash -c "echo 'LNBITS_ADMIN_UI=true' >> ${lnbitsConfig}"
|
||||
fi
|
||||
sudo -u lnbits touch $lnbitsConfig
|
||||
sudo chown lnbits:lnbits $lnbitsConfig
|
||||
|
||||
# crete symbolic link
|
||||
sudo -u lnbits ln -s $lnbitsConfig /home/lnbits/lnbits/.env
|
||||
|
||||
# activate admin user
|
||||
sudo sed -i "/^LNBITS_ADMIN_UI=/d" $lnbitsConfig
|
||||
sudo bash -c "echo 'LNBITS_ADMIN_UI=true' >> ${lnbitsConfig}"
|
||||
|
||||
if [ ! -e /mnt/hdd/app-data/LNBits/database.sqlite3 ]; then
|
||||
echo "# install database: PostgreSQL"
|
||||
|
||||
|
||||
@@ -202,11 +202,20 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
if [ "${isInstalled}" == "0" ]; then
|
||||
echo "# Install code base first ...."
|
||||
if ! /home/admin/config.scripts/bonus.mempool.sh install; then
|
||||
/home/admin/config.scripts/bonus.mempool.sh uninstall 2>/dev/null
|
||||
echo "FAIL - install did not run correctly, aborting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# check if /home/mempool/mempool exists
|
||||
if [ ! -d "/home/mempool/mempool" ]; then
|
||||
/home/admin/config.scripts/bonus.mempool.sh uninstall 2>/dev/null
|
||||
echo "error='mempool code base install failed'"
|
||||
echo "# please run manually first: /home/admin/config.scripts/bonus.mempool.sh install"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# *** Activate MEMPOOL ***"
|
||||
|
||||
# make sure mariadb is running
|
||||
@@ -233,6 +242,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
RPC_USER=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcuser | cut -c 9-)
|
||||
PASSWORD_B=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcpassword | cut -c 13-)
|
||||
|
||||
sudo rm /var/cache/raspiblitz/mempool-config.json 2>/dev/null
|
||||
touch /var/cache/raspiblitz/mempool-config.json
|
||||
chmod 600 /var/cache/raspiblitz/mempool-config.json || exit 1
|
||||
cat >/var/cache/raspiblitz/mempool-config.json <<EOF
|
||||
|
||||
@@ -62,7 +62,7 @@ if [ "$command" = "1" ] || [ "$command" = "on" ]; then
|
||||
sudo chown -R postgres:postgres $postgres_datadir
|
||||
|
||||
echo "# Create cluster"
|
||||
sudo pg_createcluster --locale en_US.UTF-8 $PG_VERSION main
|
||||
sudo pg_createcluster $PG_VERSION main
|
||||
sudo pg_ctlcluster $PG_VERSION main start
|
||||
|
||||
elif [ -d /mnt/hdd/app-data/postgresql/$PG_VERSION/main ]; then
|
||||
@@ -79,12 +79,12 @@ if [ "$command" = "1" ] || [ "$command" = "on" ]; then
|
||||
echo "# Create $PG_VERSION config"
|
||||
sudo mkdir -p $postgres_datadir/$PG_VERSION/main
|
||||
sudo chown -R postgres:postgres $postgres_datadir
|
||||
sudo pg_createcluster --locale en_US.UTF-8 $PG_VERSION main
|
||||
sudo pg_createcluster $PG_VERSION main
|
||||
sudo pg_ctlcluster $PG_VERSION main start
|
||||
echo "Setting default password for postgres user"
|
||||
# start cluster temporarily
|
||||
sudo systemctl start postgresql
|
||||
sudo pg_createcluster --locale en_US.UTF-8 $PG_VERSION main
|
||||
sudo pg_createcluster $PG_VERSION main
|
||||
sudo pg_ctlcluster $PG_VERSION main start
|
||||
echo "Setting default password for postgres user"
|
||||
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';"
|
||||
@@ -108,7 +108,7 @@ if [ "$command" = "1" ] || [ "$command" = "on" ]; then
|
||||
sudo chown -R postgres:postgres $postgres_datadir
|
||||
sudo systemctl start postgresql
|
||||
sudo systemctl start postgresql@13-main
|
||||
sudo pg_createcluster --locale en_US.UTF-8 $PG_VERSION main
|
||||
sudo pg_createcluster $PG_VERSION main
|
||||
sudo pg_ctlcluster $PG_VERSION main start
|
||||
|
||||
elif [ -d /mnt/hdd/app-data/postgresql/13/main ]; then
|
||||
@@ -130,7 +130,7 @@ if [ "$command" = "1" ] || [ "$command" = "on" ]; then
|
||||
sudo chown -R postgres:postgres $postgres_datadir
|
||||
# start cluster temporarily
|
||||
sudo systemctl start postgresql
|
||||
sudo pg_createcluster --locale en_US.UTF-8 13 main
|
||||
sudo pg_createcluster 13 main
|
||||
sudo pg_ctlcluster 13 main start
|
||||
echo "# Setting default password for postgres user"
|
||||
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';"
|
||||
@@ -154,7 +154,7 @@ if [ "$command" = "1" ] || [ "$command" = "on" ]; then
|
||||
sudo chown -R postgres:postgres $postgres_datadir
|
||||
sudo systemctl start postgresql
|
||||
sudo systemctl start postgresql@13-main
|
||||
sudo pg_createcluster --locale en_US.UTF-8 13 main
|
||||
sudo pg_createcluster 13 main
|
||||
sudo pg_ctlcluster 13 main start
|
||||
|
||||
if [ -d /mnt/hdd/app-data/postgresql/$PG_VERSION ] || pg_lsclusters | grep -q "$PG_VERSION main"; then
|
||||
@@ -185,24 +185,6 @@ if [ "$command" = "1" ] || [ "$command" = "on" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Setting PostgreSQL locale settings
|
||||
LOCALE_SETTINGS=(
|
||||
"lc_messages = 'en_US.UTF-8'"
|
||||
"lc_monetary = 'en_US.UTF-8'"
|
||||
"lc_numeric = 'en_US.UTF-8'"
|
||||
"lc_time = 'en_US.UTF-8'"
|
||||
)
|
||||
for setting in "${LOCALE_SETTINGS[@]}"; do
|
||||
key=$(echo "$setting" | cut -d= -f1 | tr -d ' ')
|
||||
if ! sudo grep -q "^${key}" /etc/postgresql/$PG_VERSION/main/postgresql.conf; then
|
||||
echo "# Adding $setting"
|
||||
echo "$setting" | sudo tee -a /etc/postgresql/$PG_VERSION/main/postgresql.conf
|
||||
else
|
||||
echo "# Updating $setting"
|
||||
sudo sed -i "s|^${key}.*|${setting}|" /etc/postgresql/$PG_VERSION/main/postgresql.conf
|
||||
fi
|
||||
done
|
||||
|
||||
# start cluster
|
||||
sudo systemctl enable postgresql
|
||||
sudo systemctl start postgresql
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# https://github.com/cryptoadvance/specter-desktop
|
||||
|
||||
pinnedVersion="2.0.4"
|
||||
pinnedVersion="2.0.5"
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
|
||||
@@ -60,16 +60,14 @@ ExecStartPost=-/home/admin/config.scripts/cl.check.sh poststart $CHAIN
|
||||
|
||||
# Creates /run/lightningd owned by bitcoin
|
||||
RuntimeDirectory=lightningd
|
||||
|
||||
User=bitcoin
|
||||
Group=bitcoin
|
||||
# Type=forking hangs on restart
|
||||
Type=simple
|
||||
PIDFile=/run/lightningd/${netprefix}lightningd.pid
|
||||
Restart=on-failure
|
||||
|
||||
Restart=always
|
||||
RestartSec=60
|
||||
TimeoutSec=240
|
||||
RestartSec=30
|
||||
StandardOutput=null
|
||||
StandardError=journal
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# https://lightning.readthedocs.io/
|
||||
|
||||
# https://github.com/ElementsProject/lightning/releases
|
||||
CLVERSION="v24.11"
|
||||
CLVERSION="v24.08.1"
|
||||
|
||||
# https://github.com/ElementsProject/lightning/tree/master/contrib/keys
|
||||
# rustyrussell D9200E6CD1ADB8F1
|
||||
@@ -11,9 +11,9 @@ CLVERSION="v24.11"
|
||||
# pneuroth (nepet) C3F21EE387FF4CD2
|
||||
# sfarooqui (ShahanaFarooqui) B56B4453DA8C6DF7FC9BCFCBDCA40B7128DA62A8
|
||||
# amyers (endothermicdev) F3BF63F2747436AB
|
||||
PGPsigner="rustyrussell"
|
||||
PGPsigner="sfarooqui"
|
||||
PGPpubkeyLink="https://raw.githubusercontent.com/ElementsProject/lightning/master/contrib/keys/${PGPsigner}.txt"
|
||||
PGPpubkeyFingerprint="D9200E6CD1ADB8F1"
|
||||
PGPpubkeyFingerprint="B56B4453DA8C6DF7FC9BCFCBDCA40B7128DA62A8"
|
||||
|
||||
# help
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
## based on https://raspibolt.github.io/raspibolt/raspibolt_40_lnd.html#lightning-lnd
|
||||
## see LND releases: https://github.com/lightningnetwork/lnd/releases
|
||||
### If you change here - make sure to also change interims version in lnd.update.sh #!
|
||||
lndVersion="0.18.3-beta"
|
||||
lndVersion="0.17.5-beta"
|
||||
|
||||
# olaoluwa
|
||||
PGPauthor="roasbeef"
|
||||
PGPpkeys="https://raw.githubusercontent.com/lightningnetwork/lnd/master/scripts/keys/roasbeef.asc"
|
||||
PGPcheck="A5B61896952D9FDA83BC054CDC42612E89237182"
|
||||
# PGPauthor="roasbeef"
|
||||
# PGPpkeys="https://raw.githubusercontent.com/lightningnetwork/lnd/master/scripts/keys/roasbeef.asc"
|
||||
# PGPcheck="A5B61896952D9FDA83BC054CDC42612E89237182"
|
||||
|
||||
# guggero
|
||||
# PGPauthor="guggero"
|
||||
# PGPpkeys="https://keybase.io/guggero/pgp_keys.asc"
|
||||
# PGPcheck="F4FC70F07310028424EFC20A8E4256593F177720"
|
||||
PGPauthor="guggero"
|
||||
PGPpkeys="https://keybase.io/guggero/pgp_keys.asc"
|
||||
PGPcheck="F4FC70F07310028424EFC20A8E4256593F177720"
|
||||
|
||||
# bitconner
|
||||
#PGPauthor="bitconner"
|
||||
|
||||
@@ -167,6 +167,9 @@ EOF
|
||||
# setting value in raspi blitz config
|
||||
/home/admin/config.scripts/blitz.conf.sh set runBehindTor "off"
|
||||
|
||||
# remove "debug=tor" from bitcoin.conf
|
||||
sudo sed -i '/^debug=tor$/d' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
|
||||
# deactivate bitcoin over tor (function call)
|
||||
deactivateBitcoinOverTor
|
||||
echo
|
||||
|
||||
70
toc.sh
Executable file
70
toc.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
## Updated version maintained on https://github.com/nyxnor/scripts/blob/master/toc.sh
|
||||
|
||||
## Produces Table of Contents (ToC) for simple markdown files
|
||||
## Requirement: header is set by hashtag '#'
|
||||
## $1 = FILE.md
|
||||
|
||||
red="\033[31m"
|
||||
nocolor="\033[0m"
|
||||
|
||||
error_msg(){ printf %s"${red}ERROR: ${1}\n${nocolor}" >&2; exit 1; }
|
||||
|
||||
test -f "${1}" || error_msg "file '${1}' doesn't exist"
|
||||
|
||||
trap 'rm -f toc.tmp' EXIT INT
|
||||
|
||||
line_count=0
|
||||
while IFS="$(printf '\n')" read -r line; do
|
||||
line_count=$((line_count+1))
|
||||
## extract code blocks
|
||||
code="${code:-0}"
|
||||
[ "${code}" -eq 0 ] && printf '%s\n' "${line_count}:${line}" | grep "^${line_count}:.*# "
|
||||
case "${line}" in
|
||||
*\`\`\`*)
|
||||
case "${code}" in
|
||||
1) code=0;;
|
||||
0|*) code=1;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done < "${1}" > toc.tmp
|
||||
|
||||
|
||||
while IFS="$(printf '\n')" read -r line; do
|
||||
## get line number
|
||||
line_number="$(printf '%s\n' "${line}" | cut -d ":" -f1)"
|
||||
## remove hashtag from line to be compared later if it is repeated
|
||||
line_clean="$(printf '%s\n' "${line}" | sed "s/.*\# //")"
|
||||
## save header to cache to check later if it was already printed
|
||||
# shellcheck disable=SC2030
|
||||
line_cache="$(printf '%s\n%s\n' "${line_cache}" "${line}")"
|
||||
## check if header was already printed before and if positive, save all repeated headers
|
||||
## if positive, insert link index
|
||||
line_repeated="$(printf '%s\n' "${line_cache}" | grep -c -- ".*# ${line_clean}$")"
|
||||
line_repeated_index=""
|
||||
## first line does not have '-n', just the first repeated line (second occurence), starting with '-1'. So we consider the occurrence-1.
|
||||
[ "${line_repeated}" -ge 2 ] && line_repeated_index="-$((line_repeated-1))"
|
||||
## if it is the second time line has repeated, save first and second occurrence
|
||||
if [ "${line_repeated}" -eq 2 ]; then
|
||||
line_first_occurrence="$(printf '%s\n' "${line_cache}" | grep -- ".*# ${line_clean}$" | head -n 1)"
|
||||
line_repeated_cache="$(printf '%s\n%s\n' "${line_first_occurrence}" "${line}")"
|
||||
## if it is the third or greater time line has repeated, save lines from before (1st and 2nd occurrence) plus add current lines
|
||||
elif [ "${line_repeated}" -gt 2 ]; then
|
||||
line_repeated_cache="$(printf '%s\n%s\n' "${line_repeated_cache}" "${line}")"
|
||||
fi
|
||||
## clean header that have link reference
|
||||
line_md="$(printf '%s\n' "${line}" | sed "s/${line_number}://;s|](.*||;s|\[||;s/\]//g")"
|
||||
## set header indentation
|
||||
line_md="$(printf '%s\n' "${line_md}" | sed "s|######| -|;s|#####| -|;s|####| -|;s|###| -|;s|##| -|;s|#|-|")"
|
||||
## set link content
|
||||
line_content="$(printf '%s\n' "${line_md}" | sed "s/.*- /#/;s| |-|g;s|'||g;s|]||g;s/|/-/g" | tr "[:upper:]" "[:lower:]" | tr -cd "[:alnum:]-_" | tr -d ".")"
|
||||
## set link reference
|
||||
line_md="$(printf '%s\n' "${line_md}" | sed "s|- |- [|;s|$|](#${line_content}${line_repeated_index})|")"
|
||||
## print header
|
||||
printf '%s\n' "${line_md}"
|
||||
done < toc.tmp
|
||||
|
||||
[ -n "${line_repeated_cache}" ] &&
|
||||
printf %s"\n\nWARN: Some headers are repeated, the hiperlinks are correctly indexed. If you think this is an error, review these lines:headers:\n${line_repeated_cache}\n"
|
||||
Reference in New Issue
Block a user