mirror of
https://github.com/owncloud/ocis
synced 2026-04-26 01:35:25 +02:00
Hardcoded web options (#6188)
* use custom struct for web options Signed-off-by: jkoberg <jkoberg@owncloud.com> * update envvar descriptions Co-authored-by: Martin <github@diemattels.at> * Use correct defaults * fix code style --------- Signed-off-by: jkoberg <jkoberg@owncloud.com> Co-authored-by: Michael Barz <michael.barz@zeitgestalten.eu> Co-authored-by: Martin <github@diemattels.at> Co-authored-by: Michael Barz <mbarz@owncloud.com>
This commit is contained in:
@@ -66,8 +66,20 @@ func DefaultConfig() *config.Config {
|
||||
},
|
||||
},
|
||||
},
|
||||
Options: map[string]interface{}{
|
||||
"previewFileMimeTypes": []string{"image/gif", "image/png", "image/jpeg", "text/plain", "image/tiff", "image/bmp", "image/x-ms-bmp"},
|
||||
Options: config.Options{
|
||||
ContextHelpersReadMore: true,
|
||||
PreviewFileMimeTypes: []string{"image/gif", "image/png", "image/jpeg", "text/plain", "image/tiff", "image/bmp", "image/x-ms-bmp"},
|
||||
SharingRecipientsPerPage: 200,
|
||||
AccountEditLink: &config.AccountEditLink{},
|
||||
Editor: &config.Editor{},
|
||||
FeedbackLink: &config.FeedbackLink{},
|
||||
Routing: config.Routing{
|
||||
IDBased: true,
|
||||
},
|
||||
Sidebar: config.Sidebar{
|
||||
Shares: config.SidebarShares{},
|
||||
},
|
||||
Upload: &config.Upload{},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -121,4 +133,22 @@ func Sanitize(cfg *config.Config) {
|
||||
if cfg.Web.Config.OpenIDConnect.MetadataURL == "" {
|
||||
cfg.Web.Config.OpenIDConnect.MetadataURL = strings.TrimRight(cfg.Web.Config.OpenIDConnect.Authority, "/") + "/.well-known/openid-configuration"
|
||||
}
|
||||
// remove AccountEdit parent if no value is set
|
||||
if cfg.Web.Config.Options.AccountEditLink.Href == "" {
|
||||
cfg.Web.Config.Options.AccountEditLink = nil
|
||||
}
|
||||
// remove Editor parent if no value is set
|
||||
if !cfg.Web.Config.Options.Editor.AutosaveEnabled {
|
||||
cfg.Web.Config.Options.Editor = nil
|
||||
}
|
||||
// remove FeedbackLink parent if no value is set
|
||||
if cfg.Web.Config.Options.FeedbackLink.Href == "" &&
|
||||
cfg.Web.Config.Options.FeedbackLink.AriaLabel == "" &&
|
||||
cfg.Web.Config.Options.FeedbackLink.Description == "" {
|
||||
cfg.Web.Config.Options.FeedbackLink = nil
|
||||
}
|
||||
// remove Upload parent if no value is set
|
||||
if cfg.Web.Config.Options.Upload.XHR.Timeout == 0 {
|
||||
cfg.Web.Config.Options.Upload = nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user