source: trunk/docs/configuration.rst @ 582931b

Last change on this file since 582931b was 582931b, checked in by Brian Warner <warner@…>, at 2017-01-09T06:59:51Z

docs: recommend proper introducers.yaml syntax

add a test to exercise that this syntax is parseable, and another to point
out that the previously-recommended syntax was not

refs ticket:2862

  • Property mode set to 100644
File size: 47.9 KB
Line 
1.. -*- coding: utf-8-with-signature -*-
2
3=============================
4Configuring a Tahoe-LAFS node
5=============================
6
7#.  `Node Types`_
8#.  `Overall Node Configuration`_
9#.  `Connection Management`_
10#.  `Client Configuration`_
11#.  `Storage Server Configuration`_
12#.  `Frontend Configuration`_
13#.  `Running A Helper`_
14#.  `Running An Introducer`_
15#.  `Other Files in BASEDIR`_
16#. `Static Server Definitions`_
17#. `Other files`_
18#. `Example`_
19
20A Tahoe-LAFS node is configured by writing to files in its base directory.
21These files are read by the node when it starts, so each time you change
22them, you need to restart the node.
23
24The node also writes state to its base directory, so it will create files on
25its own.
26
27This document contains a complete list of the config files that are examined
28by the client node, as well as the state files that you'll observe in its
29base directory.
30
31The main file is named "``tahoe.cfg``", and is an ".INI"-style configuration
32file (parsed by the Python stdlib 'ConfigParser' module: "``[name]``" section
33markers, lines with "``key.subkey: value``", rfc822-style
34continuations). There are also other files containing information that does
35not easily fit into this format. The "``tahoe create-node``" or "``tahoe
36create-client``" command will create an initial ``tahoe.cfg`` file for
37you. After creation, the node will never modify the ``tahoe.cfg`` file: all
38persistent state is put in other files.
39
40The item descriptions below use the following types:
41
42``boolean``
43
44    one of (True, yes, on, 1, False, off, no, 0), case-insensitive
45
46``strports string``
47
48    a Twisted listening-port specification string, like "``tcp:80``" or
49    "``tcp:3456:interface=127.0.0.1``". For a full description of the format,
50    see `the Twisted strports documentation`_.  Please note, if interface= is
51    not specified, Tahoe-LAFS will attempt to bind the port specified on all
52    interfaces.
53
54``endpoint specification string``
55
56    a Twisted Endpoint specification string, like "``tcp:80``" or
57    "``tcp:3456:interface=127.0.0.1``". These are replacing strports strings.
58    For a full description of the format, see `the Twisted Endpoints
59    documentation`_. Please note, if interface= is not specified, Tahoe-LAFS
60    will attempt to bind the port specified on all interfaces. Also note that
61    ``tub.port`` only works with TCP endpoints right now.
62
63``FURL string``
64
65    a Foolscap endpoint identifier, like
66    ``pb://soklj4y7eok5c3xkmjeqpw@192.168.69.247:44801/eqpwqtzm``
67
68.. _the Twisted strports documentation: https://twistedmatrix.com/documents/current/api/twisted.application.strports.html
69.. _the Twisted Endpoints documentation: http://twistedmatrix.com/documents/current/core/howto/endpoints.html#endpoint-types-included-with-twisted
70
71Node Types
72==========
73
74A node can be a client/server, an introducer, or a statistics gatherer.
75
76Client/server nodes provide one or more of the following services:
77
78* web-API service
79* SFTP service
80* FTP service
81* Magic Folder service
82* helper service
83* storage service.
84
85A client/server that provides storage service (i.e. storing shares for
86clients) is called a "storage server". If it provides any of the other
87services, it is a "storage client" (a node can be both a storage server and a
88storage client). A client/server node that provides web-API service is called
89a "gateway".
90
91
92Overall Node Configuration
93==========================
94
95This section controls the network behavior of the node overall: which ports
96and IP addresses are used, when connections are timed out, etc. This
97configuration applies to all node types and is independent of the services
98that the node is offering.
99
100If your node is behind a firewall or NAT device and you want other clients to
101connect to it, you'll need to open a port in the firewall or NAT, and specify
102that port number in the tub.port option. If behind a NAT, you *may* need to
103set the ``tub.location`` option described below.
104
105``[node]``
106
107``nickname = (UTF-8 string, optional)``
108
109    This value will be displayed in management tools as this node's
110    "nickname". If not provided, the nickname will be set to "<unspecified>".
111    This string shall be a UTF-8 encoded Unicode string.
112
113``web.port = (strports string, optional)``
114
115    This controls where the node's web server should listen, providing node
116    status and, if the node is a client/server, providing web-API service as
117    defined in :doc:`frontends/webapi`.
118
119    This file contains a Twisted "strports" specification such as "``3456``"
120    or "``tcp:3456:interface=127.0.0.1``". The "``tahoe create-node``" or
121    "``tahoe create-client``" commands set the ``web.port`` to
122    "``tcp:3456:interface=127.0.0.1``" by default; this is overridable by the
123    ``--webport`` option. You can make it use SSL by writing
124    "``ssl:3456:privateKey=mykey.pem:certKey=cert.pem``" instead.
125
126    If this is not provided, the node will not run a web server.
127
128``web.static = (string, optional)``
129
130    This controls where the ``/static`` portion of the URL space is
131    served. The value is a directory name (``~username`` is allowed, and
132    non-absolute names are interpreted relative to the node's basedir), which
133    can contain HTML and other files. This can be used to serve a
134    Javascript-based frontend to the Tahoe-LAFS node, or other services.
135
136    The default value is "``public_html``", which will serve
137    ``BASEDIR/public_html`` .  With the default settings,
138    ``http://127.0.0.1:3456/static/foo.html`` will serve the contents of
139    ``BASEDIR/public_html/foo.html`` .
140
141``tub.port = (endpoint specification strings or "disabled", optional)``
142
143    This controls which port the node uses to accept Foolscap connections
144    from other nodes. It is parsed as a comma-separated list of Twisted
145    "server endpoint descriptor" strings, each of which is a value like
146    ``tcp:12345`` and ``tcp:23456:interface=127.0.0.1``.
147
148    To listen on multiple ports at once (e.g. both TCP-on-IPv4 and TCP-on-IPv6),
149    use something like ``tcp6:interface=2600\:3c01\:f03c\:91ff\:fe93\:d272:3456,tcp:interface=8.8.8.8:3456``.
150    Lists of endpoint descriptor strings like the following ``tcp:12345,tcp6:12345``
151    are known to not work because an ``Address already in use.`` error.
152
153    If ``tub.port`` is the string ``disabled``, the node will not listen at
154    all, and thus cannot accept connections from other nodes. If ``[storage]
155    enabled = true``, or ``[helper] enabled = true``, or the node is an
156    Introducer, then it is an error to have ``tub.port`` be empty. If
157    ``tub.port`` is disabled, then ``tub.location`` must also be disabled,
158    and vice versa.
159
160    For backwards compatibility, if this contains a simple integer, it will
161    be used as a TCP port number, like ``tcp:%d`` (which will accept
162    connections on all interfaces). However ``tub.port`` cannot be ``0`` or
163    ``tcp:0`` (older versions accepted this, but the node is no longer
164    willing to ask Twisted to allocate port numbers in this way). If
165    ``tub.port`` is present, it may not be empty.
166
167    If the ``tub.port`` config key is not provided (e.g. ``tub.port`` appears
168    nowhere in the ``[node]`` section, or is commented out), the node will
169    look in ``BASEDIR/client.port`` (or ``BASEDIR/introducer.port``, for
170    introducers) for the descriptor that was used last time.
171
172    If neither ``tub.port`` nor the port file is available, the node will ask
173    the kernel to allocate any available port (the moral equivalent of
174    ``tcp:0``). The allocated port number will be written into a descriptor
175    string in ``BASEDIR/client.port`` (or ``introducer.port``), so that
176    subsequent runs will re-use the same port.
177
178``tub.location = (hint string or "disabled", optional)``
179
180    In addition to running as a client, each Tahoe-LAFS node can also run as
181    a server, listening for connections from other Tahoe-LAFS clients. The
182    node announces its location by publishing a "FURL" (a string with some
183    connection hints) to the Introducer. The string it publishes can be found
184    in ``BASEDIR/private/storage.furl`` . The ``tub.location`` configuration
185    controls what location is published in this announcement.
186
187    If your node is meant to run as a server, you should fill this in, using
188    a hostname or IP address that is reachable from your intended clients.
189
190    If ``tub.port`` is set to ``disabled``, then ``tub.location`` must also
191    be ``disabled``.
192
193    If you don't provide ``tub.location``, the node will try to figure out a
194    useful one by itself, by using tools like "``ifconfig``" to determine the
195    set of IP addresses on which it can be reached from nodes both near and
196    far. It will also include the TCP port number on which it is listening
197    (either the one specified by ``tub.port``, or whichever port was assigned
198    by the kernel when ``tub.port`` is left unspecified). However this
199    automatic address-detection is discouraged, and will probably be removed
200    from a future release. It will include the ``127.0.0.1`` "localhost"
201    address (which is only useful to clients running on the same computer),
202    and RFC1918 private-network addresses like ``10.*.*.*`` and
203    ``192.168.*.*`` (which are only useful to clients on the local LAN). In
204    general, the automatically-detected IP addresses will only be useful if
205    the node has a public IP address, such as a VPS or colo-hosted server.
206
207    You will certainly need to set ``tub.location`` if your node lives behind
208    a firewall that is doing inbound port forwarding, or if you are using
209    other proxies such that the local IP address or port number is not the
210    same one that remote clients should use to connect. You might also want
211    to control this when using a Tor proxy to avoid revealing your actual IP
212    address through the Introducer announcement.
213
214    If ``tub.location`` is specified, by default it entirely replaces the
215    automatically determined set of IP addresses. To include the automatically
216    determined addresses as well as the specified ones, include the uppercase
217    string "``AUTO``" in the list.
218
219    The value is a comma-separated string of method:host:port location hints,
220    like this::
221
222      tcp:123.45.67.89:8098,tcp:tahoe.example.com:8098,tcp:127.0.0.1:8098
223
224    A few examples:
225
226    * Don't listen at all (client-only mode)::
227
228        tub.port = disabled
229        tub.location = disabled
230
231    * Use a DNS name so you can change the IP address more easily::
232
233        tub.port = tcp:8098
234        tub.location = tcp:tahoe.example.com:8098
235
236    * Run a node behind a firewall (which has an external IP address) that
237      has been configured to forward external port 7912 to our internal
238      node's port 8098::
239
240        tub.port = tcp:8098
241        tub.location = tcp:external-firewall.example.com:7912
242
243    * Emulate default behavior, assuming your host has public IP address of
244      123.45.67.89, and the kernel-allocated port number was 8098::
245
246        tub.port = tcp:8098
247        tub.location = tcp:123.45.67.89:8098,tcp:127.0.0.1:8098
248
249    * Use a DNS name but also include the default set of addresses::
250
251        tub.port = tcp:8098
252        tub.location = tcp:tahoe.example.com:8098,AUTO
253
254    * Run a node behind a Tor proxy (perhaps via ``torsocks``), in
255      client-only mode (i.e. we can make outbound connections, but other
256      nodes will not be able to connect to us). The literal
257      '``unreachable.example.org``' will not resolve, but will serve as a
258      reminder to human observers that this node cannot be reached. "Don't
259      call us.. we'll call you"::
260
261        tub.port = tcp:8098
262        tub.location = tcp:unreachable.example.org:0
263
264    * Run a node behind a Tor proxy, and make the server available as a Tor
265      "hidden service". (This assumes that other clients are running their
266      node with ``torsocks``, such that they are prepared to connect to a
267      ``.onion`` address.) The hidden service must first be configured in
268      Tor, by giving it a local port number and then obtaining a ``.onion``
269      name, using something in the ``torrc`` file like::
270
271        HiddenServiceDir /var/lib/tor/hidden_services/tahoe
272        HiddenServicePort 29212 127.0.0.1:8098
273
274      once Tor is restarted, the ``.onion`` hostname will be in
275      ``/var/lib/tor/hidden_services/tahoe/hostname``. Then set up your
276      ``tahoe.cfg`` like::
277
278        tub.port = tcp:8098
279        tub.location = tor:ualhejtq2p7ohfbb.onion:29212
280
281``log_gatherer.furl = (FURL, optional)``
282
283    If provided, this contains a single FURL string that is used to contact a
284    "log gatherer", which will be granted access to the logport. This can be
285    used to gather operational logs in a single place. Note that in previous
286    releases of Tahoe-LAFS, if an old-style ``BASEDIR/log_gatherer.furl``
287    file existed it would also be used in addition to this value, allowing
288    multiple log gatherers to be used at once. As of Tahoe-LAFS v1.9.0, an
289    old-style file is ignored and a warning will be emitted if one is
290    detected. This means that as of Tahoe-LAFS v1.9.0 you can have at most
291    one log gatherer per node. See ticket `#1423`_ about lifting this
292    restriction and letting you have multiple log gatherers.
293
294    .. _`#1423`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1423
295
296``timeout.keepalive = (integer in seconds, optional)``
297
298``timeout.disconnect = (integer in seconds, optional)``
299
300    If ``timeout.keepalive`` is provided, it is treated as an integral number
301    of seconds, and sets the Foolscap "keepalive timer" to that value. For
302    each connection to another node, if nothing has been heard for a while,
303    we will attempt to provoke the other end into saying something. The
304    duration of silence that passes before sending the PING will be between
305    KT and 2*KT. This is mainly intended to keep NAT boxes from expiring idle
306    TCP sessions, but also gives TCP's long-duration keepalive/disconnect
307    timers some traffic to work with. The default value is 240 (i.e. 4
308    minutes).
309
310    If timeout.disconnect is provided, this is treated as an integral number
311    of seconds, and sets the Foolscap "disconnect timer" to that value. For
312    each connection to another node, if nothing has been heard for a while,
313    we will drop the connection. The duration of silence that passes before
314    dropping the connection will be between DT-2*KT and 2*DT+2*KT (please see
315    ticket `#521`_ for more details). If we are sending a large amount of
316    data to the other end (which takes more than DT-2*KT to deliver), we
317    might incorrectly drop the connection. The default behavior (when this
318    value is not provided) is to disable the disconnect timer.
319
320    See ticket `#521`_ for a discussion of how to pick these timeout values.
321    Using 30 minutes means we'll disconnect after 22 to 68 minutes of
322    inactivity. Receiving data will reset this timeout, however if we have
323    more than 22min of data in the outbound queue (such as 800kB in two
324    pipelined segments of 10 shares each) and the far end has no need to
325    contact us, our ping might be delayed, so we may disconnect them by
326    accident.
327
328    .. _`#521`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/521
329
330``tempdir = (string, optional)``
331
332    This specifies a temporary directory for the web-API server to use, for
333    holding large files while they are being uploaded. If a web-API client
334    attempts to upload a 10GB file, this tempdir will need to have at least
335    10GB available for the upload to complete.
336
337    The default value is the ``tmp`` directory in the node's base directory
338    (i.e. ``BASEDIR/tmp``), but it can be placed elsewhere. This directory is
339    used for files that usually (on a Unix system) go into ``/tmp``. The
340    string will be interpreted relative to the node's base directory.
341
342``reveal-IP-address = (boolean, optional, defaults to True)``
343
344    This is a safety flag. When set to False (aka "private mode"), the node
345    will refuse to start if any of the other configuration options would
346    reveal the node's IP address to servers or the external network. This
347    flag does not directly affect the node's behavior: its only power is to
348    veto node startup when something looks unsafe.
349
350    The default is True (non-private mode), because setting it to False
351    requires the installation of additional libraries (use ``pip install
352    tahoe-lafs[tor]`` and/or ``pip install tahoe-lafs[i2p]`` to get them) as
353    well as additional non-python software (Tor/I2P daemons). Performance is
354    also generally reduced when operating in private mode.
355
356    When False, any of the following configuration problems will cause
357    ``tahoe start`` to throw a PrivacyError instead of starting the node:
358
359    * ``[node] tub.location`` contains any ``tcp:`` hints
360
361    * ``[node] tub.location`` uses ``AUTO``, or is missing/empty (because
362      that defaults to AUTO)
363
364    * ``[connections] tcp =`` is set to ``tcp`` (or left as the default),
365      rather than being set to ``tor`` or ``disabled``
366
367
368.. _Connection Management:
369
370Connection Management
371=====================
372
373Three sections (``[tor]``, ``[i2p]``, and ``[connections]``) control how the
374Tahoe node makes outbound connections. Tor and I2P are configured here. This
375also controls when Tor and I2P are used: for all TCP connections (to hide
376your IP address), or only when necessary (just for servers which declare that
377they need Tor, because they use ``.onion`` addresses).
378
379Note that if you want to protect your node's IP address, you should set
380``[node] reveal-IP-address = False``, which will refuse to launch the node if
381any of the other configuration settings might violate this privacy property.
382
383``[connections]``
384-----------------
385
386This section controls *when* Tor and I2P are used. The ``[tor]`` and
387``[i2p]`` sections (described later) control *how* Tor/I2P connections are
388managed.
389
390All Tahoe nodes need to make a connection to the Introducer; the ``[client]
391introducer.furl`` setting (described below) indicates where the Introducer
392lives. Tahoe client nodes must also make connections to storage servers:
393these targets are specified in announcements that come from the Introducer.
394Both are expressed as FURLs (a Foolscap URL), which include a list of
395"connection hints". Each connection hint describes one (of perhaps many)
396network endpoints where the service might live.
397
398Connection hints include a type, and look like:
399
400* ``tcp:tahoe.example.org:12345``
401* ``tor:u33m4y7klhz3b.onion:1000``
402* ``i2p:c2ng2pbrmxmlwpijn``
403
404``tor`` hints are always handled by the ``tor`` handler (configured in the
405``[tor]`` section, described below). Likewise, ``i2p`` hints are always
406routed to the ``i2p`` handler. But either will be ignored if Tahoe was not
407installed with the necessary Tor/I2P support libraries, or if the Tor/I2P
408daemon is unreachable.
409
410The ``[connections]`` section lets you control how ``tcp`` hints are handled.
411By default, they use the normal TCP handler, which just makes direct
412connections (revealing your node's IP address to both the target server and
413the intermediate network). The node behaves this way if the ``[connections]``
414section is missing entirely, or if it looks like this::
415
416  [connections]
417   tcp = tcp
418
419To hide the Tahoe node's IP address from the servers that it uses, set the
420``[connections]`` section to use Tor for TCP hints::
421
422  [connections]
423   tcp = tor
424
425You can also disable TCP hints entirely, which would be appropriate when
426running an I2P-only node::
427
428  [connections]
429   tcp = disabled
430
431(Note that I2P does not support connections to normal TCP ports, so
432``[connections] tcp = i2p`` is invalid)
433
434In the future, Tahoe services may be changed to live on HTTP/HTTPS URLs
435instead of Foolscap. In that case, connections will be made using whatever
436handler is configured for ``tcp`` hints. So the same ``tcp = tor``
437configuration will work.
438
439``[tor]``
440---------
441
442This controls how Tor connections are made. The defaults (all empty) mean
443that, when Tor is needed, the node will try to connect to a Tor daemon's
444SOCKS proxy on localhost port 9050 or 9150. Port 9050 is the default Tor
445SOCKS port, so it should be available under any system Tor instance (e.g. the
446one launched at boot time when the standard Debian ``tor`` package is
447installed). Port 9150 is the SOCKS port for the Tor Browser Bundle, so it
448will be available any time the TBB is running.
449
450You can set ``launch = True`` to cause the Tahoe node to launch a new Tor
451daemon when it starts up (and kill it at shutdown), if you don't have a
452system-wide instance available. Note that it takes 30-60 seconds for Tor to
453get running, so using a long-running Tor process may enable a faster startup.
454If your Tor executable doesn't live on ``$PATH``, use ``tor.executable=`` to
455specify it.
456
457``[tor]``
458
459``enabled = (boolean, optional, defaults to True)``
460
461    If False, this will disable the use of Tor entirely. The default of True
462    means the node will use Tor, if necessary, and if possible.
463
464``socks.port = (string, optional, endpoint specification string, defaults to empty)``
465
466    This tells the node that Tor connections should be routed to a SOCKS
467    proxy listening on the given endpoint. The default (of an empty value)
468    will cause the node to first try localhost port 9050, then if that fails,
469    try localhost port 9150. These are the default listening ports of the
470    standard Tor daemon, and the Tor Browser Bundle, respectively.
471
472    While this nominally accepts an arbitrary endpoint string, internal
473    limitations prevent it from accepting anything but ``tcp:HOST:PORT``
474    (unfortunately, unix-domain sockets are not yet supported). See ticket
475    #2813 for details. Also note that using a HOST of anything other than
476    localhost is discouraged, because you would be revealing your IP address
477    to external (and possibly hostile) machines.
478
479``control.port = (string, optional, endpoint specification string)``
480
481    This tells the node to connect to a pre-existing Tor daemon on the given
482    control port (which is typically ``unix://var/run/tor/control`` or
483    ``tcp:localhost:9051``). The node will then ask Tor what SOCKS port it is
484    using, and route Tor connections to that.
485
486``launch = (bool, optional, defaults to False)``
487
488    If True, the node will spawn a new (private) copy of Tor at startup, and
489    will kill it at shutdown. The new Tor will be given a persistent state
490    directory under ``NODEDIR/private/``, where Tor's microdescriptors will
491    be cached, to speed up subsequent startup.
492
493``tor.executable = (string, optional, defaults to empty)``
494
495    This controls which Tor executable is used when ``launch = True``. If
496    empty, the first executable program named ``tor`` found on ``$PATH`` will
497    be used.
498
499There are 5 valid combinations of these configuration settings:
500
501* 1: ``(empty)``: use SOCKS on port 9050/9150
502* 2: ``launch = true``: launch a new Tor
503* 3: ``socks.port = tcp:HOST:PORT``: use an existing Tor on the given SOCKS port
504* 4: ``control.port = ENDPOINT``: use an existing Tor at the given control port
505* 5: ``enabled = false``: no Tor at all
506
5071 is the default, and should work for any Linux host with the system Tor
508package installed. 2 should work on any box with Tor installed into $PATH,
509but will take an extra 30-60 seconds at startup. 3 and 4 can be used for
510specialized installations, where Tor is already running, but not listening on
511the default port. 5 should be used in environments where Tor is installed,
512but should not be used (perhaps due to a site-wide policy).
513
514Note that Tor support depends upon some additional Python libraries. To
515install Tahoe with Tor support, use ``pip install tahoe-lafs[tor]``.
516
517``[i2p]``
518---------
519
520This controls how I2P connections are made. Like with Tor, the all-empty
521defaults will cause I2P connections to be routed to a pre-existing I2P daemon
522on port 7656. This is the default SAM port for the ``i2p`` daemon.
523
524
525``[i2p]``
526
527``enabled = (boolean, optional, defaults to True)``
528
529    If False, this will disable the use of I2P entirely. The default of True
530    means the node will use I2P, if necessary, and if possible.
531
532``sam.port = (string, optional, endpoint descriptor, defaults to empty)``
533
534    This tells the node that I2P connections should be made via the SAM
535    protocol on the given port. The default (of an empty value) will cause
536    the node to try localhost port 7656. This is the default listening port
537    of the standard I2P daemon.
538
539``launch = (bool, optional, defaults to False)``
540
541    If True, the node will spawn a new (private) copy of I2P at startup, and
542    will kill it at shutdown. The new I2P will be given a persistent state
543    directory under ``NODEDIR/private/``, where I2P's microdescriptors will
544    be cached, to speed up subsequent startup. The daemon will allocate its
545    own SAM port, which will be queried from the config directory.
546
547``i2p.configdir = (string, optional, directory)``
548
549    This tells the node to parse an I2P config file in the given directory,
550    and use the SAM port it finds there. If ``launch = True``, the new I2P
551    daemon will be told to use the given directory (which can be
552    pre-populated with a suitable config file). If ``launch = False``, we
553    assume there is a pre-running I2P daemon running from this directory, and
554    can again parse the config file for the SAM port.
555
556``i2p.executable = (string, optional, defaults to empty)``
557
558    This controls which I2P executable is used when ``launch = True``. If
559    empty, the first executable program named ``i2p`` found on ``$PATH`` will
560    be used.
561
562
563.. _Client Configuration:
564
565Client Configuration
566====================
567
568``[client]``
569
570``introducer.furl = (FURL string, mandatory)``
571
572    This FURL tells the client how to connect to the introducer. Each
573    Tahoe-LAFS grid is defined by an introducer. The introducer's FURL is
574    created by the introducer node and written into its private base
575    directory when it starts, whereupon it should be published to everyone
576    who wishes to attach a client to that grid
577
578``helper.furl = (FURL string, optional)``
579
580    If provided, the node will attempt to connect to and use the given helper
581    for uploads. See :doc:`helper` for details.
582
583``stats_gatherer.furl = (FURL string, optional)``
584
585    If provided, the node will connect to the given stats gatherer and
586    provide it with operational statistics.
587
588``shares.needed = (int, optional) aka "k", default 3``
589
590``shares.total = (int, optional) aka "N", N >= k, default 10``
591
592``shares.happy = (int, optional) 1 <= happy <= N, default 7``
593
594    These three values set the default encoding parameters. Each time a new
595    file is uploaded, erasure-coding is used to break the ciphertext into
596    separate shares. There will be ``N`` (i.e. ``shares.total``) shares
597    created, and the file will be recoverable if any ``k``
598    (i.e. ``shares.needed``) shares are retrieved. The default values are
599    3-of-10 (i.e.  ``shares.needed = 3``, ``shares.total = 10``). Setting
600    ``k`` to 1 is equivalent to simple replication (uploading ``N`` copies of
601    the file).
602
603    These values control the tradeoff between storage overhead and
604    reliability. To a first approximation, a 1MB file will use (1MB *
605    ``N``/``k``) of backend storage space (the actual value will be a bit
606    more, because of other forms of overhead). Up to ``N``-``k`` shares can
607    be lost before the file becomes unrecoverable.  So large ``N``/``k``
608    ratios are more reliable, and small ``N``/``k`` ratios use less disk
609    space. ``N`` cannot be larger than 256, because of the 8-bit
610    erasure-coding algorithm that Tahoe-LAFS uses. ``k`` can not be greater
611    than ``N``. See :doc:`performance` for more details.
612
613    ``shares.happy`` allows you control over how well to "spread out" the
614    shares of an immutable file. For a successful upload, shares are
615    guaranteed to be initially placed on at least ``shares.happy`` distinct
616    servers, the correct functioning of any ``k`` of which is sufficient to
617    guarantee the availability of the uploaded file. This value should not be
618    larger than the number of servers on your grid.
619
620    A value of ``shares.happy`` <= ``k`` is allowed, but this is not
621    guaranteed to provide any redundancy if some servers fail or lose shares.
622    It may still provide redundancy in practice if ``N`` is greater than
623    the number of connected servers, because in that case there will typically
624    be more than one share on at least some storage nodes. However, since a
625    successful upload only guarantees that at least ``shares.happy`` shares
626    have been stored, the worst case is still that there is no redundancy.
627
628    (Mutable files use a different share placement algorithm that does not
629    currently consider this parameter.)
630
631``mutable.format = sdmf or mdmf``
632
633    This value tells Tahoe-LAFS what the default mutable file format should
634    be. If ``mutable.format=sdmf``, then newly created mutable files will be
635    in the old SDMF format. This is desirable for clients that operate on
636    grids where some peers run older versions of Tahoe-LAFS, as these older
637    versions cannot read the new MDMF mutable file format. If
638    ``mutable.format`` is ``mdmf``, then newly created mutable files will use
639    the new MDMF format, which supports efficient in-place modification and
640    streaming downloads. You can overwrite this value using a special
641    mutable-type parameter in the webapi. If you do not specify a value here,
642    Tahoe-LAFS will use SDMF for all newly-created mutable files.
643
644    Note that this parameter applies only to files, not to directories.
645    Mutable directories, which are stored in mutable files, are not
646    controlled by this parameter and will always use SDMF. We may revisit
647    this decision in future versions of Tahoe-LAFS.
648
649    See :doc:`specifications/mutable` for details about mutable file formats.
650
651``peers.preferred = (string, optional)``
652
653    This is an optional comma-separated list of Node IDs of servers that will
654    be tried first when selecting storage servers for reading or writing.
655
656    Servers should be identified here by their Node ID as it appears in the web
657    ui, underneath the server's nickname. For storage servers running tahoe
658    versions >=1.10 (if the introducer is also running tahoe >=1.10) this will
659    be a "Node Key" (which is prefixed with 'v0-'). For older nodes, it will be
660    a TubID instead. When a preferred server (and/or the introducer) is
661    upgraded to 1.10 or later, clients must adjust their configs accordingly.
662
663    Every node selected for upload, whether preferred or not, will still
664    receive the same number of shares (one, if there are ``N`` or more servers
665    accepting uploads). Preferred nodes are simply moved to the front of the
666    server selection lists computed for each file.
667
668    This is useful if a subset of your nodes have different availability or
669    connectivity characteristics than the rest of the grid. For instance, if
670    there are more than ``N`` servers on the grid, and ``K`` or more of them
671    are at a single physical location, it would make sense for clients at that
672    location to prefer their local servers so that they can maintain access to
673    all of their uploads without using the internet.
674
675
676Frontend Configuration
677======================
678
679The Tahoe client process can run a variety of frontend file-access protocols.
680You will use these to create and retrieve files from the virtual filesystem.
681Configuration details for each are documented in the following
682protocol-specific guides:
683
684HTTP
685
686    Tahoe runs a webserver by default on port 3456. This interface provides a
687    human-oriented "WUI", with pages to create, modify, and browse
688    directories and files, as well as a number of pages to check on the
689    status of your Tahoe node. It also provides a machine-oriented "WAPI",
690    with a REST-ful HTTP interface that can be used by other programs
691    (including the CLI tools). Please see :doc:`frontends/webapi` for full
692    details, and the ``web.port`` and ``web.static`` config variables above.
693    :doc:`frontends/download-status` also describes a few WUI status pages.
694
695CLI
696
697    The main ``tahoe`` executable includes subcommands for manipulating the
698    filesystem, uploading/downloading files, and creating/running Tahoe
699    nodes. See :doc:`frontends/CLI` for details.
700
701SFTP, FTP
702
703    Tahoe can also run both SFTP and FTP servers, and map a username/password
704    pair to a top-level Tahoe directory. See :doc:`frontends/FTP-and-SFTP`
705    for instructions on configuring these services, and the ``[sftpd]`` and
706    ``[ftpd]`` sections of ``tahoe.cfg``.
707
708Magic Folder
709
710    A node running on Linux or Windows can be configured to automatically
711    upload files that are created or changed in a specified local directory.
712    See :doc:`frontends/magic-folder` for details.
713
714
715Storage Server Configuration
716============================
717
718``[storage]``
719
720``enabled = (boolean, optional)``
721
722    If this is ``True``, the node will run a storage server, offering space
723    to other clients. If it is ``False``, the node will not run a storage
724    server, meaning that no shares will be stored on this node. Use ``False``
725    for clients who do not wish to provide storage service. The default value
726    is ``True``.
727
728``readonly = (boolean, optional)``
729
730    If ``True``, the node will run a storage server but will not accept any
731    shares, making it effectively read-only. Use this for storage servers
732    that are being decommissioned: the ``storage/`` directory could be
733    mounted read-only, while shares are moved to other servers. Note that
734    this currently only affects immutable shares. Mutable shares (used for
735    directories) will be written and modified anyway. See ticket `#390`_ for
736    the current status of this bug. The default value is ``False``.
737
738``reserved_space = (str, optional)``
739
740    If provided, this value defines how much disk space is reserved: the
741    storage server will not accept any share that causes the amount of free
742    disk space to drop below this value. (The free space is measured by a
743    call to ``statvfs(2)`` on Unix, or ``GetDiskFreeSpaceEx`` on Windows, and
744    is the space available to the user account under which the storage server
745    runs.)
746
747    This string contains a number, with an optional case-insensitive scale
748    suffix, optionally followed by "B" or "iB". The supported scale suffixes
749    are "K", "M", "G", "T", "P" and "E", and a following "i" indicates to use
750    powers of 1024 rather than 1000. So "100MB", "100 M", "100000000B",
751    "100000000", and "100000kb" all mean the same thing. Likewise, "1MiB",
752    "1024KiB", "1024 Ki", and "1048576 B" all mean the same thing.
753
754    "``tahoe create-node``" generates a tahoe.cfg with
755    "``reserved_space=1G``", but you may wish to raise, lower, or remove the
756    reservation to suit your needs.
757
758``expire.enabled =``
759
760``expire.mode =``
761
762``expire.override_lease_duration =``
763
764``expire.cutoff_date =``
765
766``expire.immutable =``
767
768``expire.mutable =``
769
770    These settings control garbage collection, in which the server will
771    delete shares that no longer have an up-to-date lease on them. Please see
772    :doc:`garbage-collection` for full details.
773
774.. _#390: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/390
775
776
777Running A Helper
778================
779
780A "helper" is a regular client node that also offers the "upload helper"
781service.
782
783``[helper]``
784
785``enabled = (boolean, optional)``
786
787    If ``True``, the node will run a helper (see :doc:`helper` for details).
788    The helper's contact FURL will be placed in ``private/helper.furl``, from
789    which it can be copied to any clients that wish to use it. Clearly nodes
790    should not both run a helper and attempt to use one: do not create
791    ``helper.furl`` and also define ``[helper]enabled`` in the same node. The
792    default is ``False``.
793
794
795Running An Introducer
796=====================
797
798The introducer node uses a different ``.tac`` file (named
799"``introducer.tac``"), and pays attention to the ``[node]`` section, but not
800the others.
801
802The Introducer node maintains some different state than regular client nodes.
803
804``BASEDIR/private/introducer.furl``
805
806  This is generated the first time the introducer node is started, and used
807  again on subsequent runs, to give the introduction service a persistent
808  long-term identity. This file should be published and copied into new
809  client nodes before they are started for the first time.
810
811
812Other Files in BASEDIR
813======================
814
815Some configuration is not kept in ``tahoe.cfg``, for the following reasons:
816
817* it doesn't fit into the INI format of ``tahoe.cfg`` (e.g.
818  ``private/servers.yaml``)
819* it is generated by the node at startup, e.g. encryption keys. The node
820  never writes to ``tahoe.cfg``.
821* it is generated by user action, e.g. the "``tahoe create-alias``" command.
822
823In addition, non-configuration persistent state is kept in the node's base
824directory, next to the configuration knobs.
825
826This section describes these other files.
827
828``private/node.pem``
829
830  This contains an SSL private-key certificate. The node generates this the
831  first time it is started, and re-uses it on subsequent runs. This
832  certificate allows the node to have a cryptographically-strong identifier
833  (the Foolscap "TubID"), and to establish secure connections to other nodes.
834
835``storage/``
836
837  Nodes that host StorageServers will create this directory to hold shares of
838  files on behalf of other clients. There will be a directory underneath it
839  for each StorageIndex for which this node is holding shares. There is also
840  an "incoming" directory where partially-completed shares are held while
841  they are being received.
842
843``tahoe-client.tac``
844
845  This file defines the client, by constructing the actual Client instance
846  each time the node is started. It is used by the "``twistd``" daemonization
847  program (in the ``-y`` mode), which is run internally by the "``tahoe
848  start``" command. This file is created by the "``tahoe create-node``" or
849  "``tahoe create-client``" commands.
850
851``tahoe-introducer.tac``
852
853  This file is used to construct an introducer, and is created by the
854  "``tahoe create-introducer``" command.
855
856``tahoe-stats-gatherer.tac``
857
858  This file is used to construct a statistics gatherer, and is created by the
859  "``tahoe create-stats-gatherer``" command.
860
861``private/control.furl``
862
863  This file contains a FURL that provides access to a control port on the
864  client node, from which files can be uploaded and downloaded. This file is
865  created with permissions that prevent anyone else from reading it (on
866  operating systems that support such a concept), to insure that only the
867  owner of the client node can use this feature. This port is intended for
868  debugging and testing use.
869
870``private/logport.furl``
871
872  This file contains a FURL that provides access to a 'log port' on the
873  client node, from which operational logs can be retrieved. Do not grant
874  logport access to strangers, because occasionally secret information may be
875  placed in the logs.
876
877``private/helper.furl``
878
879  If the node is running a helper (for use by other clients), its contact
880  FURL will be placed here. See :doc:`helper` for more details.
881
882``private/root_dir.cap`` (optional)
883
884  The command-line tools will read a directory cap out of this file and use
885  it, if you don't specify a '--dir-cap' option or if you specify
886  '--dir-cap=root'.
887
888``private/convergence`` (automatically generated)
889
890  An added secret for encrypting immutable files. Everyone who has this same
891  string in their ``private/convergence`` file encrypts their immutable files
892  in the same way when uploading them. This causes identical files to
893  "converge" -- to share the same storage space since they have identical
894  ciphertext -- which conserves space and optimizes upload time, but it also
895  exposes file contents to the possibility of a brute-force attack by people
896  who know that string. In this attack, if the attacker can guess most of the
897  contents of a file, then they can use brute-force to learn the remaining
898  contents.
899
900  So the set of people who know your ``private/convergence`` string is the
901  set of people who converge their storage space with you when you and they
902  upload identical immutable files, and it is also the set of people who
903  could mount such an attack.
904
905  The content of the ``private/convergence`` file is a base-32 encoded
906  string.  If the file doesn't exist, then when the Tahoe-LAFS client starts
907  up it will generate a random 256-bit string and write the base-32 encoding
908  of this string into the file. If you want to converge your immutable files
909  with as many people as possible, put the empty string (so that
910  ``private/convergence`` is a zero-length file).
911
912Additional Introducer Definitions
913=================================
914
915The ``private/introducers.yaml`` file defines additional Introducers. The
916first introducer is defined in ``tahoe.cfg``, in ``[client]
917introducer.furl``. To use two or more Introducers, choose a locally-unique
918"petname" for each one, then define their FURLs in
919``private/introducers.yaml`` like this::
920
921  introducers:
922    petname2:
923      furl: FURL2
924    petname3:
925      furl: FURL3
926
927Servers will announce themselves to all configured introducers. Clients will
928merge the announcements they receive from all introducers. Nothing will
929re-broadcast an announcement (i.e. telling introducer 2 about something you
930heard from introducer 1).
931
932If you omit the introducer definitions from both ``tahoe.cfg`` and
933``introducers.yaml``, the node will not use an Introducer at all. Such
934"introducerless" clients must be configured with static servers (described
935below), or they will not be able to upload and download files.
936
937Static Server Definitions
938=========================
939
940The ``private/servers.yaml`` file defines "static servers": those which are
941not announced through the Introducer. This can also control how we connect to
942those servers.
943
944Most clients do not need this file. It is only necessary if you want to use
945servers which are (for some specialized reason) not announced through the
946Introducer, or to connect to those servers in different ways. You might do
947this to "freeze" the server list: use the Introducer for a while, then copy
948all announcements into ``servers.yaml``, then stop using the Introducer
949entirely. Or you might have a private server that you don't want other users
950to learn about (via the Introducer). Or you might run a local server which is
951announced to everyone else as a Tor onion address, but which you can connect
952to directly (via TCP).
953
954The file syntax is `YAML`_, with a top-level dictionary named ``storage``.
955Other items may be added in the future.
956
957The ``storage`` dictionary takes keys which are server-ids, and values which
958are dictionaries with two keys: ``ann`` and ``connections``. The ``ann``
959value is a dictionary which will be used in lieu of the introducer
960announcement, so it can be populated by copying the ``ann`` dictionary from
961``NODEDIR/introducer_cache.yaml``.
962
963The server-id can be any string, but ideally you should use the public key as
964published by the server. Each server displays this as "Node ID:" in the
965top-right corner of its "WUI" web welcome page. It can also be obtained from
966other client nodes, which record it as ``key_s:`` in their
967``introducer_cache.yaml`` file. The format is "v0-" followed by 52 base32
968characters like so::
969
970  v0-c2ng2pbrmxmlwpijn3mr72ckk5fmzk6uxf6nhowyosaubrt6y5mq
971
972The ``ann`` dictionary really only needs one key:
973
974* ``anonymous-storage-FURL``: how we connect to the server
975
976(note that other important keys may be added in the future, as Accounting and
977HTTP-based servers are implemented)
978
979Optional keys include:
980
981* ``nickname``: the name of this server, as displayed on the Welcome page
982  server list
983* ``permutation-seed-base32``: this controls how shares are mapped to
984  servers. This is normally computed from the server-ID, but can be
985  overridden to maintain the mapping for older servers which used to use
986  Foolscap TubIDs as server-IDs. If your selected server-ID cannot be parsed
987  as a public key, it will be hashed to compute the permutation seed. This is
988  fine as long as all clients use the same thing, but if they don't, then
989  your client will disagree with the other clients about which servers should
990  hold each share. This will slow downloads for everybody, and may cause
991  additional work or consume extra storage when repair operations don't
992  converge.
993* anything else from the ``introducer_cache.yaml`` announcement, like
994  ``my-version``, which is displayed on the Welcome page server list
995
996For example, a private static server could be defined with a
997``private/servers.yaml`` file like this::
998
999  storage:
1000    v0-4uazse3xb6uu5qpkb7tel2bm6bpea4jhuigdhqcuvvse7hugtsia:
1001      ann:
1002        nickname: my-server-1
1003        anonymous-storage-FURL: pb://u33m4y7klhz3bypswqkozwetvabelhxt@tcp:8.8.8.8:51298/eiu2i7p6d6mm4ihmss7ieou5hac3wn6b
1004
1005Or, if you're feeling really lazy::
1006
1007  storage:
1008    my-serverid-1:
1009      ann:
1010        anonymous-storage-FURL: pb://u33m4y7klhz3bypswqkozwetvabelhxt@tcp:8.8.8.8:51298/eiu2i7p6d6mm4ihmss7ieou5hac3wn6b
1011
1012.. _YAML: http://yaml.org/
1013
1014Overriding Connection-Handlers for Static Servers
1015-------------------------------------------------
1016
1017A ``connections`` entry will override the default connection-handler mapping
1018(as established by ``tahoe.cfg [connections]``). This can be used to build a
1019"Tor-mostly client": one which is restricted to use Tor for all connections,
1020except for a few private servers to which normal TCP connections will be
1021made. To override the published announcement (and thus avoid connecting twice
1022to the same server), the server ID must exactly match.
1023
1024``tahoe.cfg``::
1025
1026  [connections]
1027   # this forces the use of Tor for all "tcp" hints
1028   tcp = tor
1029
1030``private/servers.yaml``::
1031
1032  storage:
1033    v0-c2ng2pbrmxmlwpijn3mr72ckk5fmzk6uxf6nhowyosaubrt6y5mq:
1034      ann:
1035        nickname: my-server-1
1036        anonymous-storage-FURL: pb://u33m4y7klhz3bypswqkozwetvabelhxt@tcp:10.1.2.3:51298/eiu2i7p6d6mm4ihmss7ieou5hac3wn6b
1037      connections:
1038        # this overrides the tcp=tor from tahoe.cfg, for just this server
1039        tcp: tcp
1040
1041The ``connections`` table is needed to override the ``tcp = tor`` mapping
1042that comes from ``tahoe.cfg``. Without it, the client would attempt to use
1043Tor to connect to ``10.1.2.3``, which would fail because it is a
1044local/non-routeable (RFC1918) address.
1045
1046
1047Other files
1048===========
1049
1050``logs/``
1051
1052  Each Tahoe-LAFS node creates a directory to hold the log messages produced
1053  as the node runs. These logfiles are created and rotated by the
1054  "``twistd``" daemonization program, so ``logs/twistd.log`` will contain the
1055  most recent messages, ``logs/twistd.log.1`` will contain the previous ones,
1056  ``logs/twistd.log.2`` will be older still, and so on. ``twistd`` rotates
1057  logfiles after they grow beyond 1MB in size. If the space consumed by
1058  logfiles becomes troublesome, they should be pruned: a cron job to delete
1059  all files that were created more than a month ago in this ``logs/``
1060  directory should be sufficient.
1061
1062``my_nodeid``
1063
1064  this is written by all nodes after startup, and contains a base32-encoded
1065  (i.e. human-readable) NodeID that identifies this specific node. This
1066  NodeID is the same string that gets displayed on the web page (in the
1067  "which peers am I connected to" list), and the shortened form (the first
1068  few characters) is recorded in various log messages.
1069
1070``access.blacklist``
1071
1072  Gateway nodes may find it necessary to prohibit access to certain
1073  files. The web-API has a facility to block access to filecaps by their
1074  storage index, returning a 403 "Forbidden" error instead of the original
1075  file. For more details, see the "Access Blacklist" section of
1076  :doc:`frontends/webapi`.
1077
1078
1079Example
1080=======
1081
1082The following is a sample ``tahoe.cfg`` file, containing values for some of
1083the keys described in the previous section. Note that this is not a
1084recommended configuration (most of these are not the default values), merely
1085a legal one.
1086
1087::
1088
1089  [node]
1090  nickname = Bob's Tahoe-LAFS Node
1091  tub.port = tcp:34912
1092  tub.location = tcp:123.45.67.89:8098,tcp:44.55.66.77:8098
1093  web.port = tcp:3456
1094  log_gatherer.furl = pb://soklj4y7eok5c3xkmjeqpw@192.168.69.247:44801/eqpwqtzm
1095  timeout.keepalive = 240
1096  timeout.disconnect = 1800
1097 
1098  [client]
1099  introducer.furl = pb://ok45ssoklj4y7eok5c3xkmj@tcp:tahoe.example:44801/ii3uumo
1100  helper.furl = pb://ggti5ssoklj4y7eok5c3xkmj@tcp:helper.tahoe.example:7054/kk8lhr
1101 
1102  [storage]
1103  enabled = True
1104  readonly = True
1105  reserved_space = 10000000000
1106 
1107  [helper]
1108  enabled = True
1109
1110
1111Old Configuration Files
1112=======================
1113
1114Tahoe-LAFS releases before v1.3.0 had no ``tahoe.cfg`` file, and used
1115distinct files for each item. This is no longer supported and if you have
1116configuration in the old format you must manually convert it to the new
1117format for Tahoe-LAFS to detect it. See :doc:`historical/configuration`.
Note: See TracBrowser for help on using the repository browser.