From 93138c81edb15e47f2c34024948872f324c73d92 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 5 Oct 2020 21:30:51 +0200 Subject: [PATCH] Rename ocis single binary commands and flagset --- .gitignore | 1 + docs/ocis/configuration.md | 230 ++++++++++--------- ocis/go.mod | 4 +- ocis/go.sum | 1 + ocis/pkg/command/proxy.go | 4 +- ocis/pkg/command/revaauthbasic.go | 50 ---- ocis/pkg/command/revaauthbearer.go | 50 ---- ocis/pkg/command/revafrontend.go | 50 ---- ocis/pkg/command/revagateway.go | 50 ---- ocis/pkg/command/revasharing.go | 50 ---- ocis/pkg/command/revastorageeos.go | 50 ---- ocis/pkg/command/revastorageeosdata.go | 50 ---- ocis/pkg/command/revastoragehome.go | 50 ---- ocis/pkg/command/revastoragehomedata.go | 50 ---- ocis/pkg/command/revastoragemetadata.go | 49 ---- ocis/pkg/command/revastorageoc.go | 50 ---- ocis/pkg/command/revastorageocdata.go | 50 ---- ocis/pkg/command/revastoragepubliclink.go | 50 ---- ocis/pkg/command/revastorageroot.go | 50 ---- ocis/pkg/command/revausers.go | 50 ---- ocis/pkg/command/settings.go | 8 +- ocis/pkg/command/storageauthbasic.go | 50 ++++ ocis/pkg/command/storageauthbearer.go | 50 ++++ ocis/pkg/command/storagefrontend.go | 50 ++++ ocis/pkg/command/storagegateway.go | 50 ++++ ocis/pkg/command/storagesharing.go | 50 ++++ ocis/pkg/command/storagestorageeos.go | 50 ++++ ocis/pkg/command/storagestorageeosdata.go | 50 ++++ ocis/pkg/command/storagestoragehome.go | 50 ++++ ocis/pkg/command/storagestoragehomedata.go | 50 ++++ ocis/pkg/command/storagestoragemetadata.go | 49 ++++ ocis/pkg/command/storagestorageoc.go | 50 ++++ ocis/pkg/command/storagestorageocdata.go | 50 ++++ ocis/pkg/command/storagestoragepubliclink.go | 50 ++++ ocis/pkg/command/storagestorageroot.go | 50 ++++ ocis/pkg/command/storageusers.go | 50 ++++ ocis/pkg/config/config.go | 12 +- ocis/pkg/runtime/runtime.go | 28 +-- ocis/templates/CONFIGURATION.tmpl | 10 +- storage/pkg/flagset/sharing.go | 2 +- 40 files changed, 905 insertions(+), 893 deletions(-) delete mode 100644 ocis/pkg/command/revaauthbasic.go delete mode 100644 ocis/pkg/command/revaauthbearer.go delete mode 100644 ocis/pkg/command/revafrontend.go delete mode 100644 ocis/pkg/command/revagateway.go delete mode 100644 ocis/pkg/command/revasharing.go delete mode 100644 ocis/pkg/command/revastorageeos.go delete mode 100644 ocis/pkg/command/revastorageeosdata.go delete mode 100644 ocis/pkg/command/revastoragehome.go delete mode 100644 ocis/pkg/command/revastoragehomedata.go delete mode 100644 ocis/pkg/command/revastoragemetadata.go delete mode 100644 ocis/pkg/command/revastorageoc.go delete mode 100644 ocis/pkg/command/revastorageocdata.go delete mode 100644 ocis/pkg/command/revastoragepubliclink.go delete mode 100644 ocis/pkg/command/revastorageroot.go delete mode 100644 ocis/pkg/command/revausers.go create mode 100644 ocis/pkg/command/storageauthbasic.go create mode 100644 ocis/pkg/command/storageauthbearer.go create mode 100644 ocis/pkg/command/storagefrontend.go create mode 100644 ocis/pkg/command/storagegateway.go create mode 100644 ocis/pkg/command/storagesharing.go create mode 100644 ocis/pkg/command/storagestorageeos.go create mode 100644 ocis/pkg/command/storagestorageeosdata.go create mode 100644 ocis/pkg/command/storagestoragehome.go create mode 100644 ocis/pkg/command/storagestoragehomedata.go create mode 100644 ocis/pkg/command/storagestoragemetadata.go create mode 100644 ocis/pkg/command/storagestorageoc.go create mode 100644 ocis/pkg/command/storagestorageocdata.go create mode 100644 ocis/pkg/command/storagestoragepubliclink.go create mode 100644 ocis/pkg/command/storagestorageroot.go create mode 100644 ocis/pkg/command/storageusers.go diff --git a/.gitignore b/.gitignore index 01612bb087..4d568dbd49 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ */coverage.out +/**/config /**/bin /**/dist /hugo diff --git a/docs/ocis/configuration.md b/docs/ocis/configuration.md index 807f92149e..7da299cbf2 100644 --- a/docs/ocis/configuration.md +++ b/docs/ocis/configuration.md @@ -1,9 +1,9 @@ --- title: "Configuration" -date: "2020-09-21T13:14:56+0200" +date: "2020-10-05T21:19:39+0200" weight: 20 geekdocRepo: https://github.com/owncloud/ocis -geekdocEditPath: edit/master/docs +geekdocEditPath: edit/master/docs/ocis geekdocFilePath: configuration.md --- @@ -43,28 +43,25 @@ ownCloud Infinite Scale Stack Usage: `ocis [global options] command [command options] [arguments...]` ---config-file | $OCIS_CONFIG_FILE +--config-file | $OCIS_CONFIG_FILE : Path to config file. ---log-level | $OCIS_LOG_LEVEL +--log-level | $OCIS_LOG_LEVEL : Set logging level. Default: `info`. ---log-pretty | $OCIS_LOG_PRETTY +--log-pretty | $OCIS_LOG_PRETTY : Enable pretty logging. Default: `true`. ---log-color | $OCIS_LOG_COLOR +--log-color | $OCIS_LOG_COLOR : Enable colored logging. Default: `true`. ## Sub Commands -### ocis health +### ocis kill -Check health status +Kill an extension by name -Usage: `ocis health [command options] [arguments...]` - ---debug-addr | $OCIS_DEBUG_ADDR -: Address to debug endpoint. Default: `0.0.0.0:9010`. +Usage: `ocis kill [command options] [arguments...]` ### ocis server @@ -72,42 +69,63 @@ Start fullstack server Usage: `ocis server [command options] [arguments...]` ---tracing-enabled | $OCIS_TRACING_ENABLED +--tracing-enabled | $OCIS_TRACING_ENABLED : Enable sending traces. ---tracing-type | $OCIS_TRACING_TYPE +--tracing-type | $OCIS_TRACING_TYPE : Tracing backend type. Default: `jaeger`. ---tracing-endpoint | $OCIS_TRACING_ENDPOINT +--tracing-endpoint | $OCIS_TRACING_ENDPOINT : Endpoint for the agent. Default: `localhost:6831`. ---tracing-collector | $OCIS_TRACING_COLLECTOR +--tracing-collector | $OCIS_TRACING_COLLECTOR : Endpoint for the collector. Default: `http://localhost:14268/api/traces`. ---tracing-service | $OCIS_TRACING_SERVICE +--tracing-service | $OCIS_TRACING_SERVICE : Service name for tracing. Default: `ocis`. ---debug-addr | $OCIS_DEBUG_ADDR +--debug-addr | $OCIS_DEBUG_ADDR : Address to bind debug server. Default: `0.0.0.0:9010`. ---debug-token | $OCIS_DEBUG_TOKEN +--debug-token | $OCIS_DEBUG_TOKEN : Token to grant metrics access. ---debug-pprof | $OCIS_DEBUG_PPROF +--debug-pprof | $OCIS_DEBUG_PPROF : Enable pprof debugging. ---debug-zpages | $OCIS_DEBUG_ZPAGES +--debug-zpages | $OCIS_DEBUG_ZPAGES : Enable zpages debugging. ---http-addr | $OCIS_HTTP_ADDR +--http-addr | $OCIS_HTTP_ADDR : Address to bind http server. Default: `0.0.0.0:9000`. ---http-root | $OCIS_HTTP_ROOT +--http-root | $OCIS_HTTP_ROOT : Root path of http server. Default: `/`. ---grpc-addr | $OCIS_GRPC_ADDR +--grpc-addr | $OCIS_GRPC_ADDR : Address to bind grpc server. Default: `0.0.0.0:9001`. +### ocis run + +Runs an extension + +Usage: `ocis run [command options] [arguments...]` + +### ocis health + +Check health status + +Usage: `ocis health [command options] [arguments...]` + +--debug-addr | $OCIS_DEBUG_ADDR +: Address to debug endpoint. Default: `0.0.0.0:9010`. + +### ocis list + +Lists running ocis extensions + +Usage: `ocis list [command options] [arguments...]` + ### List of available Extension subcommands There are more subcommands to start the individual extensions. Please check the documentation about their usage and options in the dedicated section of the documentation. @@ -116,9 +134,29 @@ There are more subcommands to start the individual extensions. Please check the Start konnectd server -#### ocis run +#### ocis storage-frontend -Runs an extension +Start storage frontend + +#### ocis accounts + +Start accounts server + +#### ocis storage-storage-root + +Start storage root storage + +#### ocis storage-gateway + +Start storage gateway + +#### ocis storage-storage-home + +Start storage storage service for home mount + +#### ocis storage-storage-public-link + +Start storage public link storage #### ocis store @@ -128,95 +166,67 @@ Start a go-micro store Start glauth server -#### ocis ocs +#### ocis storage-auth-bearer -Start ocs server +Start storage auth-bearer service -#### ocis reva-storage-eos-data +#### ocis storage-sharing -Start reva storage data provider for eos mount - -#### ocis reva-storage-home-data - -Start reva storage data provider for home mount - -#### ocis kill - -Kill an extension by name - -#### ocis proxy - -Start proxy server - -#### ocis reva-auth-bearer - -Start reva auth-bearer service - -#### ocis reva-storage-oc-data - -Start reva storage data provider for oc mount - -#### ocis settings - -Start settings server - -#### ocis accounts - -Start accounts server - -#### ocis phoenix - -Start phoenix server - -#### ocis reva-storage-eos - -Start reva storage service for eos mount - -#### ocis reva-storage-home - -Start reva storage service for home mount - -#### ocis reva-storage-oc - -Start reva storage service for oc mount - -#### ocis reva-storage-root - -Start reva root storage - -#### ocis reva-gateway - -Start reva gateway - -#### ocis reva-sharing - -Start reva sharing service - -#### ocis reva-users - -Start reva users service - -#### ocis list - -Lists running ocis extensions - -#### ocis reva-auth-basic - -Start reva auth-basic service - -#### ocis reva-frontend - -Start reva frontend - -#### ocis reva-storage-public-link - -Start reva public link storage - -#### ocis thumbnails - -Start thumbnails server +Start storage sharing service #### ocis webdav Start webdav server +#### ocis storage-storage-oc-data + +Start storage storage data provider for oc mount + +#### ocis thumbnails + +Start thumbnails server + +#### ocis proxy + +Start proxy server + +#### ocis settings + +Start settings server + +#### ocis storage-auth-basic + +Start storage auth-basic service + +#### ocis storage-storage-metadata + +Start storage storage service for metadata mount + +#### ocis ocs + +Start ocs server + +#### ocis storage-storage-eos + +Start storage storage service for eos mount + +#### ocis storage-storage-eos-data + +Start storage storage data provider for eos mount + +#### ocis storage-storage-home-data + +Start storage storage data provider for home mount + +#### ocis storage-storage-oc + +Start storage storage service for oc mount + +#### ocis storage-users + +Start storage users service + +#### ocis phoenix + +Start phoenix server + diff --git a/ocis/go.mod b/ocis/go.mod index 598986960b..2d124d781a 100644 --- a/ocis/go.mod +++ b/ocis/go.mod @@ -21,7 +21,7 @@ require ( github.com/owncloud/ocis/konnectd v0.0.0-00010101000000-000000000000 github.com/owncloud/ocis/ocis-phoenix v0.0.0-00010101000000-000000000000 github.com/owncloud/ocis/ocis-pkg v0.1.0 - github.com/owncloud/ocis/ocis-reva v0.0.0-00010101000000-000000000000 + github.com/owncloud/ocis/storage v0.0.0-00010101000000-000000000000 github.com/owncloud/ocis/ocs v0.0.0-00010101000000-000000000000 github.com/owncloud/ocis/proxy v0.0.0-00010101000000-000000000000 github.com/owncloud/ocis/settings v0.0.0-20200918114005-1a0ddd2190ee @@ -40,7 +40,7 @@ replace ( github.com/owncloud/ocis/konnectd => ../konnectd github.com/owncloud/ocis/ocis-phoenix => ../ocis-phoenix github.com/owncloud/ocis/ocis-pkg => ../ocis-pkg - github.com/owncloud/ocis/ocis-reva => ../ocis-reva + github.com/owncloud/ocis/storage => ../storage github.com/owncloud/ocis/ocs => ../ocs github.com/owncloud/ocis/proxy => ../proxy github.com/owncloud/ocis/settings => ../settings diff --git a/ocis/go.sum b/ocis/go.sum index 65eb5011ed..1650c10e9f 100644 --- a/ocis/go.sum +++ b/ocis/go.sum @@ -868,6 +868,7 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5 h1:FdBGmSkD2QpQzRWup//SGObvWf2nq89zj9+ta9OvI3A= github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5/go.mod h1:0YZ2wQSuwviXXXGUiK6zXzskyBLAbLXhamxzcFHSLoM= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= diff --git a/ocis/pkg/command/proxy.go b/ocis/pkg/command/proxy.go index 8402a6dd6b..8422a39e10 100644 --- a/ocis/pkg/command/proxy.go +++ b/ocis/pkg/command/proxy.go @@ -48,8 +48,8 @@ func configureProxy(cfg *config.Config) *svcconfig.Config { cfg.Proxy.Tracing.Service = cfg.Tracing.Service } - if cfg.Reva.Reva.JWTSecret != "" { - cfg.Proxy.TokenManager.JWTSecret = cfg.Reva.Reva.JWTSecret + if cfg.Storage.Reva.JWTSecret != "" { + cfg.Proxy.TokenManager.JWTSecret = cfg.Storage.Reva.JWTSecret } return cfg.Proxy diff --git a/ocis/pkg/command/revaauthbasic.go b/ocis/pkg/command/revaauthbasic.go deleted file mode 100644 index a48c177e13..0000000000 --- a/ocis/pkg/command/revaauthbasic.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaAuthBasicCommand is the entrypoint for the reva-auth-basic command. -func RevaAuthBasicCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-auth-basic", - Usage: "Start reva auth-basic service", - Category: "Extensions", - Flags: flagset.AuthBasicWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaAuthBasic(cfg) - - return cli.HandleAction( - command.AuthBasic(scfg).Action, - c, - ) - }, - } -} - -func configureRevaAuthBasic(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaAuthBasicCommand) -} diff --git a/ocis/pkg/command/revaauthbearer.go b/ocis/pkg/command/revaauthbearer.go deleted file mode 100644 index da15afcbe6..0000000000 --- a/ocis/pkg/command/revaauthbearer.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaAuthBearerCommand is the entrypoint for the reva-auth-bearer command. -func RevaAuthBearerCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-auth-bearer", - Usage: "Start reva auth-bearer service", - Category: "Extensions", - Flags: flagset.AuthBearerWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaAuthBearer(cfg) - - return cli.HandleAction( - command.AuthBearer(scfg).Action, - c, - ) - }, - } -} - -func configureRevaAuthBearer(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaAuthBearerCommand) -} diff --git a/ocis/pkg/command/revafrontend.go b/ocis/pkg/command/revafrontend.go deleted file mode 100644 index 8e28b5647e..0000000000 --- a/ocis/pkg/command/revafrontend.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaFrontendCommand is the entrypoint for the reva-frontend command. -func RevaFrontendCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-frontend", - Usage: "Start reva frontend", - Category: "Extensions", - Flags: flagset.FrontendWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaFrontend(cfg) - - return cli.HandleAction( - command.Frontend(scfg).Action, - c, - ) - }, - } -} - -func configureRevaFrontend(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaFrontendCommand) -} diff --git a/ocis/pkg/command/revagateway.go b/ocis/pkg/command/revagateway.go deleted file mode 100644 index ea0d377144..0000000000 --- a/ocis/pkg/command/revagateway.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaGatewayCommand is the entrypoint for the reva-gateway command. -func RevaGatewayCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-gateway", - Usage: "Start reva gateway", - Category: "Extensions", - Flags: flagset.GatewayWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaGateway(cfg) - - return cli.HandleAction( - command.Gateway(scfg).Action, - c, - ) - }, - } -} - -func configureRevaGateway(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaGatewayCommand) -} diff --git a/ocis/pkg/command/revasharing.go b/ocis/pkg/command/revasharing.go deleted file mode 100644 index 582843251a..0000000000 --- a/ocis/pkg/command/revasharing.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaSharingCommand is the entrypoint for the reva-sharing command. -func RevaSharingCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-sharing", - Usage: "Start reva sharing service", - Category: "Extensions", - Flags: flagset.SharingWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaSharing(cfg) - - return cli.HandleAction( - command.Sharing(scfg).Action, - c, - ) - }, - } -} - -func configureRevaSharing(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaSharingCommand) -} diff --git a/ocis/pkg/command/revastorageeos.go b/ocis/pkg/command/revastorageeos.go deleted file mode 100644 index 3c858aace4..0000000000 --- a/ocis/pkg/command/revastorageeos.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaStorageEOSCommand is the entrypoint for the reva-storage-oc command. -func RevaStorageEOSCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-storage-eos", - Usage: "Start reva storage service for eos mount", - Category: "Extensions", - Flags: flagset.StorageEOSWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaStorageEOS(cfg) - - return cli.HandleAction( - command.StorageEOS(scfg).Action, - c, - ) - }, - } -} - -func configureRevaStorageEOS(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaStorageEOSCommand) -} diff --git a/ocis/pkg/command/revastorageeosdata.go b/ocis/pkg/command/revastorageeosdata.go deleted file mode 100644 index 1abb391183..0000000000 --- a/ocis/pkg/command/revastorageeosdata.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaStorageEOSDataCommand is the entrypoint for the reva-storage-eos-data command. -func RevaStorageEOSDataCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-storage-eos-data", - Usage: "Start reva storage data provider for eos mount", - Category: "Extensions", - Flags: flagset.StorageEOSDataWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaStorageEOSData(cfg) - - return cli.HandleAction( - command.StorageEOSData(scfg).Action, - c, - ) - }, - } -} - -func configureRevaStorageEOSData(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaStorageEOSDataCommand) -} diff --git a/ocis/pkg/command/revastoragehome.go b/ocis/pkg/command/revastoragehome.go deleted file mode 100644 index 6fe7388b9c..0000000000 --- a/ocis/pkg/command/revastoragehome.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaStorageHomeCommand is the entrypoint for the reva-storage-home command. -func RevaStorageHomeCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-storage-home", - Usage: "Start reva storage service for home mount", - Category: "Extensions", - Flags: flagset.StorageHomeWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaStorageHome(cfg) - - return cli.HandleAction( - command.StorageHome(scfg).Action, - c, - ) - }, - } -} - -func configureRevaStorageHome(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaStorageHomeCommand) -} diff --git a/ocis/pkg/command/revastoragehomedata.go b/ocis/pkg/command/revastoragehomedata.go deleted file mode 100644 index b55cf0fd52..0000000000 --- a/ocis/pkg/command/revastoragehomedata.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaStorageHomeDataCommand is the entrypoint for the reva-storage-home-data command. -func RevaStorageHomeDataCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-storage-home-data", - Usage: "Start reva storage data provider for home mount", - Category: "Extensions", - Flags: flagset.StorageHomeDataWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaStorageHomeData(cfg) - - return cli.HandleAction( - command.StorageHomeData(scfg).Action, - c, - ) - }, - } -} - -func configureRevaStorageHomeData(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaStorageHomeDataCommand) -} diff --git a/ocis/pkg/command/revastoragemetadata.go b/ocis/pkg/command/revastoragemetadata.go deleted file mode 100644 index 61c7af1125..0000000000 --- a/ocis/pkg/command/revastoragemetadata.go +++ /dev/null @@ -1,49 +0,0 @@ -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaStorageMetadataCommand is the entrypoint for the reva-storage-metadata command. -func RevaStorageMetadataCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-storage-metadata", - Usage: "Start reva storage service for metadata mount", - Category: "Extensions", - Flags: flagset.StorageMetadata(cfg.Reva), - Action: func(c *cli.Context) error { - revaStorageMetadataCommand := command.StorageMetadata(configureRevaStorageMetadata(cfg)) - - if err := revaStorageMetadataCommand.Before(c); err != nil { - return err - } - - return cli.HandleAction(revaStorageMetadataCommand.Action, c) - }, - } -} - -func configureRevaStorageMetadata(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaStorageMetadataCommand) -} diff --git a/ocis/pkg/command/revastorageoc.go b/ocis/pkg/command/revastorageoc.go deleted file mode 100644 index 419b4dd646..0000000000 --- a/ocis/pkg/command/revastorageoc.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaStorageOCCommand is the entrypoint for the reva-storage-oc command. -func RevaStorageOCCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-storage-oc", - Usage: "Start reva storage service for oc mount", - Category: "Extensions", - Flags: flagset.StorageOCWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaStorageOC(cfg) - - return cli.HandleAction( - command.StorageOC(scfg).Action, - c, - ) - }, - } -} - -func configureRevaStorageOC(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaStorageOCCommand) -} diff --git a/ocis/pkg/command/revastorageocdata.go b/ocis/pkg/command/revastorageocdata.go deleted file mode 100644 index 0590dfff18..0000000000 --- a/ocis/pkg/command/revastorageocdata.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaStorageOCDataCommand is the entrypoint for the reva-storage-oc-data command. -func RevaStorageOCDataCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-storage-oc-data", - Usage: "Start reva storage data provider for oc mount", - Category: "Extensions", - Flags: flagset.StorageOCDataWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaStorageOCData(cfg) - - return cli.HandleAction( - command.StorageOCData(scfg).Action, - c, - ) - }, - } -} - -func configureRevaStorageOCData(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaStorageOCDataCommand) -} diff --git a/ocis/pkg/command/revastoragepubliclink.go b/ocis/pkg/command/revastoragepubliclink.go deleted file mode 100644 index 292f7927a0..0000000000 --- a/ocis/pkg/command/revastoragepubliclink.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaStoragePublicLinkCommand is the entrypoint for the reva-storage-oc command. -func RevaStoragePublicLinkCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-storage-public-link", - Usage: "Start reva public link storage", - Category: "Extensions", - Flags: flagset.StoragePublicLink(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaStoragePublicLink(cfg) - - return cli.HandleAction( - command.StoragePublicLink(scfg).Action, - c, - ) - }, - } -} - -func configureRevaStoragePublicLink(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaStoragePublicLinkCommand) -} diff --git a/ocis/pkg/command/revastorageroot.go b/ocis/pkg/command/revastorageroot.go deleted file mode 100644 index 1dcc51deb0..0000000000 --- a/ocis/pkg/command/revastorageroot.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaStorageRootCommand is the entrypoint for the reva-storage-root command. -func RevaStorageRootCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-storage-root", - Usage: "Start reva root storage", - Category: "Extensions", - Flags: flagset.StorageRootWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaStorageRoot(cfg) - - return cli.HandleAction( - command.StorageRoot(scfg).Action, - c, - ) - }, - } -} - -func configureRevaStorageRoot(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaStorageRootCommand) -} diff --git a/ocis/pkg/command/revausers.go b/ocis/pkg/command/revausers.go deleted file mode 100644 index 1e3953eac5..0000000000 --- a/ocis/pkg/command/revausers.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build !simple - -package command - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis/ocis-reva/pkg/command" - svcconfig "github.com/owncloud/ocis/ocis-reva/pkg/config" - "github.com/owncloud/ocis/ocis-reva/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" -) - -// RevaUsersCommand is the entrypoint for the reva-users command. -func RevaUsersCommand(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "reva-users", - Usage: "Start reva users service", - Category: "Extensions", - Flags: flagset.UsersWithConfig(cfg.Reva), - Action: func(c *cli.Context) error { - scfg := configureRevaUsers(cfg) - - return cli.HandleAction( - command.Users(scfg).Action, - c, - ) - }, - } -} - -func configureRevaUsers(cfg *config.Config) *svcconfig.Config { - cfg.Reva.Log.Level = cfg.Log.Level - cfg.Reva.Log.Pretty = cfg.Log.Pretty - cfg.Reva.Log.Color = cfg.Log.Color - - if cfg.Tracing.Enabled { - cfg.Reva.Tracing.Enabled = cfg.Tracing.Enabled - cfg.Reva.Tracing.Type = cfg.Tracing.Type - cfg.Reva.Tracing.Endpoint = cfg.Tracing.Endpoint - cfg.Reva.Tracing.Collector = cfg.Tracing.Collector - cfg.Reva.Tracing.Service = cfg.Tracing.Service - } - - return cfg.Reva -} - -func init() { - register.AddCommand(RevaUsersCommand) -} diff --git a/ocis/pkg/command/settings.go b/ocis/pkg/command/settings.go index 38944a687b..df1af102be 100644 --- a/ocis/pkg/command/settings.go +++ b/ocis/pkg/command/settings.go @@ -4,12 +4,12 @@ package command import ( "github.com/micro/cli/v2" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/ocis/pkg/version" "github.com/owncloud/ocis/settings/pkg/command" svcconfig "github.com/owncloud/ocis/settings/pkg/config" "github.com/owncloud/ocis/settings/pkg/flagset" - "github.com/owncloud/ocis/ocis/pkg/config" - "github.com/owncloud/ocis/ocis/pkg/register" ) // SettingsCommand is the entry point for the settings command. @@ -48,8 +48,8 @@ func configureSettings(cfg *config.Config) *svcconfig.Config { cfg.Settings.Tracing.Service = cfg.Tracing.Service } - if cfg.Reva.Reva.JWTSecret != "" { - cfg.Settings.TokenManager.JWTSecret = cfg.Reva.Reva.JWTSecret + if cfg.Storage.Reva.JWTSecret != "" { + cfg.Settings.TokenManager.JWTSecret = cfg.Storage.Reva.JWTSecret } return cfg.Settings diff --git a/ocis/pkg/command/storageauthbasic.go b/ocis/pkg/command/storageauthbasic.go new file mode 100644 index 0000000000..a2f7fb5908 --- /dev/null +++ b/ocis/pkg/command/storageauthbasic.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" +) + +// StorageAuthBasicCommand is the entrypoint for the reva-auth-basic command. +func StorageAuthBasicCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-auth-basic", + Usage: "Start storage auth-basic service", + Category: "Extensions", + Flags: flagset.AuthBasicWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageAuthBasic(cfg) + + return cli.HandleAction( + command.AuthBasic(scfg).Action, + c, + ) + }, + } +} + +func configureStorageAuthBasic(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageAuthBasicCommand) +} diff --git a/ocis/pkg/command/storageauthbearer.go b/ocis/pkg/command/storageauthbearer.go new file mode 100644 index 0000000000..a1c2cfd962 --- /dev/null +++ b/ocis/pkg/command/storageauthbearer.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageAuthBearerCommand is the entrypoint for the reva-auth-bearer command. +func StorageAuthBearerCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-auth-bearer", + Usage: "Start storage auth-bearer service", + Category: "Extensions", + Flags: flagset.AuthBearerWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageAuthBearer(cfg) + + return cli.HandleAction( + command.AuthBearer(scfg).Action, + c, + ) + }, + } +} + +func configureStorageAuthBearer(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageAuthBearerCommand) +} diff --git a/ocis/pkg/command/storagefrontend.go b/ocis/pkg/command/storagefrontend.go new file mode 100644 index 0000000000..699abb4d05 --- /dev/null +++ b/ocis/pkg/command/storagefrontend.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageFrontendCommand is the entrypoint for the reva-frontend command. +func StorageFrontendCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-frontend", + Usage: "Start storage frontend", + Category: "Extensions", + Flags: flagset.FrontendWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageFrontend(cfg) + + return cli.HandleAction( + command.Frontend(scfg).Action, + c, + ) + }, + } +} + +func configureStorageFrontend(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageFrontendCommand) +} diff --git a/ocis/pkg/command/storagegateway.go b/ocis/pkg/command/storagegateway.go new file mode 100644 index 0000000000..ad120a62e3 --- /dev/null +++ b/ocis/pkg/command/storagegateway.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageGatewayCommand is the entrypoint for the reva-gateway command. +func StorageGatewayCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-gateway", + Usage: "Start storage gateway", + Category: "Extensions", + Flags: flagset.GatewayWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageGateway(cfg) + + return cli.HandleAction( + command.Gateway(scfg).Action, + c, + ) + }, + } +} + +func configureStorageGateway(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageGatewayCommand) +} diff --git a/ocis/pkg/command/storagesharing.go b/ocis/pkg/command/storagesharing.go new file mode 100644 index 0000000000..1b3dd60c32 --- /dev/null +++ b/ocis/pkg/command/storagesharing.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageSharingCommand is the entrypoint for the reva-sharing command. +func StorageSharingCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-sharing", + Usage: "Start storage sharing service", + Category: "Extensions", + Flags: flagset.SharingWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageSharing(cfg) + + return cli.HandleAction( + command.Sharing(scfg).Action, + c, + ) + }, + } +} + +func configureStorageSharing(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageSharingCommand) +} diff --git a/ocis/pkg/command/storagestorageeos.go b/ocis/pkg/command/storagestorageeos.go new file mode 100644 index 0000000000..06edff5e75 --- /dev/null +++ b/ocis/pkg/command/storagestorageeos.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" +) + +// StorageStorageEOSCommand is the entrypoint for the reva-storage-oc command. +func StorageStorageEOSCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-storage-eos", + Usage: "Start storage storage service for eos mount", + Category: "Extensions", + Flags: flagset.StorageEOSWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageStorageEOS(cfg) + + return cli.HandleAction( + command.StorageEOS(scfg).Action, + c, + ) + }, + } +} + +func configureStorageStorageEOS(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageStorageEOSCommand) +} diff --git a/ocis/pkg/command/storagestorageeosdata.go b/ocis/pkg/command/storagestorageeosdata.go new file mode 100644 index 0000000000..057a62bd9d --- /dev/null +++ b/ocis/pkg/command/storagestorageeosdata.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageStorageEOSDataCommand is the entrypoint for the reva-storage-eos-data command. +func StorageStorageEOSDataCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-storage-eos-data", + Usage: "Start storage storage data provider for eos mount", + Category: "Extensions", + Flags: flagset.StorageEOSDataWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageStorageEOSData(cfg) + + return cli.HandleAction( + command.StorageEOSData(scfg).Action, + c, + ) + }, + } +} + +func configureStorageStorageEOSData(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageStorageEOSDataCommand) +} diff --git a/ocis/pkg/command/storagestoragehome.go b/ocis/pkg/command/storagestoragehome.go new file mode 100644 index 0000000000..b065c1eb2a --- /dev/null +++ b/ocis/pkg/command/storagestoragehome.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageStorageHomeCommand is the entrypoint for the reva-storage-home command. +func StorageStorageHomeCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-storage-home", + Usage: "Start storage storage service for home mount", + Category: "Extensions", + Flags: flagset.StorageHomeWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageStorageHome(cfg) + + return cli.HandleAction( + command.StorageHome(scfg).Action, + c, + ) + }, + } +} + +func configureStorageStorageHome(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageStorageHomeCommand) +} diff --git a/ocis/pkg/command/storagestoragehomedata.go b/ocis/pkg/command/storagestoragehomedata.go new file mode 100644 index 0000000000..ac63adbc3f --- /dev/null +++ b/ocis/pkg/command/storagestoragehomedata.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageStorageHomeDataCommand is the entrypoint for the reva-storage-home-data command. +func StorageStorageHomeDataCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-storage-home-data", + Usage: "Start storage storage data provider for home mount", + Category: "Extensions", + Flags: flagset.StorageHomeDataWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageStorageHomeData(cfg) + + return cli.HandleAction( + command.StorageHomeData(scfg).Action, + c, + ) + }, + } +} + +func configureStorageStorageHomeData(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageStorageHomeDataCommand) +} diff --git a/ocis/pkg/command/storagestoragemetadata.go b/ocis/pkg/command/storagestoragemetadata.go new file mode 100644 index 0000000000..d55716830e --- /dev/null +++ b/ocis/pkg/command/storagestoragemetadata.go @@ -0,0 +1,49 @@ +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageStorageMetadataCommand is the entrypoint for the reva-storage-metadata command. +func StorageStorageMetadataCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-storage-metadata", + Usage: "Start storage storage service for metadata mount", + Category: "Extensions", + Flags: flagset.StorageMetadata(cfg.Storage), + Action: func(c *cli.Context) error { + revaStorageMetadataCommand := command.StorageMetadata(configureStorageStorageMetadata(cfg)) + + if err := revaStorageMetadataCommand.Before(c); err != nil { + return err + } + + return cli.HandleAction(revaStorageMetadataCommand.Action, c) + }, + } +} + +func configureStorageStorageMetadata(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageStorageMetadataCommand) +} diff --git a/ocis/pkg/command/storagestorageoc.go b/ocis/pkg/command/storagestorageoc.go new file mode 100644 index 0000000000..c2c187bf54 --- /dev/null +++ b/ocis/pkg/command/storagestorageoc.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageStorageOCCommand is the entrypoint for the reva-storage-oc command. +func StorageStorageOCCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-storage-oc", + Usage: "Start storage storage service for oc mount", + Category: "Extensions", + Flags: flagset.StorageOCWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageStorageOC(cfg) + + return cli.HandleAction( + command.StorageOC(scfg).Action, + c, + ) + }, + } +} + +func configureStorageStorageOC(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageStorageOCCommand) +} diff --git a/ocis/pkg/command/storagestorageocdata.go b/ocis/pkg/command/storagestorageocdata.go new file mode 100644 index 0000000000..089b303b7e --- /dev/null +++ b/ocis/pkg/command/storagestorageocdata.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageStorageOCDataCommand is the entrypoint for the reva-storage-oc-data command. +func StorageStorageOCDataCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-storage-oc-data", + Usage: "Start storage storage data provider for oc mount", + Category: "Extensions", + Flags: flagset.StorageOCDataWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageStorageOCData(cfg) + + return cli.HandleAction( + command.StorageOCData(scfg).Action, + c, + ) + }, + } +} + +func configureStorageStorageOCData(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageStorageOCDataCommand) +} diff --git a/ocis/pkg/command/storagestoragepubliclink.go b/ocis/pkg/command/storagestoragepubliclink.go new file mode 100644 index 0000000000..e35d84a736 --- /dev/null +++ b/ocis/pkg/command/storagestoragepubliclink.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageStoragePublicLinkCommand is the entrypoint for the reva-storage-oc command. +func StorageStoragePublicLinkCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-storage-public-link", + Usage: "Start storage public link storage", + Category: "Extensions", + Flags: flagset.StoragePublicLink(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageStoragePublicLink(cfg) + + return cli.HandleAction( + command.StoragePublicLink(scfg).Action, + c, + ) + }, + } +} + +func configureStorageStoragePublicLink(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageStoragePublicLinkCommand) +} diff --git a/ocis/pkg/command/storagestorageroot.go b/ocis/pkg/command/storagestorageroot.go new file mode 100644 index 0000000000..5a5a485779 --- /dev/null +++ b/ocis/pkg/command/storagestorageroot.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageStorageRootCommand is the entrypoint for the reva-storage-root command. +func StorageStorageRootCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-storage-root", + Usage: "Start storage root storage", + Category: "Extensions", + Flags: flagset.StorageRootWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageStorageRoot(cfg) + + return cli.HandleAction( + command.StorageRoot(scfg).Action, + c, + ) + }, + } +} + +func configureStorageStorageRoot(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageStorageRootCommand) +} diff --git a/ocis/pkg/command/storageusers.go b/ocis/pkg/command/storageusers.go new file mode 100644 index 0000000000..d5ade5cbc7 --- /dev/null +++ b/ocis/pkg/command/storageusers.go @@ -0,0 +1,50 @@ +// +build !simple + +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis/storage/pkg/command" + svcconfig "github.com/owncloud/ocis/storage/pkg/config" + "github.com/owncloud/ocis/storage/pkg/flagset" + "github.com/owncloud/ocis/ocis/pkg/config" + "github.com/owncloud/ocis/ocis/pkg/register" +) + +// StorageUsersCommand is the entrypoint for the reva-users command. +func StorageUsersCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "storage-users", + Usage: "Start storage users service", + Category: "Extensions", + Flags: flagset.UsersWithConfig(cfg.Storage), + Action: func(c *cli.Context) error { + scfg := configureStorageUsers(cfg) + + return cli.HandleAction( + command.Users(scfg).Action, + c, + ) + }, + } +} + +func configureStorageUsers(cfg *config.Config) *svcconfig.Config { + cfg.Storage.Log.Level = cfg.Log.Level + cfg.Storage.Log.Pretty = cfg.Log.Pretty + cfg.Storage.Log.Color = cfg.Log.Color + + if cfg.Tracing.Enabled { + cfg.Storage.Tracing.Enabled = cfg.Tracing.Enabled + cfg.Storage.Tracing.Type = cfg.Tracing.Type + cfg.Storage.Tracing.Endpoint = cfg.Tracing.Endpoint + cfg.Storage.Tracing.Collector = cfg.Tracing.Collector + cfg.Storage.Tracing.Service = cfg.Tracing.Service + } + + return cfg.Storage +} + +func init() { + register.AddCommand(StorageUsersCommand) +} diff --git a/ocis/pkg/config/config.go b/ocis/pkg/config/config.go index 06c0778d2c..339eefe00a 100644 --- a/ocis/pkg/config/config.go +++ b/ocis/pkg/config/config.go @@ -1,17 +1,17 @@ package config import ( - accounts "github.com/owncloud/ocis/accounts/pkg/config" - glauth "github.com/owncloud/ocis/glauth/pkg/config" graphExplorer "github.com/owncloud/ocis-graph-explorer/pkg/config" graph "github.com/owncloud/ocis-graph/pkg/config" hello "github.com/owncloud/ocis-hello/pkg/config" + accounts "github.com/owncloud/ocis/accounts/pkg/config" + glauth "github.com/owncloud/ocis/glauth/pkg/config" konnectd "github.com/owncloud/ocis/konnectd/pkg/config" - ocs "github.com/owncloud/ocis/ocs/pkg/config" phoenix "github.com/owncloud/ocis/ocis-phoenix/pkg/config" + ocs "github.com/owncloud/ocis/ocs/pkg/config" proxy "github.com/owncloud/ocis/proxy/pkg/config" - reva "github.com/owncloud/ocis/ocis-reva/pkg/config" settings "github.com/owncloud/ocis/settings/pkg/config" + storage "github.com/owncloud/ocis/storage/pkg/config" store "github.com/owncloud/ocis/store/pkg/config" thumbnails "github.com/owncloud/ocis/thumbnails/pkg/config" webdav "github.com/owncloud/ocis/webdav/pkg/config" @@ -71,7 +71,7 @@ type Config struct { OCS *ocs.Config Phoenix *phoenix.Config Proxy *proxy.Config - Reva *reva.Config + Storage *storage.Config Thumbnails *thumbnails.Config WebDAV *webdav.Config Settings *settings.Config @@ -90,7 +90,7 @@ func New() *Config { OCS: ocs.New(), Phoenix: phoenix.New(), WebDAV: webdav.New(), - Reva: reva.New(), + Storage: storage.New(), GLAuth: glauth.New(), Proxy: proxy.New(), Thumbnails: thumbnails.New(), diff --git a/ocis/pkg/runtime/runtime.go b/ocis/pkg/runtime/runtime.go index 0733b8ee0e..3f5c4943bb 100644 --- a/ocis/pkg/runtime/runtime.go +++ b/ocis/pkg/runtime/runtime.go @@ -38,19 +38,19 @@ var ( "graph-explorer", "ocs", "webdav", - "reva-frontend", - "reva-gateway", - "reva-users", - "reva-auth-basic", - "reva-auth-bearer", - "reva-storage-home", - "reva-storage-home-data", - "reva-storage-eos", - "reva-storage-eos-data", - "reva-storage-oc", - "reva-storage-oc-data", - "reva-storage-public-link", - "reva-storage-metadata", + "storage-frontend", + "storage-gateway", + "storage-users", + "storage-auth-basic", + "storage-auth-bearer", + "storage-storage-home", + "storage-storage-home-data", + "storage-storage-eos", + "storage-storage-eos-data", + "storage-storage-oc", + "storage-storage-oc-data", + "storage-storage-public-link", + "storage-storage-metadata", "glauth", "konnectd", "thumbnails", @@ -59,7 +59,7 @@ var ( // There seem to be a race condition when reva-sharing needs to read the sharing.json file and the parent folder is not present. dependants = []string{ "accounts", - "reva-sharing", + "storage-sharing", } // Maximum number of retries until getting a connection to the rpc runtime service. diff --git a/ocis/templates/CONFIGURATION.tmpl b/ocis/templates/CONFIGURATION.tmpl index f25878eaff..463df0150e 100644 --- a/ocis/templates/CONFIGURATION.tmpl +++ b/ocis/templates/CONFIGURATION.tmpl @@ -3,7 +3,7 @@ title: "Configuration" date: "{{ date "2006-01-02T15:04:05-0700" now }}" weight: 20 geekdocRepo: https://github.com/owncloud/ocis -geekdocEditPath: edit/master/docs +geekdocEditPath: edit/master/docs/ocis geekdocFilePath: configuration.md --- {{- define "options"}} @@ -11,7 +11,7 @@ geekdocFilePath: configuration.md {{ range $opt := first . }}{{ with list $fnName $opt -}} {{ $o := last . -}} {{ if eq $o.FnName $fnName -}} ---{{ $o.Name }} | ${{ index $o.Env 0 }} +--{{ $o.Name }} | ${{ index $o.Env 0 }} : {{ $o.Usage }}. {{- if $o.Default }} Default: `{{ $o.Default }}`.{{ end }} {{ end -}} @@ -66,7 +66,7 @@ Usage: `ocis [global options] command [command options] [arguments...]` {{ end -}} {{- range $com := .Commands }}{{ with (list $options $com) -}} {{- $c := last . }} -{{- if eq $c.Name "server" "health" -}} +{{- if eq $c.Name "server" "health" "kill" "list" "run" -}} {{- if ne $c.FnName "Simple" -}} ### ocis {{ $c.Name }} @@ -84,11 +84,11 @@ Usage: `ocis {{ $c.Name }} [command options] [arguments...]` There are more subcommands to start the individual extensions. Please check the documentation about their usage and options in the dedicated section of the documentation. {{ range $com := .Commands }}{{ with $com -}} -{{ if and (ne .Name "health") (ne .Name "server") (ne .Name "ocis") -}} +{{ if and (ne .Name "health") (ne .Name "server") (ne .Name "ocis") (ne .Name "kill") (ne .Name "list") (ne .Name "run") -}} #### ocis {{ .Name }} {{ .Usage }} {{ end -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/storage/pkg/flagset/sharing.go b/storage/pkg/flagset/sharing.go index 669b4f039b..24ca534fe5 100644 --- a/storage/pkg/flagset/sharing.go +++ b/storage/pkg/flagset/sharing.go @@ -65,7 +65,7 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "user-json-file", - Value: "/var/tmp/storage/shares.json", + Value: "/var/tmp/ocis/shares.json", Usage: "file used to persist shares for the UserShareProvider", EnvVars: []string{"STORAGE_SHARING_USER_JSON_FILE"}, Destination: &cfg.Reva.Sharing.UserJSONFile,