Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a default protocol parameter instead of explicitly disabling tus #1374

Merged
merged 4 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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