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...
CREATE TABLE IF NOT EXISTS `inodes` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `type` CHAR(1) NOT NULL, `owner_id` INT NOT NULL, `ctime` DECIMAL(13, 3) NOT NULL, `mtime` DECIMAL(13, 3) NOT NULL, `permissions_id` INT(12) UNSIGNED NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY (`owner_id`, `ctime`) ); INSERT INTO `inodes` VALUES (1,'d',1,0.000,0.001,1); INSERT INTO `inodes` VALUES (2,'d',1,0.001,0.001,1); CREATE TABLE IF NOT EXISTS `directories_entries` ( `inode_id` INT(11) UNSIGNED NOT NULL, `start_time` DECIMAL(13, 3) NOT NULL, `end_time` DECIMAL(13, 3) NULL DEFAULT NULL, `modified_by` INT NOT NULL, `file_id` INT(11) UNSIGNED NOT NULL, `file_name` TEXT NOT NULL, PRIMARY KEY (`inode_id`, `file_name`(100), `start_time`), UNIQUE KEY (`inode_id`, `file_name`(100), `end_time`), KEY (`file_id`) ); INSERT INTO `directories_entries` VALUES (1,0.001,NULL,1,2,'admin'); CREATE TABLE IF NOT EXISTS `files` ( `inode_id` INT(11) UNSIGNED NOT NULL, `start_time` DECIMAL(13, 3) NOT NULL, `end_time` DECIMAL(13, 3) NULL DEFAULT NULL, `modified_by` INT NOT NULL, `file_size` INT(11) UNSIGNED NOT NULL, PRIMARY KEY (`inode_id`, `start_time`), UNIQUE KEY (`inode_id`, `end_time`), KEY (`modified_by`) ); CREATE TABLE IF NOT EXISTS `symlinks` ( `inode_id` INT(11) UNSIGNED NOT NULL, `start_time` DECIMAL(13, 3) NOT NULL, `end_time` DECIMAL(13, 3) NULL DEFAULT NULL, `modified_by` INT NOT NULL, `link_to` TEXT NOT NULL, PRIMARY KEY (`inode_id`, `start_time`), UNIQUE KEY (`inode_id`, `end_time`) ); CREATE TABLE IF NOT EXISTS `users_permissions` ( `inode_id` INT(11) UNSIGNED NOT NULL, `user_id` INT NOT NULL, `permissions` INT(3) NOT NULL, PRIMARY KEY (`inode_id`, `user_id`) ); CREATE TABLE IF NOT EXISTS `groups_permissions` ( `inode_id` INT(11) UNSIGNED NOT NULL, `group_id` INT NOT NULL, `permissions` INT(3) NOT NULL, PRIMARY KEY (`inode_id`, `group_id`) ); INSERT INTO `groups_permissions` VALUES(1,1,127);
lib_tralfamadorian.php.gz
Description: GNU Zip compressed data
_______________________________________________ Owncloud mailing list [email protected] https://mail.kde.org/mailman/listinfo/owncloud
