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

View File

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

View File

@@ -52,7 +52,7 @@ sudo systemctl stop lnd
sudo touch /home/admin/lnd.db.bolt.auto-compact.log sudo touch /home/admin/lnd.db.bolt.auto-compact.log
sudo chmod 777 /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" 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" echo "# Compacting channel.db, this can take a long time"