don't expose services by default

This commit is contained in:
Willy Kloucek
2021-10-12 14:00:33 +02:00
parent 90246d776d
commit 879827ca4b
31 changed files with 94 additions and 114 deletions
+5 -5
View File
@@ -157,22 +157,22 @@ func groupsConfigFromStruct(c *cli.Context, cfg *config.Config) map[string]inter
}
}
// GroupProvider allows for the storage-groupprovider command to be embedded and supervised by a suture supervisor tree.
type GroupProvider struct {
// GroupSutureService allows for the storage-groupprovider command to be embedded and supervised by a suture supervisor tree.
type GroupSutureService struct {
cfg *config.Config
}
// NewGroupProvider creates a new storage.GroupProvider
// NewGroupProviderSutureService creates a new storage.GroupProvider
func NewGroupProvider(cfg *ociscfg.Config) suture.Service {
if cfg.Mode == 0 {
cfg.Storage.Reva.Groups.Supervised = true
}
return GroupProvider{
return GroupSutureService{
cfg: cfg.Storage,
}
}
func (s GroupProvider) Serve(ctx context.Context) error {
func (s GroupSutureService) Serve(ctx context.Context) error {
s.cfg.Reva.Groups.Context = ctx
f := &flag.FlagSet{}
cmdFlags := Groups(s.cfg).Flags
+3 -3
View File
@@ -159,7 +159,7 @@ func storageMetadataFromStruct(c *cli.Context, cfg *config.Config) map[string]in
}
// SutureService allows for the storage-metadata command to be embedded and supervised by a suture supervisor tree.
type SutureService struct {
type MetadataSutureService struct {
cfg *config.Config
}
@@ -168,12 +168,12 @@ func NewStorageMetadata(cfg *ociscfg.Config) suture.Service {
if cfg.Mode == 0 {
cfg.Storage.Reva.StorageMetadata.Supervised = true
}
return SutureService{
return MetadataSutureService{
cfg: cfg.Storage,
}
}
func (s SutureService) Serve(ctx context.Context) error {
func (s MetadataSutureService) Serve(ctx context.Context) error {
s.cfg.Reva.StorageMetadata.Context = ctx
f := &flag.FlagSet{}
cmdFlags := StorageMetadata(s.cfg).Flags
+5 -5
View File
@@ -178,22 +178,22 @@ func usersConfigFromStruct(c *cli.Context, cfg *config.Config) map[string]interf
return rcfg
}
// UserProvider allows for the storage-userprovider command to be embedded and supervised by a suture supervisor tree.
type UserProvider struct {
// UserProviderSutureService allows for the storage-userprovider command to be embedded and supervised by a suture supervisor tree.
type UserProviderSutureService struct {
cfg *config.Config
}
// NewUserProvider creates a new storage.UserProvider
// NewUserProviderSutureService creates a new storage.UserProvider
func NewUserProvider(cfg *ociscfg.Config) suture.Service {
if cfg.Mode == 0 {
cfg.Storage.Reva.Users.Supervised = true
}
return UserProvider{
return UserProviderSutureService{
cfg: cfg.Storage,
}
}
func (s UserProvider) Serve(ctx context.Context) error {
func (s UserProviderSutureService) Serve(ctx context.Context) error {
s.cfg.Reva.Users.Context = ctx
f := &flag.FlagSet{}
cmdFlags := Users(s.cfg).Flags
+2 -2
View File
@@ -13,7 +13,7 @@ func AppProviderWithConfig(cfg *config.Config) []cli.Flag {
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.DebugAddr, "0.0.0.0:9165"),
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.DebugAddr, "127.0.0.1:9165"),
Usage: "Address to bind debug server",
EnvVars: []string{"APP_PROVIDER_BASIC_DEBUG_ADDR"},
Destination: &cfg.Reva.AppProvider.DebugAddr,
@@ -34,7 +34,7 @@ func AppProviderWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "addr",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.GRPCAddr, "0.0.0.0:9164"),
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.GRPCAddr, "127.0.0.1:9164"),
Usage: "Address to bind storage service",
EnvVars: []string{"APP_PROVIDER_BASIC_GRPC_ADDR"},
Destination: &cfg.Reva.AppProvider.GRPCAddr,
+2 -2
View File
@@ -13,7 +13,7 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.AuthBasic.DebugAddr, "0.0.0.0:9147"),
Value: flags.OverrideDefaultString(cfg.Reva.AuthBasic.DebugAddr, "127.0.0.1:9147"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_AUTH_BASIC_DEBUG_ADDR"},
Destination: &cfg.Reva.AuthBasic.DebugAddr,
@@ -49,7 +49,7 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "addr",
Value: flags.OverrideDefaultString(cfg.Reva.AuthBasic.GRPCAddr, "0.0.0.0:9146"),
Value: flags.OverrideDefaultString(cfg.Reva.AuthBasic.GRPCAddr, "127.0.0.1:9146"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_AUTH_BASIC_GRPC_ADDR"},
Destination: &cfg.Reva.AuthBasic.GRPCAddr,
+2 -2
View File
@@ -13,7 +13,7 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.AuthBearer.DebugAddr, "0.0.0.0:9149"),
Value: flags.OverrideDefaultString(cfg.Reva.AuthBearer.DebugAddr, "127.0.0.1:9149"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_AUTH_BEARER_DEBUG_ADDR"},
Destination: &cfg.Reva.AuthBearer.DebugAddr,
@@ -95,7 +95,7 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "addr",
Value: flags.OverrideDefaultString(cfg.Reva.AuthBearer.GRPCAddr, "0.0.0.0:9148"),
Value: flags.OverrideDefaultString(cfg.Reva.AuthBearer.GRPCAddr, "127.0.0.1:9148"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_AUTH_BEARER_GRPC_ADDR"},
Destination: &cfg.Reva.AuthBearer.GRPCAddr,
+2 -2
View File
@@ -14,7 +14,7 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.Frontend.DebugAddr, "0.0.0.0:9141"),
Value: flags.OverrideDefaultString(cfg.Reva.Frontend.DebugAddr, "127.0.0.1:9141"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_FRONTEND_DEBUG_ADDR"},
Destination: &cfg.Reva.Frontend.DebugAddr,
@@ -88,7 +88,7 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "addr",
Value: flags.OverrideDefaultString(cfg.Reva.Frontend.HTTPAddr, "0.0.0.0:9140"),
Value: flags.OverrideDefaultString(cfg.Reva.Frontend.HTTPAddr, "127.0.0.1:9140"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_FRONTEND_HTTP_ADDR"},
Destination: &cfg.Reva.Frontend.HTTPAddr,
+2 -2
View File
@@ -13,7 +13,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.Gateway.DebugAddr, "0.0.0.0:9143"),
Value: flags.OverrideDefaultString(cfg.Reva.Gateway.DebugAddr, "127.0.0.1:9143"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_GATEWAY_DEBUG_ADDR"},
Destination: &cfg.Reva.Gateway.DebugAddr,
@@ -48,7 +48,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "addr",
Value: flags.OverrideDefaultString(cfg.Reva.Gateway.GRPCAddr, "0.0.0.0:9142"),
Value: flags.OverrideDefaultString(cfg.Reva.Gateway.GRPCAddr, "127.0.0.1:9142"),
Usage: "Address to bind REVA service",
EnvVars: []string{"STORAGE_GATEWAY_GRPC_ADDR"},
Destination: &cfg.Reva.Gateway.GRPCAddr,
+2 -2
View File
@@ -13,7 +13,7 @@ func GroupsWithConfig(cfg *config.Config) []cli.Flag {
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.Groups.DebugAddr, "0.0.0.0:9161"),
Value: flags.OverrideDefaultString(cfg.Reva.Groups.DebugAddr, "127.0.0.1:9161"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_GROUPPROVIDER_DEBUG_ADDR"},
Destination: &cfg.Reva.Groups.DebugAddr,
@@ -42,7 +42,7 @@ func GroupsWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "addr",
Value: flags.OverrideDefaultString(cfg.Reva.Groups.GRPCAddr, "0.0.0.0:9160"),
Value: flags.OverrideDefaultString(cfg.Reva.Groups.GRPCAddr, "127.0.0.1:9160"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_GROUPPROVIDER_ADDR"},
Destination: &cfg.Reva.Groups.GRPCAddr,
+1 -1
View File
@@ -11,7 +11,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9109"),
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9109"),
Usage: "Address to debug endpoint",
EnvVars: []string{"STORAGE_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
+2 -2
View File
@@ -13,7 +13,7 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag {
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.Sharing.DebugAddr, "0.0.0.0:9151"),
Value: flags.OverrideDefaultString(cfg.Reva.Sharing.DebugAddr, "127.0.0.1:9151"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_SHARING_DEBUG_ADDR"},
Destination: &cfg.Reva.Sharing.DebugAddr,
@@ -42,7 +42,7 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "addr",
Value: flags.OverrideDefaultString(cfg.Reva.Sharing.GRPCAddr, "0.0.0.0:9150"),
Value: flags.OverrideDefaultString(cfg.Reva.Sharing.GRPCAddr, "127.0.0.1:9150"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_SHARING_GRPC_ADDR"},
Destination: &cfg.Reva.Sharing.GRPCAddr,
+3 -3
View File
@@ -14,7 +14,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.DebugAddr, "0.0.0.0:9156"),
Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.DebugAddr, "127.0.0.1:9156"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_HOME_DEBUG_ADDR"},
Destination: &cfg.Reva.StorageHome.DebugAddr,
@@ -33,7 +33,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "grpc-addr",
Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.GRPCAddr, "0.0.0.0:9154"),
Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.GRPCAddr, "127.0.0.1:9154"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_HOME_GRPC_ADDR"},
Destination: &cfg.Reva.StorageHome.GRPCAddr,
@@ -47,7 +47,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "http-addr",
Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.HTTPAddr, "0.0.0.0:9155"),
Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.HTTPAddr, "127.0.0.1:9155"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_HOME_HTTP_ADDR"},
Destination: &cfg.Reva.StorageHome.HTTPAddr,
+3 -3
View File
@@ -12,7 +12,7 @@ func StorageMetadata(cfg *config.Config) []cli.Flag {
f := []cli.Flag{
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.DebugAddr, "0.0.0.0:9217"),
Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.DebugAddr, "127.0.0.1:9217"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_METADATA_DEBUG_ADDR"},
Destination: &cfg.Reva.StorageMetadata.DebugAddr,
@@ -26,7 +26,7 @@ func StorageMetadata(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "grpc-addr",
Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.GRPCAddr, "0.0.0.0:9215"),
Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.GRPCAddr, "127.0.0.1:9215"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_METADATA_GRPC_PROVIDER_ADDR"},
Destination: &cfg.Reva.StorageMetadata.GRPCAddr,
@@ -47,7 +47,7 @@ func StorageMetadata(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "http-addr",
Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.HTTPAddr, "0.0.0.0:9216"),
Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.HTTPAddr, "127.0.0.1:9216"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_METADATA_HTTP_ADDR"},
Destination: &cfg.Reva.StorageMetadata.HTTPAddr,
+2 -2
View File
@@ -12,7 +12,7 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag {
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.StoragePublicLink.DebugAddr, "0.0.0.0:9179"),
Value: flags.OverrideDefaultString(cfg.Reva.StoragePublicLink.DebugAddr, "127.0.0.1:9179"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_PUBLIC_LINK_DEBUG_ADDR"},
Destination: &cfg.Reva.StoragePublicLink.DebugAddr,
@@ -27,7 +27,7 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "addr",
Value: flags.OverrideDefaultString(cfg.Reva.StoragePublicLink.GRPCAddr, "0.0.0.0:9178"),
Value: flags.OverrideDefaultString(cfg.Reva.StoragePublicLink.GRPCAddr, "127.0.0.1:9178"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_PUBLIC_LINK_GRPC_ADDR"},
Destination: &cfg.Reva.StoragePublicLink.GRPCAddr,
+3 -3
View File
@@ -14,7 +14,7 @@ func StorageUsersWithConfig(cfg *config.Config) []cli.Flag {
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.DebugAddr, "0.0.0.0:9159"),
Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.DebugAddr, "127.0.0.1:9159"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_USERS_DEBUG_ADDR"},
Destination: &cfg.Reva.StorageUsers.DebugAddr,
@@ -33,7 +33,7 @@ func StorageUsersWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "grpc-addr",
Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.GRPCAddr, "0.0.0.0:9157"),
Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.GRPCAddr, "127.0.0.1:9157"),
Usage: "GRPC Address to bind users storage",
EnvVars: []string{"STORAGE_USERS_GRPC_ADDR"},
Destination: &cfg.Reva.StorageUsers.GRPCAddr,
@@ -47,7 +47,7 @@ func StorageUsersWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "http-addr",
Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.HTTPAddr, "0.0.0.0:9158"),
Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.HTTPAddr, "127.0.0.1:9158"),
Usage: "HTTP Address to bind users storage",
EnvVars: []string{"STORAGE_USERS_HTTP_ADDR"},
Destination: &cfg.Reva.StorageUsers.HTTPAddr,
+2 -2
View File
@@ -13,7 +13,7 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag {
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.Users.DebugAddr, "0.0.0.0:9145"),
Value: flags.OverrideDefaultString(cfg.Reva.Users.DebugAddr, "127.0.0.1:9145"),
Usage: "Address to bind debug server",
EnvVars: []string{"STORAGE_USERPROVIDER_DEBUG_ADDR"},
Destination: &cfg.Reva.Users.DebugAddr,
@@ -42,7 +42,7 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "addr",
Value: flags.OverrideDefaultString(cfg.Reva.Users.GRPCAddr, "0.0.0.0:9144"),
Value: flags.OverrideDefaultString(cfg.Reva.Users.GRPCAddr, "127.0.0.1:9144"),
Usage: "Address to bind storage service",
EnvVars: []string{"STORAGE_USERPROVIDER_ADDR"},
Destination: &cfg.Reva.Users.GRPCAddr,