galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.4k stars 1.01k forks source link

[Feature request] file_sources_conf allow for write-only POSIX directory #17396

Open alpapan opened 9 months ago

alpapan commented 9 months ago

Brief Does it make sense for client/src/components/Upload to have code to prevent a specific file_sources entry from being displayed? Just like writable:true is required for export

Verbose For example this POSIX data for users to dump files into a NFS mount.

`

I don't want to allow every galaxy user to have read access to the files of other users, at least not so visibly in the Import remote files button.

Dropbox, owncloud and Nexcloud implement this as a read-only folder.

Is it possible therefore to have a readable: option defaulting to true that determines on whether a file_source appears in the Choose remote files.

I reckon doing this on the template might be good enough as handling it upstream might be complex?

davelopez commented 9 months ago

As a workaround (or solution), you may use requires_groups or requires_roles to specify exactly who can see and access those file sources. You could make them only visible then for the admin or a group of admins (useful to check that the file source is there and working even if you use it only for uploading).

https://github.com/galaxyproject/galaxy/blob/da12de9702ebf8cc985027c0510a838c7f2452c3/lib/galaxy/schema/remote_files.py#L80

davelopez commented 9 months ago

Hmm rereading this, my suggestion does not address your case, because using the requires_ will make the upload also inaccessible to users who are not part of those groups or roles...

Alternatively, you could try something like:

root: /data_storage/common/datasets/common_upload/${user.email]}/

I haven't tried this, so not sure it will work, but in my head this would create a different directory for each user and they will see only their stuff.

alpapan commented 9 months ago

As a workaround (or solution), you may use requires_groups or requires_roles to specify exactly who can see and access those file sources. You could make them only visible then for the admin or a group of admins (useful to check that the file source is there and working even if you use it only for uploading).

https://github.com/galaxyproject/galaxy/blob/da12de9702ebf8cc985027c0510a838c7f2452c3/lib/galaxy/schema/remote_files.py#L80

This is very useful to know! Will use it for exactly what you suggested.

alpapan commented 9 months ago

i love the requires_groups and also the root: /data_storage/common/datasets/common_upload/${user.email]}/ (could we document it?)

readable: so the setting with same thinking seems to already exist as browsable but i can't seem to get it to work!

- type: posix
  root: '/data_storage/common/datasets/common_upload/'
  id: data-storage-dataset-dump
  label: Dataset Dump
  doc: Place to dump into /data_storage
  writable: true
  browsable: false
  timeout: 60

@davelopez any ideas?

davelopez commented 9 months ago

i love the requires_groups and also the root: /data_storage/common/datasets/common_upload/${user.email]}/ (could we document it?)

Sure, I'll add it to my TODO :+1: or a PR is welcome if you want to give it a try, you probably know more about file sources than me by now :smiley:

so the setting with same thinking seems to already exist as browsable but i can't seem to get it to work!

So it seems browsable has a slightly different meaning and determines whether the file source plugin "implements the listing" of remote files. This would explain why setting it will not take any effect, as it is a computed property:

https://github.com/galaxyproject/galaxy/blob/39bfc6ab78af8c4bc95ba3c15abfbda14665aec3/lib/galaxy/files/sources/__init__.py#L276