datalad / datalad-fuse

DataLad extension to provide FUSE file system access
Other
1 stars 4 forks source link

Will there be support for multiple user? #76

Closed Myrskyta closed 2 years ago

Myrskyta commented 2 years ago

I have been testing using datalad-fuse as a method for a web app to automatically pull down and cache images from S3. In its current state only the user that ran the datalad fusefs ... command is able to access the mounted filesystem. I realize this is how fuse works by default, but I did find a commented out section in $project/datalad_fuse/__init__.py on line 117 that allows me to enable it.

In the future will this be enabled in datalad by default? If not, will there be an optional flag for it?

yarikoptic commented 2 years ago

we haven't looked into it. Moreover it seems would require first configuration of fuse at the system level to allow for such functionality:

$> grep other /etc/fuse.conf
# user_allow_other - Using the allow_other mount option works fine as root, in
# order to have it work as user you need user_allow_other in /etc/fuse.conf as
# well. (This option allows users to use the allow_other option.) You need
# allow_other if you want users other than the owner to access a mounted fuse.
#user_allow_other

so you could try and see if changing that option within datalad-fuse allows you to obtain a working setup. If so, we could expose that as an option I guess.

Myrskyta commented 2 years ago

Fair enough, it is sort of a weird use-case, but it seemed potentially useful to me. I just didn't want to use it this way if it would be something that might be a problem in the future.

When enabling user_allow_other in /etc/fuse.conf, and allow_other in $project/datalad_fuse/init.py on line 117 my use-case does function as I would expect it to. It does then allow other users to access the files, and it does work with the web app I mentioned.

/etc/fuse.conf:

# user_allow_other - Using the allow_other mount option works fine as root, in
# order to have it work as user you need user_allow_other in /etc/fuse.conf as
# well. (This option allows users to use the allow_other option.) You need
# allow_other if you want users other than the owner to access a mounted fuse.
user_allow_other

$project/datalad_fuse/__init__.py:

...
        FUSE(
            DataLadFUSE(ds.path, mode_transparent=mode_transparent),
            mount_path,
            foreground=foreground,
            allow_other=True #enabled
        )
...
yarikoptic commented 2 years ago

Dear @jwodder could you please add a CLI option to expose --allow-other functionality. Note in the description that it requires corresponding configuration of FUSE system-wide.