From 26f56433a57aec688a18a964751cfe08b62d9bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Wed, 11 Oct 2017 15:35:21 -0400 Subject: puppet 4 needs arrays in templates to be marked as such --- templates/torrc.directory.erb | 2 +- templates/torrc.dns.erb | 2 +- templates/torrc.exit_policy.erb | 4 ++-- templates/torrc.global.erb | 2 +- templates/torrc.hidden_service.erb | 2 +- templates/torrc.relay.erb | 4 ++-- templates/torrc.socks.erb | 4 ++-- templates/torrc.transparent.erb | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) (limited to 'templates') diff --git a/templates/torrc.directory.erb b/templates/torrc.directory.erb index c7dc4ab..2eaffb7 100644 --- a/templates/torrc.directory.erb +++ b/templates/torrc.directory.erb @@ -2,7 +2,7 @@ <% if @port != '0' -%> DirPort <%= @port %> <% end -%> -<% listen_addresses.each do |listen_address| -%> +<% Array(listen_addresses).each do |listen_address| -%> DirListenAddress <%= listen_address %> <% end -%> <% if @port_front_page != '' -%> diff --git a/templates/torrc.dns.erb b/templates/torrc.dns.erb index 57cf46d..2b9ff8e 100644 --- a/templates/torrc.dns.erb +++ b/templates/torrc.dns.erb @@ -1,5 +1,5 @@ # DNS DNSPort <%= @port %> -<% @listen_addresses.each do |listen_address| -%> +<% Array(@listen_addresses).each do |listen_address| -%> DNSListenAddress <%= listen_address %> <% end -%> diff --git a/templates/torrc.exit_policy.erb b/templates/torrc.exit_policy.erb index a30d43b..5481914 100644 --- a/templates/torrc.exit_policy.erb +++ b/templates/torrc.exit_policy.erb @@ -2,10 +2,10 @@ <% if @reject_private != '1' -%> ExitPolicyRejectPrivate <%= @reject_private %> <% end -%> -<% @accept.each do |policy| -%> +<% Array(@accept).each do |policy| -%> ExitPolicy accept <%= policy %> <% end -%> -<% @reject.each do |policy| -%> +<% Array(@reject).each do |policy| -%> ExitPolicy reject <%= policy %> <% end -%> diff --git a/templates/torrc.global.erb b/templates/torrc.global.erb index a02afc8..c29b76b 100644 --- a/templates/torrc.global.erb +++ b/templates/torrc.global.erb @@ -8,7 +8,7 @@ DataDirectory <%= v %> <% if (rules=scope.lookupvar('tor::daemon::log_rules')).empty? -%> Log notice syslog <% else -%> -<% rules.each do |log_rule| -%> +<% Array(rules).each do |log_rule| -%> Log <%= log_rule %> <% end -%> <% end -%> diff --git a/templates/torrc.hidden_service.erb b/templates/torrc.hidden_service.erb index 5b6afe1..6672937 100644 --- a/templates/torrc.hidden_service.erb +++ b/templates/torrc.hidden_service.erb @@ -6,7 +6,7 @@ SOCKSPort 0 # hidden service <%= @name %> HiddenServiceDir <%= @data_dir %>/<%= @name %> -<% @ports.each do |port| -%> +<% Array(@ports).each do |port| -%> HiddenServicePort <%= port %> <% end -%> diff --git a/templates/torrc.relay.erb b/templates/torrc.relay.erb index a286459..bfe982c 100644 --- a/templates/torrc.relay.erb +++ b/templates/torrc.relay.erb @@ -1,10 +1,10 @@ # relay <% if @port != 0 -%> ORPort <%= @port %> -<% @listen_addresses.each do |listen_address| -%> +<% Array(@listen_addresses).each do |listen_address| -%> ORListenAddress <%= @listen_address %> <% end -%> -<% @real_outbound_bindaddresses.each do |outbound_bindaddress| -%> +<% Array(@real_outbound_bindaddresses).each do |outbound_bindaddress| -%> OutboundBindAddress <%= @outbound_bindaddress %> <% end -%> <% if @nickname != '' -%> diff --git a/templates/torrc.socks.erb b/templates/torrc.socks.erb index 4bc3ddc..09e13ae 100644 --- a/templates/torrc.socks.erb +++ b/templates/torrc.socks.erb @@ -1,9 +1,9 @@ # socks SocksPort <%= @port %> -<% @listen_addresses.each do |listen_address| -%> +<% Array(@listen_addresses).each do |listen_address| -%> SocksListenAddress <%= listen_address %> <% end -%> -<% @policies.each do |policy| -%> +<% Array(@policies).each do |policy| -%> SocksPolicy <%= policy %> <% end -%> diff --git a/templates/torrc.transparent.erb b/templates/torrc.transparent.erb index c683150..19a40e1 100644 --- a/templates/torrc.transparent.erb +++ b/templates/torrc.transparent.erb @@ -1,5 +1,5 @@ # Transparent proxy TransPort <%= @port %> -<% @listen_addresses.each do |listen_address| -%> +<% Array(@listen_addresses).each do |listen_address| -%> TransListenAddress <%= listen_address %> <% end -%> -- cgit v1.2.3 From 682cc7622e033575d6238c5792f135fce05b13c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Wed, 18 Oct 2017 16:09:14 -0400 Subject: add support for Server Transport Plugins --- templates/torrc.transport_plugin.pp | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 templates/torrc.transport_plugin.pp (limited to 'templates') diff --git a/templates/torrc.transport_plugin.pp b/templates/torrc.transport_plugin.pp new file mode 100644 index 0000000..6adf00e --- /dev/null +++ b/templates/torrc.transport_plugin.pp @@ -0,0 +1,10 @@ +# transport plugin +<% if @servertransport_plugin != '' -%> +ServerTransportPlugin <%= @servertransport_plugin %> +<% if @servertransport_listenaddr != '' -%> +ServerTransportListenAddr <%= @servertransport_listenaddr %> +<% if @servertransport_options != '' -%> +ServerTransportOptions <%= @servertransport_options %> +<% if @ext_port != '' -%> +ExtORPort <%= @ext_port %> +<% end -%> -- cgit v1.2.3 From 2785024a9b2bb49847d8cc77e0691b70cbb3fd5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Wed, 25 Oct 2017 15:58:32 -0400 Subject: fix syntax error in transport_plugin template --- templates/torrc.transport_plugin.pp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'templates') diff --git a/templates/torrc.transport_plugin.pp b/templates/torrc.transport_plugin.pp index 6adf00e..d57f0e8 100644 --- a/templates/torrc.transport_plugin.pp +++ b/templates/torrc.transport_plugin.pp @@ -1,10 +1,13 @@ # transport plugin <% if @servertransport_plugin != '' -%> ServerTransportPlugin <%= @servertransport_plugin %> +<% end -%> <% if @servertransport_listenaddr != '' -%> ServerTransportListenAddr <%= @servertransport_listenaddr %> +<% end -%> <% if @servertransport_options != '' -%> ServerTransportOptions <%= @servertransport_options %> +<% end -%> <% if @ext_port != '' -%> ExtORPort <%= @ext_port %> <% end -%> -- cgit v1.2.3 From 1e885d3d5987f4b4cec42e883db5b3f444350c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Wed, 1 Nov 2017 16:31:55 -0400 Subject: templates are ERB files, not PP --- templates/torrc.transport_plugin.erb | 13 +++++++++++++ templates/torrc.transport_plugin.pp | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 templates/torrc.transport_plugin.erb delete mode 100644 templates/torrc.transport_plugin.pp (limited to 'templates') diff --git a/templates/torrc.transport_plugin.erb b/templates/torrc.transport_plugin.erb new file mode 100644 index 0000000..d57f0e8 --- /dev/null +++ b/templates/torrc.transport_plugin.erb @@ -0,0 +1,13 @@ +# transport plugin +<% if @servertransport_plugin != '' -%> +ServerTransportPlugin <%= @servertransport_plugin %> +<% end -%> +<% if @servertransport_listenaddr != '' -%> +ServerTransportListenAddr <%= @servertransport_listenaddr %> +<% end -%> +<% if @servertransport_options != '' -%> +ServerTransportOptions <%= @servertransport_options %> +<% end -%> +<% if @ext_port != '' -%> +ExtORPort <%= @ext_port %> +<% end -%> diff --git a/templates/torrc.transport_plugin.pp b/templates/torrc.transport_plugin.pp deleted file mode 100644 index d57f0e8..0000000 --- a/templates/torrc.transport_plugin.pp +++ /dev/null @@ -1,13 +0,0 @@ -# transport plugin -<% if @servertransport_plugin != '' -%> -ServerTransportPlugin <%= @servertransport_plugin %> -<% end -%> -<% if @servertransport_listenaddr != '' -%> -ServerTransportListenAddr <%= @servertransport_listenaddr %> -<% end -%> -<% if @servertransport_options != '' -%> -ServerTransportOptions <%= @servertransport_options %> -<% end -%> -<% if @ext_port != '' -%> -ExtORPort <%= @ext_port %> -<% end -%> -- cgit v1.2.3 From d5c17a1c842bbec4d0172895d715f5ce48fb7068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Wed, 1 Nov 2017 16:47:02 -0400 Subject: *ListenAddress (OR, DNS, Trans, etc.) are deprecated since 0.2.3.x-alpha --- templates/torrc.directory.erb | 3 --- templates/torrc.dns.erb | 3 --- templates/torrc.relay.erb | 2 -- templates/torrc.socks.erb | 3 --- templates/torrc.transparent.erb | 3 --- 5 files changed, 14 deletions(-) (limited to 'templates') diff --git a/templates/torrc.directory.erb b/templates/torrc.directory.erb index 2eaffb7..d70ab39 100644 --- a/templates/torrc.directory.erb +++ b/templates/torrc.directory.erb @@ -2,9 +2,6 @@ <% if @port != '0' -%> DirPort <%= @port %> <% end -%> -<% Array(listen_addresses).each do |listen_address| -%> -DirListenAddress <%= listen_address %> -<% end -%> <% if @port_front_page != '' -%> DirPortFrontPage <%= @port_front_page %> <%- end -%> diff --git a/templates/torrc.dns.erb b/templates/torrc.dns.erb index 2b9ff8e..a89ba31 100644 --- a/templates/torrc.dns.erb +++ b/templates/torrc.dns.erb @@ -1,5 +1,2 @@ # DNS DNSPort <%= @port %> -<% Array(@listen_addresses).each do |listen_address| -%> -DNSListenAddress <%= listen_address %> -<% end -%> diff --git a/templates/torrc.relay.erb b/templates/torrc.relay.erb index bfe982c..27e35d6 100644 --- a/templates/torrc.relay.erb +++ b/templates/torrc.relay.erb @@ -1,8 +1,6 @@ # relay <% if @port != 0 -%> ORPort <%= @port %> -<% Array(@listen_addresses).each do |listen_address| -%> -ORListenAddress <%= @listen_address %> <% end -%> <% Array(@real_outbound_bindaddresses).each do |outbound_bindaddress| -%> OutboundBindAddress <%= @outbound_bindaddress %> diff --git a/templates/torrc.socks.erb b/templates/torrc.socks.erb index 09e13ae..c6aba60 100644 --- a/templates/torrc.socks.erb +++ b/templates/torrc.socks.erb @@ -1,8 +1,5 @@ # socks SocksPort <%= @port %> -<% Array(@listen_addresses).each do |listen_address| -%> -SocksListenAddress <%= listen_address %> -<% end -%> <% Array(@policies).each do |policy| -%> SocksPolicy <%= policy %> <% end -%> diff --git a/templates/torrc.transparent.erb b/templates/torrc.transparent.erb index 19a40e1..c57d138 100644 --- a/templates/torrc.transparent.erb +++ b/templates/torrc.transparent.erb @@ -1,5 +1,2 @@ # Transparent proxy TransPort <%= @port %> -<% Array(@listen_addresses).each do |listen_address| -%> -TransListenAddress <%= listen_address %> -<% end -%> -- cgit v1.2.3 From 76ab876ae0e660e1f68e2d8432b865f8e7915da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Wed, 1 Nov 2017 16:53:28 -0400 Subject: remove missing end in modified template --- templates/torrc.relay.erb | 1 - 1 file changed, 1 deletion(-) (limited to 'templates') diff --git a/templates/torrc.relay.erb b/templates/torrc.relay.erb index 27e35d6..7735b47 100644 --- a/templates/torrc.relay.erb +++ b/templates/torrc.relay.erb @@ -1,7 +1,6 @@ # relay <% if @port != 0 -%> ORPort <%= @port %> -<% end -%> <% Array(@real_outbound_bindaddresses).each do |outbound_bindaddress| -%> OutboundBindAddress <%= @outbound_bindaddress %> <% end -%> -- cgit v1.2.3 From 01cfa7e013179f17d981ef8ca9822a8c3bd727ff Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 7 Oct 2017 13:39:12 -0400 Subject: add v3 hidden service support --- templates/torrc.hidden_service.erb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'templates') diff --git a/templates/torrc.hidden_service.erb b/templates/torrc.hidden_service.erb index 6672937..c7dbe9e 100644 --- a/templates/torrc.hidden_service.erb +++ b/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 +<% Array(@ports).each do |port| -%> +HiddenServicePort <%= port %> +<% end -%> +<% end -%> -- cgit v1.2.3