diff --git a/lib/galaxy/files/templates/examples/production_webdav.yml b/lib/galaxy/files/templates/examples/production_webdav.yml index 5568c56cb49..6b469bc2663 100644 --- a/lib/galaxy/files/templates/examples/production_webdav.yml +++ b/lib/galaxy/files/templates/examples/production_webdav.yml @@ -1,6 +1,49 @@ - id: webdav version: 0 name: WebDAV (e.g. Nextcloud, Owncloud, Opencloud) + description: | + The WebDAV protocol is a simple way to access files over the internet. Here, you can connect to any WebDAV server. + variables: + url: + label: Server Domain (e.g. https://myowncloud.org) + type: string + help: | + The domain of the WebDAV server you are connecting to. This should be the full URL + including the protocol (http or https) and the domain name. + root: + label: WebDAV server Path (e.g., /a/sub/path/remote.php/webdav, /remote.php/dav/files/username) + type: string + help: | + The full server path to the WebDAV service. + login: + label: Username + type: string + help: | + The username to use to connect to the WebDAV server. This should be the username you use + to log in to the WebDAV server. + writable: + label: Writable? + type: boolean + optional: true + default: false + help: Allow Galaxy to write data to this WebDAV server. + secrets: + password: + label: Password + help: | + The password to use to connect to the WebDAV server. This should be the password you use + to log in to the WebDAV server. + configuration: + type: webdav + url: '{{ variables.url }}' + root: '{{ variables.root }}' + login: '{{ variables.login }}' + writable: '{{ variables.writable }}' + password: '{{ secrets.password }}' + +- id: webdav + version: 1 + name: WebDAV (e.g. Nextcloud, Owncloud, Opencloud) description: | The WebDAV protocol is a simple way to access files over the internet. Here, you can connect to any WebDAV server. variables: @@ -40,4 +83,3 @@ login: '{{ variables.login }}' writable: '{{ variables.writable }}' password: '{{ secrets.password }}' - \ No newline at end of file diff --git a/lib/galaxy/files/templates/models.py b/lib/galaxy/files/templates/models.py index 927657655d9..bec5245a0da 100644 --- a/lib/galaxy/files/templates/models.py +++ b/lib/galaxy/files/templates/models.py @@ -268,8 +268,9 @@ class WebdavConfigMixin: @model_validator(mode="before") @classmethod def ensure_base_url(cls, data: Any) -> Any: - # Keep persisted user file sources created before the WebDAV - # url -> base_url rename loadable in the preferences UI. + # Accept the version-0 WebDAV template's `url` field as an alias of + # `base_url` so that v0 templates and any persisted v0 rendered configs + # continue to validate after the rename. if isinstance(data, dict) and "base_url" not in data and "url" in data: data = dict(data) data["base_url"] = data.pop("url")