2013-11-08 20:31:08 +00:00
|
|
|
.. -*- coding: utf-8-with-signature -*-
|
|
|
|
|
2015-09-16 13:24:10 +00:00
|
|
|
================================
|
|
|
|
Tahoe-LAFS Magic Folder Frontend
|
|
|
|
================================
|
2011-08-08 18:21:46 +00:00
|
|
|
|
|
|
|
1. `Introduction`_
|
|
|
|
2. `Configuration`_
|
|
|
|
3. `Known Issues and Limitations`_
|
|
|
|
|
|
|
|
|
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
2015-09-16 13:24:10 +00:00
|
|
|
The Magic Folder frontend allows an upload to a Tahoe-LAFS grid to be triggered
|
2011-08-08 18:21:46 +00:00
|
|
|
automatically whenever a file is created or changed in a specific local
|
2015-04-28 19:11:40 +00:00
|
|
|
directory. It currently works on Linux and Windows.
|
2011-08-08 18:21:46 +00:00
|
|
|
|
|
|
|
The implementation was written as a prototype at the First International
|
|
|
|
Tahoe-LAFS Summit in June 2011, and is not currently in as mature a state as
|
2012-03-22 22:04:53 +00:00
|
|
|
the other frontends (web, CLI, SFTP and FTP). This means that you probably
|
2015-04-28 19:11:40 +00:00
|
|
|
should not rely on all changes to files in the local directory to result in
|
|
|
|
successful uploads. There might be (and have been) incompatible changes to
|
|
|
|
how the feature is configured.
|
2011-08-08 18:21:46 +00:00
|
|
|
|
|
|
|
We are very interested in feedback on how well this feature works for you, and
|
|
|
|
suggestions to improve its usability, functionality, and reliability.
|
|
|
|
|
|
|
|
|
|
|
|
Configuration
|
|
|
|
=============
|
|
|
|
|
2015-09-16 13:24:10 +00:00
|
|
|
The Magic Folder frontend runs as part of a gateway node. To set it up, you
|
2011-08-08 18:21:46 +00:00
|
|
|
need to choose the local directory to monitor for file changes, and a mutable
|
|
|
|
directory on the grid to which files will be uploaded.
|
|
|
|
|
2015-09-16 13:24:10 +00:00
|
|
|
These settings are configured in the ``[magic_folder]`` section of the
|
2011-08-08 18:21:46 +00:00
|
|
|
gateway's ``tahoe.cfg`` file.
|
|
|
|
|
2015-09-16 13:24:10 +00:00
|
|
|
``[magic_folder]``
|
2011-08-08 18:21:46 +00:00
|
|
|
|
|
|
|
``enabled = (boolean, optional)``
|
|
|
|
|
2015-09-16 13:24:10 +00:00
|
|
|
If this is ``True``, Magic Folder will be enabled. The default value is
|
2011-11-20 23:24:26 +00:00
|
|
|
``False``.
|
2011-08-08 18:21:46 +00:00
|
|
|
|
|
|
|
``local.directory = (UTF-8 path)``
|
|
|
|
|
|
|
|
This specifies the local directory to be monitored for new or changed
|
|
|
|
files. If the path contains non-ASCII characters, it should be encoded
|
|
|
|
in UTF-8 regardless of the system's filesystem encoding. Relative paths
|
|
|
|
will be interpreted starting from the node's base directory.
|
|
|
|
|
2015-09-16 13:24:10 +00:00
|
|
|
In addition:
|
|
|
|
* the file ``private/magic_folder_dircap`` must contain a writecap pointing
|
|
|
|
to an existing mutable directory to be used as the target of uploads.
|
|
|
|
It will start with ``URI:DIR2:``, and cannot include an alias or path.
|
|
|
|
* the file ``private/collective_dircap`` must contain a readcap
|
2011-11-20 23:24:26 +00:00
|
|
|
|
2011-08-08 18:21:46 +00:00
|
|
|
After setting the above fields and starting or restarting the gateway,
|
|
|
|
you can confirm that the feature is working by copying a file into the
|
|
|
|
local directory. Then, use the WUI or CLI to check that it has appeared
|
|
|
|
in the upload directory with the same filename. A large file may take some
|
|
|
|
time to appear, since it is only linked into the directory after the upload
|
|
|
|
has completed.
|
|
|
|
|
2016-03-30 07:55:21 +00:00
|
|
|
The 'Operational Statistics' page linked from the Welcome page shows counts
|
|
|
|
of the number of files uploaded, the number of change events currently
|
2011-08-08 18:21:46 +00:00
|
|
|
queued, and the number of failed uploads. The 'Recent Uploads and Downloads'
|
2016-03-30 07:55:21 +00:00
|
|
|
page and the node :doc:`log<../logging>` may be helpful to determine the
|
|
|
|
cause of any failures.
|
2011-08-08 18:21:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
Known Issues and Limitations
|
|
|
|
============================
|
|
|
|
|
2015-04-28 19:11:40 +00:00
|
|
|
This frontend only works on Linux and Windows. There is a ticket to add
|
|
|
|
support for Mac OS X and BSD-based systems (`#1432`_).
|
2011-08-08 18:21:46 +00:00
|
|
|
|
|
|
|
The only way to determine whether uploads have failed is to look at the
|
|
|
|
'Operational Statistics' page linked from the Welcome page. This only shows
|
|
|
|
a count of failures, not the names of files. Uploads are never retried.
|
|
|
|
|
2015-09-16 13:24:10 +00:00
|
|
|
The Magic Folder frontend performs its uploads sequentially (i.e. it waits
|
2011-08-08 18:21:46 +00:00
|
|
|
until each upload is finished before starting the next), even when there
|
|
|
|
would be enough memory and bandwidth to efficiently perform them in parallel.
|
2015-09-16 13:24:10 +00:00
|
|
|
A Magic Folder upload can occur in parallel with an upload by a different
|
|
|
|
frontend, though. (`#1459`_)
|
2011-08-08 18:21:46 +00:00
|
|
|
|
2015-04-28 19:11:40 +00:00
|
|
|
On Linux, if there are a large number of near-simultaneous file creation or
|
2011-08-08 18:21:46 +00:00
|
|
|
change events (greater than the number specified in the file
|
|
|
|
``/proc/sys/fs/inotify/max_queued_events``), it is possible that some events
|
|
|
|
could be missed. This is fairly unlikely under normal circumstances, because
|
|
|
|
the default value of ``max_queued_events`` in most Linux distributions is
|
|
|
|
16384, and events are removed from this queue immediately without waiting for
|
|
|
|
the corresponding upload to complete. (`#1430`_)
|
|
|
|
|
2015-04-28 19:11:40 +00:00
|
|
|
The Windows implementation might also occasionally miss file creation or
|
|
|
|
change events, due to limitations of the underlying Windows API
|
|
|
|
(ReadDirectoryChangesW). We do not know how likely or unlikely this is.
|
|
|
|
(`#1431`_)
|
|
|
|
|
2011-08-08 18:21:46 +00:00
|
|
|
Some filesystems may not support the necessary change notifications.
|
|
|
|
So, it is recommended for the local directory to be on a directly attached
|
|
|
|
disk-based filesystem, not a network filesystem or one provided by a virtual
|
|
|
|
machine.
|
|
|
|
|
|
|
|
Attempts to read the mutable directory at about the same time as an uploaded
|
|
|
|
file is being linked into it, might fail, even if they are done through the
|
|
|
|
same gateway. (`#1105`_)
|
|
|
|
|
2012-04-06 04:39:46 +00:00
|
|
|
When a local file is changed and closed several times in quick succession,
|
|
|
|
it may be uploaded more times than necessary to keep the remote copy
|
|
|
|
up-to-date. (`#1440`_)
|
|
|
|
|
|
|
|
Files deleted from the local directory will not be unlinked from the upload
|
|
|
|
directory. (`#1710`_)
|
|
|
|
|
2015-09-16 13:24:10 +00:00
|
|
|
The ``private/magic_folder_dircap`` and ``private/collective_dircap`` files
|
|
|
|
cannot use an alias or path to specify the upload directory. (`#1711`_)
|
2012-04-06 04:39:46 +00:00
|
|
|
|
2011-08-08 18:21:46 +00:00
|
|
|
Files are always uploaded as immutable. If there is an existing mutable file
|
|
|
|
of the same name in the upload directory, it will be unlinked and replaced
|
2012-04-06 04:39:46 +00:00
|
|
|
with an immutable file. (`#1712`_)
|
2011-08-08 18:21:46 +00:00
|
|
|
|
|
|
|
If a file in the upload directory is changed (actually relinked to a new
|
2013-11-11 22:04:11 +00:00
|
|
|
file), then the old file is still present on the grid, and any other caps to
|
2016-03-30 07:55:21 +00:00
|
|
|
it will remain valid. See :doc:`../garbage-collection` for how to reclaim
|
2013-11-11 22:04:11 +00:00
|
|
|
the space used by files that are no longer needed.
|
2011-08-08 18:21:46 +00:00
|
|
|
|
2015-04-28 19:11:40 +00:00
|
|
|
Unicode filenames are supported on both Linux and Windows, but on Linux, the
|
|
|
|
local name of a file must be encoded correctly in order for it to be uploaded.
|
|
|
|
The expected encoding is that printed by
|
|
|
|
``python -c "import sys; print sys.getfilesystemencoding()"``.
|
|
|
|
|
|
|
|
On Windows, local directories with non-ASCII names are not currently working.
|
|
|
|
(`#2219`_)
|
|
|
|
|
2015-09-16 13:24:10 +00:00
|
|
|
On Windows, when a node has Magic Folder enabled, it is unresponsive to Ctrl-C
|
2015-04-28 19:11:40 +00:00
|
|
|
(it can only be killed using Task Manager or similar). (`#2218`_)
|
2011-08-08 18:21:46 +00:00
|
|
|
|
2012-03-13 20:26:54 +00:00
|
|
|
.. _`#1105`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1105
|
|
|
|
.. _`#1430`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1430
|
|
|
|
.. _`#1431`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1431
|
|
|
|
.. _`#1432`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1432
|
|
|
|
.. _`#1433`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1433
|
2012-04-06 04:39:46 +00:00
|
|
|
.. _`#1440`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1440
|
2012-03-13 20:26:54 +00:00
|
|
|
.. _`#1449`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1449
|
|
|
|
.. _`#1458`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1458
|
|
|
|
.. _`#1459`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1459
|
2012-04-06 04:39:46 +00:00
|
|
|
.. _`#1710`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1710
|
|
|
|
.. _`#1711`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1711
|
|
|
|
.. _`#1712`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1712
|
2015-04-28 19:11:40 +00:00
|
|
|
.. _`#2218`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2218
|
|
|
|
.. _`#2219`: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2219
|