From 3b87f751321008af8dc7ec9d391e4ae7bbbce3f0 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Tue, 21 Jun 2022 15:51:19 +0200 Subject: [PATCH] further refactoring & add changelog Signed-off-by: Christian Richter --- changelog/unreleased/refactor-extensions-to-services.md | 7 +++++++ ocis-pkg/config/config.go | 2 +- ocis/pkg/command/app-provider.go | 2 +- ocis/pkg/command/app-registry.go | 2 +- ocis/pkg/command/audit.go | 2 +- ocis/pkg/command/auth-basic.go | 2 +- ocis/pkg/command/auth-bearer.go | 2 +- ocis/pkg/command/auth-machine.go | 2 +- ocis/pkg/command/frontend.go | 2 +- ocis/pkg/command/gateway.go | 2 +- ocis/pkg/command/graph-explorer.go | 2 +- ocis/pkg/command/graph.go | 2 +- ocis/pkg/command/groups.go | 2 +- ocis/pkg/command/idm.go | 2 +- ocis/pkg/command/idp.go | 2 +- ocis/pkg/command/migrate.go | 6 +++--- ocis/pkg/command/nats.go | 2 +- ocis/pkg/command/notifications.go | 2 +- ocis/pkg/command/ocdav.go | 2 +- ocis/pkg/command/ocs.go | 2 +- ocis/pkg/command/proxy.go | 2 +- ocis/pkg/command/search.go | 2 +- ocis/pkg/command/settings.go | 2 +- ocis/pkg/command/sharing.go | 2 +- ocis/pkg/command/storage-publiclink.go | 2 +- ocis/pkg/command/storage-shares.go | 2 +- ocis/pkg/command/storage-system.go | 2 +- ocis/pkg/command/storage-users.go | 2 +- ocis/pkg/command/store.go | 2 +- ocis/pkg/command/thumbnails.go | 2 +- ocis/pkg/command/users.go | 2 +- ocis/pkg/command/web.go | 2 +- ocis/pkg/command/webdav.go | 2 +- 33 files changed, 41 insertions(+), 34 deletions(-) create mode 100644 changelog/unreleased/refactor-extensions-to-services.md diff --git a/changelog/unreleased/refactor-extensions-to-services.md b/changelog/unreleased/refactor-extensions-to-services.md new file mode 100644 index 0000000000..ebe84055e3 --- /dev/null +++ b/changelog/unreleased/refactor-extensions-to-services.md @@ -0,0 +1,7 @@ +Enhancement: Refactor extensions to services + +We have decided to name all extensions, we maintain and provide with ocis, +services from here on to avoid confusion between external extensions and code +we provide and maintain. + +https://github.com/owncloud/ocis/pull/3980 diff --git a/ocis-pkg/config/config.go b/ocis-pkg/config/config.go index 6a2829e392..763e600455 100644 --- a/ocis-pkg/config/config.go +++ b/ocis-pkg/config/config.go @@ -49,7 +49,7 @@ type Mode int type Runtime struct { Port string `yaml:"port" env:"OCIS_RUNTIME_PORT"` Host string `yaml:"host" env:"OCIS_RUNTIME_HOST"` - Extensions string `yaml:"extensions" env:"OCIS_RUN_EXTENSIONS"` + Extensions string `yaml:"services" env:"OCIS_RUN_SERVICES"` } // Config combines all available configuration parts. diff --git a/ocis/pkg/command/app-provider.go b/ocis/pkg/command/app-provider.go index 86ba8e07f7..89120bd57f 100644 --- a/ocis/pkg/command/app-provider.go +++ b/ocis/pkg/command/app-provider.go @@ -16,7 +16,7 @@ func AppProviderCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.AppProvider.Service.Name, Usage: helper.SubcommandDescription(cfg.AppProvider.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/app-registry.go b/ocis/pkg/command/app-registry.go index c624ae5422..b16df293a8 100644 --- a/ocis/pkg/command/app-registry.go +++ b/ocis/pkg/command/app-registry.go @@ -16,7 +16,7 @@ func AppRegistryCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.AppRegistry.Service.Name, Usage: helper.SubcommandDescription(cfg.AppRegistry.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/audit.go b/ocis/pkg/command/audit.go index da4bb1a4ee..58b4d4e0a6 100644 --- a/ocis/pkg/command/audit.go +++ b/ocis/pkg/command/audit.go @@ -16,7 +16,7 @@ func AuditCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Audit.Service.Name, Usage: helper.SubcommandDescription(cfg.Audit.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/auth-basic.go b/ocis/pkg/command/auth-basic.go index 49596578cd..3a850faa67 100644 --- a/ocis/pkg/command/auth-basic.go +++ b/ocis/pkg/command/auth-basic.go @@ -16,7 +16,7 @@ func AuthBasicCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.AuthBasic.Service.Name, Usage: helper.SubcommandDescription(cfg.AuthBasic.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/auth-bearer.go b/ocis/pkg/command/auth-bearer.go index d4d53a94cf..be1e360503 100644 --- a/ocis/pkg/command/auth-bearer.go +++ b/ocis/pkg/command/auth-bearer.go @@ -16,7 +16,7 @@ func AuthBearerCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.AuthBearer.Service.Name, Usage: helper.SubcommandDescription(cfg.AuthBearer.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/auth-machine.go b/ocis/pkg/command/auth-machine.go index e70e515d92..336823efab 100644 --- a/ocis/pkg/command/auth-machine.go +++ b/ocis/pkg/command/auth-machine.go @@ -16,7 +16,7 @@ func AuthMachineCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.AuthMachine.Service.Name, Usage: helper.SubcommandDescription(cfg.AuthMachine.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/frontend.go b/ocis/pkg/command/frontend.go index 2f2e3eda9b..741e96cdce 100644 --- a/ocis/pkg/command/frontend.go +++ b/ocis/pkg/command/frontend.go @@ -16,7 +16,7 @@ func FrontendCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Frontend.Service.Name, Usage: helper.SubcommandDescription(cfg.Frontend.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/gateway.go b/ocis/pkg/command/gateway.go index 91df18481f..b771d3c9e9 100644 --- a/ocis/pkg/command/gateway.go +++ b/ocis/pkg/command/gateway.go @@ -16,7 +16,7 @@ func GatewayCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Gateway.Service.Name, Usage: helper.SubcommandDescription(cfg.Gateway.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/graph-explorer.go b/ocis/pkg/command/graph-explorer.go index 5089272177..4c54deec1e 100644 --- a/ocis/pkg/command/graph-explorer.go +++ b/ocis/pkg/command/graph-explorer.go @@ -16,7 +16,7 @@ func GraphExplorerCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.GraphExplorer.Service.Name, Usage: helper.SubcommandDescription(cfg.GraphExplorer.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/graph.go b/ocis/pkg/command/graph.go index f756b8c821..ce0acc33e6 100644 --- a/ocis/pkg/command/graph.go +++ b/ocis/pkg/command/graph.go @@ -16,7 +16,7 @@ func GraphCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Graph.Service.Name, Usage: helper.SubcommandDescription(cfg.Graph.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/groups.go b/ocis/pkg/command/groups.go index 4854d45dbc..5039434894 100644 --- a/ocis/pkg/command/groups.go +++ b/ocis/pkg/command/groups.go @@ -16,7 +16,7 @@ func GroupsCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Groups.Service.Name, Usage: helper.SubcommandDescription(cfg.Groups.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/idm.go b/ocis/pkg/command/idm.go index 15714cf49f..21862ade96 100644 --- a/ocis/pkg/command/idm.go +++ b/ocis/pkg/command/idm.go @@ -16,7 +16,7 @@ func IDMCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.IDM.Service.Name, Usage: helper.SubcommandDescription(cfg.IDM.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/idp.go b/ocis/pkg/command/idp.go index df8fba7581..6b798bf438 100644 --- a/ocis/pkg/command/idp.go +++ b/ocis/pkg/command/idp.go @@ -16,7 +16,7 @@ func IDPCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.IDP.Service.Name, Usage: helper.SubcommandDescription(cfg.IDP.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/migrate.go b/ocis/pkg/command/migrate.go index 11bc486687..3f18b96ece 100644 --- a/ocis/pkg/command/migrate.go +++ b/ocis/pkg/command/migrate.go @@ -11,12 +11,12 @@ import ( publicregistry "github.com/cs3org/reva/v2/pkg/publicshare/manager/registry" "github.com/cs3org/reva/v2/pkg/share" "github.com/cs3org/reva/v2/pkg/share/manager/registry" - sharing "github.com/owncloud/ocis/v2/extensions/sharing/pkg/config" - sharingparser "github.com/owncloud/ocis/v2/extensions/sharing/pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" - "github.com/owncloud/ocis/v2/ocis/pkg/register" + sharing "github.com/owncloud/ocis/v2/services/sharing/pkg/config" + sharingparser "github.com/owncloud/ocis/v2/services/sharing/pkg/config/parser" "github.com/rs/zerolog" "github.com/urfave/cli/v2" ) diff --git a/ocis/pkg/command/nats.go b/ocis/pkg/command/nats.go index c476bc5ec2..e8c60061ed 100644 --- a/ocis/pkg/command/nats.go +++ b/ocis/pkg/command/nats.go @@ -16,7 +16,7 @@ func NatsCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Nats.Service.Name, Usage: helper.SubcommandDescription(cfg.Nats.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/notifications.go b/ocis/pkg/command/notifications.go index 2014a71b0e..0599dc86e8 100644 --- a/ocis/pkg/command/notifications.go +++ b/ocis/pkg/command/notifications.go @@ -16,7 +16,7 @@ func NotificationsCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Notifications.Service.Name, Usage: helper.SubcommandDescription(cfg.Notifications.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/ocdav.go b/ocis/pkg/command/ocdav.go index 1fee04910b..cc04d64884 100644 --- a/ocis/pkg/command/ocdav.go +++ b/ocis/pkg/command/ocdav.go @@ -16,7 +16,7 @@ func OCDavCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.OCDav.Service.Name, Usage: helper.SubcommandDescription(cfg.OCDav.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/ocs.go b/ocis/pkg/command/ocs.go index a3de3fc062..abeb8310bd 100644 --- a/ocis/pkg/command/ocs.go +++ b/ocis/pkg/command/ocs.go @@ -16,7 +16,7 @@ func OCSCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.OCS.Service.Name, Usage: helper.SubcommandDescription(cfg.OCS.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/proxy.go b/ocis/pkg/command/proxy.go index cdb06bdc27..127957bc69 100644 --- a/ocis/pkg/command/proxy.go +++ b/ocis/pkg/command/proxy.go @@ -16,7 +16,7 @@ func ProxyCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Proxy.Service.Name, Usage: helper.SubcommandDescription(cfg.Proxy.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/search.go b/ocis/pkg/command/search.go index 302b5152b4..c649fbce41 100644 --- a/ocis/pkg/command/search.go +++ b/ocis/pkg/command/search.go @@ -16,7 +16,7 @@ func SearchCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Search.Service.Name, Usage: helper.SubcommandDescription(cfg.Search.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/settings.go b/ocis/pkg/command/settings.go index bbb7faa766..ec95cf3a17 100644 --- a/ocis/pkg/command/settings.go +++ b/ocis/pkg/command/settings.go @@ -16,7 +16,7 @@ func SettingsCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Settings.Service.Name, Usage: helper.SubcommandDescription(cfg.Settings.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/sharing.go b/ocis/pkg/command/sharing.go index a08f0c725f..9145f532c5 100644 --- a/ocis/pkg/command/sharing.go +++ b/ocis/pkg/command/sharing.go @@ -16,7 +16,7 @@ func SharingCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Sharing.Service.Name, Usage: helper.SubcommandDescription(cfg.Sharing.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/storage-publiclink.go b/ocis/pkg/command/storage-publiclink.go index e26bb7124d..04780870c5 100644 --- a/ocis/pkg/command/storage-publiclink.go +++ b/ocis/pkg/command/storage-publiclink.go @@ -16,7 +16,7 @@ func StoragePublicLinkCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.StoragePublicLink.Service.Name, Usage: helper.SubcommandDescription(cfg.StoragePublicLink.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/storage-shares.go b/ocis/pkg/command/storage-shares.go index 8940c86374..e499e008f6 100644 --- a/ocis/pkg/command/storage-shares.go +++ b/ocis/pkg/command/storage-shares.go @@ -16,7 +16,7 @@ func StorageSharesCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.StorageShares.Service.Name, Usage: helper.SubcommandDescription(cfg.StorageShares.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/storage-system.go b/ocis/pkg/command/storage-system.go index 6cde00e56b..e90af46907 100644 --- a/ocis/pkg/command/storage-system.go +++ b/ocis/pkg/command/storage-system.go @@ -16,7 +16,7 @@ func StorageSystemCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.StorageSystem.Service.Name, Usage: helper.SubcommandDescription(cfg.StorageSystem.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/storage-users.go b/ocis/pkg/command/storage-users.go index 8cda2193ce..f1598332bb 100644 --- a/ocis/pkg/command/storage-users.go +++ b/ocis/pkg/command/storage-users.go @@ -16,7 +16,7 @@ func StorageUsersCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.StorageUsers.Service.Name, Usage: helper.SubcommandDescription(cfg.StorageUsers.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/store.go b/ocis/pkg/command/store.go index 22de102984..617af037cd 100644 --- a/ocis/pkg/command/store.go +++ b/ocis/pkg/command/store.go @@ -17,7 +17,7 @@ func StoreCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Store.Service.Name, Usage: helper.SubcommandDescription(cfg.Store.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/thumbnails.go b/ocis/pkg/command/thumbnails.go index 5db2ead8fa..da60a12a18 100644 --- a/ocis/pkg/command/thumbnails.go +++ b/ocis/pkg/command/thumbnails.go @@ -16,7 +16,7 @@ func ThumbnailsCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Thumbnails.Service.Name, Usage: helper.SubcommandDescription(cfg.Thumbnails.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/users.go b/ocis/pkg/command/users.go index a0b65c5d0d..992a049285 100644 --- a/ocis/pkg/command/users.go +++ b/ocis/pkg/command/users.go @@ -16,7 +16,7 @@ func UsersCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Users.Service.Name, Usage: helper.SubcommandDescription(cfg.Users.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/web.go b/ocis/pkg/command/web.go index 1dec612d43..dd826d6b99 100644 --- a/ocis/pkg/command/web.go +++ b/ocis/pkg/command/web.go @@ -16,7 +16,7 @@ func WebCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Web.Service.Name, Usage: helper.SubcommandDescription(cfg.Web.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err) diff --git a/ocis/pkg/command/webdav.go b/ocis/pkg/command/webdav.go index 950565a1e8..20be56b5b0 100644 --- a/ocis/pkg/command/webdav.go +++ b/ocis/pkg/command/webdav.go @@ -17,7 +17,7 @@ func WebDAVCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.WebDAV.Service.Name, Usage: helper.SubcommandDescription(cfg.WebDAV.Service.Name), - Category: "extensions", + Category: "services", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg, true); err != nil { fmt.Printf("%v", err)