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

feat: add uppy companion url config #6453

Merged
merged 1 commit into from
Jun 7, 2023
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
5 changes: 5 additions & 0 deletions changelog/unreleased/enhancement-add-companion-url-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add companion URL config

Introduce a config to set the Uppy Companion URL via `WEB_OPTION_UPLOAD_COMPANION_URL`.

https://github.com/owncloud/ocis/pull/6453
2 changes: 1 addition & 1 deletion services/web/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func Sanitize(cfg *config.Config) {
cfg.Web.Config.Options.FeedbackLink = nil
}
// remove Upload parent if no value is set
if cfg.Web.Config.Options.Upload.XHR.Timeout == 0 {
if cfg.Web.Config.Options.Upload.XHR.Timeout == 0 && cfg.Web.Config.Options.Upload.CompanionURL == "" {
cfg.Web.Config.Options.Upload = nil
}
}
3 changes: 2 additions & 1 deletion services/web/pkg/config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ type Routing struct {

// Upload are the upload options
type Upload struct {
XHR XHR `json:"xhr,omitempty" yaml:"xhr"`
XHR XHR `json:"xhr,omitempty" yaml:"xhr"`
CompanionURL string `json:"companionUrl,omitempty" yaml:"companionUrl" env:"WEB_OPTION_UPLOAD_COMPANION_URL" desc:"Sets the URL of Companion which is a service provided by Uppy to import files from external cloud providers. See https://uppy.io/docs/companion/ for instructions on how to set up Companion. This feature is disabled as long as no URL is given."`
}

// XHR are the XHR options
Expand Down