summaryrefslogtreecommitdiff
path: root/manifests/hidden.pp
blob: 65504bfc44aeea2224897500861eb817e140db70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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"],
  }
}