From 990edc125ccbf09d2829f793616145b8d3ad651b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 20 Apr 2018 11:08:36 +0100 Subject: [PATCH] Move tor services to new file --- src/freedombone-app-gogs | 4 ++-- src/freedombone-app-keyserver | 4 ++-- src/freedombone-app-xmpp | 6 +++--- src/freedombone-base-email | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/freedombone-app-gogs b/src/freedombone-app-gogs index b2a5ce1c..d54f0452 100755 --- a/src/freedombone-app-gogs +++ b/src/freedombone-app-gogs @@ -655,11 +655,11 @@ function install_gogs { echo $'No Tor installation found. Gogs onion site cannot be configured.' exit 877367 fi - if ! grep -q "hidden_service_gogs" /etc/tor/torrc; then + if ! grep -q "hidden_service_gogs" $ONION_SERVICES_FILE; then { echo 'HiddenServiceDir /var/lib/tor/hidden_service_gogs/'; echo 'HiddenServiceVersion 3'; echo "HiddenServicePort 80 127.0.0.1:${GIT_ONION_PORT}"; - echo "HiddenServicePort 9418 127.0.0.1:9418"; } >> /etc/tor/torrc + echo "HiddenServicePort 9418 127.0.0.1:9418"; } >> $ONION_SERVICES_FILE echo $'Added onion site for Gogs' fi diff --git a/src/freedombone-app-keyserver b/src/freedombone-app-keyserver index 03614d70..5e65792d 100755 --- a/src/freedombone-app-keyserver +++ b/src/freedombone-app-keyserver @@ -656,12 +656,12 @@ function install_keyserver { chown debian-sks: $sksconf_file - if ! grep -q "hidden_service_sks" /etc/tor/torrc; then + if ! grep -q "hidden_service_sks" $ONION_SERVICES_FILE; then { echo 'HiddenServiceDir /var/lib/tor/hidden_service_sks/'; echo 'HiddenServiceVersion 3'; echo "HiddenServicePort 11370 127.0.0.1:11370"; echo "HiddenServicePort 11373 127.0.0.1:11371"; - echo "HiddenServicePort 11372 127.0.0.1:11372"; } >> /etc/tor/torrc + echo "HiddenServicePort 11372 127.0.0.1:11372"; } >> $ONION_SERVICES_FILE echo $'Added onion site for sks' fi diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index decb0f01..f3952b13 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -608,7 +608,7 @@ function remove_xmpp { function_check remove_onion_service remove_onion_service xmpp 5222 5223 5269 - sed -i '/HiddenServiceVersion 2/d' /etc/tor/torrc + sed -i '/HiddenServiceVersion 2/d' $ONION_SERVICES_FILE apt-mark -q unhold prosody apt-get -yq remove --purge prosody @@ -1079,11 +1079,11 @@ function install_xmpp { echo $'No Tor installation found. xmpp onion site cannot be configured.' exit 877367 fi - if ! grep -q "hidden_service_xmpp" /etc/tor/torrc; then + if ! grep -q "hidden_service_xmpp" $ONION_SERVICES_FILE; then { echo 'HiddenServiceDir /var/lib/tor/hidden_service_xmpp/'; echo 'HiddenServiceVersion 2'; echo "HiddenServicePort 5222 127.0.0.1:5222"; - echo "HiddenServicePort 5269 127.0.0.1:5269"; } >> /etc/tor/torrc + echo "HiddenServicePort 5269 127.0.0.1:5269"; } >> $ONION_SERVICES_FILE echo $'Added onion site for xmpp chat' fi diff --git a/src/freedombone-base-email b/src/freedombone-base-email index 96c6a28d..0a6199ac 100755 --- a/src/freedombone-base-email +++ b/src/freedombone-base-email @@ -224,12 +224,12 @@ function email_create_template { function create_email_onion_address { email_hostname='/var/lib/tor/hidden_service_email/hostname' - if ! grep -q "hidden_service_email" /etc/tor/torrc; then + if ! grep -q "hidden_service_email" $ONION_SERVICES_FILE; then { echo 'HiddenServiceDir /var/lib/tor/hidden_service_email/'; echo 'HiddenServiceVersion 3'; echo 'HiddenServicePort 25 127.0.0.1:25'; echo 'HiddenServicePort 587 127.0.0.1:587'; - echo 'HiddenServicePort 465 127.0.0.1:465'; } >> /etc/tor/torrc + echo 'HiddenServicePort 465 127.0.0.1:465'; } >> $ONION_SERVICES_FILE function_check onion_update onion_update