mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-03 09:20:50 -05:00
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>
This commit is contained in:
@@ -56,15 +56,10 @@ func Server(opts ...Option) (http.Service, error) {
|
||||
return http.Service{}, err
|
||||
}
|
||||
|
||||
coreFS := fsx.NewFallbackFS(
|
||||
fsx.NewBasePathFs(fsx.NewOsFs(), options.Config.Asset.CorePath),
|
||||
fsx.NewBasePathFs(fsx.FromIOFS(web.Assets), "assets/core"),
|
||||
)
|
||||
appsFS := fsx.NewFallbackFS(
|
||||
fsx.NewReadOnlyFs(fsx.NewBasePathFs(fsx.NewOsFs(), options.Config.Asset.AppsPath)),
|
||||
fsx.NewBasePathFs(fsx.FromIOFS(web.Assets), "assets/apps"),
|
||||
)
|
||||
|
||||
// build and inject the list of applications into the config
|
||||
for _, application := range apps.List(options.Logger, options.Config.Apps, appsFS.Secondary().IOFS(), appsFS.Primary().IOFS()) {
|
||||
options.Config.Web.Config.ExternalApps = append(
|
||||
@@ -73,10 +68,31 @@ func Server(opts ...Option) (http.Service, error) {
|
||||
)
|
||||
}
|
||||
|
||||
handle := svc.NewService(
|
||||
coreFS := fsx.NewFallbackFS(
|
||||
fsx.NewBasePathFs(fsx.NewOsFs(), options.Config.Asset.CorePath),
|
||||
fsx.NewBasePathFs(fsx.FromIOFS(web.Assets), "assets/core"),
|
||||
)
|
||||
themeFS := fsx.NewFallbackFS(
|
||||
fsx.NewBasePathFs(fsx.NewOsFs(), options.Config.Asset.ThemesPath),
|
||||
fsx.NewBasePathFs(fsx.FromIOFS(web.Assets), "assets/themes"),
|
||||
)
|
||||
// oCis is Apache licensed, and the ownCloud branding is AGPLv3.
|
||||
// we are not allowed to have the ownCloud branding as part of the oCIS repository,
|
||||
// as workaround we layer the embedded core fs on top of the theme fs to provide the ownCloud branding.
|
||||
// each asset that is part of the embedded core fs (coreFS secondary fs)
|
||||
// is downloaded at build time from the ownCloud web repository,
|
||||
// web is licensed under AGPLv3 too, and is allowed to contain the ownCloud branding.
|
||||
// themeFS = themeFS.Primary (rw) < themeFS.Secondary (ro) < coreFS.Secondary (ro)
|
||||
themeFS = fsx.NewFallbackFS(
|
||||
themeFS,
|
||||
fsx.NewBasePathFs(coreFS.Secondary(), "themes"),
|
||||
)
|
||||
|
||||
handle, err := svc.NewService(
|
||||
svc.Logger(options.Logger),
|
||||
svc.CoreFS(coreFS),
|
||||
svc.CoreFS(coreFS.IOFS()),
|
||||
svc.AppFS(appsFS.IOFS()),
|
||||
svc.ThemeFS(themeFS),
|
||||
svc.AppsHTTPEndpoint(_customAppsEndpoint),
|
||||
svc.Config(options.Config),
|
||||
svc.GatewaySelector(gatewaySelector),
|
||||
@@ -103,6 +119,10 @@ func Server(opts ...Option) (http.Service, error) {
|
||||
svc.TraceProvider(options.TraceProvider),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return http.Service{}, err
|
||||
}
|
||||
|
||||
{
|
||||
handle = svc.NewInstrument(handle, options.Metrics)
|
||||
handle = svc.NewLogging(handle, options.Logger)
|
||||
|
||||
Reference in New Issue
Block a user