mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-28 16:58:03 +01:00
btcpay update to v1.9.1, migration to postgres (#3756)
* btcpay update to v1.9.0, migration to postgres * update CHANGES.md * always fix postgres files ownership * add socksendpoint=127.0.0.1:9050 to fix #3729 * btcpay update to v1.9.1 * update changes * create config directory in BtcPayConfig
This commit is contained in:
parent
34bac321f4
commit
084304531a
3 changed files with 20 additions and 21 deletions
|
@ -13,14 +13,14 @@
|
|||
- New on WebUI: Jam (JoinMarket Web UI) v0.1.5 [details](https://github.com/joinmarket-webui/joinmarket-webui/releases/tag/v0.1.5)
|
||||
- Update: Bitcoin Core v24.0.1 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.1.md)
|
||||
- Update: LND v0.16.0-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.16.0-beta)
|
||||
- Update: Core Lightning v23.02 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.02)
|
||||
- Update: Core Lightning v23.02.2 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.02.2)
|
||||
- Update: C-lightningREST v0.10.2 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.10.2)
|
||||
- Update: Electrum Server in Rust (electrs) v0.9.11 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0911-jan-5-2023)
|
||||
- Update: Lightning Terminal v0.8.6-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.8.6-alpha)
|
||||
- Update: RTL v0.13.6 with update option [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.13.6)
|
||||
- Update: Thunderhub v0.13.16 with balance sharing disabled [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.16)
|
||||
- Update: LNbits 0.10.2 [details](https://github.com/lnbits/lnbits/releases/tag/0.10.2)
|
||||
- Update: BTCPayServer 1.8.2 (using postgres for new installs) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.8.2)
|
||||
- Update: BTCPayServer 1.9.1 (postgres by default with sqlite migration) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.9.1)
|
||||
- Update: ItchySats 0.7.0 [details](https://github.com/itchysats/itchysats/releases/tag/0.7.0)
|
||||
- Update: Channel Tools (chantools) v0.10.5 [details](https://github.com/guggero/chantools/releases/tag/v0.10.5)
|
||||
- Update: JoinMarket v0.9.9 [details](https://github.com/JoinMarket-Org/joinmarket-clientserver/releases/tag/v0.9.9)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# https://github.com/dgarage/NBXplorer/tags
|
||||
NBXplorerVersion="v2.3.62"
|
||||
# https://github.com/btcpayserver/btcpayserver/releases
|
||||
BTCPayVersion="v1.8.2"
|
||||
BTCPayVersion="v1.9.1"
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
|
@ -58,25 +58,20 @@ nomigrateevts=1
|
|||
function BtcPayConfig() {
|
||||
# set thumbprint
|
||||
FINGERPRINT=$(openssl x509 -noout -fingerprint -sha256 -inform pem -in /home/btcpay/.lnd/tls.cert | cut -d"=" -f2)
|
||||
if sudo ls /mnt/hdd/app-data/.btcpayserver/Main/sqllite.db 1>/dev/null 2>&1; then
|
||||
echo "# sqlite database exists"
|
||||
databaseOption="# keep using sqlite as /mnt/hdd/app-data/.btcpayserver/Main/sqllite.db exists (configured in the btcpayserver.service)"
|
||||
# set up postgres
|
||||
if sudo -u postgres psql -c '\l' | grep btcpaymainnet; then
|
||||
echo "# btcpaymainnet database already exists"
|
||||
else
|
||||
echo "# sqlite database does not exist, using postgresql"
|
||||
databaseOption="postgres=User ID=btcpay;Host=localhost;Port=5432;Application Name=btcpay;MaxPoolSize=20;Database=btcpaymainnet;Password='raspiblitz';"
|
||||
if sudo -u postgres psql -c '\l' | grep btcpaymainnet; then
|
||||
echo "# btcpaymainnet database already exists"
|
||||
else
|
||||
echo "# Generate the database for btcpay"
|
||||
sudo -u postgres psql -c "CREATE DATABASE btcpaymainnet TEMPLATE template0 LC_CTYPE 'C' LC_COLLATE 'C' ENCODING 'UTF8';"
|
||||
sudo -u postgres psql -c "create user btcpay with encrypted password 'raspiblitz';"
|
||||
sudo -u postgres psql -c "grant all privileges on database btcpaymainnet to btcpay;"
|
||||
fi
|
||||
echo "# List databases with: sudo -u postgres psql -c '\l'"
|
||||
sudo -u postgres psql -c '\l'
|
||||
echo "# Generate the database for btcpay"
|
||||
sudo -u postgres psql -c "CREATE DATABASE btcpaymainnet TEMPLATE template0 LC_CTYPE 'C' LC_COLLATE 'C' ENCODING 'UTF8';"
|
||||
sudo -u postgres psql -c "create user btcpay with encrypted password 'raspiblitz';"
|
||||
sudo -u postgres psql -c "grant all privileges on database btcpaymainnet to btcpay;"
|
||||
fi
|
||||
echo "# List databases with: sudo -u postgres psql -c '\l'"
|
||||
sudo -u postgres psql -c '\l'
|
||||
echo "# Regenerate the btcpayserver settings (includes the LND TLS thumbprint)"
|
||||
# https://docs.btcpayserver.org/Deployment/ManualDeploymentExtended/#3-create-a-configuration-file
|
||||
sudo -u btcpay mkdir -p /home/btcpay/.btcpayserver/Main
|
||||
echo "
|
||||
### Global settings ###
|
||||
network=mainnet
|
||||
|
@ -85,20 +80,21 @@ network=mainnet
|
|||
port=23000
|
||||
bind=127.0.0.1
|
||||
externalurl=https://$BTCPayDomain
|
||||
socksendpoint=127.0.0.1:9050
|
||||
|
||||
### NBXplorer settings ###
|
||||
BTC.explorer.url=http://127.0.0.1:24444/
|
||||
BTC.lightning=type=lnd-rest;server=https://127.0.0.1:8080/;macaroonfilepath=/home/btcpay/admin.macaroon;certthumbprint=$FINGERPRINT
|
||||
|
||||
### Database ###
|
||||
${databaseOption}
|
||||
postgres=User ID=btcpay;Host=localhost;Port=5432;Application Name=btcpay;MaxPoolSize=20;Database=btcpaymainnet;Password='raspiblitz';
|
||||
explorer.postgres=User ID=nbxplorer;Host=localhost;Port=5432;Application Name=nbxplorer;MaxPoolSize=20;Database=nbxplorermainnet;Password='raspiblitz';
|
||||
" | sudo -u btcpay tee /home/btcpay/.btcpayserver/Main/settings.config
|
||||
}
|
||||
|
||||
function BtcPayService() {
|
||||
if sudo ls /mnt/hdd/app-data/.btcpayserver/Main/sqllite.db 1>/dev/null 2>&1; then
|
||||
echo "# sqlite database exists"
|
||||
echo "# sqlite database exists - will be ignored after the migration to postgresql"
|
||||
databaseOption=" -- --sqlitefile=sqllite.db"
|
||||
else
|
||||
echo "# sqlite database does not exist, using postgresql"
|
||||
|
@ -619,7 +615,6 @@ WantedBy=multi-user.target
|
|||
echo "# Because the system is not 'ready' the service 'btcpayserver' will not be started at this point .. it is enabled and will start on next reboot"
|
||||
fi
|
||||
|
||||
sudo -u btcpay mkdir -p /home/btcpay/.btcpayserver/Main/
|
||||
if [ "${lnd}" = on ]; then
|
||||
/home/admin/config.scripts/bonus.btcpayserver.sh write-tls-macaroon
|
||||
fi
|
||||
|
|
|
@ -59,6 +59,10 @@ if [ "$command" = "1" ] || [ "$command" = "on" ]; then
|
|||
sudo rm -rf $postgres_datadir # not a symlink.. delete it silently
|
||||
sudo ln -s /mnt/hdd/app-data/postgresql /var/lib/
|
||||
fi
|
||||
|
||||
# always fix ownership
|
||||
sudo chown -R postgres:postgres /mnt/hdd/app-data/postgresql
|
||||
|
||||
sudo systemctl enable postgresql
|
||||
sudo systemctl start postgresql
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue