From ae040143739a6c9d20f4fd3d2c62f26d1cb866ba Mon Sep 17 00:00:00 2001 From: Florian Schade Date: Tue, 25 Oct 2022 12:11:17 +0200 Subject: [PATCH 1/2] disable activities app by default --- services/experimental/pkg/config/activities.go | 1 + services/experimental/pkg/service/http/v0/service.go | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/services/experimental/pkg/config/activities.go b/services/experimental/pkg/config/activities.go index fa356955255..2e5df70fda1 100644 --- a/services/experimental/pkg/config/activities.go +++ b/services/experimental/pkg/config/activities.go @@ -2,6 +2,7 @@ package config // Activities defines the available activities configuration. type Activities struct { + Enabled bool `yaml:"enabled" env:"EXPERIMENTAL_ACTIVITIES_ENABLED" desc:"enable activities app."` Storage ActivitiesStorage `yaml:"storage" env:"EXPERIMENTAL_ACTIVITIES_STORAGE" desc:"activities storage."` } diff --git a/services/experimental/pkg/service/http/v0/service.go b/services/experimental/pkg/service/http/v0/service.go index 5627184d6e6..c9d3a3bc9f4 100644 --- a/services/experimental/pkg/service/http/v0/service.go +++ b/services/experimental/pkg/service/http/v0/service.go @@ -3,6 +3,7 @@ package svc import ( "crypto/tls" "crypto/x509" + "github.com/owncloud/ocis/v2/services/experimental/pkg/activities" "net/http" "os" @@ -12,7 +13,6 @@ import ( ociscrypto "github.com/owncloud/ocis/v2/ocis-pkg/crypto" "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" searchSvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/search/v0" - "github.com/owncloud/ocis/v2/services/experimental/pkg/activities" "github.com/owncloud/ocis/v2/services/experimental/pkg/tags" ) @@ -63,8 +63,11 @@ func NewService(opts ...Option) (Experimental, error) { logger, ) - if err := activities.NewActivitiesService(r, bus, logger, cfg.Activities); err != nil { - return svc, err + if cfg.Activities.Enabled { + err := activities.NewActivitiesService(r, bus, logger, cfg.Activities) + if err != nil { + return svc, err + } } r.Mount(cfg.HTTP.Root, r) From 766ab466a984effa1292c2e651b15030fa74bce2 Mon Sep 17 00:00:00 2001 From: Florian Schade Date: Wed, 26 Oct 2022 14:52:28 +0200 Subject: [PATCH 2/2] fix goimports --- services/experimental/pkg/service/http/v0/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/experimental/pkg/service/http/v0/service.go b/services/experimental/pkg/service/http/v0/service.go index c9d3a3bc9f4..4ac396d407d 100644 --- a/services/experimental/pkg/service/http/v0/service.go +++ b/services/experimental/pkg/service/http/v0/service.go @@ -3,7 +3,6 @@ package svc import ( "crypto/tls" "crypto/x509" - "github.com/owncloud/ocis/v2/services/experimental/pkg/activities" "net/http" "os" @@ -13,6 +12,7 @@ import ( ociscrypto "github.com/owncloud/ocis/v2/ocis-pkg/crypto" "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" searchSvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/search/v0" + "github.com/owncloud/ocis/v2/services/experimental/pkg/activities" "github.com/owncloud/ocis/v2/services/experimental/pkg/tags" )