Files
opencloud/ocis-pkg/capabilities/defaults.go
Florian Schade eb7c36443f enhancement: introduce theme processing (#9133)
* enhancement: introduce theme processing

* enhancement: introduce theme processing

* enhancement: add theme processing tests and changelog

* Update services/web/pkg/config/config.go

Co-authored-by: Michael Barz <michael.barz@zeitgestalten.eu>

* fix: ci findings

* Apply suggestions from code review

Co-authored-by: Martin <github@diemattels.at>

* enhancement: use the theme assets from web instead of having them inside the oCis repo (license clash Apache vs. AGPLv3)

* fix: golangci tagalign order

* fix: rename UnifiedRoleUploader to UnifiedRoleEditorLite

* fix: some typos

Co-authored-by: Michael Barz <michael.barz@zeitgestalten.eu>

* enhancement: export supported theme logo upload filetypes

* chore: bump reva

* fix: allow init func

---------

Co-authored-by: Michael Barz <michael.barz@zeitgestalten.eu>
Co-authored-by: Martin <github@diemattels.at>
2024-05-29 15:48:49 +02:00

36 lines
795 B
Go

package capabilities
import (
"sync/atomic"
"github.com/cs3org/reva/v2/pkg/owncloud/ocs"
)
// allow the consuming part to change defaults, e.g., tests
var defaultCapabilities atomic.Pointer[ocs.Capabilities]
func init() { //nolint:gochecknoinits
ResetDefault()
}
// ResetDefault resets the default [Capabilities] to the default values.
func ResetDefault() {
defaultCapabilities.Store(
&ocs.Capabilities{
Theme: &ocs.CapabilitiesTheme{
Logo: &ocs.CapabilitiesThemeLogo{
PermittedFileTypes: map[string]string{
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
".png": "image/png",
".gif": "image/gif",
},
},
},
},
)
}
// Default returns the default [Capabilities].
func Default() *ocs.Capabilities { return defaultCapabilities.Load() }