]> gitweb.fluxo.info Git - puppet-tor.git/commitdiff
fixing relay options
authordrebs <drebs@riseup.net>
Sun, 8 Jan 2012 05:10:56 +0000 (03:10 -0200)
committerdrebs <drebs@riseup.net>
Sun, 8 Jan 2012 05:10:56 +0000 (03:10 -0200)
manifests/daemon.pp
manifests/relay.pp
templates/torrc.erb

index c669d71fc8f0d2eb67c7e69f4fb5a639c6960f5b..c9819c353fc1f7dcc84a8d51c1e9d839c11c1889 100644 (file)
@@ -12,7 +12,7 @@ class tor::daemon inherits tor {
                  $socks_policies = [ 'accept 127.0.0.1/16', 'reject *' ],
                  $log_rules = [ 'notice file /var/log/tor/notices.log' ],
                  $data_directory = '/var/tor',
-                 $control_port = false,
+                 $control_port = 0,
                  $hashed_control_password = '',
                  $hidden_services = [],
                  $or_port = 0,
index 6f74895d383d2bda05a2c40ccafd585a39a79902..a6d813c45e4a3c848ceb5c4f2d21d0ed467a718d 100644 (file)
@@ -3,18 +3,19 @@ class tor::relay inherits tor::daemon {
   tor::daemon::config { "tor-relay":
                         socks_port             => 0,
                         socks_listen_addresses => [],
+                        socks_policies         => [],
                         or_port                => 9001,
                         or_listen_address      => '',
                         nickname               => '',
-                        address                => $hostname,
-                        relay_bandwidth_rate    => 0,
-                        relay_bandwidth_burst   => 0,
+                        address                => '',
+                        relay_bandwidth_rate   => 0,
+                        relay_bandwidth_burst  => 0,
                         accounting_max         => 0,
                         accounting_start       => [],
                         contact_info           => '',
                         dir_port               => 0,
                         dir_listen_address     => '',
-                        dir_port_front_page         => '',
+                        dir_port_front_page    => '',
                         my_family              => '',
                         exit_policies          => [],
                       }
index 3605ba6ae6577c1b8f33c1f57a6b5b3a32780543..21129310aa8fd1be425ee5d0df9c345e0b551dc1 100644 (file)
@@ -2,91 +2,91 @@
 
 ## socks
 SocksPort <%= socks_port %>
-<%- for address in socks_listen_addresses %>
+<%- for address in socks_listen_addresses -%>
 SocksListenAddress <%= address %>
-<%- end %>
-<%- for policy in socks_policies %>
+<%- end -%>
+<%- for policy in socks_policies -%>
 SocksPolicy <%= policy %>
-<%- end %>
+<%- end -%>
 
 ## log
-<%- if log_rules != [] then %>
-<%-   for log_rule in log_rules %>
+<%- if log_rules != [] then -%>
+<%-   for log_rule in log_rules -%>
 Log <%= log_rule %>
-<%-   end %>
-<%- else %>
+<%-   end -%>
+<%- else -%>
 Log notice syslog
-<%- end %>
+<%- end -%>
 
 ## runtime
 RunAsDaemon 1
 DataDirectory <%= data_directory %>
 
 ## tor controller
-<%- if control_port != '' then %>
+<%- if control_port != 0 then -%>
 ControlPort <%= control_port %>
 HashedControlPassword <%= hashed_control_password %>
-<%- end %>
+<%- end -%>
 
 ## hidden services
-<%- for service in hidden_services %>
+<%- for service in hidden_services -%>
 HiddenServiceDir /var/tor/<%= service[:name] %>/<%= service[:dir] %>
-<%-   for port in service[:ports] %>
+<%-   for port in service[:ports] -%>
 HiddenServicePort <%= port %>
-<%-   end %>
-<%-  end %>
+<%-   end -%>
+<%-  end -%>
 
 ## relay
-<%- if or_port != 0 then %>
+<%- if or_port != 0 then -%>
 ORPort <%= or_port %>
-<%- end %>
-<%- if or_listen_address != '' then %>
+<%- end -%>
+<%- if or_listen_address != '' then -%>
 ORListenAddress <%= or_listen_address %>
-<%- end %>
-<%- if nickname != '' then %>
+<%- end -%>
+<%- if nickname != '' then -%>
 Nickname <%= nickname %>
-<%- end %>
-<%- if address != '' then %>
+<%- end -%>
+<%- if address != '' then -%>
 Address <%= address %>
-<%- end %>
-<%- if relay_bandwidth_rate != 0 then %>
+<%- end -%>
+<%- if relay_bandwidth_rate != '0' then -%>
 RelayBandwidthRate <%= relay_bandwidth_rate %> KB
-<%- end %>
-<%- if relay_bandwidth_burst != 0 then %>
+<%- end -%>
+<%- if relay_bandwidth_burst != '0' then -%>
 RelayBandwidthBurst <%= relay_bandwidth_burst %> KB
-<%- end %>
-<%- if accounting_max != 0 then %>
+<%- end -%>
+<%- if accounting_max != '0' then -%>
 AccountingMax <%= accounting_max %> GB
-<%- end %>
-<%- for accounting in accounting_start %>
+<%- end -%>
+<%- for accounting in accounting_start -%>
 AccountingStart <%= accounting_start %>
-<%- end %>
-<%- if contact_info != '' then %>
+<%- end -%>
+<%- if contact_info != '' then -%>
 ContactInfo <%= contact_info %>
-<%- end %>
+<%- end -%>
 
 ## directory listing
-<%- if dir_port != 0 then %>
+<%- if dir_port != '0' then -%>
 DirPort <%= dir_port %>
-<%- end %>
-<%- if dir_listen_address != '' then %>
+<%- end -%>
+<%- if dir_listen_address != '' then -%>
 DirListenAddress <%= dir_listen_address %>
-<%- end %>
-<%- if dir_port_front_page != '' then %>
+<%- end -%>
+<%- if dir_port_front_page != '' then -%>
 DirPortFrontPage <%= dir_port_front_page %>
-<%- end %>
+<%- end -%>
 
 ## relay family
-<%- if my_family != '' then %>
+<%- if my_family != '' then -%>
 MyFamily <%= my_family %>
-<%- end %>
+<%- end -%>
 
 ## bridge relay
-<%- if bridge_relay != 0 then %>
+<%- if bridge_relay != '0' then -%>
 BridgeRelay <%= bridge_relay %>
-<%- end %>
+<%- end -%>
 
 ## exit policies
-<%- for policy in exit_policies %>
+<%- for policy in exit_policies -%>
 ExitPolicy <%= policy %>
-<%- end %>
+<%- end -%>