mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-26 05:58:27 -05:00
Add global TUS capability + some config
Added global TUS capability in the config structure. Added config switches for the advertised max chunk size and http method override.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
Enhancement: Add TUS global capability
|
||||
|
||||
The TUS global capabilities from Reva are now exposed.
|
||||
|
||||
The advertised max chunk size can be configured using the "--upload-max-chunk-size" CLI switch or "REVA_FRONTEND_UPLOAD_MAX_CHUNK_SIZE" environment variable.
|
||||
The advertised http method override can be configured using the "--upload-http-method-override" CLI switch or "REVA_FRONTEND_UPLOAD_HTTP_METHOD_OVERRIDE" environment variable.
|
||||
|
||||
https://github.com/owncloud/ocis-reva/issues/177
|
||||
https://github.com/owncloud/ocis-reva/pull/228
|
||||
@@ -143,6 +143,13 @@ func Frontend(cfg *config.Config) *cli.Command {
|
||||
"blacklisted_files": []string{},
|
||||
"undelete": true,
|
||||
"versioning": true,
|
||||
"tus_support": map[string]interface{}{
|
||||
"version": "1.0.0",
|
||||
"resumable": "1.0.0",
|
||||
"extension": "creation,creation-with-upload",
|
||||
"http_method_override": cfg.Reva.UploadHttpMethodOverride,
|
||||
"max_chunk_size": int(cfg.Reva.UploadMaxChunkSize),
|
||||
},
|
||||
},
|
||||
"dav": map[string]interface{}{},
|
||||
"files_sharing": map[string]interface{}{
|
||||
|
||||
@@ -253,6 +253,9 @@ type Reva struct {
|
||||
// Configs can be used to configure the reva instance.
|
||||
// Services and Ports will be ignored if this is used
|
||||
Configs map[string]interface{}
|
||||
// chunking and resumable upload config (TUS)
|
||||
UploadMaxChunkSize int
|
||||
UploadHttpMethodOverride string
|
||||
}
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
|
||||
@@ -157,5 +157,21 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_GATEWAY_URL"},
|
||||
Destination: &cfg.Reva.Gateway.URL,
|
||||
},
|
||||
|
||||
// Chunking
|
||||
&cli.IntFlag{
|
||||
Name: "upload-max-chunk-size",
|
||||
Value: 0,
|
||||
Usage: "Max chunk size in bytes to advertise to clients through capabilities",
|
||||
EnvVars: []string{"REVA_FRONTEND_UPLOAD_MAX_CHUNK_SIZE"},
|
||||
Destination: &cfg.Reva.UploadMaxChunkSize,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "upload-http-method-override",
|
||||
Value: "",
|
||||
Usage: "Specify an HTTP method (ex: POST) to use when uploading in case OPTIONS and PATCH are not available",
|
||||
EnvVars: []string{"REVA_FRONTEND_UPLOAD_HTTP_METHOD_OVERRIDE"},
|
||||
Destination: &cfg.Reva.UploadHttpMethodOverride,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user