[Owncloud] Tralfamadorian filesystem

Marco Michelino michelinux at gmail.com
Thu Apr 7 14:39:51 UTC 2011


Hi all,
I really like OwnCloud project but I need some features that are still
missing... that's why I've created Tralfamadorian filesystem.
This class extends OC_FILESTORAGE and implements a filesystem
supporting versioning, users permissions, symlinks, users quotas and
hard links.
Metadata are stored in a database (I'm using MySQL for development)
while underlying filesystem is used for data and locking.

Versioning
All methods consider path as formed by a "where" part and an optional
"when" part separated by @ character.
As an example, "/marco" is my home directory just now while
"@20110405123456789@/marco" shows my home directory as it was on april
the 5th at 12:34:56.789.
File versions are identified by timestamps with millisecond resolution.
In this way, with only one mount point and without any special
software I can access all versions of files.

Permissions
On each filesystem object you can assign permissions for any number of
users and groups.
For each directory you can assign default permissions for files that
will be created in it (kind of per directory umask).
Directories have distinct write permissions for adding and deleting files.

Quotas
Tralfamadorian filesystem can limit both disk space and number of
inodes per user

Limitations
atime is not implemented for performance (reported as equal to mtime)
x permission is not implemented (directory traversal is always granted
to everybody)
permissions are not historicized: current permissions are used for old
versions of files and directories too.
development is not finished yet

What is needed
Some extensions should be done on OC_FILESTORAGE and OC_FILESYSTEM
classes for Tralfamadorian to operate at his best.
I think we should implement a number of options that any son of
OC_FILESTORAGE can customize; in particular Tralfamadorian needs:
paths not chrooted by OC_FILESYSTEM
no permission handling by OC_FILESYSTEM
exporting methods for managing permissions, symlinks, hard links and quotas.
I imagine these methods to be added to OC_FILESTORAGE:

public static function wants_chroot() // returns true or false
public static function supports_permissions() // returns true or false
public function get_users_permissions($path) // returns array of
integers with userid as index
public function get_groups_permissions($path) // returns array of
integers with groupid as index
public function set_users_permissions($path,$permissions)
public function set_groups_permissions($path,$permissions)
public static function supports_symlinks() // returns true or false
public function symlink($target,$link) // just like PHP standard function
public function readlink($path) // just like PHP standard function
public static function supports_hardlinks() // returns true or false
public function link($target,$link) // just like PHP standard function
public static function supports_quotas() // returns true or false
public function set_user_quota($userid,$max_space,$max_inodes)
public function get_user_quota($userid) // returns array of
'max_space', max_inodes', 'used_space', 'used_inodes'
public static function supports_versioning() // returns true or false
public function get_file_versions($path) // returns array of mtimes

What do you think about it?

Marco

P.S. Excuse me for my poor english...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filestorage_tralfamadorian.sql
Type: text/x-sql
Size: 1994 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20110407/241c073d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lib_tralfamadorian.php.gz
Type: application/x-gzip
Size: 6383 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20110407/241c073d/attachment-0001.bin>


More information about the Owncloud mailing list