From 414e36cf11364a9e581eb260b3267078b6cdda44 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 7 Oct 2017 13:50:55 -0400 Subject: feat: add v3 tor hidden service support Resolves: #8879 --- provider_base/services/tor_hidden_service.json | 3 ++- puppet/modules/site_static/manifests/hidden_service.pp | 5 +++-- puppet/modules/site_static/manifests/init.pp | 5 ++--- puppet/modules/site_webapp/manifests/hidden_service.pp | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/provider_base/services/tor_hidden_service.json b/provider_base/services/tor_hidden_service.json index 137932fa..d7f3ec27 100644 --- a/provider_base/services/tor_hidden_service.json +++ b/provider_base/services/tor_hidden_service.json @@ -5,7 +5,8 @@ "public_key": "= tor_public_key_path(:node_tor_pub_key, tor.hidden_service.key_type)", "private_key": "= tor_private_key_path(:node_tor_priv_key, tor.hidden_service.key_type)", "address": "=> onion_address(:node_tor_pub_key)", - "single_hop": false + "single_hop": false, + "v3": false } } } diff --git a/puppet/modules/site_static/manifests/hidden_service.pp b/puppet/modules/site_static/manifests/hidden_service.pp index f23727f7..c5d12c34 100644 --- a/puppet/modules/site_static/manifests/hidden_service.pp +++ b/puppet/modules/site_static/manifests/hidden_service.pp @@ -1,11 +1,12 @@ # create hidden service for static sites -class site_static::hidden_service ( $single_hop = false ) { +class site_static::hidden_service ( $single_hop = false, $v3 = false ) { Class['site_tor::hidden_service'] -> Class['site_static::hidden_service'] include site_tor::hidden_service tor::daemon::hidden_service { 'static': ports => [ '80 127.0.0.1:80'], - single_hop => $single_hop + single_hop => $single_hop, + v3 => $v3 } file { diff --git a/puppet/modules/site_static/manifests/init.pp b/puppet/modules/site_static/manifests/init.pp index 40c6a28b..fdc5782f 100644 --- a/puppet/modules/site_static/manifests/init.pp +++ b/puppet/modules/site_static/manifests/init.pp @@ -60,10 +60,8 @@ class site_static { include site_config::ruby::dev if (member($formats, 'rack')) { - include site_apt::preferences::passenger class { 'passenger': manage_munin => false, - require => Class['site_apt::preferences::passenger'] } } @@ -81,7 +79,8 @@ class site_static { $hidden_service = $tor['hidden_service'] $onion_domain = "${hidden_service['address']}.onion" class { 'site_static::hidden_service': - single_hop => $hidden_service['single_hop'] + single_hop => $hidden_service['single_hop'], + v3 => $hidden_service['v3'] } # Currently, we only support a single hidden service address per server. diff --git a/puppet/modules/site_webapp/manifests/hidden_service.pp b/puppet/modules/site_webapp/manifests/hidden_service.pp index 1f87da6b..290f9665 100644 --- a/puppet/modules/site_webapp/manifests/hidden_service.pp +++ b/puppet/modules/site_webapp/manifests/hidden_service.pp @@ -14,7 +14,8 @@ class site_webapp::hidden_service { tor::daemon::hidden_service { 'webapp': ports => [ '80 127.0.0.1:80'], - single_hop => $hidden_service['single_hop'] + single_hop => $hidden_service['single_hop'], + v3 => $hidden_service['v3'] } file { -- cgit v1.2.3 From 3478b7b46087971f4396de3ea370741694963ca9 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 7 Oct 2017 14:04:02 -0400 Subject: git subrepo pull puppet/modules/tor subrepo: subdir: "puppet/modules/tor" merged: "4380e2ea" upstream: origin: "https://leap.se/git/puppet_tor" branch: "master" commit: "4380e2ea" git-subrepo: version: "0.3.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a7ee886" --- puppet/modules/tor/.gitrepo | 6 +++--- puppet/modules/tor/manifests/daemon/hidden_service.pp | 1 + puppet/modules/tor/templates/torrc.directory.erb | 2 +- puppet/modules/tor/templates/torrc.hidden_service.erb | 8 ++++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/puppet/modules/tor/.gitrepo b/puppet/modules/tor/.gitrepo index 5e3e3c1f..ea3c1495 100644 --- a/puppet/modules/tor/.gitrepo +++ b/puppet/modules/tor/.gitrepo @@ -6,6 +6,6 @@ [subrepo] remote = https://leap.se/git/puppet_tor branch = master - commit = 5ef29012dccc90e68afc215be9521629a0903bc6 - parent = 747d3e9b55c8b7b7d98a63474b6de82d7114c389 - cmdver = 0.4.0 + commit = 4380e2eabd94d8f0df7f63c642dd46ec4783ef07 + parent = be4182d7227d57b4da20d088b4750c756f759888 + cmdver = 0.3.1 diff --git a/puppet/modules/tor/manifests/daemon/hidden_service.pp b/puppet/modules/tor/manifests/daemon/hidden_service.pp index 07121bd6..d91bdc89 100644 --- a/puppet/modules/tor/manifests/daemon/hidden_service.pp +++ b/puppet/modules/tor/manifests/daemon/hidden_service.pp @@ -2,6 +2,7 @@ define tor::daemon::hidden_service( $ports = [], $single_hop = false, + $v3 = false, $data_dir = $tor::daemon::data_dir, $ensure = present ) { diff --git a/puppet/modules/tor/templates/torrc.directory.erb b/puppet/modules/tor/templates/torrc.directory.erb index c7dc4ab5..23ed3392 100644 --- a/puppet/modules/tor/templates/torrc.directory.erb +++ b/puppet/modules/tor/templates/torrc.directory.erb @@ -2,7 +2,7 @@ <% if @port != '0' -%> DirPort <%= @port %> <% end -%> -<% listen_addresses.each do |listen_address| -%> +<% @listen_addresses.each do |listen_address| -%> DirListenAddress <%= listen_address %> <% end -%> <% if @port_front_page != '' -%> diff --git a/puppet/modules/tor/templates/torrc.hidden_service.erb b/puppet/modules/tor/templates/torrc.hidden_service.erb index 5b6afe1c..8a691c6b 100644 --- a/puppet/modules/tor/templates/torrc.hidden_service.erb +++ b/puppet/modules/tor/templates/torrc.hidden_service.erb @@ -10,3 +10,11 @@ HiddenServiceDir <%= @data_dir %>/<%= @name %> HiddenServicePort <%= port %> <% end -%> +<% if @v3 != false %> +# hidden service v3 static +HiddenServiceDir <%= @data_dir %>/<%= @name -%>3 +HiddenServiceVersion 3 +<% @ports.each do |port| -%> +HiddenServicePort <%= port %> +<% end -%> +<% end -%> -- cgit v1.2.3