diff options
-rw-r--r-- | manifests/daemon.pp | 2 | ||||
-rw-r--r-- | manifests/init.pp | 26 | ||||
-rw-r--r-- | manifests/polipo.pp | 4 | ||||
-rw-r--r-- | manifests/relay.pp | 2 |
4 files changed, 31 insertions, 3 deletions
diff --git a/manifests/daemon.pp b/manifests/daemon.pp index d05f94f..037171b 100644 --- a/manifests/daemon.pp +++ b/manifests/daemon.pp @@ -7,7 +7,7 @@ class tor::daemon inherits tor { require => [ Package['tor'], Service["polipo"] ], } - define config( $socks_port = 9001, + define config( $socks_port = 9050, $socks_listen_addresses = [ '127.0.0.1' ], $socks_policies = [ 'accept 127.0.0.1/16', 'reject *' ], $log_rules = [ 'notice file /var/log/tor/notices.log' ], diff --git a/manifests/init.pp b/manifests/init.pp index bf4f696..c585489 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -8,7 +8,31 @@ class tor { ensure => absent, } - package { [ "tor", "polipo", "torsocks" ]: + package { [ "tor", "torsocks" ]: ensure => installed, } + + group { "debian-tor": + ensure => present, + allowdupe => false, + require => Package["tor"], + } + + user { "debian-tor": + allowdupe => false, + comment => "tor user,,,", + ensure => present, + home => "/var/tor", + shell => "/bin/sh", + gid => "debian-tor", + require => Group["debian-tor"], + } + + file { "/var/tor": + ensure => directory, + mode => 0755, + owner => debian-tor, + group => debian-tor, + require => User["debian-tor"], + } } diff --git a/manifests/polipo.pp b/manifests/polipo.pp index 7509563..d7b1caa 100644 --- a/manifests/polipo.pp +++ b/manifests/polipo.pp @@ -1,5 +1,9 @@ class polipo { + package { "polipo": + ensure => installed, + } + service { "polipo": ensure => running, require => Package["polipo"], diff --git a/manifests/relay.pp b/manifests/relay.pp index fb2bf18..b57bc8d 100644 --- a/manifests/relay.pp +++ b/manifests/relay.pp @@ -1,6 +1,6 @@ class tor::relay inherits tor::daemon { - tor::daemon::config { "tor-relay-$name": + tor::daemon::config { "tor-relay": socks_port => 0, socks_listen_addresses => [], or_port => 9001, |