diff --git a/accounts/pkg/config/config.go b/accounts/pkg/config/config.go index 956c12cea6..2b8fcfb7cd 100644 --- a/accounts/pkg/config/config.go +++ b/accounts/pkg/config/config.go @@ -75,7 +75,7 @@ type Disk struct { // CS3 is the cs3 implementation of the storage. type CS3 struct { ProviderAddr string - DriverURL string + DataURL string DataPrefix string } diff --git a/accounts/pkg/flagset/flagset.go b/accounts/pkg/flagset/flagset.go index 7956d58ff0..885a079229 100644 --- a/accounts/pkg/flagset/flagset.go +++ b/accounts/pkg/flagset/flagset.go @@ -108,17 +108,17 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "storage-cs3-provider-addr", - Value: "0.0.0.0:9215", + Value: "localhost:9215", Usage: "bind address for the metadata storage provider", EnvVars: []string{"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR"}, Destination: &cfg.Repo.CS3.ProviderAddr, }, &cli.StringFlag{ - Name: "storage-cs3-driver-url", + Name: "storage-cs3-data-url", Value: "http://localhost:9216", - Usage: "http endpoint of the metadata storage, without trailing slash", - EnvVars: []string{"ACCOUNTS_STORAGE_CS3_DRIVER_URL"}, - Destination: &cfg.Repo.CS3.DriverURL, + Usage: "http endpoint of the metadata storage", + EnvVars: []string{"ACCOUNTS_STORAGE_CS3_DATA_URL"}, + Destination: &cfg.Repo.CS3.DataURL, }, &cli.StringFlag{ Name: "storage-cs3-data-prefix", diff --git a/accounts/pkg/service/v0/accounts.go b/accounts/pkg/service/v0/accounts.go index 3f85b868db..f8a4579e79 100644 --- a/accounts/pkg/service/v0/accounts.go +++ b/accounts/pkg/service/v0/accounts.go @@ -3,7 +3,6 @@ package service import ( "context" "fmt" - "github.com/owncloud/ocis/accounts/pkg/storage" "path/filepath" "regexp" "sync" @@ -17,6 +16,7 @@ import ( merrors "github.com/micro/go-micro/v2/errors" "github.com/owncloud/ocis/accounts/pkg/proto/v0" "github.com/owncloud/ocis/accounts/pkg/provider" + "github.com/owncloud/ocis/accounts/pkg/storage" "github.com/owncloud/ocis/ocis-pkg/roles" settings "github.com/owncloud/ocis/settings/pkg/proto/v0" settings_svc "github.com/owncloud/ocis/settings/pkg/service/v0" diff --git a/accounts/pkg/storage/cs3.go b/accounts/pkg/storage/cs3.go index bb5c346cdd..12609a9f2b 100644 --- a/accounts/pkg/storage/cs3.go +++ b/accounts/pkg/storage/cs3.go @@ -218,11 +218,11 @@ func (r CS3Repo) authenticate(ctx context.Context) (token string, err error) { } func (r CS3Repo) accountURL(id string) string { - return singleJoiningSlash(r.cfg.Repo.CS3.DriverURL, path.Join(r.cfg.Repo.CS3.DataPrefix, accountsFolder, id)) + return singleJoiningSlash(r.cfg.Repo.CS3.DataURL, path.Join(r.cfg.Repo.CS3.DataPrefix, accountsFolder, id)) } func (r CS3Repo) groupURL(id string) string { - return singleJoiningSlash(r.cfg.Repo.CS3.DriverURL, path.Join(r.cfg.Repo.CS3.DataPrefix, groupsFolder, id)) + return singleJoiningSlash(r.cfg.Repo.CS3.DataURL, path.Join(r.cfg.Repo.CS3.DataPrefix, groupsFolder, id)) } func (r CS3Repo) makeRootDirIfNotExist(ctx context.Context, folder string) error { diff --git a/accounts/pkg/storage/cs3_test.go b/accounts/pkg/storage/cs3_test.go index af576acfbc..d788dc7ac3 100644 --- a/accounts/pkg/storage/cs3_test.go +++ b/accounts/pkg/storage/cs3_test.go @@ -17,7 +17,7 @@ package storage // Repo: config.Repo{ // CS3: config.CS3{ // ProviderAddr: "0.0.0.0:9215", -// DriverURL: "http://localhost:9216", +// DataURL: "http://localhost:9216", // DataPrefix: "data", // }, // }, diff --git a/accounts/pkg/storage/disk.go b/accounts/pkg/storage/disk.go index 2b0265324d..df3288936c 100644 --- a/accounts/pkg/storage/disk.go +++ b/accounts/pkg/storage/disk.go @@ -3,12 +3,12 @@ package storage import ( "context" "encoding/json" - "github.com/owncloud/ocis/accounts/pkg/config" "io/ioutil" "os" "path/filepath" "sync" + "github.com/owncloud/ocis/accounts/pkg/config" "github.com/owncloud/ocis/accounts/pkg/proto/v0" olog "github.com/owncloud/ocis/ocis-pkg/log" )