]> gitweb.fluxo.info Git - puppet-apache.git/commitdiff
Adding tor hidden service support
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 25 May 2012 14:29:26 +0000 (11:29 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 25 May 2012 14:29:26 +0000 (11:29 -0300)
manifests/init.pp

index 9e9f43fb4a214d474e2ce3868b997f4984b1cf36..669dd00b90e22740b2c79edf71da1b455026d1b8 100644 (file)
@@ -191,7 +191,7 @@ class apache {
               $comment = '', $sshkey = absent,
               $groups = '', $shell = '/bin/false', $manage_user = true,
               $ssl = false, $listen = '*', $https_redirect = false,
-              $canonical = false, $canonical_exceptions = '') {
+              $canonical = false, $canonical_exceptions = '', $hidden_service = false) {
 
     $vhost = $filename ? {
       ''      => "$title",
@@ -213,6 +213,16 @@ class apache {
       default => $mpm_group,
     }
 
+    if $hidden_service == true {
+      # 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.
+      tor::daemon::hidden_service { $title:
+        ports    => "80 127.0.0.1:80",
+        data_dir => "$tor::daemon::data_dir/hidden",
+      }
+    }
+
     if $mpm == true and $manage_user == true and $user != 'root' {
       if $ensure == present {
         if !defined(Group[$gid]) {