[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [chutney/master] Always specify the onion service version
commit a881ebb0d6955e1a7f92e2910b0866a569b9ea44
Author: teor <teor@xxxxxxxxxxxxxx>
Date: Sat Oct 6 16:38:16 2018 -0500
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.
---
torrc_templates/hs-common.i | 8 ++++++++
torrc_templates/hs-v2.tmpl | 4 ++++
torrc_templates/hs-v3.tmpl | 4 +++-
torrc_templates/hs.tmpl | 14 +++-----------
torrc_templates/single-onion-common.i | 21 +++++++++++++++++++++
torrc_templates/single-onion-v2.tmpl | 2 ++
torrc_templates/single-onion-v3.tmpl | 2 +-
torrc_templates/single-onion.tmpl | 24 +++---------------------
8 files changed, 45 insertions(+), 34 deletions(-)
diff --git a/torrc_templates/hs-common.i b/torrc_templates/hs-common.i
new file mode 100644
index 0000000..63502dc
--- /dev/null
+++ b/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
diff --git a/torrc_templates/hs-v2.tmpl b/torrc_templates/hs-v2.tmpl
new file mode 100644
index 0000000..62c7173
--- /dev/null
+++ b/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
diff --git a/torrc_templates/hs-v3.tmpl b/torrc_templates/hs-v3.tmpl
index 27f031f..23db75f 100644
--- a/torrc_templates/hs-v3.tmpl
+++ b/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
diff --git a/torrc_templates/hs.tmpl b/torrc_templates/hs.tmpl
index c1cafd8..253d0bb 100644
--- a/torrc_templates/hs.tmpl
+++ b/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}
diff --git a/torrc_templates/single-onion-common.i b/torrc_templates/single-onion-common.i
new file mode 100644
index 0000000..eec4986
--- /dev/null
+++ b/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.
diff --git a/torrc_templates/single-onion-v2.tmpl b/torrc_templates/single-onion-v2.tmpl
new file mode 100644
index 0000000..fb0b64e
--- /dev/null
+++ b/torrc_templates/single-onion-v2.tmpl
@@ -0,0 +1,2 @@
+${include:single-onion-common.i}
+HiddenServiceVersion 2
diff --git a/torrc_templates/single-onion-v3.tmpl b/torrc_templates/single-onion-v3.tmpl
index 403e8fa..84a55d6 100644
--- a/torrc_templates/single-onion-v3.tmpl
+++ b/torrc_templates/single-onion-v3.tmpl
@@ -1,2 +1,2 @@
-${include:single-onion.tmpl}
+${include:single-onion-common.i}
HiddenServiceVersion 3
diff --git a/torrc_templates/single-onion.tmpl b/torrc_templates/single-onion.tmpl
index 2b266c8..7fe7eb8 100644
--- a/torrc_templates/single-onion.tmpl
+++ b/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}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits