From 3e03e30fd2cd61a232ca002f6326152762fce521 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 23 Feb 2018 11:46:13 +0000 Subject: [PATCH] Option to force usage of v2 onion address Hopefully this won't be needed for long --- src/freedombone-app-rss | 1 + src/freedombone-utils-onion | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/freedombone-app-rss b/src/freedombone-app-rss index 4e31eb75..7f7f142a 100755 --- a/src/freedombone-app-rss +++ b/src/freedombone-app-rss @@ -392,6 +392,7 @@ function install_rss_main { sleep 2 + USE_V2_ONION_ADDRESS=1 RSS_MOBILE_READER_ONION_HOSTNAME=$(add_onion_service mobilerss 80 ${RSS_MOBILE_READER_ONION_PORT}) echo 'server {' > /etc/nginx/sites-available/$RSS_READER_DOMAIN_NAME diff --git a/src/freedombone-utils-onion b/src/freedombone-utils-onion index f2178b96..bc8081e7 100755 --- a/src/freedombone-utils-onion +++ b/src/freedombone-utils-onion @@ -31,6 +31,7 @@ # The maximum amount of traffic per day in gigabytes TOR_MAX_TRAFFIC_PER_MONTH_GB=10 +USE_V2_ONION_ADDRESS= HIDDEN_SERVICE_PATH='/var/lib/tor/hidden_service_' function add_email_hostname { @@ -124,7 +125,12 @@ function add_onion_service { fi if ! grep -q "hidden_service_${onion_service_name}" /etc/tor/torrc; then echo "HiddenServiceDir ${HIDDEN_SERVICE_PATH}${onion_service_name}/" >> /etc/tor/torrc - echo 'HiddenServiceVersion 3' >> /etc/tor/torrc + if [ ! $USE_V2_ONION_ADDRESS ]; then + echo 'HiddenServiceVersion 3' >> /etc/tor/torrc + else + echo 'HiddenServiceVersion 2' >> /etc/tor/torrc + USE_V2_ONION_ADDRESS= + fi echo "HiddenServicePort ${onion_service_port_from} 127.0.0.1:${onion_service_port_to}" >> /etc/tor/torrc if [ ${#onion_stealth_name} -gt 0 ]; then echo "HiddenServiceAuthorizeClient stealth ${onion_stealth_name}" >> /etc/tor/torrc