mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-31 01:10:20 -06:00
Merge pull request #1374 from ishank011/upload-capabilities
Use a default protocol parameter instead of explicitly disabling tus
This commit is contained in:
4
changelog/unreleased/default-upload-protocol.md
Normal file
4
changelog/unreleased/default-upload-protocol.md
Normal file
@@ -0,0 +1,4 @@
|
||||
Enhancement: Use a default protocol parameter instead of explicitly disabling tus
|
||||
|
||||
https://github.com/cs3org/reva/pull/1331
|
||||
https://github.com/owncloud/ocis/pull/1374
|
||||
@@ -88,7 +88,7 @@ func Frontend(cfg *config.Config) *cli.Command {
|
||||
"versioning": true,
|
||||
}
|
||||
|
||||
if !cfg.Reva.UploadDisableTus {
|
||||
if cfg.Reva.DefaultUploadProtocol == "tus" {
|
||||
filesCfg["tus_support"] = map[string]interface{}{
|
||||
"version": "1.0.0",
|
||||
"resumable": "1.0.0",
|
||||
@@ -131,12 +131,10 @@ func Frontend(cfg *config.Config) *cli.Command {
|
||||
},
|
||||
"ocdav": map[string]interface{}{
|
||||
"prefix": cfg.Reva.Frontend.OCDavPrefix,
|
||||
"chunk_folder": cfg.Reva.OCDav.ChunkFolder,
|
||||
"files_namespace": cfg.Reva.OCDav.DavFilesNamespace,
|
||||
"webdav_namespace": cfg.Reva.OCDav.WebdavNamespace,
|
||||
"timeout": 86400,
|
||||
"insecure": true,
|
||||
"disable_tus": cfg.Reva.UploadDisableTus,
|
||||
},
|
||||
"ocs": map[string]interface{}{
|
||||
"share_prefix": cfg.Reva.Frontend.OCSSharePrefix,
|
||||
@@ -148,7 +146,7 @@ func Frontend(cfg *config.Config) *cli.Command {
|
||||
"contact": "admin@localhost",
|
||||
"ssl": "false",
|
||||
},
|
||||
"disable_tus": cfg.Reva.UploadDisableTus,
|
||||
"default_upload_protocol": cfg.Reva.DefaultUploadProtocol,
|
||||
"capabilities": map[string]interface{}{
|
||||
"capabilities": map[string]interface{}{
|
||||
"core": map[string]interface{}{
|
||||
|
||||
@@ -284,7 +284,6 @@ type LDAPSchema struct {
|
||||
|
||||
// OCDav defines the available ocdav configuration.
|
||||
type OCDav struct {
|
||||
ChunkFolder string
|
||||
WebdavNamespace string
|
||||
DavFilesNamespace string
|
||||
}
|
||||
@@ -320,10 +319,10 @@ type Reva struct {
|
||||
// chunking and resumable upload config (TUS)
|
||||
UploadMaxChunkSize int
|
||||
UploadHTTPMethodOverride string
|
||||
UploadDisableTus bool
|
||||
// checksumming capabilities
|
||||
ChecksumSupportedTypes []string
|
||||
ChecksumPreferredUploadType string
|
||||
DefaultUploadProtocol string
|
||||
}
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
|
||||
@@ -128,12 +128,12 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
|
||||
},
|
||||
|
||||
// Chunking
|
||||
&cli.BoolFlag{
|
||||
Name: "upload-disable-tus",
|
||||
Value: false,
|
||||
Usage: "Disables TUS upload mechanism",
|
||||
EnvVars: []string{"STORAGE_FRONTEND_UPLOAD_DISABLE_TUS"},
|
||||
Destination: &cfg.Reva.UploadDisableTus,
|
||||
&cli.StringFlag{
|
||||
Name: "default-upload-protocol",
|
||||
Value: "tus",
|
||||
Usage: "Default upload chunking protocol to be used out of tus/v1/ng",
|
||||
EnvVars: []string{"STORAGE_FRONTEND_DEFAULT_UPLOAD_PROTOCOL"},
|
||||
Destination: &cfg.Reva.DefaultUploadProtocol,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "upload-max-chunk-size",
|
||||
|
||||
Reference in New Issue
Block a user