From aee3fd08b9bdec93ee7cc5687f8ed106a53ea71c Mon Sep 17 00:00:00 2001 From: limd Date: Fri, 25 Sep 2020 11:04:32 +0800 Subject: [PATCH 1/3] code style --- weed/filesys/wfs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index ef31a9258..14c851f88 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -97,6 +97,7 @@ func NewSeaweedFileSystem(option *Option) *WFS { }) entry, _ := filer_pb.GetEntry(wfs, util.FullPath(wfs.option.FilerMountRootPath)) + wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs, entry: entry} wfs.fsNodeCache = newFsCache(wfs.root) From 370a98cf6b5fd1a205c8015404dbb3815afb0eac Mon Sep 17 00:00:00 2001 From: limd Date: Fri, 25 Sep 2020 11:19:42 +0800 Subject: [PATCH 2/3] code style --- weed/filesys/wfs.go | 1 - 1 file changed, 1 deletion(-) diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index 14c851f88..ef31a9258 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -97,7 +97,6 @@ func NewSeaweedFileSystem(option *Option) *WFS { }) entry, _ := filer_pb.GetEntry(wfs, util.FullPath(wfs.option.FilerMountRootPath)) - wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs, entry: entry} wfs.fsNodeCache = newFsCache(wfs.root) From ed7816681aae57569c64fc0182364ddbc116a3fa Mon Sep 17 00:00:00 2001 From: limd Date: Fri, 25 Sep 2020 11:22:47 +0800 Subject: [PATCH 3/3] Add cassandra authenticator mode --- weed/filer/cassandra/cassandra_store.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/weed/filer/cassandra/cassandra_store.go b/weed/filer/cassandra/cassandra_store.go index 250db629a..ae8cb7a86 100644 --- a/weed/filer/cassandra/cassandra_store.go +++ b/weed/filer/cassandra/cassandra_store.go @@ -28,11 +28,16 @@ func (store *CassandraStore) Initialize(configuration util.Configuration, prefix return store.initialize( configuration.GetString(prefix+"keyspace"), configuration.GetStringSlice(prefix+"hosts"), + configuration.GetString(prefix+"username"), + configuration.GetString(prefix+"password"), ) } -func (store *CassandraStore) initialize(keyspace string, hosts []string) (err error) { +func (store *CassandraStore) initialize(keyspace string, hosts []string, username string, password string) (err error) { store.cluster = gocql.NewCluster(hosts...) + if username != "" && password != "" { + store.cluster.Authenticator = gocql.PasswordAuthenticator{Username: username, Password: password} + } store.cluster.Keyspace = keyspace store.cluster.Consistency = gocql.LocalQuorum store.session, err = store.cluster.CreateSession()