Browse Source

Always specify the onion service version

Tor's #27215 changed the default onion service version to 3.
But chutney assumed the default was 2.

Closes #27965.
teor 5 years ago
parent
commit
a881ebb0d6

+ 8 - 0
torrc_templates/hs-common.i

@@ -0,0 +1,8 @@
+${include:common.i}
+SocksPort 0
+Address $ip
+
+HiddenServiceDir ${dir}/hidden_service
+
+# Redirect requests to the port used by chutney verify
+HiddenServicePort 5858 127.0.0.1:4747

+ 4 - 0
torrc_templates/hs-v2.tmpl

@@ -0,0 +1,4 @@
+${include:hs-common.i}
+
+# Tor 0.3.4 and earlier default to 2, but 0.3.5 and later default to 3
+HiddenServiceVersion 2

+ 3 - 1
torrc_templates/hs-v3.tmpl

@@ -1,2 +1,4 @@
-${include:hs.tmpl}
+${include:hs-common.i}
+
+# Tor 0.3.4 and earlier default to 2, but 0.3.5 and later default to 3
 HiddenServiceVersion 3

+ 3 - 11
torrc_templates/hs.tmpl

@@ -1,11 +1,3 @@
-${include:common.i}
-SocksPort 0
-Address $ip
-
-HiddenServiceDir ${dir}/hidden_service
-# SSH is usually a popular service that is running. This is really just to make
-# a quick way to test the HS with torsocks and have an app at the other end.
-#HiddenServicePort 6000 127.0.0.1:22
-
-# Redirect requests to the port used by chutney verify
-HiddenServicePort 5858 127.0.0.1:4747
+# This file is a backwards-compatibility redirect
+# Older chutney networks use hs.tmpl for v2 onion services
+${include:hs-v2.tmpl}

+ 21 - 0
torrc_templates/single-onion-common.i

@@ -0,0 +1,21 @@
+${include:hs-common.i}
+
+# Make this hidden service instance a Single Onion Service
+HiddenServiceSingleHopMode 1
+HiddenServiceNonAnonymousMode 1
+
+# Log only the messages we need to confirm that the Single Onion server is
+# making one-hop circuits, and to see any errors or major issues
+# To confirm one-hop intro and rendezvous circuits, look for
+# rend_service_intro_has_opened and rend_service_rendezvous_has_opened, and
+# check the length of the circuit in the next line.
+Log notice [rend,bug]info file ${dir}/single-onion.log
+
+# Disable preemtive circuits, a Single Onion doesn't need them (except for
+# descriptor posting).
+# This stalls at bootstrap due to #17359.
+#__DisablePredictedCircuits 1
+# A workaround is to set:
+LongLivedPorts
+# This disables everything except hidden service preemptive 3-hop circuits.
+# See #17360.

+ 2 - 0
torrc_templates/single-onion-v2.tmpl

@@ -0,0 +1,2 @@
+${include:single-onion-common.i}
+HiddenServiceVersion 2

+ 1 - 1
torrc_templates/single-onion-v3.tmpl

@@ -1,2 +1,2 @@
-${include:single-onion.tmpl}
+${include:single-onion-common.i}
 HiddenServiceVersion 3

+ 3 - 21
torrc_templates/single-onion.tmpl

@@ -1,21 +1,3 @@
-${include:hs.tmpl}
-
-# Make every hidden service instance a Single Onion Service
-HiddenServiceSingleHopMode 1
-HiddenServiceNonAnonymousMode 1
-
-# Log only the messages we need to confirm that the Single Onion server is
-# making one-hop circuits, and to see any errors or major issues
-# To confirm one-hop intro and rendezvous circuits, look for
-# rend_service_intro_has_opened and rend_service_rendezvous_has_opened, and
-# check the length of the circuit in the next line.
-Log notice [rend,bug]info file ${dir}/single-onion.log
-
-# Disable preemtive circuits, a Single Onion doesn't need them (except for
-# descriptor posting).
-# This stalls at bootstrap due to #17359.
-#__DisablePredictedCircuits 1
-# A workaround is to set:
-LongLivedPorts
-# This disables everything except hidden service preemptive 3-hop circuits.
-# See #17360.
+# This file is a backwards-compatibility redirect
+# Older chutney networks use single-onion.tmpl for v2 single onion services
+${include:single-onion-v2.tmpl}