btcpay: update to v1.0.3.146 and fix folders

This commit is contained in:
openoms 2020-01-13 15:00:22 +00:00
parent 3b2f867a84
commit 6ce189b3f8
No known key found for this signature in database
GPG key ID: A8133C3CF50B44E3
3 changed files with 36 additions and 16 deletions

View file

@ -507,7 +507,7 @@ if [ "${BTCPayServer}" != "${choice}" ]; then
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
source /home/btcpay/.btcpayserver/Main/settings.config
if [ ${externalurl} = "https://" ]; then
if [ ${externalurl} = "https://localhost" ]; then
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
externalurl="https://$localip\n
Will need to accept the self-signed certificate in the \

View file

@ -32,6 +32,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "exiting as user cancelled BTCPayServer installation"
exit 1
fi
# check for $BTCPayDomain
source /mnt/hdd/raspiblitz.conf
isInstalled=$(sudo ls /etc/systemd/system/btcpayserver.service 2>/dev/null | grep -c 'btcpayserver.service')
if [ ${isInstalled} -eq 0 ]; then
@ -40,14 +42,19 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
cd /home/btcpay
# store BTCpay data on HDD
sudo mkdir /mnt/hdd/app-data/btcpayserver 2>/dev/null
sudo mkdir /mnt/hdd/app-data/.btcpayserver 2>/dev/null
# move old btcpay data to app-data
sudo mv -f /mnt/hdd/.btcpayserver/* /mnt/hdd/app-data/btcpayserver/ 2>/dev/null
sudo rm -f /mnt/hdd/.btcpayserver 2>/dev/null
sudo mv -f /mnt/hdd/.btcpayserver/* /mnt/hdd/app-data/.btcpayserver/ 2>/dev/null
sudo rm -rf /mnt/hdd/.btcpayserver 2>/dev/null
sudo chown -R btcpay:btcpay /mnt/hdd/app-data/btcpayserver
sudo ln -s /mnt/hdd/app-data/btcpayserver /home/btcpay/ 2>/dev/null
# clean dirty SDcard (from before v1.4)
sudo mv -f /home/btcpay/.btcpayserver/* /mnt/hdd/app-data/.btcpayserver/ 2>/dev/null
sudo rm -rf /home/btcpay/.btcpayserver 2>/dev/null
sudo chown -R btcpay:btcpay /mnt/hdd/app-data/.btcpayserver
sudo -u btcpay ln -s /mnt/hdd/app-data/.btcpayserver /home/btcpay/ 2>/dev/null
sudo chown -R btcpay:btcpay /home/btcpay/.btcpayserver
echo ""
echo "***"
@ -81,6 +88,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo -u btcpay mkdir /home/btcpay/dotnet
sudo -u btcpay tar -xvf ${dotnetName} -C /home/btcpay/dotnet
sudo -u btcpay tar -xvf ${aspnetcoreName} -C /home/btcpay/dotnet
sudo rm -f *.tar.gz*
# opt out of telemetry
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | sudo tee -a /etc/environment
@ -124,7 +132,7 @@ PrivateDevices=true
[Install]
WantedBy=multi-user.target
" | sudo tee -a /etc/systemd/system/nbxplorer.service
" | sudo tee /etc/systemd/system/nbxplorer.service
sudo systemctl daemon-reload
# restart to create settings.config if was running already
@ -173,8 +181,9 @@ EOF
sudo -u btcpay git clone https://github.com/btcpayserver/btcpayserver.git
cd btcpayserver
# https://github.com/btcpayserver/btcpayserver/releases
sudo -u btcpay git reset --hard v1.0.3.144
sudo -u btcpay ./build.sh
sudo -u btcpay git reset --hard v1.0.3.146
# sudo -u btcpay ./build.sh
sudo -u btcpay dotnet build -c Release BTCPayServer/BTCPayServer.csproj
echo "
[Unit]
@ -192,7 +201,7 @@ Restart=on-failure
[Install]
WantedBy=multi-user.target
" | sudo tee -a /etc/systemd/system/btcpayserver.service
" | sudo tee /etc/systemd/system/btcpayserver.service
sudo systemctl daemon-reload
sudo systemctl enable btcpayserver
@ -210,7 +219,7 @@ network=mainnet
### Server settings ###
port=23000
bind=127.0.0.1
externalurl=https://$YOUR_DOMAIN
externalurl=https://$BTCPayDomain
### NBXplorer settings ###
BTC.explorer.url=http://127.0.0.1:24444/
@ -244,6 +253,8 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
sudo systemctl disable btcpayserver
sudo rm /etc/systemd/system/btcpayserver.service
sudo -u btcpay dotnet nuget locals all --clear
sudo rm -f /home/btcpay/dotnet-sdk*
sudo rm -f /home/btcpay/aspnetcore*
sudo rm -rf /home/btcpay/dotnet

View file

@ -56,6 +56,12 @@ if [ ${#ownDomain} -eq 0 ]; then
exit 1
fi
# add default value to raspi config if needed
if ! grep -Eq "^BTCPayDomain=" /mnt/hdd/raspiblitz.conf; then
echo "BTCPayDomain=off" >> /mnt/hdd/raspiblitz.conf
fi
echo ""
echo "***"
echo "Setting up Nginx and Certbot"
@ -65,12 +71,12 @@ echo ""
if [ $ownDomain -eq 1 ]; then
echo ""
echo "***"
echo "Confirm that the port 80, 443 and 9735 are forwarded to the IP of your RaspiBlitz by pressing [ENTER] or use [CTRL + C] to exit"
echo "Confirm that the ports 80, 443 and 9735 are forwarded to the IP of your RaspiBlitz by pressing [ENTER] or use [CTRL + C] to exit"
read key
echo ""
echo "***"
echo "Type your domain/ddns pointing to your public IP and press [ENTER] or use [CTRL + C] to exit"
echo "Type your domain or dynamicDNS pointing to your public IP and press [ENTER] or use [CTRL + C] to exit"
echo "example:"
echo "btcpay.example.com"
read YOUR_DOMAIN
@ -96,7 +102,7 @@ if [ $ownDomain -eq 1 ]; then
# get SSL cert
sudo systemctl stop certbot 2>/dev/null
sudo certbot certonly -a standalone -m $YOUR_EMAIL --agree-tos -d $YOUR_DOMAIN --pre-hook "service nginx stop" --post-hook "service nginx start"
sudo certbot certonly -a standalone -m $YOUR_EMAIL --agree-tos -d $YOUR_DOMAIN -n --pre-hook "service nginx stop" --post-hook "service nginx start"
# set nginx
sudo rm -f /etc/nginx/sites-enabled/default
@ -337,6 +343,9 @@ server {
sudo systemctl restart nginx
fi
# setting value in raspi blitz config
sudo sed -i "s/^BTCPayDomain=.*/BTCPayDomain=$YOUR_DOMAIN/g" /mnt/hdd/raspiblitz.conf
if [ $ownDomain -eq 1 ]; then
echo ""
echo "Visit your BTCpayServer instance on https://$YOUR_DOMAIN"