]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - docs/configuration.txt
#518: replace various BASEDIR/* config files with a single BASEDIR/tahoe.cfg, with...
[tahoe-lafs/tahoe-lafs.git] / docs / configuration.txt
1
2 = Configuring a Tahoe node =
3
4 A Tahoe node is configured by writing to files in its base directory. These
5 files are read by the node when it starts, so each time you change them, you
6 need to restart the node.
7
8 The node also writes state to its base directory, so it will create files on
9 its own.
10
11 This document contains a complete list of the config files that are examined
12 by the client node, as well as the state files that you'll observe in its
13 base directory.
14
15 The main file is named 'tahoe.cfg', which is an ".INI"-style configuration
16 file (parsed by the Python stdlib 'ConfigParser' module: "[name]" section
17 markers, lines with "key.subkey: value", rfc822-style continuations). There
18 are other files that contain information which does not easily fit into this
19 format. The 'tahoe create-client' command will create an initial tahoe.cfg
20 file for you. After creation, the node will never modify the 'tahoe.cfg'
21 file: all persistent state is put in other files.
22
23 The item descriptions below use the following types:
24
25  boolean: one of (True, yes, on, 1, False, off, no, 0), case-insensitive
26  strports string: a Twisted listening-port specification string, like "tcp:80"
27                   or "tcp:8123:interface=127.0.0.1". For a full scription of
28                   the format, see
29                   http://twistedmatrix.com/documents/current/api/twisted.application.strports.html
30  FURL string: a Foolscap endpoint identifier, like
31               pb://soklj4y7eok5c3xkmjeqpw@192.168.69.247:44801/eqpwqtzm
32
33
34 == Overall Node Configuration ==
35
36 This section controls the network behavior of the node overall: which ports
37 and IP addresses are used, when connections are timed out, etc. This
38 configuration is independent of the services that the node is offering: the
39 same controls are used for client and introducer nodes.
40
41 [node]
42
43 nickname = (UTF-8 string, optional)
44
45  This value will be displayed in management tools as this node's "nickname".
46  If not provided, the nickname will be set to "<unspecified>". This string
47  shall be a UTF-8 encoded unicode string.
48
49 web.port = (strports string, optional)
50
51  This controls where the node's webserver should listen, providing filesystem
52  access and node status as defined in webapi.txt . This file contains a
53  Twisted "strports" specification such as "8123" or
54  "tcp:8123:interface=127.0.0.1". The 'tahoe create-client' command sets the
55  web.port to "tcp:8123:interface=127.0.0.1" by default, and is overridable by
56  the "--webport" option. You can make it use SSL by writing
57  "ssl:8123:privateKey=mykey.pem:certKey=cert.pem" instead.
58
59  If this is not provided, the node will not run a web server.
60
61 tub.port = (integer, optional)
62
63  This controls which port the node uses to accept Foolscap connections from
64  other nodes. If not provided, the node will ask the kernel for any available
65  port. The port will be written to a separate file (named client.port or
66  introducer.port), so that subsequent runs will re-use the same port.
67
68 advertised_ip_addresses = (comma-separated host[:port] string, optional)
69
70  The node normally uses tools like 'ifconfig' to determine the set of IP
71  addresses on which it can be reached from nodes both near and far. The node
72  introduces itself to the rest of the grid with a FURL that contains a series
73  of (ipaddr, port) pairs which other nodes will use to contact this one. By
74  providing this file, you can add to this list. This can be useful if your
75  node is running behind a firewall, but you have created a port-forwarding to
76  allow the outside world to access it. Each line must have a dotted-quad IP
77  address and an optional :portnum specification, like:
78
79   123.45.67.89
80   44.55.66.77:8098
81
82  Lines that do not provide a port number will use the same client.port as the
83  automatically-discovered addresses.
84
85 log_gatherer.furl = (FURL, optional)
86
87  If provided, this contains a single FURL string which is used to contact a
88  'log gatherer', which will be granted access to the logport. This can be
89  used by centralized storage meshes to gather operational logs in a single
90  place. Note that when an old-style BASEDIR/log_gatherer.furl file exists
91  (see 'Backwards Compatibility Files', below), both are used. (for most other
92  items, the separate config file overrides the entry in tahoe.cfg)
93
94 timeout.keepalive = (integer in seconds, optional)
95 timeout.disconnect = (integer in seconds, optional)
96
97  If timeout.keepalive is provided, it is treated as an integral number of
98  seconds, and sets the Foolscap "keepalive timer" to that value. For each
99  connection to another node, if nothing has been heard for a while, we will
100  attempt to provoke the other end into saying something. The duration of
101  silence that passes before sending the PING will be between KT and 2*KT.
102  This is mainly intended to keep NAT boxes from expiring idle TCP sessions,
103  but also gives TCP's long-duration keepalive/disconnect timers some traffic
104  to work with. The default value is 240 (i.e. 4 minutes).
105
106  If timeout.disconnect is provided, this is treated as an integral number of
107  seconds, and sets the Foolscap "disconnect timer" to that value. For each
108  connection to another node, if nothing has been heard for a while, we will
109  drop the connection. The duration of silence that passes before dropping the
110  connection will be between DT-2*KT and 2*DT+2*KT (please see ticket #521 for
111  more details). If we are sending a large amount of data to the other end
112  (which takes more than DT-2*KT to deliver), we might incorrectly drop the
113  connection. The default behavior (when this value is not provided) is to
114  disable the disconnect timer.
115
116  See ticket #521 for a discussion of how to pick these timeout values. Using
117  30 minutes means we'll disconnect after 22 to 68 minutes of inactivity.
118  Receiving data will reset this timeout, however if we have more than 22min
119  of data in the outbound queue (such as 800kB in two pipelined segments of 10
120  shares each) and the far end has no need to contact us, our ping might be
121  delayed, so we may disconnect them by accident.
122
123 ssh.port = (strports string, optional)
124 ssh.authorized_keys_file = (filename, optional)
125
126  This enables an SSH-based interactive Python shell, which can be used to
127  inspect the internal state of the node, for debugging. To cause the node to
128  accept SSH connections on port 8022 from the same keys as the rest of your
129  account, use:
130
131    [tub]
132    ssh.port = 8022
133    ssh.authorized_keys_file = ~/.ssh/authorized_keys
134
135 == Client Configuration ==
136
137 [client]
138 introducer.furl = (FURL string, mandatory)
139
140  This FURL tells the client how to connect to the introducer. Each Tahoe grid
141  is defined by an introducer. The introducer's furl is created by the
142  introducer node and written into its base directory when it starts,
143  whereupon it should be published to everyone who wishes to attach a client
144  to that grid
145
146 helper.furl = (FURL string, optional)
147
148  If provided, the node will attempt to connect to and use the given helper
149  for uploads. See docs/helper.txt for details.
150
151 key_generator.furl = (FURL string, optional)
152
153  If provided, the node will attempt to connect to and use the given
154  key-generator service, using RSA keys from the external process rather than
155  generating its own.
156
157 stats_gatherer.furl = (FURL string, optional)
158
159  If provided, the node will connect to the given stats gatherer and provide
160  it with operational statistics.
161
162
163 == Storage Server Configuration ==
164
165 [storage]
166 enabled = (boolean, optional)
167
168  If this is True, the node will run a storage server, offering space to other
169  clients. If it is False, the node will not run a storage server, meaning
170  that no shares will be stored on this node. Use False this for clients who
171  do not wish to provide storage service. The default value is True.
172
173 readonly = (boolean, optional)
174
175  If True, the node will run a storage server but will not accept any shares,
176  making it effectively read-only. Use this for storage servers which are
177  being decommissioned: the storage/ directory could be mounted read-only,
178  while shares are moved to other servers. Note that this currently only
179  affects immutable shares. Mutable shares (used for directories) will be
180  written and modified anyway. See ticket #390 for the current status of this
181  bug. The default value is False.
182
183 sizelimit = (str, optional)
184
185  If provided, this value establishes an upper bound (in bytes) on the amount
186  of storage consumed by share data (data that your node holds on behalf of
187  clients that are uploading files to the grid). To avoid providing more than
188  100MB of data to other clients, set this key to "100MB". Note that this is a
189  fairly loose bound, and the node may occasionally use slightly more storage
190  than this. To enforce a stronger (and possibly more reliable) limit, use a
191  symlink to place the 'storage/' directory on a separate size-limited
192  filesystem, and/or use per-user OS/filesystem quotas. If a size limit is
193  specified then Tahoe will do a "du" at startup (traversing all the storage
194  and summing the sizes of the files), which can take a long time if there are
195  a lot of shares stored.
196
197  This string contains a number, with an optional case-insensitive scale
198  suffix like "K" or "M" or "G", and an optional "B" suffix. So "100MB",
199  "100M", "100000000B", "100000000", and "100000kb" all mean the same thing.
200
201
202 == Running A Helper ==
203
204 A "helper" is a regular client node that also offers the "upload helper"
205 service.
206
207 [helper]
208 enabled = (boolean, optional)
209
210  If True, the node will run a helper (see docs/helper.txt for details). The
211  helper's contact FURL will be placed in private/helper.furl, from which it
212  can be copied to any clients which wish to use it. Clearly nodes should not
213  both run a helper and attempt to use one: do not create both helper.furl and
214  run_helper in the same node. The default is False.
215
216
217 == Running An Introducer ==
218
219 The introducer node uses a different '.tac' file (named introducer.tac), and
220 pays attention to the "[node]" section, but not the others.
221
222 The Introducer node maintains some different state than regular client
223 nodes.
224
225 BASEDIR/introducer.furl : This is generated the first time the introducer
226 node is started, and used again on subsequent runs, to give the introduction
227 service a persistent long-term identity. This file should be published and
228 copied into new client nodes before they are started for the first time.
229
230
231 == Other Files in BASEDIR ==
232
233 Some configuration is not kept in tahoe.cfg, for the following reasons:
234
235  * it is generated by the node at startup, e.g. encryption keys. The node
236    never writes to tahoe.cfg
237  * it is generated by user action, e.g. the 'tahoe create-alias' command
238
239 In addition, non-configuration persistent state is kept in the node's base
240 directory, next to the configuration knobs.
241
242 This section describes these other files.
243
244
245 private/node.pem : This contains an SSL private-key certificate. The node
246 generates this the first time it is started, and re-uses it on subsequent
247 runs. This certificate allows the node to have a cryptographically-strong
248 identifier (the Foolscap "TubID"), and to establish secure connections to
249 other nodes.
250
251 storage/ : Nodes which host StorageServers will create this directory to hold
252 shares of files on behalf of other clients. There will be a directory
253 underneath it for each StorageIndex for which this node is holding shares.
254 There is also an "incoming" directory where partially-completed shares are
255 held while they are being received.
256
257 client.tac : this file defines the client, by constructing the actual Client
258 instance each time the node is started. It is used by the 'twistd'
259 daemonization program (in the "-y" mode), which is run internally by the
260 "tahoe start" command. This file is created by the "tahoe create-client"
261 command.
262
263 private/control.furl : this file contains a FURL that provides access to a
264 control port on the client node, from which files can be uploaded and
265 downloaded. This file is created with permissions that prevent anyone else
266 from reading it (on operating systems that support such a concept), to insure
267 that only the owner of the client node can use this feature. This port is
268 intended for debugging and testing use.
269
270 private/logport.furl : this file contains a FURL that provides access to a
271 'log port' on the client node, from which operational logs can be retrieved.
272 Do not grant logport access to strangers, because occasionally secret
273 information may be placed in the logs.
274
275 private/helper.furl : if the node is running a helper (for use by other
276 clients), its contact FURL will be placed here. See docs/helper.txt for more
277 details.
278
279 private/root_dir.cap (optional): The command-line tools will read a directory
280 cap out of this file and use it, if you don't specify a '--dir-cap' option or
281 if you specify '--dir-cap=root'.
282
283 private/convergence (automatically generated): An added secret for encrypting
284 immutable files. Everyone who has this same string in their
285 private/convergence file encrypts their immutable files in the same way when
286 uploading them. This causes identical files to "converge" -- to share the
287 same storage space since they have identical ciphertext -- which conserves
288 space and optimizes upload time, but it also exposes files to the possibility
289 of a brute-force attack by people who know that string. In this attack, if
290 the attacker can guess most of the contents of a file, then they can use
291 brute-force to learn the remaining contents.
292
293 So the set of people who know your private/convergence string is the set of
294 people who converge their storage space with you when you and they upload
295 identical immutable files, and it is also the set of people who could mount
296 such an attack.
297
298 The content of the private/convergence file is a base-32 encoded string. If
299 the file doesn't exist, then when the Tahoe client starts up it will generate
300 a random 256-bit string and write the base-32 encoding of this string into
301 the file. If you want to converge your immutable files with as many people as
302 possible, put the empty string (so that private/convergence is a zero-length
303 file).
304
305
306 == Other files ==
307
308 logs/ : Each Tahoe node creates a directory to hold the log messages produced
309 as the node runs. These logfiles are created and rotated by the "twistd"
310 daemonization program, so logs/twistd.log will contain the most recent
311 messages, logs/twistd.log.1 will contain the previous ones, logs/twistd.log.2
312 will be older still, and so on. twistd rotates logfiles after they grow
313 beyond 1MB in size. If the space consumed by logfiles becomes troublesome,
314 they should be pruned: a cron job to delete all files that were created more
315 than a month ago in this logs/ directory should be sufficient.
316
317 my_nodeid : this is written by all nodes after startup, and contains a
318 base32-encoded (i.e. human-readable) NodeID that identifies this specific
319 node. This NodeID is the same string that gets displayed on the web page (in
320 the "which peers am I connected to" list), and the shortened form (the first
321 characters) is recorded in various log messages.
322
323
324 == Backwards Compatibility Files ==
325
326 Tahoe releases before 1.3.0 had no 'tahoe.cfg' file, and used distinct files
327 for each item listed below. For each configuration knob, if the distinct file
328 exists, it will take precedence over the corresponding item in tahoe.cfg .
329
330
331 [node]nickname : BASEDIR/nickname
332 [node]web.port : BASEDIR/webport
333 [node]tub.port : BASEDIR/client.port  (for Clients, not Introducers)
334 [node]tub.port : BASEDIR/introducer.port  (for Introducers, not Clients)
335       (note that, unlike other keys, tahoe.cfg overrides the *.port file)
336 [node]advertised_ip_addresses : BASEDIR/advertised_ip_addresses (one per line)
337 [node]log_gatherer.furl : BASEDIR/log_gatherer.furl (one per line)
338 [node]timeout.keepalive : BASEDIR/keepalive_timeout
339 [node]timeout.disconnect : BASEDIR/disconnect_timeout
340 [node]ssh.port : BASEDIR/authorized_keys.SSHPORT
341 [node]ssh.authorized_keys_file : BASEDIR/authorized_keys.SSHPORT
342 [client]introducer.furl : BASEDIR/introducer.furl
343 [client]helper.furl : BASEDIR/helper.furl
344 [client]key_generator.furl : BASEDIR/key_generator.furl
345 [client]stats_gatherer.furl : BASEDIR/stats_gatherer.furl
346 [storage]enabled : BASEDIR/no_storage (False if no_storage exists)
347 [storage]readonly : BASEDIR/readonly_storage (True if readonly_storage exists)
348 [storage]sizelimit : BASEDIR/sizelimit
349 [storage]debug_discard : BASEDIR/debug_discard_storage
350 [helper]enabled : BASEDIR/run_helper (True if run_helper exists)
351
352 Note: the functionality of [node]ssh.port and [node]ssh.authorized_keys_file
353 were previously combined, controlled by the presence of a
354 BASEDIR/authorized_keys.SSHPORT file, in which the suffix of the filename
355 indicated which port the ssh server should listen on.
356
357
358 == Example ==
359
360 The following is a sample tahoe.cfg file, containing values for all keys
361 described above. Note that this is not a recommended configuration (most of
362 these are not the default values), merely a legal one.
363
364 [node]
365 port = 34912
366 advertised_ip_addresses = 123.45.67.89,44.55.66.77:8098
367 log_gatherer.furl = pb://soklj4y7eok5c3xkmjeqpw@192.168.69.247:44801/eqpwqtzm
368 timeout.keepalive = 240
369 timeout.disconnect = 1800
370 ssh.port = 8022
371 ssh.authorized_keys_file = ~/.ssh/authorized_keys
372
373 [client]
374 introducer.furl = pb://ok45ssoklj4y7eok5c3xkmj@tahoe.example:44801/ii3uumo
375 nickname = Bob's Tahoe Node
376 web.port = 8123
377 helper.furl = pb://ggti5ssoklj4y7eok5c3xkmj@helper.tahoe.example:7054/kk8lhr
378
379 [storage]
380 no_storage = False
381 readonly_storage = True
382 sizelimit = 10000000000
383
384 [helper]
385 run_helper = True