summaryrefslogtreecommitdiff
path: root/manifests/hidden.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-06-22 18:10:28 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-06-22 18:10:28 -0300
commit6e9ced5c0eda28b6a20384f6e5d00609342c11b8 (patch)
tree4cbc5f66975f9d12b7a83f5d0d40cfb712fb9a13 /manifests/hidden.pp
parent2445bd4442e29fea85ba7f10ae5ef675490bc378 (diff)
downloadpuppet-mail-6e9ced5c0eda28b6a20384f6e5d00609342c11b8.tar.gz
puppet-mail-6e9ced5c0eda28b6a20384f6e5d00609342c11b8.tar.bz2
Adding mail::hidden for tor hidden services support
Diffstat (limited to 'manifests/hidden.pp')
-rw-r--r--manifests/hidden.pp22
1 files changed, 22 insertions, 0 deletions
diff --git a/manifests/hidden.pp b/manifests/hidden.pp
new file mode 100644
index 0000000..bdddcf2
--- /dev/null
+++ b/manifests/hidden.pp
@@ -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"],
+ }
+}