Sfoglia il codice sorgente

Option to force usage of v2 onion address

Hopefully this won't be needed for long
Bob Mottram 7 anni fa
parent
commit
3e03e30fd2
2 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 1
    0
      src/freedombone-app-rss
  2. 7
    1
      src/freedombone-utils-onion

+ 1
- 0
src/freedombone-app-rss Vedi File

@@ -392,6 +392,7 @@ function install_rss_main {
392 392
 
393 393
     sleep 2
394 394
 
395
+    USE_V2_ONION_ADDRESS=1
395 396
     RSS_MOBILE_READER_ONION_HOSTNAME=$(add_onion_service mobilerss 80 ${RSS_MOBILE_READER_ONION_PORT})
396 397
 
397 398
     echo 'server {' > /etc/nginx/sites-available/$RSS_READER_DOMAIN_NAME

+ 7
- 1
src/freedombone-utils-onion Vedi File

@@ -31,6 +31,7 @@
31 31
 # The maximum amount of traffic per day in gigabytes
32 32
 TOR_MAX_TRAFFIC_PER_MONTH_GB=10
33 33
 
34
+USE_V2_ONION_ADDRESS=
34 35
 HIDDEN_SERVICE_PATH='/var/lib/tor/hidden_service_'
35 36
 
36 37
 function add_email_hostname {
@@ -124,7 +125,12 @@ function add_onion_service {
124 125
     fi
125 126
     if ! grep -q "hidden_service_${onion_service_name}" /etc/tor/torrc; then
126 127
         echo "HiddenServiceDir ${HIDDEN_SERVICE_PATH}${onion_service_name}/" >> /etc/tor/torrc
127
-        echo 'HiddenServiceVersion 3' >> /etc/tor/torrc
128
+        if [ ! $USE_V2_ONION_ADDRESS ]; then
129
+            echo 'HiddenServiceVersion 3' >> /etc/tor/torrc
130
+        else
131
+            echo 'HiddenServiceVersion 2' >> /etc/tor/torrc
132
+            USE_V2_ONION_ADDRESS=
133
+        fi
128 134
         echo "HiddenServicePort ${onion_service_port_from} 127.0.0.1:${onion_service_port_to}" >> /etc/tor/torrc
129 135
         if [ ${#onion_stealth_name} -gt 0 ]; then
130 136
             echo "HiddenServiceAuthorizeClient stealth ${onion_stealth_name}" >> /etc/tor/torrc