mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add WebDAV as user file source
Adds WebDAV example template, configuration and updates the docs, and the file source model along with the client API schema
This commit is contained in:
@@ -9035,7 +9035,7 @@ export interface components {
|
||||
* Type
|
||||
* @enum {string}
|
||||
*/
|
||||
type: "ftp" | "posix" | "s3fs" | "azure" | "onedata";
|
||||
type: "ftp" | "posix" | "s3fs" | "azure" | "onedata" | "webdav";
|
||||
/** Variables */
|
||||
variables?:
|
||||
| (
|
||||
@@ -17366,7 +17366,7 @@ export interface components {
|
||||
* Type
|
||||
* @enum {string}
|
||||
*/
|
||||
type: "ftp" | "posix" | "s3fs" | "azure" | "onedata";
|
||||
type: "ftp" | "posix" | "s3fs" | "azure" | "onedata" | "webdav";
|
||||
/** Uri Root */
|
||||
uri_root: string;
|
||||
/**
|
||||
|
||||
@@ -350,6 +350,19 @@ configuration).
|
||||
|
||||

|
||||
|
||||
#### `webdav`
|
||||
|
||||
The syntax for the `configuration` section of `webdav` templates looks like this.
|
||||
|
||||

|
||||
|
||||
At runtime, after the `configuration` template is expanded, the resulting dictionary
|
||||
passed to Galaxy's file source plugin infrastructure looks like this and should match a subset
|
||||
of what you'd be able to add directly to `file_sources_conf.yml` (Galaxy's global file source
|
||||
configuration).
|
||||
|
||||

|
||||
|
||||
### YAML Syntax
|
||||
|
||||

|
||||
@@ -398,6 +411,14 @@ and you are comfortable with it storing your user's secrets.
|
||||
:language: yaml
|
||||
```
|
||||
|
||||
#### Allow Users to Define WebDAV Servers as File Sources
|
||||
|
||||
```{literalinclude} ../../../lib/galaxy/files/templates/examples/production_webdav.yml
|
||||
:language: yaml
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Playing Nicer with Ansible
|
||||
|
||||
Many large instances of Galaxy are configured with Ansible and much of the existing administrator
|
||||
|
||||
@@ -15,6 +15,8 @@ from galaxy.files.templates.models import (
|
||||
PosixFileSourceTemplateConfiguration,
|
||||
S3FSFileSourceConfiguration,
|
||||
S3FSFileSourceTemplateConfiguration,
|
||||
WebdavFileSourceTemplateConfiguration,
|
||||
WebdavFileSourceConfiguration,
|
||||
)
|
||||
from galaxy.objectstore.templates.models import (
|
||||
AwsS3ObjectStoreConfiguration,
|
||||
@@ -53,6 +55,8 @@ class_to_diagram = {
|
||||
S3FSFileSourceConfiguration: "file_source_s3fs_configuration",
|
||||
FtpFileSourceTemplateConfiguration: "file_source_ftp_configuration_template",
|
||||
FtpFileSourceConfiguration: "file_source_ftp_configuration",
|
||||
WebdavFileSourceTemplateConfiguration: "file_source_webdav_configuration_template",
|
||||
WebdavFileSourceConfiguration: "file_source_webdav_configuration",
|
||||
}
|
||||
|
||||
for clazz, diagram_name in class_to_diagram.items():
|
||||
|
||||
@@ -22,6 +22,7 @@ SEARCH_FOR = [
|
||||
"user_file_source_form_full_aws_public.png",
|
||||
"user_file_source_form_full_azure.png",
|
||||
"user_file_source_form_full_ftp.png",
|
||||
"user_file_source_form_full_webdav.png"
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
- id: webdav
|
||||
version: 0
|
||||
name: WebDAV
|
||||
description: |
|
||||
The WebDAV protocol is a simple way to access files over the internet. This template
|
||||
configuration allows you to connect to a 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 (should end with /remote.php/webdav, e.g. /a/sub/path/remote.php/webdav)
|
||||
type: string
|
||||
help: |
|
||||
The full server path to the WebDAV service. Ensure the path includes /remote.php/webdav.
|
||||
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
|
||||
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 }}'
|
||||
@@ -25,7 +25,7 @@ from galaxy.util.config_templates import (
|
||||
UserDetailsDict,
|
||||
)
|
||||
|
||||
FileSourceTemplateType = Literal["ftp", "posix", "s3fs", "azure", "onedata"]
|
||||
FileSourceTemplateType = Literal["ftp", "posix", "s3fs", "azure", "onedata", "webdav"]
|
||||
|
||||
|
||||
class PosixFileSourceTemplateConfiguration(StrictModel):
|
||||
@@ -121,6 +121,29 @@ class OnedataFileSourceConfiguration(StrictModel):
|
||||
disable_tls_certificate_validation: bool = False
|
||||
writable: bool = False
|
||||
|
||||
class WebdavFileSourceTemplateConfiguration(StrictModel):
|
||||
type: Literal["webdav"]
|
||||
url: Union[str, TemplateExpansion]
|
||||
root: Union[str, TemplateExpansion]
|
||||
login: Union[str, TemplateExpansion]
|
||||
password: Union[str, TemplateExpansion]
|
||||
writable: Union[bool, TemplateExpansion] = False
|
||||
use_temp_files: Optional[Union[bool, TemplateExpansion]] = None
|
||||
temp_path: Optional[Union[str, TemplateExpansion]] = None
|
||||
template_start: Optional[str] = None
|
||||
template_end: Optional[str] = None
|
||||
|
||||
|
||||
class WebdavFileSourceConfiguration(StrictModel):
|
||||
type: Literal["webdav"]
|
||||
url: str
|
||||
root: str
|
||||
login: str
|
||||
password: str
|
||||
writable: bool = False
|
||||
use_temp_files: Optional[bool] = None
|
||||
temp_path: Optional[str] = None
|
||||
|
||||
|
||||
FileSourceTemplateConfiguration = Union[
|
||||
PosixFileSourceTemplateConfiguration,
|
||||
@@ -128,6 +151,7 @@ FileSourceTemplateConfiguration = Union[
|
||||
FtpFileSourceTemplateConfiguration,
|
||||
AzureFileSourceTemplateConfiguration,
|
||||
OnedataFileSourceTemplateConfiguration,
|
||||
WebdavFileSourceTemplateConfiguration,
|
||||
]
|
||||
FileSourceConfiguration = Union[
|
||||
PosixFileSourceConfiguration,
|
||||
@@ -135,6 +159,7 @@ FileSourceConfiguration = Union[
|
||||
FtpFileSourceConfiguration,
|
||||
AzureFileSourceConfiguration,
|
||||
OnedataFileSourceConfiguration,
|
||||
WebdavFileSourceConfiguration,
|
||||
]
|
||||
|
||||
|
||||
@@ -196,6 +221,7 @@ TypesToConfigurationClasses: Dict[FileSourceTemplateType, Type[FileSourceConfigu
|
||||
"s3fs": S3FSFileSourceConfiguration,
|
||||
"azure": AzureFileSourceConfiguration,
|
||||
"onedata": OnedataFileSourceConfiguration,
|
||||
"webdav": WebdavFileSourceConfiguration,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user