Browse Source

#592 user choice to IBD behind TOR or IP

v1.3
Christian Rotzoll 6 years ago
parent
commit
0ecf144a18
  1. 7
      home.admin/20setupDialog.sh
  2. 39
      home.admin/50syncHDD.sh
  3. 15
      home.admin/60finishHDD.sh
  4. 2
      home.admin/70initLND.sh

7
home.admin/20setupDialog.sh

@ -70,10 +70,9 @@ dialog --backtitle "RaspiBlitz" --msgbox "OK - RPC password changed \n\nNow star
# https://github.com/rootzoll/raspiblitz/issues/592
###################
whiptail --title ' Privacy Level - How do you want to run your node? ' --yes-button='Public IP' --no-button='TOR NETWORK' --yesno "
Running your node with your Public IP is the default but might reveal your personal identity and location.\n
You can better protect your privacy with running your node as a Hidden Service within the TOR network, but that makes syncing slower, makes it harder to connect with other non-TOR nodes and remote mobile apps.
" 14 75
whiptail --title ' Privacy Level - How do you want to run your node? ' --yes-button='Public IP' --no-button='TOR NETWORK' --yesno "Running your Lightning node with your Public IP is common and faster, but might reveal your personal identity and location.\n
You can better protect your privacy with running your lightning node as a TOR Hidden Service from the start, but it can make it harder to connect with other non-TOR nodes and remote mobile apps later on.
" 12 75
if [ $? -eq 1 ]; then
echo "runBehindTor=on" >> /home/admin/raspiblitz.info
fi

39
home.admin/50syncHDD.sh

@ -17,28 +17,31 @@ if [ "$network" = "bitcoin" ]; then
# raspberryPi 3 and lower
msg=" This old RaspberryPi has very limited CPU power.\n"
msg="$msg To sync & validate the complete blockchain\n"
msg="$msg can take multiple days - even weeksn"
msg="$msg can take multiple days - even weeks\n"
msg="$msg Its recommended to use another option.\n"
msg="$msg \n"
msg="$msg So do you really want start syncing now?"
else
# raspberryPi 4 and up
msg=" Your RaspiBlitz will sync and validate\n"
msg="$msg the complete blockchain by itself.\n"
msg="$msg This can take multiple days, but\n"
msg="$msg its the best to do it this way.\n"
msg="$msg \n"
msg="$msg So do you want start syncing now?"
dialog --title " WARNING " --yesno "${msg}" 11 57
response=$?
case $response in
0) echo "--> OK";;
1) exit 1;;
255) exit 1;;
esac
fi
dialog --title " WARNING " --yesno "${msg}" 11 57
response=$?
case $response in
0) echo "--> OK";;
1) exit 1;;
255) exit 1;;
esac
# ask if really sync behind TOR
if [ "${runBehindTor}" = "on" ]; then
whiptail --title ' Sync Blockchain from behind TOR? ' --yes-button='Public-Sync' --no-button='TOR-Sync' --yesno "You decided to run your node behind TOR and validate the blockchain with your RaspiBlitz - thats good. But downloading the complete blockchain thru TOR can add some extra time (maybe a day) to the process and adds a heavy load on the TOR network.\n
Your RaspiBlitz can just run the initial blockchain download with your public IP (Public-Sync) but keep your Lighting node safe behind TOR.
It would speed up the self-validation while not revealing your Lightning node identity. But for most privacy choose (TOR-Sync).
" 15 76
if [ $? -eq 0 ]; then
# set flag to not run bitcoin behind TOR during IDB
echo "ibdBehindTor=off" >> /home/admin/raspiblitz.info
fi
fi
clear
if [ ${raspberryPi} -lt 4 ]; then
echo "********************************"
@ -71,7 +74,7 @@ elif [ ${kbSizeRAM} -gt 1500000 ]; then
# RP3/4 1GB
else
echo "Detected RAM <=1GB --> optimizing ${network}.conf"
sudo sed -i "s/^dbcache=.*/dbcache=768/g" /home/admin/assets/${network}.conf
sudo sed -i "s/^dbcache=.*/dbcache=512/g" /home/admin/assets/${network}.conf
fi
echo "*** Activating Blockain Sync ***"

15
home.admin/60finishHDD.sh

@ -37,10 +37,21 @@ if [ ${mountOK} -eq 1 ]; then
###### ACTIVATE TOR IF SET DURING SETUP
if [ "${runBehindTor}" = "on" ]; then
echo "TOR was selected ..."
echo "runBehindTor --> ON"
sudo /home/admin/config.scripts/internet.tor.sh on
# but if IBD is allowed to be public switch off TOR just fro bitcoin
# until IBD is done. background service will after that switch TOR on
if [ "${ibdBehindTor}" = "off" ]; then
echo "ibdBehindTor --> OFF"
sudo /home/admin/config.scripts/internet.tor.sh btcconf-off
else
echo "ibdBehindTor --> ON"
fi
else
echo "TOR was not selected"
echo "runBehindTor --> OFF"
fi
###### START NETWORK SERVICE

2
home.admin/70initLND.sh

@ -109,7 +109,7 @@ if [ ${lndRunning} -eq 0 ]; then
###### ACTIVATE TOR IF SET DURING SETUP
if [ "${runBehindTor}" = "on" ]; then
echo "TOR was selected ..."
echo "TOR was selected"
sudo /home/admin/config.scripts/internet.tor.sh lndconf-on
else
echo "TOR was not selected"

Loading…
Cancel
Save