Description of multiuser patch ============================== This file provides some HowTos and internals about the new multiuser functionality of MLDonkey. The goal is to provide a p2p-service to be used by more than user and where each user has its own environment in provided by the daemon. Some basics and definitions =========================== User "admin" and all users belonging to a group where group_admin = true can see all files in any case and can use all functions of MLDonkey. file_owner in this text means one user which owns a downloading file, file_group means one group the file belongs to, file_owner must be a member of this group, both values are saved in files.ini. New options (displayed options are default values) ================================================== users.ini --------- - users is kept unchanged for compatibility - users2 is extended with these settings: user_groups = [] A list of groups the user belongs to, this user can view all files which belong to one of the groups The default group of the user, the user must also be a member of this group. File_group of new downloads started by the user are automatically assigned to this value. This value can be None, this means the file is only visible to the file_owner (and admins, of course). user_default_group = mldonkey E-mail address to sent commit notifications to. Globals option "mail" can still be used for admins, if both addresses match only one mail is sent. user_mail = "" Not implemented yet, planned feature is to have user specific directories below global incoming directories. user_commit_dir = "" Like global option max_concurrent_downloads this implements a user-specific limit of the maximum number of concurrent files a user can download. Other downloads are queued, this is done by round-robin. If the sum of user_max_concurrent_downloads from all users is bigger than max_concurrent_downloads less downloads than user_max_concurrent_downloads are in downloading state. 0 means no user-specific limit. Users can change file priorities the control which files are not queued. user_max_concurrent_downloads = 0 - groups, new option At least one group named "mldonkey" with group_admin = true must exist This option is not implemented yet group_mail = "" Option to control if the group has admin rights. All users belonging to such a group have the same rights as user "admin". group_admin = true files.ini --------- - each file has two new options in files.ini file_owner: the incoming directory of the owner is used for commit, if the user does not exist "admin" is used file_group: default value for a new download is user_default_group if file_owner is not member of file_group or the group does not exist, the value user_default_group is used Commands to control multiuser features/data =========================================== chgrp "" change group of download to , group = none for private file chown "" change owner of download to groupadd [] add new mldonkey group passwd change own password useradd add new mldonkey user/change user password usercommit change user specific commit directory userdel remove a mldonkey user userdls change number of allowed concurrent downloads usermail change user mail address users use this command in HTML interface for a small GUI to control users whoami print logged-in user name Updating from a non-multiuser MLDonkey ====================================== When updating all files have file_owner "admin" and file_group "mldonkey". All existing users have user_default_group = "mldonkey" and user_groups = ["mldonkey"]. This means all users can use all features of MLDonkey and see all files in use by MLDonkey core. To hide user downloads from each other create a new group with group_admin = false and assign all users to this group and remove them from all admin groups Additional features =================== - file_completed_cmd has new environment variables $FILE_OWNER and $FILE_GROUP - remove option enable_user_config, replaced by membership of admin groups To-Do ====== - check on start-up of group "mldonkey" exists and if it has admin rights - implement groupdel + prevent deletion if group is in use - prevent groupdel if group is file_group of current downloads - prevent groupdel if group has members - implement user_commit_dir (work is done in multigroup_usercommit.patch) Besides supporting the option user_commit_dir the mechanism to choose incoming directory is changed. Incoming directories are saved in a list of directories in option shared_directories. They have a special sharing_strategy named incoming_directories (for BT multifile downloads only) or incoming_files. Current implementation uses the first directory with this stratagy found in the list. The new implementation (already done) iters the list of marked incoming directories until one is found with enough free space. If no usable directory is found, the file will stay in the list of files to be committed. - implement group_mail