mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-04 19:29:49 -06:00
* 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>
36 lines
795 B
Go
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() }
|