]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - docs/frontends/magic-folder.rst
More Magic Folder doc updates.
[tahoe-lafs/tahoe-lafs.git] / docs / frontends / magic-folder.rst
1 .. -*- coding: utf-8-with-signature -*-
2
3 ================================
4 Tahoe-LAFS Magic Folder Frontend
5 ================================
6
7 1.  `Introduction`_
8 2.  `Configuration`_
9 3.  `Known Issues and Limitations`_
10
11
12 Introduction
13 ============
14
15 The Magic Folder frontend synchronizes local directories on two or more
16 clients, using a Tahoe-LAFS grid for storage. Whenever a file is created
17 or changed under the local directory of one of the clients, the change is
18 propagated to the grid and then to the other clients.
19
20 The implementation of the "drop-upload" frontend, on which Magic Folder is
21 based, was written as a prototype at the First International Tahoe-LAFS
22 Summit in June 2011. In 2015, with the support of a grant from the
23 `Open Technology Fund`_, it was redesigned and extended to support
24 synchronization between clients. It currently works on Linux and Windows.
25
26 Magic Folder is not currently in as mature a state as the other frontends
27 (web, CLI, SFTP and FTP). This means that you probably should not rely on
28 all changes to files in the local directory to result in successful uploads.
29 There might be (and have been) incompatible changes to how the feature is
30 configured.
31
32 We are very interested in feedback on how well this feature works for you, and
33 suggestions to improve its usability, functionality, and reliability.
34
35 .. _`Open Technology Fund`: https://www.opentech.fund/
36
37
38 Configuration
39 =============
40
41 The Magic Folder frontend runs as part of a gateway node. To set it up, you
42 must use the tahoe magic-folder CLI. For detailed information see our
43 `Magic-Folder CLI design documentation`_. For a given Magic-Folder collective
44 directory you need to run the ``tahoe magic-folder create`` command. After
45 that the ``tahoe magic-folder invite`` command must used to generate an
46 *invite code* for each member of the magic-folder collective. A confidential,
47 authenticated communications channel should be used to transmit the invite code
48 to each member, who will be joining using the ``tahoe magic-folder join``
49 command.
50
51 These settings are persisted in the ``[magic_folder]`` section of the
52 gateway's ``tahoe.cfg`` file.
53
54 ``[magic_folder]``
55
56 ``enabled = (boolean, optional)``
57
58     If this is ``True``, Magic Folder will be enabled. The default value is
59     ``False``.
60
61 ``local.directory = (UTF-8 path)``
62
63     This specifies the local directory to be monitored for new or changed
64     files. If the path contains non-ASCII characters, it should be encoded
65     in UTF-8 regardless of the system's filesystem encoding. Relative paths
66     will be interpreted starting from the node's base directory.
67
68 You should not normally need to set these fields manually because they are
69 set by the ``tahoe magic-folder create`` and/or ``tahoe magic-folder join``
70 commands. Use the ``--help`` option to these commands for more information.
71
72 After setting up a Magic Folder collective and starting or restarting each
73 gateway, you can confirm that the feature is working by copying a file into
74 any local directory, and checking that it appears on other clients.
75 Large files may take some time to appear.
76
77 The 'Operational Statistics' page linked from the Welcome page shows
78 counts of the number of files uploaded, the number of change events currently
79 queued, and the number of failed uploads. The 'Recent Uploads and Downloads'
80 page and the node log_ may be helpful to determine the cause of any failures.
81
82 .. _log: ../logging.rst
83
84
85 Known Issues and Limitations
86 ============================
87
88 This feature only works on Linux and Windows. There is a ticket to add
89 support for Mac OS X and BSD-based systems (`#1432`_).
90
91 The only way to determine whether uploads have failed is to look at the
92 'Operational Statistics' page linked from the Welcome page. This only shows
93 a count of failures, not the names of files. Uploads are never retried.
94
95 The Magic Folder frontend performs its uploads sequentially (i.e. it waits
96 until each upload is finished before starting the next), even when there
97 would be enough memory and bandwidth to efficiently perform them in parallel.
98 A Magic Folder upload can occur in parallel with an upload by a different
99 frontend, though. (`#1459`_)
100
101 On Linux, if there are a large number of near-simultaneous file creation or
102 change events (greater than the number specified in the file
103 ``/proc/sys/fs/inotify/max_queued_events``), it is possible that some events
104 could be missed. This is fairly unlikely under normal circumstances, because
105 the default value of ``max_queued_events`` in most Linux distributions is
106 16384, and events are removed from this queue immediately without waiting for
107 the corresponding upload to complete. (`#1430`_)
108
109 The Windows implementation might also occasionally miss file creation or
110 change events, due to limitations of the underlying Windows API
111 (ReadDirectoryChangesW). We do not know how likely or unlikely this is.
112 (`#1431`_)
113
114 Some filesystems may not support the necessary change notifications.
115 So, it is recommended for the local directory to be on a directly attached
116 disk-based filesystem, not a network filesystem or one provided by a virtual
117 machine.
118
119 The ``private/magic_folder_dircap`` and ``private/collective_dircap`` files
120 cannot use an alias or path to specify the upload directory. (`#1711`_)
121
122 If a file in the upload directory is changed (actually relinked to a new
123 file), then the old file is still present on the grid, and any other caps
124 to it will remain valid. Eventually it will be possible to use
125 `garbage collection`_ to reclaim the space used by these files; however
126 currently they are retained indefinitely. (`#2440`_)
127
128 Unicode filenames are supported on both Linux and Windows, but on Linux, the
129 local name of a file must be encoded correctly in order for it to be uploaded.
130 The expected encoding is that printed by
131 ``python -c "import sys; print sys.getfilesystemencoding()"``.
132
133 On Windows, local directories with non-ASCII names are not currently working.
134 (`#2219`_)
135
136 On Windows, when a node has Magic Folder enabled, it is unresponsive to Ctrl-C
137 (it can only be killed using Task Manager or similar). (`#2218`_)
138
139 .. _`#1430`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1430
140 .. _`#1431`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1431
141 .. _`#1432`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1432
142 .. _`#1459`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1459
143 .. _`#1711`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1711
144 .. _`#2218`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2218
145 .. _`#2219`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2219
146 .. _`#2440`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2440
147
148 .. _`garbage collection`: ../garbage-collection.rst
149 .. _`Magic-Folder CLI design documentation`: ../proposed/magic-folder/user-interface-design.rst