diff options
author | Louis-Philippe VĂ©ronneau <pollito@riseup.net> | 2017-10-18 16:09:14 -0400 |
---|---|---|
committer | Louis-Philippe VĂ©ronneau <pollito@riseup.net> | 2017-10-18 16:09:14 -0400 |
commit | 682cc7622e033575d6238c5792f135fce05b13c3 (patch) | |
tree | 575f2126dea7243b62130e8b6500c9ad7bb5cb1e | |
parent | 5ef29012dccc90e68afc215be9521629a0903bc6 (diff) |
add support for Server Transport Plugins
-rw-r--r-- | manifests/daemon/transport_plugin.pp | 17 | ||||
-rw-r--r-- | templates/torrc.transport_plugin.pp | 10 |
2 files changed, 27 insertions, 0 deletions
diff --git a/manifests/daemon/transport_plugin.pp b/manifests/daemon/transport_plugin.pp new file mode 100644 index 0000000..f0ba41f --- /dev/null +++ b/manifests/daemon/transport_plugin.pp @@ -0,0 +1,17 @@ +# transport plugin +define tor::daemon::transport_plugin( + $servertransport_plugin = '', + $servertransport_listenaddr = '', + $servertransport_options = '', + $ext_port = '' ) { + + if $port == $ext_port { + fail('ORPort and ExtORPort values cannot be the same') + } + + concat::fragment { "11.transport_plugin": + content => template('tor/torrc.transport_plugin.erb'), + order => 11, + target => $tor::daemon::config_file, + } +} 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 -%> |