From 15ced8a6df330a00f5d04e431f1b5e887232b951 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Fri, 23 Jun 2023 13:29:49 +0200 Subject: [PATCH] incorporate requested changes Signed-off-by: Christian Richter --- changelog/unreleased/disable-thumbnailer.md | 7 ++++--- ocis/pkg/runtime/service/service.go | 5 ----- services/web/pkg/config/options.go | 2 +- services/webdav/pkg/config/config.go | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/changelog/unreleased/disable-thumbnailer.md b/changelog/unreleased/disable-thumbnailer.md index 7c6336106..c32e1e8d1 100644 --- a/changelog/unreleased/disable-thumbnailer.md +++ b/changelog/unreleased/disable-thumbnailer.md @@ -1,7 +1,8 @@ -Bugfix: Thumbnailer can be disabled globally now +Enhancement: Thumbnails can be disabled for webdav & web now -We added an env var `OCIS_DISABLE_PREVIEWS` to disable the thumbnailer globally. -The web-only local env-var `WEB_OPTION_DISABLE_PREVIEWS` will be deprecated. +We added an env var `OCIS_DISABLE_PREVIEWS` to disable the thumbnails for web & webdav via a global setting. +For each service this behaviour can be disabled using the local env vars `WEB_OPTION_DISABLE_PREVIEWS` (old) +and `WEBDAV_OPTION_DISABLE_PREVIEWS` (new). https://github.com/owncloud/ocis/pull/6577 https://github.com/owncloud/ocis/issues/192 \ No newline at end of file diff --git a/ocis/pkg/runtime/service/service.go b/ocis/pkg/runtime/service/service.go index 51cb36ee0..958d2d167 100644 --- a/ocis/pkg/runtime/service/service.go +++ b/ocis/pkg/runtime/service/service.go @@ -432,11 +432,6 @@ func (s *Service) generateRunSet(cfg *ociscfg.Config) { for _, name := range cfg.Runtime.Disabled { delete(runset, name) } - - // disable thumbnail service - if cfg.WebDAV.DisablePreviews || cfg.Web.Web.Config.Options.DisablePreviews { - delete(runset, "thumbnails") - } } // List running processes for the Service Controller. diff --git a/services/web/pkg/config/options.go b/services/web/pkg/config/options.go index 5ea918c4b..9e88c176a 100644 --- a/services/web/pkg/config/options.go +++ b/services/web/pkg/config/options.go @@ -4,7 +4,7 @@ package config type Options struct { HomeFolder string `json:"homeFolder,omitempty" yaml:"homeFolder" env:"WEB_OPTION_HOME_FOLDER" desc:"Specifies a folder that is used when the user navigates 'home'. Navigating home gets triggered by clicking on the 'All files' menu item. The user will not be jailed in that directory, it simply serves as a default location. A static location can be provided, or variables of the user object to come up with a user specific home path can be used. This uses the twig template variable style and allows picking a value or a substring of a value of the authenticated user. Examples are '/Shares', '/{{.Id}}' and '/{{substr 0 3 .Id}}/{{.Id}'."` OpenAppsInTab bool `json:"openAppsInTab,omitempty" yaml:"openAppsInTab" env:"WEB_OPTION_OPEN_APPS_IN_TAB" desc:"Configures whether apps and extensions should generally open in a new tab. Defaults to false."` - DisablePreviews bool `json:"disablePreviews,omitempty" yaml:"disablePreviews" env:"OCIS_DISABLE_PREVIEWS;WEB_OPTION_DISABLE_PREVIEWS" desc:"Set this option to 'true' to disable previews in all the different file listing views. The only list view that is not affected by this setting is the trash bin, as it does not allow previewing at all." deprecationVersion:"3.1" removalVersion:"4.0.0" deprecationInfo:"WEB_OPTION_DISABLE_PREVIEWS is being replaced by a global variable" deprecationReplacement:"OCIS_DISABLE_PREVIEWS"` + DisablePreviews bool `json:"disablePreviews,omitempty" yaml:"disablePreviews" env:"OCIS_DISABLE_PREVIEWS;WEB_OPTION_DISABLE_PREVIEWS" desc:"Set this option to 'true' to disable previews in all the different web file listing views. The only list view that is not affected by this setting is the trash bin, as it does not allow previewing at all."` PreviewFileMimeTypes []string `json:"previewFileMimeTypes,omitempty" yaml:"previewFileMimeTypes" env:"WEB_OPTION_PREVIEW_FILE_MIMETYPES" desc:"Specifies which mimeTypes will be previewed in the UI. For example to only preview jpg and text files, set this option to ['image/jpeg', 'text/plain']."` AccountEditLink *AccountEditLink `json:"accountEditLink,omitempty" yaml:"accountEditLink"` DisableFeedbackLink bool `json:"disableFeedbackLink,omitempty" yaml:"disableFeedbackLink" env:"WEB_OPTION_DISABLE_FEEDBACK_LINK" desc:"Set this option to 'true' to disable the feedback link in the topbar. Keeping it enabled by setting the value to 'false' or with the absence of the option, allows ownCloud to get feedback from your user base through a dedicated survey website."` diff --git a/services/webdav/pkg/config/config.go b/services/webdav/pkg/config/config.go index 7317dc962..4c9aa57b0 100644 --- a/services/webdav/pkg/config/config.go +++ b/services/webdav/pkg/config/config.go @@ -20,7 +20,7 @@ type Config struct { HTTP HTTP `yaml:"http"` - DisablePreviews bool `yaml:"disablePreviews" env:"OCIS_DISABLE_PREVIEWS" desc:"Set this option to 'true' to disable previews in all the different file listing views. The only list view that is not affected by this setting is the trash bin, as it does not allow previewing at all."` + DisablePreviews bool `yaml:"disablePreviews" env:"OCIS_DISABLE_PREVIEWS;WEBDAV_OPTION_DISABLE_PREVIEWS" desc:"Set this option to 'true' to disable all preview related webdav paths."` OcisPublicURL string `yaml:"ocis_public_url" env:"OCIS_URL;OCIS_PUBLIC_URL" desc:"URL, where oCIS is reachable for users."` WebdavNamespace string `yaml:"webdav_namespace" env:"WEBDAV_WEBDAV_NAMESPACE" desc:"CS3 path layout to use when forwarding /webdav requests"` RevaGateway string `yaml:"reva_gateway" env:"OCIS_REVA_GATEWAY;REVA_GATEWAY" desc:"CS3 gateway used to look up user metadata" deprecationVersion:"3.0" removalVersion:"4.0.0" deprecationInfo:"REVA_GATEWAY changing name for consistency" deprecationReplacement:"OCIS_REVA_GATEWAY"`