Compare commits

...

5 Commits

Author SHA1 Message Date
Christoph Stenglein
e70667f43b dev: add codeowners file for branch protection (#3432) 2022-11-16 17:05:49 +01:00
openoms
c9802cb9af btcpay default to v1.5.4, improve update and off 2022-05-28 19:48:45 +01:00
openoms
e3519a9c27 fix manual lnd database compacting 2022-05-28 10:16:37 +01:00
openoms
c07b860c6b Merge pull request #3141 from openoms/cl-plugin-backup-fix
cln-backup: use the version before poetry
2022-05-23 13:50:39 +02:00
openoms
4a05721a58 cln-backup: use the version before poetry 2022-05-23 09:30:18 +02:00
4 changed files with 117 additions and 87 deletions

6
CODEOWNERS Normal file
View File

@@ -0,0 +1,6 @@
# For info see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
# These owners will be the default owners for everything in the repo.
# Unless a later match takes precedence, these users will be requested for review when someone opens a pull request.
* @rootzoll @openoms

View File

@@ -5,11 +5,7 @@
# https://github.com/dgarage/NBXplorer/tags
NBXplorerVersion="v2.2.20"
# https://github.com/btcpayserver/btcpayserver/releases
BTCPayVersion="v1.4.4"
PGPsigner="nicolasdorier"
PGPpubkeyLink="https://keybase.io/nicolasdorier/pgp_keys.asc"
PGPpubkeyFingerprint="AB4CFA9895ACA0DBE27F6B346618763EF09186FE"
BTCPayVersion="v1.5.4"
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
@@ -38,7 +34,11 @@ if [ "$1" = "status" ]; then
localIP=$(hostname -I | awk '{print $1}')
echo "localIP='${localIP}'"
echo "httpPort='23000'"
echo "httpsPort='23001'"
echo "httpsForced='1'"
echo "httpsSelfsigned='1'" # TODO: change later if IP2Tor+LetsEncrypt is active
echo "authMethod='userdefined'"
echo "publicIP='${publicIP}'"
# check for LetsEncryptDomain for DynDns
@@ -336,6 +336,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
cd NBXplorer || exit 1
sudo -u btcpay git reset --hard $NBXplorerVersion
# PGP verify
PGPsigner="nicolasdorier"
PGPpubkeyLink="https://keybase.io/nicolasdorier/pgp_keys.asc"
PGPpubkeyFingerprint="AB4CFA9895ACA0DBE27F6B346618763EF09186FE"
sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh \
"${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1
echo "# Build NBXplorer ..."
@@ -432,6 +437,10 @@ btc.rpc.password=$PASSWORD_B
# sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh \
# "web-flow" "https://github.com/web-flow.gpg" "4AEE18F83AFDEB23" || exit 1
PGPsigner="Kukks"
PGPpubkeyLink="https://github.com/${PGPsigner}.gpg"
PGPpubkeyFingerprint="8E5530D9D1C93097"
sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh \
"${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1
@@ -476,8 +485,8 @@ WantedBy=multi-user.target
sudo systemctl start btcpayserver
echo "# Checking for btcpayserver config"
while [ ! -f "/home/btcpay/.btcpayserver/Main/settings.config" ]; do
echo "# Waiting for btcpayserver to start - CTRL+C to abort"
sleep 10
echo "# Waiting for btcpayserver to start - CTRL+C to abort .."
sleep 30
hasFailed=$(sudo systemctl status btcpayserver | grep -c "Active: failed")
if [ ${hasFailed} -eq 1 ]; then
echo "# seems like starting btcpayserver service has failed - see: systemctl status btcpayserver"
@@ -503,6 +512,9 @@ WantedBy=multi-user.target
# setting value in raspi blitz config
/home/admin/config.scripts/blitz.conf.sh set BTCPayServer "on"
# needed for API/WebUI as signal that install ran thru
echo "result='OK'"
exit 0
fi
@@ -540,6 +552,10 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
sudo systemctl stop btcpayserver
sudo systemctl disable btcpayserver
sudo rm /etc/systemd/system/btcpayserver.service
else
echo "# The btcpayserver.service is not installed."
fi
# nbxplorer
sudo systemctl stop nbxplorer
sudo systemctl disable nbxplorer
@@ -573,55 +589,57 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
echo "# keeping data"
fi
echo "# OK BTCPayServer removed."
else
echo "# BTCPayServer is not installed."
fi
# needed for API/WebUI as signal that install ran thru
echo "result='OK'"
exit 0
fi
if [ "$1" = "update" ]; then
echo "# Update NBXplorer"
cd /home/btcpay || exit 1
cd NBXplorer || exit 1
# fetch latest master
if [ "$(sudo -u btcpay git fetch 2>&1 | grep -c "Please tell me who you are")" -gt 0 ]; then
sudo -u btcpay git config user.email "you@example.com"
sudo -u btcpay git config user.name "Your Name"
fi
sudo -u btcpay git fetch
# unset $1
set --
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
if [ $LOCAL = $REMOTE ]; then
TAG=$(git tag | sort -V | tail -1)
echo "# Up-to-date on version $TAG"
else
echo "# Pulling latest changes..."
sudo -u btcpay git pull -p
TAG=$(git tag | sort -V | tail -1)
echo "# Reset to the latest release tag: $TAG"
sudo -u btcpay git reset --hard $TAG
sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh \
"${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1
echo "# Build NBXplorer ..."
# from the build.sh with path
sudo systemctl stop nbxplorer
sudo -u btcpay /home/btcpay/dotnet/dotnet build -c Release NBXplorer/NBXplorer.csproj
# whitelist localhost in bitcoind
if ! sudo grep -Eq "^whitelist=127.0.0.1" /mnt/hdd/bitcoin/bitcoin.conf;then
echo "whitelist=127.0.0.1" | sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
echo "# Restarting bitcoind"
sudo systemctl restart bitcoind
fi
sudo systemctl start nbxplorer
echo "# Updated NBXplorer to $TAG"
fi
## don't update NBXplorer until https://github.com/rootzoll/raspiblitz/issues/3055 is solved
# echo "# Update NBXplorer"
# cd /home/btcpay || exit 1
# cd NBXplorer || exit 1
# # fetch latest master
# if [ "$(sudo -u btcpay git fetch 2>&1 | grep -c "Please tell me who you are")" -gt 0 ]; then
# sudo -u btcpay git config user.email "you@example.com"
# sudo -u btcpay git config user.name "Your Name"
# fi
# sudo -u btcpay git fetch
# # unset $1
# set --
# UPSTREAM=${1:-'@{u}'}
# LOCAL=$(git rev-parse @)
# REMOTE=$(git rev-parse "$UPSTREAM")
#
# if [ $LOCAL = $REMOTE ]; then
# TAG=$(git tag | sort -V | tail -1)
# echo "# Up-to-date on version $TAG"
# else
# echo "# Pulling latest changes..."
# sudo -u btcpay git pull -p
# TAG=$(git tag | sort -V | tail -1)
# echo "# Reset to the latest release tag: $TAG"
# sudo -u btcpay git reset --hard $TAG
# sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh \
# "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1
# echo "# Build NBXplorer ..."
# # from the build.sh with path
# sudo systemctl stop nbxplorer
# sudo -u btcpay /home/btcpay/dotnet/dotnet build -c Release NBXplorer/NBXplorer.csproj
#
# # whitelist localhost in bitcoind
# if ! sudo grep -Eq "^whitelist=127.0.0.1" /mnt/hdd/bitcoin/bitcoin.conf;then
# echo "whitelist=127.0.0.1" | sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
# echo "# Restarting bitcoind"
# sudo systemctl restart bitcoind
# fi
#
# sudo systemctl start nbxplorer
# echo "# Updated NBXplorer to $TAG"
# fi
echo "# Update BTCPayServer"
cd /home/btcpay || exit 1

View File

@@ -15,6 +15,10 @@ function help(){
exit 1
}
# https://github.com/lightningd/plugins/commits/master/backup
# use the version beore the migration to poetry
pinnedVersion="3da5778dcf408ff075515b4956aef405aa18f81a"
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
help
@@ -30,6 +34,8 @@ function install() {
cd /home/bitcoin/cl-plugins-available || exit 1
sudo -u bitcoin git clone https://github.com/lightningd/plugins.git
fi
cd ${plugindir} || exit 1
sudo -u bitcoin git reset --hard ${pinnedVersion}
if [ $($lightningcli_alias plugin list 2>/dev/null | grep -c "${plugin}") -eq 0 ];then
echo "# Checking dependencies"

View File

@@ -52,7 +52,7 @@ sudo systemctl stop lnd
sudo touch /home/admin/lnd.db.bolt.auto-compact.log
sudo chmod 777 /home/admin/lnd.db.bolt.auto-compact.log
echo "# Run LND with --db.bolt.auto-compact"
sudo -u bitcoin /usr/local/bin/lnd --configfile=/home/bitcoin/.lnd/lnd.conf --db.bolt.auto-compact > /home/admin/lnd.db.bolt.auto-compact.log &
sudo -u bitcoin /usr/local/bin/lnd --configfile=/home/bitcoin/.lnd/lnd.conf --db.bolt.auto-compact --db.bolt.auto-compact-min-age=0 > /home/admin/lnd.db.bolt.auto-compact.log &
echo "# Compacting channel.db, this can take a long time"