From 98300084425781056db43294c0f2c18abd7c10ba Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 11 Apr 2023 23:56:50 +0200 Subject: [PATCH] feat: additional web config for css, scripts and translations --- .../enhancement-web-config-additions.md | 5 +++++ services/web/pkg/config/config.go | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 changelog/unreleased/enhancement-web-config-additions.md diff --git a/changelog/unreleased/enhancement-web-config-additions.md b/changelog/unreleased/enhancement-web-config-additions.md new file mode 100644 index 0000000000..698c0e209a --- /dev/null +++ b/changelog/unreleased/enhancement-web-config-additions.md @@ -0,0 +1,5 @@ +Enhancement: Web config additions + +We've added config keys for defining additional css, scripts and translations for ownCloud Web. + +https://github.com/owncloud/ocis/pull/6032 diff --git a/services/web/pkg/config/config.go b/services/web/pkg/config/config.go index 81fcfb989e..41e622fd19 100644 --- a/services/web/pkg/config/config.go +++ b/services/web/pkg/config/config.go @@ -33,6 +33,22 @@ type Asset struct { Path string `yaml:"path" env:"WEB_ASSET_PATH" desc:"Serve ownCloud Web assets from a path on the filesystem instead of the builtin assets."` } +// CustomStyle references additional css to be loaded into ownCloud Web. +type CustomStyle struct { + Href string `json:"href" yaml:"href"` +} + +// CustomScript references an additional script to be loaded into ownCloud Web. +type CustomScript struct { + Src string `json:"src" yaml:"src"` + Async bool `json:"async,omitempty" yaml:"async"` +} + +// CustomTranslation references a json file for overwriting translations in ownCloud Web. +type CustomTranslation struct { + Url string `json:"url" yaml:"url"` +} + // WebConfig defines the available web configuration for a dynamically rendered config.json. type WebConfig struct { Server string `json:"server,omitempty" yaml:"server" env:"OCIS_URL;WEB_UI_CONFIG_SERVER" desc:"URL, where the oCIS APIs are reachable for ownCloud Web."` @@ -42,6 +58,9 @@ type WebConfig struct { Applications []Application `json:"applications,omitempty" yaml:"applications"` ExternalApps []ExternalApp `json:"external_apps,omitempty" yaml:"external_apps"` Options map[string]interface{} `json:"options,omitempty" yaml:"options"` + Styles []CustomStyle `json:"styles,omitempty" yaml:"styles"` + Scripts []CustomScript `json:"scripts,omitempty" yaml:"scripts"` + Translations []CustomTranslation `json:"customTranslations,omitempty" yaml:"custom_translations"` } // OIDC defines the available oidc configuration