Skip to content

Commit

Permalink
Use a default protocol parameter instead of explicitly disabling tus
Browse files Browse the repository at this point in the history
  • Loading branch information
ishank011 committed Jan 29, 2021
1 parent 414b635 commit c1839ce
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 4 additions & 0 deletions changelog/unreleased/default-upload-protocol.md
Original file line number Diff line number Diff line change
@@ -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
6 changes: 2 additions & 4 deletions storage/pkg/command/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -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{}{
Expand Down
3 changes: 1 addition & 2 deletions storage/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ type LDAPSchema struct {

// OCDav defines the available ocdav configuration.
type OCDav struct {
ChunkFolder string
WebdavNamespace string
DavFilesNamespace string
}
Expand Down Expand Up @@ -319,10 +318,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.
Expand Down
12 changes: 6 additions & 6 deletions storage/pkg/flagset/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c1839ce

Please sign in to comment.