Skip to content

Commit 4491317

Browse files
authored
Merge pull request #22570 from mvdbeek/worktree-webdav-template-migration
Restore WebDAV template v0; add v1 for url -> base_url rename
2 parents 1af99bd + 2346cf8 commit 4491317

2 files changed

Lines changed: 46 additions & 3 deletions

File tree

lib/galaxy/files/templates/examples/production_webdav.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,49 @@
11
- id: webdav
22
version: 0
33
name: WebDAV (e.g. Nextcloud, Owncloud, Opencloud)
4+
description: |
5+
The WebDAV protocol is a simple way to access files over the internet. Here, you can connect to any WebDAV server.
6+
variables:
7+
url:
8+
label: Server Domain (e.g. https://myowncloud.org)
9+
type: string
10+
help: |
11+
The domain of the WebDAV server you are connecting to. This should be the full URL
12+
including the protocol (http or https) and the domain name.
13+
root:
14+
label: WebDAV server Path (e.g., /a/sub/path/remote.php/webdav, /remote.php/dav/files/username)
15+
type: string
16+
help: |
17+
The full server path to the WebDAV service.
18+
login:
19+
label: Username
20+
type: string
21+
help: |
22+
The username to use to connect to the WebDAV server. This should be the username you use
23+
to log in to the WebDAV server.
24+
writable:
25+
label: Writable?
26+
type: boolean
27+
optional: true
28+
default: false
29+
help: Allow Galaxy to write data to this WebDAV server.
30+
secrets:
31+
password:
32+
label: Password
33+
help: |
34+
The password to use to connect to the WebDAV server. This should be the password you use
35+
to log in to the WebDAV server.
36+
configuration:
37+
type: webdav
38+
url: '{{ variables.url }}'
39+
root: '{{ variables.root }}'
40+
login: '{{ variables.login }}'
41+
writable: '{{ variables.writable }}'
42+
password: '{{ secrets.password }}'
43+
44+
- id: webdav
45+
version: 1
46+
name: WebDAV (e.g. Nextcloud, Owncloud, Opencloud)
447
description: |
548
The WebDAV protocol is a simple way to access files over the internet. Here, you can connect to any WebDAV server.
649
variables:
@@ -40,4 +83,3 @@
4083
login: '{{ variables.login }}'
4184
writable: '{{ variables.writable }}'
4285
password: '{{ secrets.password }}'
43-

lib/galaxy/files/templates/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,9 @@ class WebdavConfigMixin:
268268
@model_validator(mode="before")
269269
@classmethod
270270
def ensure_base_url(cls, data: Any) -> Any:
271-
# Keep persisted user file sources created before the WebDAV
272-
# url -> base_url rename loadable in the preferences UI.
271+
# Accept the version-0 WebDAV template's `url` field as an alias of
272+
# `base_url` so that v0 templates and any persisted v0 rendered configs
273+
# continue to validate after the rename.
273274
if isinstance(data, dict) and "base_url" not in data and "url" in data:
274275
data = dict(data)
275276
data["base_url"] = data.pop("url")

0 commit comments

Comments
 (0)