]> gitweb.fluxo.info Git - puppet-tor.git/commitdiff
Add support for using bridges.
authorintrigeri <intrigeri@boum.org>
Tue, 19 Jun 2012 02:07:31 +0000 (04:07 +0200)
committerintrigeri <intrigeri@boum.org>
Tue, 19 Jun 2012 03:22:47 +0000 (05:22 +0200)
manifests/daemon.pp
templates/torrc.bridge.erb [new file with mode: 0644]
templates/torrc.global.erb

index 0778bce5c553450db225e706165882335ff92840..2484edf350e737f79812f2597f207c2cba242ea9 100644 (file)
@@ -76,7 +76,8 @@ class tor::daemon inherits tor {
 
   # global configurations
   define global_opts( $data_dir = $tor::daemon::data_dir,
-                      $log_rules = [ 'notice file /var/log/tor/notices.log' ] ) {
+                      $log_rules = [ 'notice file /var/log/tor/notices.log' ],
+                      $use_bridges = 0 ) {
 
     concatenated_file_part { '01.global':
       dir     => $tor::daemon::snippet_dir,
@@ -217,5 +218,19 @@ class tor::daemon inherits tor {
     }
   }
 
+  # Bridge definition
+  define bridge( $ip,
+                 $port,
+                 $fingerprint = false,
+                 $ensure = present ) {
+
+    concatenated_file_part { "10.bridge.${name}":
+      dir     => $tor::daemon::snippet_dir,
+      content => template('tor/torrc.bridge.erb'),
+      owner => 'debian-tor', group => 'debian-tor', mode => 0644,
+      ensure  => $ensure,
+    }
+  }
+
 }
 
diff --git a/templates/torrc.bridge.erb b/templates/torrc.bridge.erb
new file mode 100644 (file)
index 0000000..58ef70d
--- /dev/null
@@ -0,0 +1,3 @@
+# Bridge <%= name%>
+Bridge <%= ip%>:<%= port%><%- if fingerprint -%> <%= fingerprint%><%- end -%>
+
index 6ca49de5a45131dafedd06ee25a1129b98262689..84e244dd99b6b245da4daf37f996ebcbaa1e2508 100644 (file)
@@ -11,3 +11,4 @@ Log <%= log_rule %>
 Log notice syslog
 <%- end -%>
 
+UseBridges <%= use_bridges%>