diff --git a/lib/galaxy/config/sample/file_sources_conf.yml.sample b/lib/galaxy/config/sample/file_sources_conf.yml.sample index f057b6e6b8a2..da81ba996959 100644 --- a/lib/galaxy/config/sample/file_sources_conf.yml.sample +++ b/lib/galaxy/config/sample/file_sources_conf.yml.sample @@ -12,6 +12,12 @@ root: ${user.preferences['owncloud|root']} login: ${user.preferences['owncloud|username']} password: ${user.preferences['owncloud|password']} + # By default, the plugin will use temp files to avoid loading entire files into memory. + # You can change the directory here or omit to use the default temp directory. + temp_path: /your/temp/path + # Set writable to true if you have write access to this source + # and want to allow exporting files to it, by default is read only. + writable: false - type: posix root: '/data/5/galaxy_import/galaxy_user_data/covid-19/data/sequences/' diff --git a/lib/galaxy/files/sources/webdav.py b/lib/galaxy/files/sources/webdav.py index 86ed55483e70..2e11a51d98b2 100644 --- a/lib/galaxy/files/sources/webdav.py +++ b/lib/galaxy/files/sources/webdav.py @@ -3,6 +3,7 @@ except ImportError: WebDAVFS = None +import tempfile from typing import ( Optional, Union, @@ -22,6 +23,11 @@ class WebDavFilesSource(PyFilesystem2FilesSource): def _open_fs(self, user_context=None, opts: Optional[FilesSourceOptions] = None): props = self._serialization_props(user_context) + use_temp_files = props.pop("use_temp_files", None) + if use_temp_files is None: + # Default to True to avoid memory issues with large files. + props["use_temp_files"] = True + props["temp_path"] = props.get("temp_path", tempfile.TemporaryDirectory(prefix="webdav_")) extra_props: Union[FilesSourceProperties, dict] = opts.extra_props or {} if opts else {} handle = WebDAVFS(**{**props, **extra_props}) return handle