summaryrefslogtreecommitdiff
path: root/templates/torrc.erb
blob: 0aac59f9338d29fd1aa59fb7192c6e86a96c40b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
## This file is managed by puppet.

## socks
<%- if socks_port then %>
SocksPort <%= socks_port %>
<%- end %>
<%- for address in socks_listen_address %>
SocksListenAddress <%= address %>
<%- end %>
<%- for policy in socks_policies %>
SocksPolicy <%= policy %>
<%- end %>

## log
<%- if log_file then %>
Log notice file <%= log_file %>
<%- else %>
Log notice syslog
<%- end %>

## runtime
RunAsDaemon 1
DataDirectory <%= tor_data_directory %>

## tor controller
<%- if control_port %>
ControlPort <%= control_port %>
HashedControlPassword <%= hashed_control_password %>
<%- end %>

## hidden services
<%- for service in hidden_services %>
HiddenServiceDir /var/tor/<%= service[:name] %>/<%= service[:dir] %>
<%-   for port in service[:ports] %>
HiddenServicePort <%= port %>
<%-   end %>
<%-  end %>

## relay
<%- if or_port %>
ORPort <%= or_port %>
<%- end %>
<%- if or_listen_address %>
ORListenAddress <%= or_listen_address %>
<%- end %>
Nickname <%= nickname %>
Address <%= hostname %>
<%- if relay_bandwidth_limit then %>
RelayBandwidthRate <% relay_bandwith_rate %> KB
<%- end %>
<%- if relay_bandwidth_burst then %>
RelayBandwidthBurst <% relay_bandwith_burst %> KB
<%- end %>
<%- if accounting_max then %>
AccountingMax <%= accounting_max %> GB
<%- end %>
<%- if accounting_start then %>
AccountingStart <%= accounting_start %>
<%- end %>
<%- if contact_info then %>
ContactInfo <%= contact_info %>
<%- end %>

## directory listing
<%- if dir_port then %>
DirPort <%= dir_port %>
<%- end %>
<%- if dir_listen_address then %>
DirListenAddress 0.0.0.0:9091
<%- end %>
<%- if dir_port_front_page then %>
DirPortFrontPage /etc/tor/tor-exit-notice.html
<%- end %>

## relay family
<%- if my_family then %>
MyFamily <%= my_family %>
<%- end %>

## exit policies
<%- for policy in exit_policies %>
ExitPolicy <%= policy %>
<%- end %>