122 Commits

Author SHA1 Message Date
Guillaume Ayoub
8ac3ce1a89 Clean many, many things 2016-08-05 02:14:49 +02:00
Guillaume Ayoub
92a0027ae1 Merge branch 'rights' of https://github.com/Unrud/Radicale into Unrud-rights 2016-08-04 23:35:01 +02:00
Guillaume Ayoub
2eaedf448f Merge pull request #457 from Unrud/atomiccreate
Atomic creation of collections and atomic PROPPATCH
2016-08-04 22:55:15 +02:00
Unrud
8ce6d1af30 Use flock locks for storage locking
These locks are compatible with the command line utility flock,
which comes preinstalled with most Linux distributions.
2016-08-04 06:15:05 +02:00
Unrud
066b5994d1 Improve rights checking and request handlers
* Access rights are checked before the storage is locked and
    collections are loaded.
  * DELETE sends 410 instead of doing nothing or crashing if the target
    doesn't exist.
  * GET always returns 404 if the target doesn't exist.
  * GET doesn't crash if a collection without tag property is requested.
  * MKCOL and MKCALENDAR send 409 if the target already exists.
  * MOVE checks if the target collection of an item actually exists and
    sends 409 otherwise.
  * PUT doesn't crash if a whole collection that doesn't exist yet is
    uploaded and ``content-type`` is ``text/vcard`` or
    ``text/calendar``.
  * PUT distinguishes between simple items and whole collections by the
    following criteria: Target is a collection; Parent exists; Parent
    has the tag property set; Parent contains other items. Before only
    the first two criteria where used, which was very unrelieable. #384
  * PROPPATCH is only allowed on collections and 409 is send otherwise.
  * ``Rights.authorized`` takes a path instead of a collection.
  * ``Collection.discover`` only returns items in ``path``, that
    actually exist. #442
2016-08-04 06:08:08 +02:00
Unrud
ae89082c24 Atomic creation of collections 2016-08-03 15:50:55 +02:00
Unrud
e34d1c46cd Move collections into collection-root folder
This is required for atomic creation and deletion of the "/" collection.
2016-08-03 15:50:38 +02:00
Unrud
bd7641699e Atomic PROPPATCH 2016-08-03 14:45:52 +02:00
Guillaume Ayoub
76b859c28e Rename .collection.props into .Radicale.props 2016-08-02 16:58:44 +02:00
Guillaume Ayoub
2f202d14e0 Fix .collection.props 2016-08-02 16:57:20 +02:00
Guillaume Ayoub
5b04ba18a8 Hide collection.props 2016-08-02 16:51:50 +02:00
Unrud
13c693ba35 Properties inside of collection
* Creation and deletion of collections can be atomic.
  * The properties file of the root collection is not outside of the
    filesystem_folder.
  * It's easier to delete and move collections by hand.
  * This breaks backward compatibility.
2016-08-02 16:35:38 +02:00
Guillaume Ayoub
d322d3f394 Clean the user's collection creation code 2016-08-02 14:00:42 +02:00
Guillaume Ayoub
04010ff8d3 Merge pull request #455 from Unrud/home
Creating addressbooks and calendars in DAVdroid
2016-08-02 13:51:29 +02:00
Guillaume Ayoub
71be1a56b8 Change find_available_file_name into private method 2016-08-02 12:11:38 +02:00
Guillaume Ayoub
a7f078eb54 Change find_available_file_name into a method 2016-08-02 11:16:24 +02:00
Guillaume Ayoub
880744ada7 Merge pull request #454 from Unrud/uniq
Check if file name already exists
2016-08-02 11:12:30 +02:00
Unrud
39d38f36a5 Check if file name already exists
The chances are pretty low but maybe the RNG is bad or something
2016-08-02 07:33:47 +02:00
Unrud
03cbcee5cd / is not a principal 2016-08-01 20:46:57 +02:00
Guillaume Ayoub
6b30870be5 Minor cleanups
Everything works fine with Apple clients now.
2016-08-01 19:00:57 +02:00
Guillaume Ayoub
6bfdcbafec Cosmetics 2016-08-01 12:50:51 +02:00
Unrud
da1a693620 Prevent unsafe usernames
If an attacker is able to create an account with a username like "user/calendar.ics", he can access collections of other users.
2016-08-01 09:10:23 +02:00
Guillaume Ayoub
dc406c17fd Merge pull request #425 from Unrud/patch-19
Don't silently drop files
2016-07-30 15:28:35 +02:00
Unrud
21d7d5a453 Hide temporary files
Fixes #443
2016-07-14 09:09:10 +02:00
Unrud
0a32e46295 Improve error message 2016-07-14 08:08:08 +02:00
Unrud
e3d7d08eab Don't silently drop files 2016-07-14 08:08:08 +02:00
Guillaume Ayoub
5bd80d8d13 Don't crash when getting unknown collections
Fix #422.
2016-07-14 01:39:57 +02:00
Guillaume Ayoub
4c91ee8906 Atomic writes (fix #440) 2016-07-14 01:14:42 +02:00
Guillaume Ayoub
5e5427f987 Cosmetics 2016-07-13 17:59:52 +02:00
Florian Mounier
6f9e9f21dd Merge branch 'optimize_storage_collection' 2016-07-08 15:35:43 +02:00
Florian Mounier
39823f8909 Add a pre_filtered_list method in collection. This allow filters optimizations 2016-07-08 11:37:30 +02:00
Florian Mounier
a2d6977cd6 Fix logic in loops 2016-07-07 17:53:35 +02:00
Florian Mounier
10e7a776fc Merge branch 'master' into optimize_storage_collection 2016-07-07 17:52:16 +02:00
Guillaume Ayoub
8c225f019c Fix support of recurring events 2016-07-07 17:49:56 +02:00
Florian Mounier
364ed3689d Optimise collection creation by avoiding nested_loop 2016-07-07 16:13:32 +02:00
Unrud
39379413d1 Use hidden file for locking 2016-06-10 01:18:02 +02:00
Unrud
3479e76690 Ignore hidden files 2016-06-10 01:17:57 +02:00
Guillaume Ayoub
063e827588 Revert "Try to use UID as filename"
This reverts commit 0b25c82d9d7b9bba874470ba439fb4bae08eeb1b.

See #419.
2016-05-30 19:05:58 +02:00
Guillaume Ayoub
f1f716b0c7 Merge pull request #419 from Unrud/patch-16
Save all items with the same UID in the same file
2016-05-30 19:03:25 +02:00
Unrud
0b25c82d9d Try to use UID as filename 2016-05-29 03:38:35 +02:00
Unrud
5c90f5b2af Save all items with the same UID in the same file
If recurrences are not in the same file, they are not correctly shown by clients.
2016-05-29 03:32:06 +02:00
Unrud
9ade92c026 Always release lock 2016-05-28 22:36:40 +02:00
Guillaume Ayoub
da1363f026 Revert "Limit duration of file locks"
This reverts commit 6b1acd14d70b2e029aa56905518b3185a66d91c2.
2016-05-25 14:05:34 +02:00
Guillaume Ayoub
69ec2891fa Remove at_once 2016-05-25 14:05:05 +02:00
Guillaume Ayoub
a3c32ee77f Merge pull request #402 from Unrud/locking
Implement locking of whole storage
2016-05-25 14:03:48 +02:00
Guillaume Ayoub
4fc5e3135a Update documentation of path_to_filesystem 2016-05-24 14:39:41 +02:00
Unrud
6b1acd14d7 Limit duration of file locks
This prevents starvation of writers in other processes
2016-05-22 23:44:21 +02:00
Unrud
14daa88772 Use FIFO for storage locking
This prevents starvation of writers in the current process
2016-05-22 23:29:00 +02:00
Unrud
1ea9a33101 Reuse lock file 2016-05-22 10:29:56 +02:00
Unrud
49bc0728e3 Only one lock file per process (lockf() works now)
lockf() is more portable than flock()
2016-05-22 10:29:56 +02:00