]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - docs/configuration.txt
docs: add statement on our refusal to insert backdoors
[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-node' or 'tahoe create-client' command will create
20 an initial tahoe.cfg file for you. After creation, the node will never modify
21 the 'tahoe.cfg' 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:3456:interface=127.0.0.1". For a full description 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 If your node is behind a firewall or NAT device and you want other clients to
42 connect to it, you'll need to open a port in the firewall or NAT, and specify
43 that port number in the tub.port option. If behind a NAT, you *may* need to
44 set the tub.location option described below.
45
46
47 [node]
48
49 nickname = (UTF-8 string, optional)
50
51  This value will be displayed in management tools as this node's "nickname".
52  If not provided, the nickname will be set to "<unspecified>". This string
53  shall be a UTF-8 encoded unicode string.
54
55 web.port = (strports string, optional)
56
57  This controls where the node's webserver should listen, providing filesystem
58  access and node status as defined in webapi.txt . This file contains a
59  Twisted "strports" specification such as "3456" or
60  "tcp:3456:interface=127.0.0.1". The 'tahoe create-node' or 'tahoe create-client'
61  commands set the web.port to "tcp:3456:interface=127.0.0.1" by default; this
62  is overridable by the "--webport" option. You can make it use SSL by writing
63  "ssl:3456:privateKey=mykey.pem:certKey=cert.pem" instead.
64
65  If this is not provided, the node will not run a web server.
66
67 web.static = (string, optional)
68
69  This controls where the /static portion of the URL space is served. The
70  value is a directory name (~username is allowed, and non-absolute names are
71  interpreted relative to the node's basedir) which can contain HTML and other
72  files. This can be used to serve a javascript-based frontend to the Tahoe
73  node, or other services.
74
75  The default value is "public_html", which will serve $BASEDIR/public_html .
76  With the default settings, http://127.0.0.1:3456/static/foo.html will serve
77  the contents of $BASEDIR/public_html/foo.html .
78
79 tub.port = (integer, optional)
80
81  This controls which port the node uses to accept Foolscap connections from
82  other nodes. If not provided, the node will ask the kernel for any available
83  port. The port will be written to a separate file (named client.port or
84  introducer.port), so that subsequent runs will re-use the same port.
85
86 tub.location = (string, optional)
87
88  In addition to running as a client, each Tahoe node also runs as a server,
89  listening for connections from other Tahoe clients. The node announces its
90  location by publishing a "FURL" (a string with some connection hints) to the
91  Introducer. The string it publishes can be found in
92  $BASEDIR/private/storage.furl . The "tub.location" configuration controls
93  what location is published in this announcement.
94
95  If you don't provide tub.location, the node will try to figure out a useful
96  one by itself, by using tools like 'ifconfig' to determine the set of IP
97  addresses on which it can be reached from nodes both near and far. It will
98  also include the TCP port number on which it is listening (either the one
99  specified by tub.port, or whichever port was assigned by the kernel when
100  tub.port is left unspecified).
101
102  You might want to override this value if your node lives behind a firewall
103  that is doing inbound port forwarding, or if you are using other proxies
104  such that the local IP address or port number is not the same one that
105  remote clients should use to connect. You might also want to control this
106  when using a Tor proxy to avoid revealing your actual IP address through the
107  Introducer announcement.
108
109  The value is a comma-separated string of host:port location hints, like
110  this:
111
112   123.45.67.89:8098,tahoe.example.com:8098,127.0.0.1:8098
113
114  A few examples:
115
116   Emulate default behavior, assuming your host has IP address 123.45.67.89
117   and the kernel-allocated port number was 8098:
118
119    tub.port = 8098
120    tub.location = 123.45.67.89:8098,127.0.0.1:8098
121
122   Use a DNS name so you can change the IP address more easily:
123
124    tub.port = 8098
125    tub.location = tahoe.example.com:8098
126
127   Run a node behind a firewall (which has an external IP address) that has
128   been configured to forward port 7912 to our internal node's port 8098:
129
130    tub.port = 8098
131    tub.location = external-firewall.example.com:7912
132
133   Run a node behind a Tor proxy (perhaps via torsocks), in client-only mode
134   (i.e. we can make outbound connections, but other nodes will not be able to
135   connect to us). The literal 'unreachable.example.org' will not resolve, but
136   will serve as a reminder to human observers that this node cannot be
137   reached. "Don't call us.. we'll call you":
138
139    tub.port = 8098
140    tub.location = unreachable.example.org:0
141
142   Run a node behind a Tor proxy, and make the server available as a Tor
143   "hidden service". (this assumes that other clients are running their node
144   with torsocks, such that they are prepared to connect to a .onion address).
145   The hidden service must first be configured in Tor, by giving it a local
146   port number and then obtaining a .onion name, using something in the torrc
147   file like:
148
149     HiddenServiceDir /var/lib/tor/hidden_services/tahoe
150     HiddenServicePort 29212 127.0.0.1:8098
151
152    once Tor is restarted, the .onion hostname will be in
153    /var/lib/tor/hidden_services/tahoe/hostname . Then set up your tahoe.cfg
154    like:
155
156     tub.port = 8098
157     tub.location = ualhejtq2p7ohfbb.onion:29212
158
159  Most users will not need to set tub.location .
160
161  Note that the old 'advertised_ip_addresses' file from earlier releases is no
162  longer supported. Tahoe 1.3.0 and later will ignore this file.
163
164 log_gatherer.furl = (FURL, optional)
165
166  If provided, this contains a single FURL string which is used to contact a
167  'log gatherer', which will be granted access to the logport. This can be
168  used by centralized storage meshes to gather operational logs in a single
169  place. Note that when an old-style BASEDIR/log_gatherer.furl file exists
170  (see 'Backwards Compatibility Files', below), both are used. (for most other
171  items, the separate config file overrides the entry in tahoe.cfg)
172
173 timeout.keepalive = (integer in seconds, optional)
174 timeout.disconnect = (integer in seconds, optional)
175
176  If timeout.keepalive is provided, it is treated as an integral number of
177  seconds, and sets the Foolscap "keepalive timer" to that value. For each
178  connection to another node, if nothing has been heard for a while, we will
179  attempt to provoke the other end into saying something. The duration of
180  silence that passes before sending the PING will be between KT and 2*KT.
181  This is mainly intended to keep NAT boxes from expiring idle TCP sessions,
182  but also gives TCP's long-duration keepalive/disconnect timers some traffic
183  to work with. The default value is 240 (i.e. 4 minutes).
184
185  If timeout.disconnect is provided, this is treated as an integral number of
186  seconds, and sets the Foolscap "disconnect timer" to that value. For each
187  connection to another node, if nothing has been heard for a while, we will
188  drop the connection. The duration of silence that passes before dropping the
189  connection will be between DT-2*KT and 2*DT+2*KT (please see ticket #521 for
190  more details). If we are sending a large amount of data to the other end
191  (which takes more than DT-2*KT to deliver), we might incorrectly drop the
192  connection. The default behavior (when this value is not provided) is to
193  disable the disconnect timer.
194
195  See ticket #521 for a discussion of how to pick these timeout values. Using
196  30 minutes means we'll disconnect after 22 to 68 minutes of inactivity.
197  Receiving data will reset this timeout, however if we have more than 22min
198  of data in the outbound queue (such as 800kB in two pipelined segments of 10
199  shares each) and the far end has no need to contact us, our ping might be
200  delayed, so we may disconnect them by accident.
201
202 ssh.port = (strports string, optional)
203 ssh.authorized_keys_file = (filename, optional)
204
205  This enables an SSH-based interactive Python shell, which can be used to
206  inspect the internal state of the node, for debugging. To cause the node to
207  accept SSH connections on port 8022 from the same keys as the rest of your
208  account, use:
209
210    [tub]
211    ssh.port = 8022
212    ssh.authorized_keys_file = ~/.ssh/authorized_keys
213
214 tempdir = (string, optional)
215
216  This specifies a temporary directory for the webapi server to use, for
217  holding large files while they are being uploaded. If a webapi client
218  attempts to upload a 10GB file, this tempdir will need to have at least 10GB
219  available for the upload to complete.
220
221  The default value is the "tmp" directory in the node's base directory (i.e.
222  $NODEDIR/tmp), but it can be placed elsewhere. This directory is used for
223  files that usually (on a unix system) go into /tmp . The string will be
224  interpreted relative to the node's base directory.
225
226 == Client Configuration ==
227
228 [client]
229 introducer.furl = (FURL string, mandatory)
230
231  This FURL tells the client how to connect to the introducer. Each Tahoe grid
232  is defined by an introducer. The introducer's furl is created by the
233  introducer node and written into its base directory when it starts,
234  whereupon it should be published to everyone who wishes to attach a client
235  to that grid
236
237 helper.furl = (FURL string, optional)
238
239  If provided, the node will attempt to connect to and use the given helper
240  for uploads. See docs/helper.txt for details.
241
242 key_generator.furl = (FURL string, optional)
243
244  If provided, the node will attempt to connect to and use the given
245  key-generator service, using RSA keys from the external process rather than
246  generating its own.
247
248 stats_gatherer.furl = (FURL string, optional)
249
250  If provided, the node will connect to the given stats gatherer and provide
251  it with operational statistics.
252
253 shares.needed = (int, optional) aka "k", default 3
254 shares.total = (int, optional) aka "N", N >= k, default 10
255 shares.happy = (int, optional) 1 <= happy <= N, default 7
256
257  These three values set the default encoding parameters. Each time a new file
258  is uploaded, erasure-coding is used to break the ciphertext into separate
259  pieces. There will be "N" (i.e. shares.total) pieces created, and the file
260  will be recoverable if any "k" (i.e. shares.needed) pieces are retrieved.
261  The default values are 3-of-10 (i.e. shares.needed = 3, shares.total = 10).
262  Setting k to 1 is equivalent to simple replication (uploading N copies of
263  the file).
264
265  These values control the tradeoff between storage overhead, performance, and
266  reliability. To a first approximation, a 1MB file will use (1MB*N/k) of
267  backend storage space (the actual value will be a bit more, because of other
268  forms of overhead). Up to N-k shares can be lost before the file becomes
269  unrecoverable, so assuming there are at least N servers, up to N-k servers
270  can be offline without losing the file. So large N/k ratios are more
271  reliable, and small N/k ratios use less disk space. Clearly, k must never be
272  smaller than N.
273
274  Large values of N will slow down upload operations slightly, since more
275  servers must be involved, and will slightly increase storage overhead due to
276  the hash trees that are created. Large values of k will cause downloads to
277  be marginally slower, because more servers must be involved. N cannot be
278  larger than 256, because of the 8-bit erasure-coding algorithm that Tahoe
279  uses.
280
281  shares.happy allows you control over the distribution of your immutable file.
282  For a successful upload, shares are guaranteed to be initially placed on
283  at least 'shares.happy' distinct servers, the correct functioning of any
284  k of which is sufficient to guarantee the availability of the uploaded file.
285  This value should not be larger than the number of servers on your grid.
286  
287  A value of shares.happy <= k is allowed, but does not provide any redundancy
288  if some servers fail or lose shares.
289
290  (Mutable files use a different share placement algorithm that does not 
291   consider this parameter.)
292
293
294 == Storage Server Configuration ==
295
296 [storage]
297 enabled = (boolean, optional)
298
299  If this is True, the node will run a storage server, offering space to other
300  clients. If it is False, the node will not run a storage server, meaning
301  that no shares will be stored on this node. Use False this for clients who
302  do not wish to provide storage service. The default value is True.
303
304 readonly = (boolean, optional)
305
306  If True, the node will run a storage server but will not accept any shares,
307  making it effectively read-only. Use this for storage servers which are
308  being decommissioned: the storage/ directory could be mounted read-only,
309  while shares are moved to other servers. Note that this currently only
310  affects immutable shares. Mutable shares (used for directories) will be
311  written and modified anyway. See ticket #390 for the current status of this
312  bug. The default value is False.
313
314 reserved_space = (str, optional)
315
316  If provided, this value defines how much disk space is reserved: the storage
317  server will not accept any share which causes the amount of free disk space
318  to drop below this value. (The free space is measured by a call to statvfs(2)
319  on Unix, or GetDiskFreeSpaceEx on Windows, and is the space available to the
320  user account under which the storage server runs.)
321
322  This string contains a number, with an optional case-insensitive scale
323  suffix like "K" or "M" or "G", and an optional "B" or "iB" suffix. So
324  "100MB", "100M", "100000000B", "100000000", and "100000kb" all mean the same
325  thing. Likewise, "1MiB", "1024KiB", and "1048576B" all mean the same thing.
326
327 expire.enabled =
328 expire.mode =
329 expire.override_lease_duration =
330 expire.cutoff_date =
331 expire.immutable =
332 expire.mutable =
333
334  These settings control garbage-collection, in which the server will delete
335  shares that no longer have an up-to-date lease on them. Please see the
336  neighboring "garbage-collection.txt" document for full details.
337
338
339 == Running A Helper ==
340
341 A "helper" is a regular client node that also offers the "upload helper"
342 service.
343
344 [helper]
345 enabled = (boolean, optional)
346
347  If True, the node will run a helper (see docs/helper.txt for details). The
348  helper's contact FURL will be placed in private/helper.furl, from which it
349  can be copied to any clients which wish to use it. Clearly nodes should not
350  both run a helper and attempt to use one: do not create both helper.furl and
351  run_helper in the same node. The default is False.
352
353
354 == Running An Introducer ==
355
356 The introducer node uses a different '.tac' file (named introducer.tac), and
357 pays attention to the "[node]" section, but not the others.
358
359 The Introducer node maintains some different state than regular client
360 nodes.
361
362 BASEDIR/introducer.furl : This is generated the first time the introducer
363 node is started, and used again on subsequent runs, to give the introduction
364 service a persistent long-term identity. This file should be published and
365 copied into new client nodes before they are started for the first time.
366
367
368 == Other Files in BASEDIR ==
369
370 Some configuration is not kept in tahoe.cfg, for the following reasons:
371
372  * it is generated by the node at startup, e.g. encryption keys. The node
373    never writes to tahoe.cfg
374  * it is generated by user action, e.g. the 'tahoe create-alias' command
375
376 In addition, non-configuration persistent state is kept in the node's base
377 directory, next to the configuration knobs.
378
379 This section describes these other files.
380
381
382 private/node.pem : This contains an SSL private-key certificate. The node
383 generates this the first time it is started, and re-uses it on subsequent
384 runs. This certificate allows the node to have a cryptographically-strong
385 identifier (the Foolscap "TubID"), and to establish secure connections to
386 other nodes.
387
388 storage/ : Nodes which host StorageServers will create this directory to hold
389 shares of files on behalf of other clients. There will be a directory
390 underneath it for each StorageIndex for which this node is holding shares.
391 There is also an "incoming" directory where partially-completed shares are
392 held while they are being received.
393
394 client.tac : this file defines the client, by constructing the actual Client
395 instance each time the node is started. It is used by the 'twistd'
396 daemonization program (in the "-y" mode), which is run internally by the
397 "tahoe start" command. This file is created by the "tahoe create-node" or
398 "tahoe create-client" commands.
399
400 private/control.furl : this file contains a FURL that provides access to a
401 control port on the client node, from which files can be uploaded and
402 downloaded. This file is created with permissions that prevent anyone else
403 from reading it (on operating systems that support such a concept), to insure
404 that only the owner of the client node can use this feature. This port is
405 intended for debugging and testing use.
406
407 private/logport.furl : this file contains a FURL that provides access to a
408 'log port' on the client node, from which operational logs can be retrieved.
409 Do not grant logport access to strangers, because occasionally secret
410 information may be placed in the logs.
411
412 private/helper.furl : if the node is running a helper (for use by other
413 clients), its contact FURL will be placed here. See docs/helper.txt for more
414 details.
415
416 private/root_dir.cap (optional): The command-line tools will read a directory
417 cap out of this file and use it, if you don't specify a '--dir-cap' option or
418 if you specify '--dir-cap=root'.
419
420 private/convergence (automatically generated): An added secret for encrypting
421 immutable files. Everyone who has this same string in their
422 private/convergence file encrypts their immutable files in the same way when
423 uploading them. This causes identical files to "converge" -- to share the
424 same storage space since they have identical ciphertext -- which conserves
425 space and optimizes upload time, but it also exposes files to the possibility
426 of a brute-force attack by people who know that string. In this attack, if
427 the attacker can guess most of the contents of a file, then they can use
428 brute-force to learn the remaining contents.
429
430 So the set of people who know your private/convergence string is the set of
431 people who converge their storage space with you when you and they upload
432 identical immutable files, and it is also the set of people who could mount
433 such an attack.
434
435 The content of the private/convergence file is a base-32 encoded string. If
436 the file doesn't exist, then when the Tahoe client starts up it will generate
437 a random 256-bit string and write the base-32 encoding of this string into
438 the file. If you want to converge your immutable files with as many people as
439 possible, put the empty string (so that private/convergence is a zero-length
440 file).
441
442
443 == Other files ==
444
445 logs/ : Each Tahoe node creates a directory to hold the log messages produced
446 as the node runs. These logfiles are created and rotated by the "twistd"
447 daemonization program, so logs/twistd.log will contain the most recent
448 messages, logs/twistd.log.1 will contain the previous ones, logs/twistd.log.2
449 will be older still, and so on. twistd rotates logfiles after they grow
450 beyond 1MB in size. If the space consumed by logfiles becomes troublesome,
451 they should be pruned: a cron job to delete all files that were created more
452 than a month ago in this logs/ directory should be sufficient.
453
454 my_nodeid : this is written by all nodes after startup, and contains a
455 base32-encoded (i.e. human-readable) NodeID that identifies this specific
456 node. This NodeID is the same string that gets displayed on the web page (in
457 the "which peers am I connected to" list), and the shortened form (the first
458 characters) is recorded in various log messages.
459
460
461 == Backwards Compatibility Files ==
462
463 Tahoe releases before 1.3.0 had no 'tahoe.cfg' file, and used distinct files
464 for each item listed below. For each configuration knob, if the distinct file
465 exists, it will take precedence over the corresponding item in tahoe.cfg .
466
467
468 [node]nickname : BASEDIR/nickname
469 [node]web.port : BASEDIR/webport
470 [node]tub.port : BASEDIR/client.port  (for Clients, not Introducers)
471 [node]tub.port : BASEDIR/introducer.port  (for Introducers, not Clients)
472       (note that, unlike other keys, tahoe.cfg overrides the *.port file)
473 [node]tub.location : replaces BASEDIR/advertised_ip_addresses
474 [node]log_gatherer.furl : BASEDIR/log_gatherer.furl (one per line)
475 [node]timeout.keepalive : BASEDIR/keepalive_timeout
476 [node]timeout.disconnect : BASEDIR/disconnect_timeout
477 [client]introducer.furl : BASEDIR/introducer.furl
478 [client]helper.furl : BASEDIR/helper.furl
479 [client]key_generator.furl : BASEDIR/key_generator.furl
480 [client]stats_gatherer.furl : BASEDIR/stats_gatherer.furl
481 [storage]enabled : BASEDIR/no_storage (False if no_storage exists)
482 [storage]readonly : BASEDIR/readonly_storage (True if readonly_storage exists)
483 [storage]sizelimit : BASEDIR/sizelimit
484 [storage]debug_discard : BASEDIR/debug_discard_storage
485 [helper]enabled : BASEDIR/run_helper (True if run_helper exists)
486
487 Note: the functionality of [node]ssh.port and [node]ssh.authorized_keys_file
488 were previously combined, controlled by the presence of a
489 BASEDIR/authorized_keys.SSHPORT file, in which the suffix of the filename
490 indicated which port the ssh server should listen on, and the contents of the
491 file provided the ssh public keys to accept. Support for these files has been
492 removed completely. To ssh into your Tahoe node, add [node]ssh.port and
493 [node].ssh_authorized_keys_file statements to your tahoe.cfg .
494
495 Likewise, the functionality of [node]tub.location is a variant of the
496 now-unsupported BASEDIR/advertised_ip_addresses . The old file was additive
497 (the addresses specified in advertised_ip_addresses were used in addition to
498 any that were automatically discovered), whereas the new tahoe.cfg directive
499 is not (tub.location is used verbatim).
500
501
502 == Example ==
503
504 The following is a sample tahoe.cfg file, containing values for all keys
505 described above. Note that this is not a recommended configuration (most of
506 these are not the default values), merely a legal one.
507
508 [node]
509 nickname = Bob's Tahoe Node
510 tub.port = 34912
511 tub.location = 123.45.67.89:8098,44.55.66.77:8098
512 web.port = 3456
513 log_gatherer.furl = pb://soklj4y7eok5c3xkmjeqpw@192.168.69.247:44801/eqpwqtzm
514 timeout.keepalive = 240
515 timeout.disconnect = 1800
516 ssh.port = 8022
517 ssh.authorized_keys_file = ~/.ssh/authorized_keys
518
519 [client]
520 introducer.furl = pb://ok45ssoklj4y7eok5c3xkmj@tahoe.example:44801/ii3uumo
521 helper.furl = pb://ggti5ssoklj4y7eok5c3xkmj@helper.tahoe.example:7054/kk8lhr
522
523 [storage]
524 enabled = True
525 readonly_storage = True
526 sizelimit = 10000000000
527
528 [helper]
529 run_helper = True