From 390b7c2e938aed9e1b9e75ec99012b2a1451a7a8 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 19 Nov 2021 10:12:49 +0100 Subject: [PATCH] add mount it to public link storage --- storage/pkg/command/gateway.go | 1 + storage/pkg/command/storagepubliclink.go | 1 + storage/pkg/flagset/gateway.go | 8 +++++++- storage/pkg/flagset/storagepubliclink.go | 7 +++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/storage/pkg/command/gateway.go b/storage/pkg/command/gateway.go index b1047367fb..3988eefc3f 100644 --- a/storage/pkg/command/gateway.go +++ b/storage/pkg/command/gateway.go @@ -227,6 +227,7 @@ func rules(cfg *config.Config, logger log.Logger) map[string]map[string]interfac cfg.Reva.StorageUsers.MountPath: {"address": cfg.Reva.StorageUsers.Endpoint}, cfg.Reva.StorageUsers.MountID + ".*": {"address": cfg.Reva.StorageUsers.Endpoint}, cfg.Reva.StoragePublicLink.MountPath: {"address": cfg.Reva.StoragePublicLink.Endpoint}, + cfg.Reva.StoragePublicLink.MountID: {"address": cfg.Reva.StoragePublicLink.MountID}, // public link storage returns the mount id of the actual storage // medatada storage not part of the global namespace } diff --git a/storage/pkg/command/storagepubliclink.go b/storage/pkg/command/storagepubliclink.go index d90b971fc0..22dbf98852 100644 --- a/storage/pkg/command/storagepubliclink.go +++ b/storage/pkg/command/storagepubliclink.go @@ -101,6 +101,7 @@ func storagePublicLinkConfigFromStruct(c *cli.Context, cfg *config.Config) map[s "services": map[string]interface{}{ "publicstorageprovider": map[string]interface{}{ "mount_path": cfg.Reva.StoragePublicLink.MountPath, + "mount_id": cfg.Reva.StoragePublicLink.MountID, "gateway_addr": cfg.Reva.Gateway.Endpoint, }, "authprovider": map[string]interface{}{ diff --git a/storage/pkg/flagset/gateway.go b/storage/pkg/flagset/gateway.go index 34c008e0ce..416fac641c 100644 --- a/storage/pkg/flagset/gateway.go +++ b/storage/pkg/flagset/gateway.go @@ -289,7 +289,13 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"STORAGE_PUBLIC_LINK_MOUNT_PATH"}, Destination: &cfg.Reva.StoragePublicLink.MountPath, }, - // public-link has no mount id + &cli.StringFlag{ + Name: "storage-public-link-mount-id", + Value: flags.OverrideDefaultString(cfg.Reva.StoragePublicLink.MountID, "e1a73ede-549b-4226-abdf-40e69ca8230d"), + Usage: "mount id", + EnvVars: []string{"STORAGE_PUBLIC_LINK_MOUNT_ID"}, + Destination: &cfg.Reva.StoragePublicLink.MountID, + }, } flags = append(flags, TracingWithConfig(cfg)...) diff --git a/storage/pkg/flagset/storagepubliclink.go b/storage/pkg/flagset/storagepubliclink.go index 5d884c79d7..8d730be418 100644 --- a/storage/pkg/flagset/storagepubliclink.go +++ b/storage/pkg/flagset/storagepubliclink.go @@ -40,6 +40,13 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { EnvVars: []string{"STORAGE_PUBLIC_LINK_MOUNT_PATH"}, Destination: &cfg.Reva.StoragePublicLink.MountPath, }, + &cli.StringFlag{ + Name: "mount-id", + Value: flags.OverrideDefaultString(cfg.Reva.StoragePublicLink.MountID, "e1a73ede-549b-4226-abdf-40e69ca8230d"), + Usage: "mount id", + EnvVars: []string{"STORAGE_PUBLIC_LINK_MOUNT_ID"}, + Destination: &cfg.Reva.StoragePublicLink.MountID, + }, &cli.StringFlag{ Name: "reva-gateway-addr",