From 78c22c0b8451feea969e6df5ed137b91c0e8d1ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 17 Jan 2025 12:03:15 +0100 Subject: [PATCH 1/2] thumbnails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- services/thumbnails/README.md | 16 ++++++++-------- services/thumbnails/pkg/command/root.go | 2 +- services/thumbnails/pkg/config/config.go | 2 +- services/thumbnails/pkg/server/http/server.go | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/services/thumbnails/README.md b/services/thumbnails/README.md index ecc403f49..a2c22239b 100644 --- a/services/thumbnails/README.md +++ b/services/thumbnails/README.md @@ -10,11 +10,11 @@ The relevant environment variables defining file locations are: - (2) `STORAGE_USERS_OCIS_ROOT` - (3) `THUMBNAILS_FILESYSTEMSTORAGE_ROOT` -(1) ... Having a default set by the Infinite Scale code, but if defined, used as base path for other services. +(1) ... Having a default set by the OpenCloud code, but if defined, used as base path for other services. (2) ... Source files, defaults to (1) plus path component, but can be freely defined if required. (3) ... Target files, defaults to (1) plus path component, but can be freely defined if required. -For details and defaults for these environment variables see the ocis admin documentation. +For details and defaults for these environment variables see the OpenCloud admin documentation. ## Thumbnail Location @@ -95,9 +95,9 @@ If a resource is shared using SecureView, the share reciever will get a 403 (for To improve performance and to support a wider range of images formats, the thumbnails service is able to utilize the [libvips library](https://www.libvips.org/) for thumbnail generation. Support for libvips needs to be enabled at buildtime and has a couple of implications: -* With libvips support enabled, it is not possible to create a statically linked ocis binary. -* Therefore, the libvips shared libraries need to be available at runtime in the same release that was used to build the ocis binary. -* When using the ocis docker images, the libvips shared libraries are included in the image and are correctly embedded. +* With libvips support enabled, it is not possible to create a statically linked OpenCloud binary. +* Therefore, the libvips shared libraries need to be available at runtime in the same release that was used to build the OpenCloud binary. +* When using the OpenCloud docker images, the libvips shared libraries are included in the image and are correctly embedded. Support of libvips is disabled by default. To enable it, make sure libvips and its buildtime dependencies are installed in your build environment. For macOS users, add the build time dependencies via: @@ -109,15 +109,15 @@ export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" Then you just need to set the `ENABLE_VIPS` variable on the `make` command: ```shell -make -C ocis build ENABLE_VIPS=1 +make -C OpenCloud build ENABLE_VIPS=1 ``` Or include the `enable_vips` build tag in the `go build` command: ```shell -go build -tags enable_vips -o ocis -o bin/ocis ./cmd/ocis +go build -tags enable_vips -o opencloud -o bin/opencloud ./cmd/opencloud ``` -When building a docker image using the Dockerfile in the top-level directory of ocis, libvips support is enabled and the libvips shared libraries are included +When building a docker image using the Dockerfile in the top-level directory of OpenCloud, libvips support is enabled and the libvips shared libraries are included in the resulting docker image. diff --git a/services/thumbnails/pkg/command/root.go b/services/thumbnails/pkg/command/root.go index 0a8641470..8e3d9e830 100644 --- a/services/thumbnails/pkg/command/root.go +++ b/services/thumbnails/pkg/command/root.go @@ -22,7 +22,7 @@ func GetCommands(cfg *config.Config) cli.Commands { } } -// Execute is the entry point for the ocis-thumbnails command. +// Execute is the entry point for the opencloud-thumbnails command. func Execute(cfg *config.Config) error { app := clihelper.DefaultApp(&cli.App{ Name: "thumbnails", diff --git a/services/thumbnails/pkg/config/config.go b/services/thumbnails/pkg/config/config.go index f8c367999..2a4015512 100644 --- a/services/thumbnails/pkg/config/config.go +++ b/services/thumbnails/pkg/config/config.go @@ -1,4 +1,4 @@ -// Package config contains the configuration for the ocis-thumbnails service +// Package config contains the configuration for the opencloud-thumbnails service package config import ( diff --git a/services/thumbnails/pkg/server/http/server.go b/services/thumbnails/pkg/server/http/server.go index 68ced7d39..d9c2a1c1f 100644 --- a/services/thumbnails/pkg/server/http/server.go +++ b/services/thumbnails/pkg/server/http/server.go @@ -5,7 +5,7 @@ import ( "github.com/go-chi/chi/v5/middleware" "github.com/opencloud-eu/opencloud/pkg/cors" - ocismiddleware "github.com/opencloud-eu/opencloud/pkg/middleware" + opencloudmiddleware "github.com/opencloud-eu/opencloud/pkg/middleware" "github.com/opencloud-eu/opencloud/pkg/service/http" "github.com/opencloud-eu/opencloud/pkg/version" svc "github.com/opencloud-eu/opencloud/services/thumbnails/pkg/service/http/v0" @@ -40,18 +40,18 @@ func Server(opts ...Option) (http.Service, error) { svc.Middleware( middleware.RealIP, middleware.RequestID, - ocismiddleware.Cors( + opencloudmiddleware.Cors( cors.Logger(options.Logger), cors.AllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), cors.AllowedMethods(options.Config.HTTP.CORS.AllowedMethods), cors.AllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), cors.AllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), - ocismiddleware.Version( + opencloudmiddleware.Version( options.Config.Service.Name, version.GetString(), ), - ocismiddleware.Logger(options.Logger), + opencloudmiddleware.Logger(options.Logger), ), svc.ThumbnailStorage( storage.NewFileSystemStorage( From 233a435fe98089253b4fe0999e5fa773fa6e3b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 17 Jan 2025 14:52:11 +0100 Subject: [PATCH 2/2] Update services/thumbnails/README.md Co-authored-by: Andre Duffeck --- services/thumbnails/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/thumbnails/README.md b/services/thumbnails/README.md index a2c22239b..ec6c55315 100644 --- a/services/thumbnails/README.md +++ b/services/thumbnails/README.md @@ -109,7 +109,7 @@ export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" Then you just need to set the `ENABLE_VIPS` variable on the `make` command: ```shell -make -C OpenCloud build ENABLE_VIPS=1 +make -C opencloud build ENABLE_VIPS=1 ``` Or include the `enable_vips` build tag in the `go build` command: