From c490926ce35e4da7b67e95ca885c424b000b0f02 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 20 Oct 2026 18:40:39 +0200 Subject: [PATCH] refactor: name the thumbnail config fields like their yaml keys Internal only: the fields in webdav, graph and frontend now read Thumbnails like the keys and the variables they carry. The generator keeps its released thumbnail block, field and key alike. --- services/frontend/pkg/config/config.go | 2 +- services/frontend/pkg/revaconfig/config.go | 2 +- services/graph/pkg/config/config.go | 2 +- services/graph/pkg/service/v0/service.go | 2 +- services/webdav/pkg/config/config.go | 32 ++++++++--------- .../pkg/config/defaults/defaultconfig.go | 14 ++++---- services/webdav/pkg/service/v0/service.go | 34 +++++++++---------- 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/services/frontend/pkg/config/config.go b/services/frontend/pkg/config/config.go index ebc0abf1d2..258bf3819d 100644 --- a/services/frontend/pkg/config/config.go +++ b/services/frontend/pkg/config/config.go @@ -158,7 +158,7 @@ type OCDav struct { // PublicURL used to redirect /s/{token} URLs to PublicURL string `yaml:"public_url" env:"OC_URL;OCDAV_PUBLIC_URL;FRONTENT_OCDAV_PUBLIC_URL" desc:"URL where OpenCloud is reachable for users." introductionVersion:"1.0.0"` - ThumbnailSourceTypes []string `yaml:"thumbnails_source_types" env:"OC_THUMBNAILS_SOURCE_TYPES;FRONTEND_THUMBNAILS_SOURCE_TYPES" desc:"Additional mime types oc:has-preview is answered with 1 for, the same list the webdav service attempts previews for. The types the build ships are included; this only adds to them." introductionVersion:"%%NEXT%%"` + ThumbnailsSourceTypes []string `yaml:"thumbnails_source_types" env:"OC_THUMBNAILS_SOURCE_TYPES;FRONTEND_THUMBNAILS_SOURCE_TYPES" desc:"Additional mime types oc:has-preview is answered with 1 for, the same list the webdav service attempts previews for. The types the build ships are included; this only adds to them." introductionVersion:"%%NEXT%%"` // Insecure certificates allowed when making requests to the gateway Insecure bool `yaml:"insecure" env:"OC_INSECURE;OCDAV_INSECURE;FRONTENT_OCDAV_INSECURE" desc:"Allow insecure connections to the GATEWAY service." introductionVersion:"1.0.0"` diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index 611a269326..411d350027 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -371,7 +371,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string "public_url": cfg.OCDav.PublicURL, // what oc:has-preview is answered from, the same set the // webdav service attempts previews for - "preview_mime_types": thumbnail.NewSourceTypes(cfg.OCDav.ThumbnailSourceTypes).List(), + "preview_mime_types": thumbnail.NewSourceTypes(cfg.OCDav.ThumbnailsSourceTypes).List(), // still not supported //"favorite_storage_driver": unused, //"favorite_storage_drivers": unused, diff --git a/services/graph/pkg/config/config.go b/services/graph/pkg/config/config.go index 1a0f0e2d67..5e6e8408ea 100644 --- a/services/graph/pkg/config/config.go +++ b/services/graph/pkg/config/config.go @@ -32,7 +32,7 @@ type Config struct { IncludeOCMSharees bool `yaml:"include_ocm_sharees" env:"OC_ENABLE_OCM;GRAPH_INCLUDE_OCM_SHAREES" desc:"Include OCM sharees when listing users." introductionVersion:"1.0.0"` Events Events `yaml:"events"` UnifiedRoles UnifiedRoles `yaml:"unified_roles"` - ThumbnailSourceTypes []string `yaml:"thumbnails_source_types" env:"OC_THUMBNAILS_SOURCE_TYPES;GRAPH_THUMBNAILS_SOURCE_TYPES" desc:"Additional mime types a preview is announced for, the same list the webdav service attempts previews for. The types the build ships are included; this only adds to them." introductionVersion:"%%NEXT%%"` + ThumbnailsSourceTypes []string `yaml:"thumbnails_source_types" env:"OC_THUMBNAILS_SOURCE_TYPES;GRAPH_THUMBNAILS_SOURCE_TYPES" desc:"Additional mime types a preview is announced for, the same list the webdav service attempts previews for. The types the build ships are included; this only adds to them." introductionVersion:"%%NEXT%%"` MaxConcurrency int `yaml:"max_concurrency" env:"OC_MAX_CONCURRENCY;GRAPH_MAX_CONCURRENCY" desc:"The maximum number of concurrent requests the service will handle." introductionVersion:"1.0.0"` diff --git a/services/graph/pkg/service/v0/service.go b/services/graph/pkg/service/v0/service.go index 03c764c5e2..151497f86f 100644 --- a/services/graph/pkg/service/v0/service.go +++ b/services/graph/pkg/service/v0/service.go @@ -184,7 +184,7 @@ func NewService(opts ...Option) (Graph, error) { //nolint:maintidx svc := Graph{ BaseGraphService: baseGraphService, - sourceTypes: thumbnail.NewSourceTypes(options.Config.ThumbnailSourceTypes), + sourceTypes: thumbnail.NewSourceTypes(options.Config.ThumbnailsSourceTypes), mux: m, specialDriveItemsCache: spacePropertiesCache, eventsPublisher: options.EventsPublisher, diff --git a/services/webdav/pkg/config/config.go b/services/webdav/pkg/config/config.go index 79a1763b36..7059c2f8aa 100644 --- a/services/webdav/pkg/config/config.go +++ b/services/webdav/pkg/config/config.go @@ -26,28 +26,28 @@ type Config struct { RevaGateway string `yaml:"reva_gateway" env:"OC_REVA_GATEWAY" desc:"CS3 gateway used to look up user metadata" introductionVersion:"1.0.0"` DisablePreviews bool `yaml:"disablePreviews" env:"OC_DISABLE_PREVIEWS;WEBDAV_DISABLE_PREVIEWS" desc:"Set this option to 'true' to disable rendering of thumbnails triggered via webdav access. Note that when disabled, all access to preview related webdav paths will return a 404." introductionVersion:"1.0.0"` - ThumbnailGeneratorURL string `yaml:"thumbnails_generator_url" env:"WEBDAV_THUMBNAILS_GENERATOR_URL" desc:"Base URL of the thumbnail generator service, e.g. http://thumbnails:9186" introductionVersion:"%%NEXT%%"` - ThumbnailGeneratorTimeout string `yaml:"thumbnails_generator_timeout" env:"WEBDAV_THUMBNAILS_GENERATOR_TIMEOUT" desc:"HTTP timeout for requests to the thumbnail generator, e.g. 30s" introductionVersion:"%%NEXT%%"` + ThumbnailsGeneratorURL string `yaml:"thumbnails_generator_url" env:"WEBDAV_THUMBNAILS_GENERATOR_URL" desc:"Base URL of the thumbnail generator service, e.g. http://thumbnails:9186" introductionVersion:"%%NEXT%%"` + ThumbnailsGeneratorTimeout string `yaml:"thumbnails_generator_timeout" env:"WEBDAV_THUMBNAILS_GENERATOR_TIMEOUT" desc:"HTTP timeout for requests to the thumbnail generator, e.g. 30s" introductionVersion:"%%NEXT%%"` // the yaml key stays unprefixed, a config file written against it has to keep working - ThumbnailMaxInputFileSize string `yaml:"thumbnails_max_input_image_file_size" env:"THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE;OC_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE;WEBDAV_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE" desc:"Maximum file size of an input image a thumbnail is made of. The generator refuses a larger body, so both read the same name by default. Usable common abbreviations: [KB, KiB, MB, MiB, GB, GiB], example: 50MB" introductionVersion:"%%NEXT%%"` + ThumbnailsMaxInputFileSize string `yaml:"thumbnails_max_input_image_file_size" env:"THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE;OC_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE;WEBDAV_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE" desc:"Maximum file size of an input image a thumbnail is made of. The generator refuses a larger body, so both read the same name by default. Usable common abbreviations: [KB, KiB, MB, MiB, GB, GiB], example: 50MB" introductionVersion:"%%NEXT%%"` - ThumbnailCacheBackend string `yaml:"thumbnails_cache_backend" env:"WEBDAV_THUMBNAILS_CACHE_BACKEND" desc:"Cache backend for imagor thumbnails: 'none', 'memory', 'file', or 's3'. Default: file." introductionVersion:"%%NEXT%%"` - ThumbnailCacheDir string `yaml:"thumbnails_cache_dir" env:"WEBDAV_THUMBNAILS_CACHE_DIR" desc:"Directory for file-based thumbnail cache (Default: $OC_BASE_DATA_PATH/thumbnails/files). Only used when ThumbnailCacheBackend is 'file'." introductionVersion:"%%NEXT%%"` + ThumbnailsCacheBackend string `yaml:"thumbnails_cache_backend" env:"WEBDAV_THUMBNAILS_CACHE_BACKEND" desc:"Cache backend for imagor thumbnails: 'none', 'memory', 'file', or 's3'. Default: file." introductionVersion:"%%NEXT%%"` + ThumbnailsCacheDir string `yaml:"thumbnails_cache_dir" env:"WEBDAV_THUMBNAILS_CACHE_DIR" desc:"Directory for file-based thumbnail cache (Default: $OC_BASE_DATA_PATH/thumbnails/files). Only used when ThumbnailsCacheBackend is 'file'." introductionVersion:"%%NEXT%%"` // kept so a deployment that configured the thumbnails service keeps its cache - ThumbnailFilesystemStorageRoot string `yaml:"thumbnails_filesystemstorage_root" env:"THUMBNAILS_FILESYSTEMSTORAGE_ROOT" desc:"Directory the thumbnails service stored its files in. Read as a fallback for WEBDAV_THUMBNAILS_CACHE_DIR." introductionVersion:"1.0.0" deprecationVersion:"%%NEXT%%" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"THUMBNAILS_FILESYSTEMSTORAGE_ROOT is deprecated. The webdav service owns the thumbnail cache now, so use WEBDAV_THUMBNAILS_CACHE_DIR instead." deprecationReplacement:"WEBDAV_THUMBNAILS_CACHE_DIR"` - ThumbnailResolutions []string `yaml:"thumbnails_resolutions" env:"THUMBNAILS_RESOLUTIONS;WEBDAV_THUMBNAILS_RESOLUTIONS" desc:"Allowed thumbnail edge lengths, like 512. Each axis of a requested size is rounded up to the next one of these before the box is sent to the generator. Legacy WidthxHeight entries are still accepted and contribute both of their sides." introductionVersion:"%%NEXT%%"` - ThumbnailCacheS3Bucket string `yaml:"thumbnails_cache_s3_bucket" env:"WEBDAV_THUMBNAILS_CACHE_S3_BUCKET" desc:"S3 bucket name for thumbnail cache when ThumbnailCacheBackend is 's3'." introductionVersion:"%%NEXT%%"` - ThumbnailCacheS3Region string `yaml:"thumbnails_cache_s3_region" env:"WEBDAV_THUMBNAILS_CACHE_S3_REGION" desc:"S3 region for thumbnail cache when ThumbnailCacheBackend is 's3'." introductionVersion:"%%NEXT%%"` - ThumbnailCacheS3Endpoint string `yaml:"thumbnails_cache_s3_endpoint" env:"WEBDAV_THUMBNAILS_CACHE_S3_ENDPOINT" desc:"S3 endpoint URL (for MinIO or compatible services) when ThumbnailCacheBackend is 's3'." introductionVersion:"%%NEXT%%"` - ThumbnailCacheS3AccessKey string `yaml:"thumbnails_cache_s3_access_key" env:"WEBDAV_THUMBNAILS_CACHE_S3_ACCESS_KEY" desc:"S3 access key for thumbnail cache authentication." introductionVersion:"%%NEXT%%"` - ThumbnailCacheS3SecretKey string `yaml:"thumbnails_cache_s3_secret_key" env:"WEBDAV_THUMBNAILS_CACHE_S3_SECRET_KEY" desc:"S3 secret key for thumbnail cache authentication." introductionVersion:"%%NEXT%%"` - ThumbnailSourceTypes []string `yaml:"thumbnails_source_types" env:"OC_THUMBNAILS_SOURCE_TYPES;WEBDAV_THUMBNAILS_SOURCE_TYPES" desc:"Additional mime types a preview is announced and attempted for, e.g. image/vnd.microsoft.icon for a generator that reads icons. The built-in list is included; this only adds to them. A type the running generator cannot read answers 404." introductionVersion:"%%NEXT%%"` + ThumbnailsFilesystemStorageRoot string `yaml:"thumbnails_filesystemstorage_root" env:"THUMBNAILS_FILESYSTEMSTORAGE_ROOT" desc:"Directory the thumbnails service stored its files in. Read as a fallback for WEBDAV_THUMBNAILS_CACHE_DIR." introductionVersion:"1.0.0" deprecationVersion:"%%NEXT%%" removalVersion:"%%NEXT_PRODUCTION_VERSION%%" deprecationInfo:"THUMBNAILS_FILESYSTEMSTORAGE_ROOT is deprecated. The webdav service owns the thumbnail cache now, so use WEBDAV_THUMBNAILS_CACHE_DIR instead." deprecationReplacement:"WEBDAV_THUMBNAILS_CACHE_DIR"` + ThumbnailsResolutions []string `yaml:"thumbnails_resolutions" env:"THUMBNAILS_RESOLUTIONS;WEBDAV_THUMBNAILS_RESOLUTIONS" desc:"Allowed thumbnail edge lengths, like 512. Each axis of a requested size is rounded up to the next one of these before the box is sent to the generator. Legacy WidthxHeight entries are still accepted and contribute both of their sides." introductionVersion:"%%NEXT%%"` + ThumbnailsCacheS3Bucket string `yaml:"thumbnails_cache_s3_bucket" env:"WEBDAV_THUMBNAILS_CACHE_S3_BUCKET" desc:"S3 bucket name for thumbnail cache when ThumbnailsCacheBackend is 's3'." introductionVersion:"%%NEXT%%"` + ThumbnailsCacheS3Region string `yaml:"thumbnails_cache_s3_region" env:"WEBDAV_THUMBNAILS_CACHE_S3_REGION" desc:"S3 region for thumbnail cache when ThumbnailsCacheBackend is 's3'." introductionVersion:"%%NEXT%%"` + ThumbnailsCacheS3Endpoint string `yaml:"thumbnails_cache_s3_endpoint" env:"WEBDAV_THUMBNAILS_CACHE_S3_ENDPOINT" desc:"S3 endpoint URL (for MinIO or compatible services) when ThumbnailsCacheBackend is 's3'." introductionVersion:"%%NEXT%%"` + ThumbnailsCacheS3AccessKey string `yaml:"thumbnails_cache_s3_access_key" env:"WEBDAV_THUMBNAILS_CACHE_S3_ACCESS_KEY" desc:"S3 access key for thumbnail cache authentication." introductionVersion:"%%NEXT%%"` + ThumbnailsCacheS3SecretKey string `yaml:"thumbnails_cache_s3_secret_key" env:"WEBDAV_THUMBNAILS_CACHE_S3_SECRET_KEY" desc:"S3 secret key for thumbnail cache authentication." introductionVersion:"%%NEXT%%"` + ThumbnailsSourceTypes []string `yaml:"thumbnails_source_types" env:"OC_THUMBNAILS_SOURCE_TYPES;WEBDAV_THUMBNAILS_SOURCE_TYPES" desc:"Additional mime types a preview is announced and attempted for, e.g. image/vnd.microsoft.icon for a generator that reads icons. The built-in list is included; this only adds to them. A type the running generator cannot read answers 404." introductionVersion:"%%NEXT%%"` - ThumbnailGeneratorFormats []string `yaml:"thumbnails_generator_formats" env:"OC_THUMBNAILS_GENERATOR_FORMATS;WEBDAV_THUMBNAILS_GENERATOR_FORMATS" desc:"The formats the thumbnail generator writes, as mime:format entries, e.g. image/webp:webp. The format is the name the generator's own format filter uses. A type that is not listed is asked for as a JPEG instead, because what the generator behind the URL really writes is its own business." introductionVersion:"%%NEXT%%"` - ThumbnailTypeMapping []string `yaml:"thumbnails_type_mapping" env:"OC_THUMBNAILS_TYPE_MAPPING;WEBDAV_THUMBNAILS_TYPE_MAPPING" desc:"The type a thumbnail is returned in, per type of the image it is made from, as mime:mime entries, e.g. image/vnd.microsoft.icon:image/png. The target is asked for by the name WEBDAV_THUMBNAILS_GENERATOR_FORMATS gives it. A type that is not listed becomes a JPEG; a target this service has no format name for is asked for as a JPEG as well." introductionVersion:"%%NEXT%%"` + ThumbnailsGeneratorFormats []string `yaml:"thumbnails_generator_formats" env:"OC_THUMBNAILS_GENERATOR_FORMATS;WEBDAV_THUMBNAILS_GENERATOR_FORMATS" desc:"The formats the thumbnail generator writes, as mime:format entries, e.g. image/webp:webp. The format is the name the generator's own format filter uses. A type that is not listed is asked for as a JPEG instead, because what the generator behind the URL really writes is its own business." introductionVersion:"%%NEXT%%"` + ThumbnailsTypeMapping []string `yaml:"thumbnails_type_mapping" env:"OC_THUMBNAILS_TYPE_MAPPING;WEBDAV_THUMBNAILS_TYPE_MAPPING" desc:"The type a thumbnail is returned in, per type of the image it is made from, as mime:mime entries, e.g. image/vnd.microsoft.icon:image/png. The target is asked for by the name WEBDAV_THUMBNAILS_GENERATOR_FORMATS gives it. A type that is not listed becomes a JPEG; a target this service has no format name for is asked for as a JPEG as well." introductionVersion:"%%NEXT%%"` // the yaml key stays unprefixed, a config file written against it has to keep working - ThumbnailFontMapFile string `yaml:"thumbnails_txt_fontmap_file" env:"THUMBNAILS_TXT_FONTMAP_FILE;WEBDAV_THUMBNAILS_TXT_FONTMAP_FILE" desc:"The path to a font map file for txt thumbnails." introductionVersion:"%%NEXT%%"` + ThumbnailsFontMapFile string `yaml:"thumbnails_txt_fontmap_file" env:"THUMBNAILS_TXT_FONTMAP_FILE;WEBDAV_THUMBNAILS_TXT_FONTMAP_FILE" desc:"The path to a font map file for txt thumbnails." introductionVersion:"%%NEXT%%"` Context context.Context `yaml:"-"` } diff --git a/services/webdav/pkg/config/defaults/defaultconfig.go b/services/webdav/pkg/config/defaults/defaultconfig.go index 04e385806f..f03809ca74 100644 --- a/services/webdav/pkg/config/defaults/defaultconfig.go +++ b/services/webdav/pkg/config/defaults/defaultconfig.go @@ -43,11 +43,11 @@ func DefaultConfig() *config.Config { WebdavNamespace: "/users/{{.Id.OpaqueId}}", RevaGateway: shared.DefaultRevaConfig().Address, - ThumbnailGeneratorURL: "http://127.0.0.1:9186", - ThumbnailGeneratorTimeout: "30s", - ThumbnailMaxInputFileSize: "50MB", - ThumbnailCacheBackend: "file", - ThumbnailResolutions: []string{ + ThumbnailsGeneratorURL: "http://127.0.0.1:9186", + ThumbnailsGeneratorTimeout: "30s", + ThumbnailsMaxInputFileSize: "50MB", + ThumbnailsCacheBackend: "file", + ThumbnailsResolutions: []string{ "16", "32", "64", "128", "192", "256", "320", "384", "448", "512", "640", "768", "1024", "1280", "1920", "2048", }, @@ -78,7 +78,7 @@ func Sanitize(cfg *config.Config) { // a yaml configuration that joined the resolutions into one entry kept // working in the thumbnails service, so it keeps working here - if len(cfg.ThumbnailResolutions) == 1 && strings.Contains(cfg.ThumbnailResolutions[0], ",") { - cfg.ThumbnailResolutions = strings.Split(cfg.ThumbnailResolutions[0], ",") + if len(cfg.ThumbnailsResolutions) == 1 && strings.Contains(cfg.ThumbnailsResolutions[0], ",") { + cfg.ThumbnailsResolutions = strings.Split(cfg.ThumbnailsResolutions[0], ",") } } diff --git a/services/webdav/pkg/service/v0/service.go b/services/webdav/pkg/service/v0/service.go index 2bdfcc97df..fe6e7ad5b3 100644 --- a/services/webdav/pkg/service/v0/service.go +++ b/services/webdav/pkg/service/v0/service.go @@ -71,7 +71,7 @@ func NewService(opts ...Option) (Service, error) { ), ) - sourceTypes := thumbnail.NewSourceTypes(conf.ThumbnailSourceTypes) + sourceTypes := thumbnail.NewSourceTypes(conf.ThumbnailsSourceTypes) tm, err := pool.StringToTLSMode(conf.GRPCClientTLS.Mode) if err != nil { @@ -159,7 +159,7 @@ func NewService(opts ...Option) (Service, error) { // newThumbnailWorkflow wires the preview pipeline: the generator client, the // cache and the gateway-backed lookups. func newThumbnailWorkflow(conf *config.Config, sourceTypes thumbnail.SourceTypes, logger log.Logger, gatewaySelector pool.Selectable[gatewayv1beta1.GatewayAPIClient]) (*workflow.ThumbnailWorkflow, error) { - genTimeout, err := time.ParseDuration(conf.ThumbnailGeneratorTimeout) + genTimeout, err := time.ParseDuration(conf.ThumbnailsGeneratorTimeout) if err != nil { return nil, fmt.Errorf("parse thumbnail generator timeout: %w", err) } @@ -167,7 +167,7 @@ func newThumbnailWorkflow(conf *config.Config, sourceTypes thumbnail.SourceTypes genTimeout = 30 * time.Second } - sizes, err := thumbnail.ParseSizes(conf.ThumbnailResolutions) + sizes, err := thumbnail.ParseSizes(conf.ThumbnailsResolutions) if err != nil { return nil, fmt.Errorf("parse thumbnail sizes: %w", err) } @@ -176,32 +176,32 @@ func newThumbnailWorkflow(conf *config.Config, sourceTypes thumbnail.SourceTypes return nil, fmt.Errorf("thumbnail resolutions must name at least one edge length") } - maxInputSize, err := generator.ParseMaxInputFileSize(conf.ThumbnailMaxInputFileSize) + maxInputSize, err := generator.ParseMaxInputFileSize(conf.ThumbnailsMaxInputFileSize) if err != nil { return nil, fmt.Errorf("parse max input file size: %w", err) } - typeMapping := thumbnail.NewTypeMapping(conf.ThumbnailTypeMapping) - formats := generator.NewFormats(conf.ThumbnailGeneratorFormats) + typeMapping := thumbnail.NewTypeMapping(conf.ThumbnailsTypeMapping) + formats := generator.NewFormats(conf.ThumbnailsGeneratorFormats) s3cfg := cache.BuildS3CacheConfig( - conf.ThumbnailCacheS3Bucket, - conf.ThumbnailCacheS3Region, - conf.ThumbnailCacheS3Endpoint, - conf.ThumbnailCacheS3AccessKey, - conf.ThumbnailCacheS3SecretKey, + conf.ThumbnailsCacheS3Bucket, + conf.ThumbnailsCacheS3Region, + conf.ThumbnailsCacheS3Endpoint, + conf.ThumbnailsCacheS3AccessKey, + conf.ThumbnailsCacheS3SecretKey, ) // the new setting wins, the deprecated one is the fallback, and an empty // result lets the cache use its own default directory. The old setting named // the root the thumbnails service kept a files/ directory in, so that // deployment's thumbnails are still found where they were written. - cacheDir := conf.ThumbnailCacheDir - if cacheDir == "" && conf.ThumbnailFilesystemStorageRoot != "" { - cacheDir = filepath.Join(conf.ThumbnailFilesystemStorageRoot, "files") + cacheDir := conf.ThumbnailsCacheDir + if cacheDir == "" && conf.ThumbnailsFilesystemStorageRoot != "" { + cacheDir = filepath.Join(conf.ThumbnailsFilesystemStorageRoot, "files") } - c, err := cache.NewThumbnailCache(conf.ThumbnailCacheBackend, cacheDir, s3cfg) + c, err := cache.NewThumbnailCache(conf.ThumbnailsCacheBackend, cacheDir, s3cfg) if err != nil { return nil, err } @@ -209,7 +209,7 @@ func newThumbnailWorkflow(conf *config.Config, sourceTypes thumbnail.SourceTypes httpClient := &http.Client{Timeout: genTimeout} return workflow.NewWorkflow( - workflow.WithGeneratorURL(conf.ThumbnailGeneratorURL), + workflow.WithGeneratorURL(conf.ThumbnailsGeneratorURL), workflow.WithCache(c), workflow.WithHTTPClient(httpClient), workflow.WithMaxInputSize(maxInputSize), @@ -218,7 +218,7 @@ func newThumbnailWorkflow(conf *config.Config, sourceTypes thumbnail.SourceTypes workflow.WithFormats(formats), workflow.WithTypeMapping(typeMapping), workflow.WithWebdavNamespace(conf.WebdavNamespace), - workflow.WithFontMapFile(conf.ThumbnailFontMapFile), + workflow.WithFontMapFile(conf.ThumbnailsFontMapFile), workflow.WithLogger(logger), workflow.WithStater(workflow.NewGatewayStater(gatewaySelector)), workflow.WithFileDownloader(workflow.NewGatewayFileDownloader(gatewaySelector, httpClient)),