#214 deactivate nginx for BTCPay over TOR

This commit is contained in:
rootzoll
2020-01-28 16:30:08 +01:00
parent 60075449cc
commit 4e95faa0ec
2 changed files with 51 additions and 48 deletions

View File

@@ -22,11 +22,9 @@ if [ "$1" = "menu" ]; then
# TOR
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
whiptail --title " BTCPay Server (TOR) " --msgbox "Open the following URL in your local web browser:
https://${localip}:23001
You need to accept the selfsigned certificate in browser.\n
Hidden Service address for TOR Browser (QR see LCD):
${toraddress}
whiptail --title " BTCPay Server (TOR) " --msgbox "Have TOR Browser installed on your laptop and open:\n
${toraddress}\n
See LCD of RaspiBlitz for QR code of this address if you want to open on mobile devices with TOR browser.
" 12 67
/home/admin/config.scripts/blitz.lcd.sh hide
else
@@ -43,10 +41,13 @@ in README of https://github.com/rootzoll/raspiblitz
exit 0
fi
# add default value to raspi config if needed
# add default values to raspi config if needed
if ! grep -Eq "^BTCPayServer=" /mnt/hdd/raspiblitz.conf; then
echo "BTCPayServer=off" >> /mnt/hdd/raspiblitz.conf
fi
if ! grep -Eq "^BTCPayDomain=" /mnt/hdd/raspiblitz.conf; then
echo "BTCPayDomain=off" >> /mnt/hdd/raspiblitz.conf
fi
# stop services
echo "making sure services are not running"
@@ -57,13 +58,17 @@ sudo systemctl stop btcpayserver 2>/dev/null
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "*** INSTALL BTCPAYSERVER ***"
# --> just serving directly thru TOR for now
# setting up nginx and the SSL certificate
/home/admin/config.scripts/bonus.btcpaysetdomain.sh
errorOnInstall=$?
if [ ${errorOnInstall} -eq 1 ]; then
echo "exiting as user cancelled BTCPayServer installation"
exit 1
fi
#/home/admin/config.scripts/bonus.btcpaysetdomain.sh
#errorOnInstall=$?
#if [ ${errorOnInstall} -eq 1 ]; then
# echo "exiting as user cancelled BTCPayServer installation"
# exit 1
#fi
sudo sed -i "s/^BTCPayDomain=.*/BTCPayDomain='localhost'/g" /mnt/hdd/raspiblitz.conf
/home/admin/config.scripts/internet.hiddenservice.sh btcpay 80 23000
# check for $BTCPayDomain
source /mnt/hdd/raspiblitz.conf

View File

@@ -5,42 +5,40 @@ source /mnt/hdd/raspiblitz.conf
# script to set up nginx and the SSL certificate for BTCPay Server
# calls the config.scripts/internet.hiddenservice.sh for the Tor connection
########## Deactivated IP/DOMAIN for now - using TOR as default ###########
#HEIGHT=20
#WIDTH=73
#CHOICE_HEIGHT=2
#BACKTITLE="RaspiBlitz"
#TITLE="BTCPay Server Install"
#MENU="Choose 'TOR' if you want to set up BTCPayServer
#as a Tor Hidden service and use a self signed SSL certificate.\n\n
#Choose 'DOMAIN' if you want to use a Domain Name or dynamicDNS
#pointing to your public IP. You will need to forward ports from your
#router to your RaspiBlitz and an email address to be used for
#communication about the SSL certificate (very experimental).\n\n
#For details or troubleshoot check for 'BTCPay'
#in README of https://github.com/rootzoll/raspiblitz"
#OPTIONS=(TOR "Tor access and a self-signed certificate"\
# DOMAIN "(Dynamic) Domain Name (experimental)")
#
#CHOICE=$(dialog --clear \
# --backtitle "$BACKTITLE" \
# --title "$TITLE" \
# --menu "$MENU" \
# $HEIGHT $WIDTH $CHOICE_HEIGHT \
# "${OPTIONS[@]}" \
# 2>&1 >/dev/tty)
#
#dialogcancel=$?
#echo "done dialog"
#clear
#
## check if user canceled dialog
#echo "dialogcancel(${dialogcancel})"
#if [ ${dialogcancel} -eq 1 ]; then
# echo "user cancelled"
# exit 1
#fi
CHOICE="TOR"
HEIGHT=20
WIDTH=73
CHOICE_HEIGHT=2
BACKTITLE="RaspiBlitz"
TITLE="BTCPay Server Install"
MENU="Choose 'TOR' if you want to set up BTCPayServer
as a Tor Hidden service and use a self signed SSL certificate.\n\n
Choose 'DOMAIN' if you want to use a Domain Name or dynamicDNS
pointing to your public IP. You will need to forward ports from your
router to your RaspiBlitz and an email address to be used for
communication about the SSL certificate (very experimental).\n\n
For details or troubleshoot check for 'BTCPay'
in README of https://github.com/rootzoll/raspiblitz"
OPTIONS=(TOR "Tor access and a self-signed certificate"\
DOMAIN "(Dynamic) Domain Name (experimental)")
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
dialogcancel=$?
echo "done dialog"
clear
# check if user canceled dialog
echo "dialogcancel(${dialogcancel})"
if [ ${dialogcancel} -eq 1 ]; then
echo "user cancelled"
exit 1
fi
clear
case $CHOICE in