From db595b0d06a111743bb4e8c68c19c6e412bee615 Mon Sep 17 00:00:00 2001 From: openoms Date: Wed, 14 Oct 2020 01:09:58 +0100 Subject: [PATCH] build: Tor config fixes --- build_joininbox.sh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/build_joininbox.sh b/build_joininbox.sh index 7052545..8ab8ab0 100644 --- a/build_joininbox.sh +++ b/build_joininbox.sh @@ -361,15 +361,24 @@ fi echo "# install torsocks and nyx" apt install -y torsocks tor-arm +# Tor config +# torrc if ! grep -Eq "^DataDirectory" /etc/tor/torrc; then - echo " -DataDirectory /var/lib/tor -ControlPort 9051 -CookieAuthentication 1" | sudo tee -a /etc/tor/torrc + echo "DataDirectory /var/lib/tor" | sudo tee -a /etc/tor/torrc fi - echo " -AllowOutboundLocalhost 1" | sudo tee -a /etc/tor/torsocks.conf - +if ! grep -Eq "^ControlPort 9051" /etc/tor/torrc; then + echo "ControlPort 9051" | sudo tee -a /etc/tor/torrc +fi +if ! grep -Eq "^CookieAuthentication 1" /etc/tor/torrc; then + echo "CookieAuthentication 1" | sudo tee -a /etc/tor/torrc +fi +sudo sed -i "s:^CookieAuthFile*:#CookieAuthFile:g" /etc/tor/torrc +# torsocks.conf +if ! grep -Eq "^AllowOutboundLocalhost 1" /etc/tor/torsocks.conf; then + echo "AllowOutboundLocalhost 1" | sudo tee -a /etc/tor/torsocks.conf +fi +# add the joinmarket user to the tor group +usermod -a -G debian-tor joinmarket # setting value in joinin config sed -i "s/^runBehindTor=.*/runBehindTor=on/g" /home/joinmarket/joinin.conf