]> gitweb.fluxo.info Git - puppet-mail.git/commitdiff
Adding mail::hidden for tor hidden services support
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 22 Jun 2012 21:10:28 +0000 (18:10 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 22 Jun 2012 21:10:28 +0000 (18:10 -0300)
manifests/hidden.pp [new file with mode: 0644]
manifests/init.pp

diff --git a/manifests/hidden.pp b/manifests/hidden.pp
new file mode 100644 (file)
index 0000000..bdddcf2
--- /dev/null
@@ -0,0 +1,22 @@
+class mail::hidden {
+  # Make sure that the tor daemon is included
+  include tor::daemon
+
+  # It's important to use a subdir from the tor datadir
+  # to ease backup/restore procedures as we don't mix
+  # hidden service data with other tor files.
+  if !defined(File["$tor::daemon::data_dir/hidden"]) {
+    file { "$tor::daemon::data_dir/hidden":
+      ensure => directory, 
+      owner  => 'debian-tor',
+      group  => 'debian-tor',
+      mode   => 0700,
+    }
+  }
+
+  tor::daemon::hidden_service { 'mail':
+    ports    => [ '80 127.0.0.1:80', '25 127.0.0.1:25', '993 127.0.0.1:993' ],
+    data_dir => "$tor::daemon::data_dir/hidden",
+    require  => File["$tor::daemon::data_dir/hidden"],
+  }
+}
index fc1824fe35dcfd6f424bdf259376c8d5ebbba978..9c2a490ab08254b11a7119e8080f91361436ce8a 100644 (file)
@@ -16,3 +16,4 @@ import "base.pp"
 import "spamassassin.pp"
 import "firma.pp"
 import "mlmmj.pp"
+import "hidden.pp"