From 489d0a5db36ff1d4613c83aca989befc1ced38f9 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Fri, 8 Oct 2021 19:37:48 +0200 Subject: [PATCH] Add favorites capability --- changelog/unreleased/favorites-capability.md | 5 +++++ storage/pkg/command/frontend.go | 1 + storage/pkg/config/config.go | 1 + storage/pkg/flagset/frontend.go | 7 +++++++ 4 files changed, 14 insertions(+) create mode 100644 changelog/unreleased/favorites-capability.md diff --git a/changelog/unreleased/favorites-capability.md b/changelog/unreleased/favorites-capability.md new file mode 100644 index 000000000..8a438bc0a --- /dev/null +++ b/changelog/unreleased/favorites-capability.md @@ -0,0 +1,5 @@ +Enhancement: Favorites capability + +We've added a capability for the storage frontend which can be used to announce to clients whether or not favorites are supported. By default this is disabled because the listing of favorites doesn't survive service restarts at the moment. + +https://github.com/owncloud/ocis/pull/2599 diff --git a/storage/pkg/command/frontend.go b/storage/pkg/command/frontend.go index 96566f55f..96f336419 100644 --- a/storage/pkg/command/frontend.go +++ b/storage/pkg/command/frontend.go @@ -83,6 +83,7 @@ func Frontend(cfg *config.Config) *cli.Command { "versioning": true, "archivers": archivers, "app_providers": appProviders, + "favorites": cfg.Reva.Frontend.Favorites, } if cfg.Reva.DefaultUploadProtocol == "tus" { diff --git a/storage/pkg/config/config.go b/storage/pkg/config/config.go index 7d34e7187..e6be58934 100644 --- a/storage/pkg/config/config.go +++ b/storage/pkg/config/config.go @@ -149,6 +149,7 @@ type FrontendPort struct { AppProviderPrefix string ArchiverPrefix string DatagatewayPrefix string + Favorites bool OCDavPrefix string OCSPrefix string OCSSharePrefix string diff --git a/storage/pkg/flagset/frontend.go b/storage/pkg/flagset/frontend.go index e7329dba9..51c7aeb36 100644 --- a/storage/pkg/flagset/frontend.go +++ b/storage/pkg/flagset/frontend.go @@ -129,6 +129,13 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"STORAGE_FRONTEND_DATAGATEWAY_PREFIX"}, Destination: &cfg.Reva.Frontend.DatagatewayPrefix, }, + &cli.BoolFlag{ + Name: "favorites", + Value: flags.OverrideDefaultBool(cfg.Reva.Frontend.Favorites, false), + Usage: "announces favorites support to clients", + EnvVars: []string{"STORAGE_FRONTEND_FAVORITES"}, + Destination: &cfg.Reva.Frontend.Favorites, + }, &cli.StringFlag{ Name: "ocdav-prefix", Value: flags.OverrideDefaultString(cfg.Reva.Frontend.OCDavPrefix, ""),