diff --git a/changelog/unreleased/enhancement-add-companion-url-config.md b/changelog/unreleased/enhancement-add-companion-url-config.md new file mode 100644 index 00000000000..1ea52cc9e0f --- /dev/null +++ b/changelog/unreleased/enhancement-add-companion-url-config.md @@ -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 diff --git a/services/web/pkg/config/defaults/defaultconfig.go b/services/web/pkg/config/defaults/defaultconfig.go index c2acd8f03a7..17e129cd2f9 100644 --- a/services/web/pkg/config/defaults/defaultconfig.go +++ b/services/web/pkg/config/defaults/defaultconfig.go @@ -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 } } diff --git a/services/web/pkg/config/options.go b/services/web/pkg/config/options.go index 2ea9696391b..8a36d86f5d8 100644 --- a/services/web/pkg/config/options.go +++ b/services/web/pkg/config/options.go @@ -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 Uppy Companion which is needed for the cloud import."` } // XHR are the XHR options