From c3289cdc472968443832ea2c148e3a3b280ac25f 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/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 +- 32 files changed, 38 insertions(+), 31 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 00000000000..ebe84055e35 --- /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 6a2829e3923..763e6004554 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 86ba8e07f72..89120bd57f3 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 c624ae54224..b16df293a80 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 da4bb1a4ee0..58b4d4e0a67 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 49596578cd7..3a850faa67a 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 d4d53a94cf0..be1e3605039 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 e70e515d924..336823efab2 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 2f2e3eda9b4..741e96cdce7 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 91df18481f3..b771d3c9e9d 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 50892721778..4c54deec1ea 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 f756b8c821b..ce0acc33e6b 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 4854d45dbc7..50394348946 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 15714cf49fb..21862ade96a 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 df8fba7581c..6b798bf4380 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/nats.go b/ocis/pkg/command/nats.go index c476bc5ec2d..e8c60061ed0 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 2014a71b0e1..0599dc86e88 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 1fee04910b0..cc04d648847 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 a3de3fc0623..abeb8310bd0 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 cdb06bdc275..127957bc693 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 302b5152b40..c649fbce414 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 bbb7faa766a..ec95cf3a17a 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 a08f0c725f5..9145f532c52 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 e26bb7124d9..04780870c5c 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 8940c86374a..e499e008f66 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 6cde00e56b8..e90af469073 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 8cda2193ce0..f1598332bb7 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 22de102984c..617af037cd8 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 5db2ead8faa..da60a12a189 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 a0b65c5d0da..992a0492858 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 1dec612d430..dd826d6b998 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 950565a1e80..20be56b5b0e 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)