From b9afd19f1dd975e20cf139fb23aa98fc046acecc Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Thu, 13 Jun 2019 02:27:19 +0200 Subject: [PATCH] #592 TOR on Setup --- home.admin/20setupDialog.sh | 14 ++++++++++++++ home.admin/60finishHDD.sh | 8 ++++++++ home.admin/70initLND.sh | 15 +++++++++++++-- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/home.admin/20setupDialog.sh b/home.admin/20setupDialog.sh index ebfb11816..36be06a4d 100755 --- a/home.admin/20setupDialog.sh +++ b/home.admin/20setupDialog.sh @@ -64,4 +64,18 @@ sudo /home/admin/config.scripts/blitz.setpassword.sh b # success info dialog dialog --backtitle "RaspiBlitz" --msgbox "OK - RPC password changed \n\nNow starting the Setup of your RaspiBlitz." 7 52 + +################### +# TOR BY DEFAULT +# 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 it harder to connect with other non-TOR nodes and remote mobile apps. + " 14 75 +if [ $? -eq 1 ]; then + echo "runBehindTor=on" >> /home/admin/raspiblitz.info +fi + clear \ No newline at end of file diff --git a/home.admin/60finishHDD.sh b/home.admin/60finishHDD.sh index a168bb946..6b9eed2c0 100755 --- a/home.admin/60finishHDD.sh +++ b/home.admin/60finishHDD.sh @@ -35,6 +35,14 @@ if [ ${mountOK} -eq 1 ]; then sudo chown -R bitcoin:bitcoin /home/bitcoin/.lnd echo "OK - ${network} setup ready" + ###### ACTIVATE TOR IF SET DURING SETUP + if [ "${runBehindTor}" = "on" ]; then + echo "TOR was selected ..." + sudo /home/admin/config.scripts/internet.tor.sh on + else + echo "TOR was not selected" + fi + ###### START NETWORK SERVICE echo "" echo "*** Start ${network} ***" diff --git a/home.admin/70initLND.sh b/home.admin/70initLND.sh index 3f8e4ac74..cee15dfdb 100755 --- a/home.admin/70initLND.sh +++ b/home.admin/70initLND.sh @@ -90,17 +90,28 @@ else fi echo "" -###### Start LND +###### Init LND service & start -echo "*** Starting LND ***" +echo "*** Init LND Service & Start ***" lndRunning=$(sudo systemctl status lnd.service 2>/dev/null | grep -c running) if [ ${lndRunning} -eq 0 ]; then + sudo systemctl stop lnd 2>/dev/null sudo systemctl disable lnd 2>/dev/null + sed -i "5s/.*/Wants=${network}d.service/" /home/admin/assets/lnd.service sed -i "6s/.*/After=${network}d.service/" /home/admin/assets/lnd.service sudo cp /home/admin/assets/lnd.service /etc/systemd/system/lnd.service sudo chmod +x /etc/systemd/system/lnd.service + + ###### ACTIVATE TOR IF SET DURING SETUP + if [ "${runBehindTor}" = "on" ]; then + echo "TOR was selected ..." + sudo /home/admin/config.scripts/internet.tor.sh lndconf + else + echo "TOR was not selected" + fi + sudo systemctl enable lnd sudo systemctl start lnd echo ""