summaryrefslogtreecommitdiff
path: root/manifests/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/daemon')
-rw-r--r--manifests/daemon/control.pp4
-rw-r--r--manifests/daemon/directory.pp2
-rw-r--r--manifests/daemon/dns.pp1
-rw-r--r--manifests/daemon/hidden_service.pp16
-rw-r--r--manifests/daemon/onion_service.pp8
-rw-r--r--manifests/daemon/params.pp5
-rw-r--r--manifests/daemon/relay.pp3
-rw-r--r--manifests/daemon/socks.pp1
-rw-r--r--manifests/daemon/transparent.pp4
-rw-r--r--manifests/daemon/transport_plugin.pp13
10 files changed, 43 insertions, 14 deletions
diff --git a/manifests/daemon/control.pp b/manifests/daemon/control.pp
index 027a49d..ee4a1fd 100644
--- a/manifests/daemon/control.pp
+++ b/manifests/daemon/control.pp
@@ -13,8 +13,8 @@ define tor::daemon::control(
fail('You need to define the tor control password')
}
- if $cookie_authentication == 0 and ($cookie_auth_file != '' or $cookie_auth_file_group_readable != '') {
- notice('You set a tor cookie authentication option, but do not have cookie_authentication on')
+ if $cookie_authentication == 0 and ($cookie_auth_file != '' or $cookie_auth_file_group_readable != '') { # lint:ignore:80chars
+ notice('You set a tor cookie authentication option, but do not have cookie_authentication on') # lint:ignore:80chars
}
concat::fragment { '04.control':
diff --git a/manifests/daemon/directory.pp b/manifests/daemon/directory.pp
index 3bbf273..b2f77fe 100644
--- a/manifests/daemon/directory.pp
+++ b/manifests/daemon/directory.pp
@@ -2,7 +2,6 @@
define tor::daemon::directory (
$ensure = 'present',
$port = 0,
- $listen_addresses = [],
$port_front_page = '/etc/tor/tor-exit-notice.html',
) {
if $ensure == 'present' {
@@ -23,4 +22,3 @@ define tor::daemon::directory (
mode => '0644',
}
}
-
diff --git a/manifests/daemon/dns.pp b/manifests/daemon/dns.pp
index 3ae8c77..899f920 100644
--- a/manifests/daemon/dns.pp
+++ b/manifests/daemon/dns.pp
@@ -2,7 +2,6 @@
define tor::daemon::dns(
$ensure = 'present',
$port = 0,
- $listen_addresses = [],
){
if $ensure == 'present' {
concat::fragment { "08.dns.${name}":
diff --git a/manifests/daemon/hidden_service.pp b/manifests/daemon/hidden_service.pp
new file mode 100644
index 0000000..8a062c5
--- /dev/null
+++ b/manifests/daemon/hidden_service.pp
@@ -0,0 +1,16 @@
+# hidden services definition
+define tor::daemon::hidden_service(
+ $ports = [],
+ $single_hop = false,
+ $v3 = false,
+ $data_dir = $tor::daemon::data_dir,
+) {
+ info("Using tor::daemon::hidden_service is deprecated, please use tor::daemon::onion_service for ${name}")
+ tor::daemon::onion_service{
+ $name:
+ ports => $ports,
+ single_hop => $single_hop,
+ v3 => $v3,
+ data_dir => $data_dir,
+ }
+}
diff --git a/manifests/daemon/onion_service.pp b/manifests/daemon/onion_service.pp
index 9d12a3a..cb55d06 100644
--- a/manifests/daemon/onion_service.pp
+++ b/manifests/daemon/onion_service.pp
@@ -3,6 +3,8 @@ define tor::daemon::onion_service(
$ensure = 'present',
$ports = [],
$data_dir = $tor::daemon::data_dir,
+ $v3 = false,
+ $single_hop = false,
$private_key = undef,
$private_key_name = $name,
$private_key_store_path = undef,
@@ -16,6 +18,12 @@ define tor::daemon::onion_service(
order => '05',
target => $tor::daemon::config_file,
}
+ if $single_hop {
+ file { "${$data_dir_path}/onion_service_non_anonymous":
+ ensure => 'present',
+ notify => Service['tor'];
+ }
+ }
}
if $private_key or ($private_key_name and $private_key_store_path) {
if $private_key and ($private_key_name and $private_key_store_path) {
diff --git a/manifests/daemon/params.pp b/manifests/daemon/params.pp
index 0c35cd6..39126ee 100644
--- a/manifests/daemon/params.pp
+++ b/manifests/daemon/params.pp
@@ -1,7 +1,6 @@
# setup variables for different distributions
class tor::daemon::params {
-
- case $osfamily {
+ case $facts['osfamily'] {
'RedHat': {
$user = 'toranon'
$group = 'toranon'
@@ -14,7 +13,7 @@ class tor::daemon::params {
$manage_user = true
$data_dir_mode = '0700'
}
- default: { fail("No support for osfamily ${osfamily}") }
+ default: { fail("No support for osfamily ${facts['osfamily']}") }
}
}
diff --git a/manifests/daemon/relay.pp b/manifests/daemon/relay.pp
index 68e06ca..bc72dd0 100644
--- a/manifests/daemon/relay.pp
+++ b/manifests/daemon/relay.pp
@@ -2,7 +2,6 @@
define tor::daemon::relay(
$ensure = 'present',
$port = 0,
- $listen_addresses = [],
$outbound_bindaddresses = [],
$portforwarding = 0,
# KB/s, defaulting to using tor's default: 5120KB/s
@@ -15,7 +14,7 @@ define tor::daemon::relay(
$relay_bandwidth_burst = 0,
# GB, 0 for no limit
$accounting_max = 0,
- $accounting_start = [],
+ $accounting_start = 'month 1 0:00',
$contact_info = '',
# TODO: autofill with other relays
$my_family = '',
diff --git a/manifests/daemon/socks.pp b/manifests/daemon/socks.pp
index 43256ae..76c1703 100644
--- a/manifests/daemon/socks.pp
+++ b/manifests/daemon/socks.pp
@@ -1,7 +1,6 @@
# socks definition
define tor::daemon::socks(
$port = 0,
- $listen_addresses = [],
$policies = [],
) {
concat::fragment { '02.socks':
diff --git a/manifests/daemon/transparent.pp b/manifests/daemon/transparent.pp
index 49f9e70..0d4620a 100644
--- a/manifests/daemon/transparent.pp
+++ b/manifests/daemon/transparent.pp
@@ -1,9 +1,7 @@
# Transparent proxy definition
define tor::daemon::transparent(
$ensure = 'present',
- $port = 0,
- $listen_addresses = [],
-) {
+ $port = 0) {
if $ensure == 'present' {
concat::fragment { "09.transparent.${name}":
diff --git a/manifests/daemon/transport_plugin.pp b/manifests/daemon/transport_plugin.pp
new file mode 100644
index 0000000..1921282
--- /dev/null
+++ b/manifests/daemon/transport_plugin.pp
@@ -0,0 +1,13 @@
+# transport plugin
+define tor::daemon::transport_plugin(
+ $servertransport_plugin = '',
+ $servertransport_listenaddr = '',
+ $servertransport_options = '',
+ $ext_port = '' ) {
+
+ concat::fragment { '11.transport_plugin':
+ content => template('tor/torrc.transport_plugin.erb'),
+ order => 11,
+ target => $tor::daemon::config_file,
+ }
+}