diff --git a/accounts/pkg/command/update_account.go b/accounts/pkg/command/update_account.go index 2d66fdd7e..b3ed17f10 100644 --- a/accounts/pkg/command/update_account.go +++ b/accounts/pkg/command/update_account.go @@ -6,7 +6,6 @@ import ( "github.com/asim/go-micro/plugins/client/grpc/v4" "github.com/owncloud/ocis/accounts/pkg/config" - "github.com/owncloud/ocis/accounts/pkg/flagset" accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0" "github.com/urfave/cli/v2" "google.golang.org/genproto/protobuf/field_mask" @@ -21,7 +20,7 @@ func UpdateAccount(cfg *config.Config) *cli.Command { Name: "update", Usage: "Make changes to an existing account", ArgsUsage: "id", - Flags: flagset.UpdateAccountWithConfig(cfg, a), + //Flags: flagset.UpdateAccountWithConfig(cfg, a), Before: func(c *cli.Context) error { if len(c.StringSlice("password_policies")) > 0 { // StringSliceFlag doesn't support Destination diff --git a/ocis/pkg/command/storageappprovider.go b/ocis/pkg/command/storageappprovider.go index 6672282b6..520295965 100644 --- a/ocis/pkg/command/storageappprovider.go +++ b/ocis/pkg/command/storageappprovider.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StorageAppProviderCommand(cfg *config.Config) *cli.Command { Name: "storage-app-provider", Usage: "Start storage app-provider service", Category: "Extensions", - Flags: flagset.AppProviderWithConfig(cfg.Storage), + //Flags: flagset.AppProviderWithConfig(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storageauthbasic.go b/ocis/pkg/command/storageauthbasic.go index 02446b448..62cddc5c8 100644 --- a/ocis/pkg/command/storageauthbasic.go +++ b/ocis/pkg/command/storageauthbasic.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StorageAuthBasicCommand(cfg *config.Config) *cli.Command { Name: "storage-auth-basic", Usage: "Start storage auth-basic service", Category: "Extensions", - Flags: flagset.AuthBasicWithConfig(cfg.Storage), + //Flags: flagset.AuthBasicWithConfig(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storageauthbearer.go b/ocis/pkg/command/storageauthbearer.go index ab14a4236..329e64467 100644 --- a/ocis/pkg/command/storageauthbearer.go +++ b/ocis/pkg/command/storageauthbearer.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StorageAuthBearerCommand(cfg *config.Config) *cli.Command { Name: "storage-auth-bearer", Usage: "Start storage auth-bearer service", Category: "Extensions", - Flags: flagset.AuthBearerWithConfig(cfg.Storage), + //Flags: flagset.AuthBearerWithConfig(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storagefrontend.go b/ocis/pkg/command/storagefrontend.go index 853a9bc44..29fb13ee2 100644 --- a/ocis/pkg/command/storagefrontend.go +++ b/ocis/pkg/command/storagefrontend.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StorageFrontendCommand(cfg *config.Config) *cli.Command { Name: "storage-frontend", Usage: "Start storage frontend", Category: "Extensions", - Flags: flagset.FrontendWithConfig(cfg.Storage), + //Flags: flagset.FrontendWithConfig(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storagegateway.go b/ocis/pkg/command/storagegateway.go index a9fe1a6f3..4f24f3e49 100644 --- a/ocis/pkg/command/storagegateway.go +++ b/ocis/pkg/command/storagegateway.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StorageGatewayCommand(cfg *config.Config) *cli.Command { Name: "storage-gateway", Usage: "Start storage gateway", Category: "Extensions", - Flags: flagset.GatewayWithConfig(cfg.Storage), + //Flags: flagset.GatewayWithConfig(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storagegroupprovider.go b/ocis/pkg/command/storagegroupprovider.go index 3500780be..530e8148c 100644 --- a/ocis/pkg/command/storagegroupprovider.go +++ b/ocis/pkg/command/storagegroupprovider.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StorageGroupProviderCommand(cfg *config.Config) *cli.Command { Name: "storage-groupprovider", Usage: "Start storage groupprovider service", Category: "Extensions", - Flags: flagset.GroupsWithConfig(cfg.Storage), + //Flags: flagset.GroupsWithConfig(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storagehome.go b/ocis/pkg/command/storagehome.go index 5ed11b581..bae5c1c67 100644 --- a/ocis/pkg/command/storagehome.go +++ b/ocis/pkg/command/storagehome.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StorageHomeCommand(cfg *config.Config) *cli.Command { Name: "storage-home", Usage: "Start storage and data provider for /home mount", Category: "Extensions", - Flags: flagset.StorageHomeWithConfig(cfg.Storage), + //Flags: flagset.StorageHomeWithConfig(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storagemetadata.go b/ocis/pkg/command/storagemetadata.go index 0729d6e31..d475da582 100644 --- a/ocis/pkg/command/storagemetadata.go +++ b/ocis/pkg/command/storagemetadata.go @@ -4,7 +4,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -14,7 +13,7 @@ func StorageMetadataCommand(cfg *config.Config) *cli.Command { Name: "storage-metadata", Usage: "Start storage and data service for metadata", Category: "Extensions", - Flags: flagset.StorageMetadata(cfg.Storage), + //Flags: flagset.StorageMetadata(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storagepubliclink.go b/ocis/pkg/command/storagepubliclink.go index 07e7d9476..e4d9dc750 100644 --- a/ocis/pkg/command/storagepubliclink.go +++ b/ocis/pkg/command/storagepubliclink.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StoragePublicLinkCommand(cfg *config.Config) *cli.Command { Name: "storage-public-link", Usage: "Start storage public link storage", Category: "Extensions", - Flags: flagset.StoragePublicLink(cfg.Storage), + //Flags: flagset.StoragePublicLink(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storagesharing.go b/ocis/pkg/command/storagesharing.go index 672e209e7..3a15d90ee 100644 --- a/ocis/pkg/command/storagesharing.go +++ b/ocis/pkg/command/storagesharing.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StorageSharingCommand(cfg *config.Config) *cli.Command { Name: "storage-sharing", Usage: "Start storage sharing service", Category: "Extensions", - Flags: flagset.SharingWithConfig(cfg.Storage), + //Flags: flagset.SharingWithConfig(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storageuserprovider.go b/ocis/pkg/command/storageuserprovider.go index 671d87ff9..fc423737a 100644 --- a/ocis/pkg/command/storageuserprovider.go +++ b/ocis/pkg/command/storageuserprovider.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StorageUserProviderCommand(cfg *config.Config) *cli.Command { Name: "storage-userprovider", Usage: "Start storage userprovider service", Category: "Extensions", - Flags: flagset.UsersWithConfig(cfg.Storage), + //Flags: flagset.UsersWithConfig(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/ocis/pkg/command/storageusers.go b/ocis/pkg/command/storageusers.go index c6c2b7700..a7978fb69 100644 --- a/ocis/pkg/command/storageusers.go +++ b/ocis/pkg/command/storageusers.go @@ -7,7 +7,6 @@ import ( "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/storage/pkg/command" - "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -17,7 +16,7 @@ func StorageUsersCommand(cfg *config.Config) *cli.Command { Name: "storage-users", Usage: "Start storage and data provider for /users mount", Category: "Extensions", - Flags: flagset.StorageUsersWithConfig(cfg.Storage), + //Flags: flagset.StorageUsersWithConfig(cfg.Storage), Before: func(ctx *cli.Context) error { return ParseStorageCommon(ctx, cfg) }, diff --git a/storage/pkg/command/appprovider.go b/storage/pkg/command/appprovider.go index a4d4b24a2..574304aee 100644 --- a/storage/pkg/command/appprovider.go +++ b/storage/pkg/command/appprovider.go @@ -25,7 +25,7 @@ func AppProvider(cfg *config.Config) *cli.Command { Usage: "Start appprovider for providing apps", //Flags: flagset.AppProviderWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.AppProvider.Services = c.StringSlice("service") + //cfg.Reva.AppProvider.Services = c.StringSlice("service") return ParseConfig(c, cfg, "storage-app-provider") }, diff --git a/storage/pkg/command/authbasic.go b/storage/pkg/command/authbasic.go index 2bb7ff3af..ef0269983 100644 --- a/storage/pkg/command/authbasic.go +++ b/storage/pkg/command/authbasic.go @@ -26,7 +26,7 @@ func AuthBasic(cfg *config.Config) *cli.Command { Usage: "Start authprovider for basic auth", //Flags: flagset.AuthBasicWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.AuthBasic.Services = c.StringSlice("service") + //cfg.Reva.AuthBasic.Services = c.StringSlice("service") return ParseConfig(c, cfg, "storage-auth-basic") }, diff --git a/storage/pkg/command/authbearer.go b/storage/pkg/command/authbearer.go index 95270e013..af60ccbda 100644 --- a/storage/pkg/command/authbearer.go +++ b/storage/pkg/command/authbearer.go @@ -23,10 +23,7 @@ func AuthBearer(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "auth-bearer", Usage: "Start authprovider for bearer auth", - //Flags: flagset.AuthBearerWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.AuthBearer.Services = c.StringSlice("service") - return ParseConfig(c, cfg, "storage-auth-bearer") }, Action: func(c *cli.Context) error { diff --git a/storage/pkg/command/authmachine.go b/storage/pkg/command/authmachine.go index 50df13176..eaaa97cbf 100644 --- a/storage/pkg/command/authmachine.go +++ b/storage/pkg/command/authmachine.go @@ -23,10 +23,7 @@ func AuthMachine(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "auth-machine", Usage: "Start authprovider for machine auth", - //Flags: flagset.AuthMachineWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.AuthMachine.Services = c.StringSlice("service") - return ParseConfig(c, cfg, "storage-auth-machine") }, Action: func(c *cli.Context) error { diff --git a/storage/pkg/command/frontend.go b/storage/pkg/command/frontend.go index 208d7dd44..4161d35c9 100644 --- a/storage/pkg/command/frontend.go +++ b/storage/pkg/command/frontend.go @@ -27,10 +27,7 @@ func Frontend(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "frontend", Usage: "Start frontend service", - //Flags: flagset.FrontendWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.Frontend.Services = c.StringSlice("service") - cfg.Reva.ChecksumSupportedTypes = c.StringSlice("checksum-supported-type") if err := loadUserAgent(c, cfg); err != nil { return err } diff --git a/storage/pkg/command/gateway.go b/storage/pkg/command/gateway.go index ede3f43a6..23de38db9 100644 --- a/storage/pkg/command/gateway.go +++ b/storage/pkg/command/gateway.go @@ -33,8 +33,8 @@ func Gateway(cfg *config.Config) *cli.Command { Usage: "Start gateway", //Flags: flagset.GatewayWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.Gateway.Services = c.StringSlice("service") - cfg.Reva.StorageRegistry.Rules = c.StringSlice("storage-registry-rule") + //cfg.Reva.Gateway.Services = c.StringSlice("service") + //cfg.Reva.StorageRegistry.Rules = c.StringSlice("storage-registry-rule") if cfg.Reva.DataGateway.PublicURL == "" { cfg.Reva.DataGateway.PublicURL = strings.TrimRight(cfg.Reva.Frontend.PublicURL, "/") + "/data" diff --git a/storage/pkg/command/groups.go b/storage/pkg/command/groups.go index 0acb622cf..043c96fdc 100644 --- a/storage/pkg/command/groups.go +++ b/storage/pkg/command/groups.go @@ -24,10 +24,7 @@ func Groups(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "groups", Usage: "Start groups service", - //Flags: flagset.GroupsWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.Groups.Services = c.StringSlice("service") - return ParseConfig(c, cfg, "storage-groups") }, Action: func(c *cli.Context) error { diff --git a/storage/pkg/command/sharing.go b/storage/pkg/command/sharing.go index 692631b58..ac6dc55b5 100644 --- a/storage/pkg/command/sharing.go +++ b/storage/pkg/command/sharing.go @@ -28,7 +28,7 @@ func Sharing(cfg *config.Config) *cli.Command { Usage: "Start sharing service", //Flags: flagset.SharingWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.Sharing.Services = c.StringSlice("service") + //cfg.Reva.Sharing.Services = c.StringSlice("service") return ParseConfig(c, cfg, "storage-sharing") }, diff --git a/storage/pkg/command/storagehome.go b/storage/pkg/command/storagehome.go index 72772be55..89eef388f 100644 --- a/storage/pkg/command/storagehome.go +++ b/storage/pkg/command/storagehome.go @@ -27,7 +27,7 @@ func StorageHome(cfg *config.Config) *cli.Command { Usage: "Start storage-home service", //Flags: flagset.StorageHomeWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.StorageHome.Services = c.StringSlice("service") + //cfg.Reva.StorageHome.Services = c.StringSlice("service") return ParseConfig(c, cfg, "storage-home") }, diff --git a/storage/pkg/command/storageusers.go b/storage/pkg/command/storageusers.go index 996655502..47477939e 100644 --- a/storage/pkg/command/storageusers.go +++ b/storage/pkg/command/storageusers.go @@ -26,7 +26,7 @@ func StorageUsers(cfg *config.Config) *cli.Command { Usage: "Start storage-users service", //Flags: flagset.StorageUsersWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.StorageHome.Services = c.StringSlice("service") + //cfg.Reva.StorageHome.Services = c.StringSlice("service") return ParseConfig(c, cfg, "storage-userprovider") }, diff --git a/storage/pkg/command/users.go b/storage/pkg/command/users.go index 7f2cf88d9..0586f7bfa 100644 --- a/storage/pkg/command/users.go +++ b/storage/pkg/command/users.go @@ -26,7 +26,7 @@ func Users(cfg *config.Config) *cli.Command { Usage: "Start users service", //Flags: flagset.UsersWithConfig(cfg), Before: func(c *cli.Context) error { - cfg.Reva.Users.Services = c.StringSlice("service") + //cfg.Reva.Users.Services = c.StringSlice("service") return ParseConfig(c, cfg, "storage-users") }, diff --git a/storage/pkg/config/config.go b/storage/pkg/config/config.go index 82f86ae9e..04dff39c9 100644 --- a/storage/pkg/config/config.go +++ b/storage/pkg/config/config.go @@ -733,7 +733,7 @@ func DefaultConfig() *Config { Protocol: "", Endpoint: "", DebugAddr: "127.0.0.1:9141", - Services: nil, + Services: []string{"datagateway", "ocdav", "ocs", "appprovider"}, Config: nil, Context: nil, Supervised: false, @@ -788,6 +788,7 @@ func DefaultConfig() *Config { Endpoint: "localhost:9144", GRPCNetwork: "tcp", GRPCAddr: "127.0.0.1:9144", + Services: []string{"userprovider"}, }, Driver: "ldap", UserGroupsCacheExpiration: 5, @@ -798,6 +799,7 @@ func DefaultConfig() *Config { DebugAddr: "127.0.0.1:9161", GRPCNetwork: "tcp", GRPCAddr: "127.0.0.1:9160", + Services: []string{"groupprovider"}, }, Driver: "ldap", GroupMembersCacheExpiration: 5, @@ -811,16 +813,19 @@ func DefaultConfig() *Config { GRPCNetwork: "tcp", GRPCAddr: "127.0.0.1:9146", DebugAddr: "127.0.0.1:9147", + Services: []string{"authprovider"}, }, AuthBearer: Port{ GRPCNetwork: "tcp", GRPCAddr: "127.0.0.1:9148", DebugAddr: "127.0.0.1:9149", + Services: []string{"authprovider"}, }, AuthMachine: Port{ GRPCNetwork: "tcp", GRPCAddr: "127.0.0.1:9166", DebugAddr: "127.0.0.1:9167", + Services: []string{"authprovider"}, }, AuthMachineConfig: AuthMachineConfig{ MachineAuthAPIKey: "change-me-please", @@ -831,6 +836,7 @@ func DefaultConfig() *Config { DebugAddr: "127.0.0.1:9151", GRPCNetwork: "tcp", GRPCAddr: "127.0.0.1:9150", + Services: []string{"usershareprovider", "publicshareprovider"}, }, UserDriver: "json", UserJSONFile: path.Join(defaults.BaseDataPath(), "storage", "shares.json"), @@ -912,6 +918,7 @@ func DefaultConfig() *Config { GRPCAddr: "127.0.0.1:9164", DebugAddr: "127.0.0.1:9165", Endpoint: "localhost:9164", + Services: []string{"appprovider"}, }, ExternalAddr: "127.0.0.1:9164", WopiDriver: WopiDriver{}, diff --git a/storage/pkg/flagset/sharing.go b/storage/pkg/flagset/sharing.go index 1f54a2f6e..dc9198a88 100644 --- a/storage/pkg/flagset/sharing.go +++ b/storage/pkg/flagset/sharing.go @@ -52,7 +52,7 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringSliceFlag{ Name: "service", - Value: cli.NewStringSlice("usershareprovider", "publicshareprovider"), // TODO osmshareprovider + Value: cli.NewStringSlice("usershareprovider", "publicshareprovider"), // accounted for Usage: "--service usershareprovider [--service publicshareprovider]", EnvVars: []string{"STORAGE_SHARING_SERVICES"}, },