diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-02-18 12:11:52 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-02-18 12:11:52 -0800 |
| commit | 77b9af531d18e10b04b49b069b5f26a329ed4902 (patch) | |
| tree | cae2524dfc445b352e5d6bab7a82f7af46b7a4c8 /weed/server/volume_server.go | |
| parent | 55761ae806bc7cc8ab34424508aee5481131b941 (diff) | |
| download | seaweedfs-77b9af531d18e10b04b49b069b5f26a329ed4902.tar.xz seaweedfs-77b9af531d18e10b04b49b069b5f26a329ed4902.zip | |
adding grpc mutual tls
Diffstat (limited to 'weed/server/volume_server.go')
| -rw-r--r-- | weed/server/volume_server.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/weed/server/volume_server.go b/weed/server/volume_server.go index d8ff01766..8e77ec570 100644 --- a/weed/server/volume_server.go +++ b/weed/server/volume_server.go @@ -1,6 +1,7 @@ package weed_server import ( + "google.golang.org/grpc" "net/http" "github.com/chrislusf/seaweedfs/weed/glog" @@ -10,13 +11,14 @@ import ( ) type VolumeServer struct { - MasterNodes []string - currentMaster string - pulseSeconds int - dataCenter string - rack string - store *storage.Store - guard *security.Guard + MasterNodes []string + currentMaster string + pulseSeconds int + dataCenter string + rack string + store *storage.Store + guard *security.Guard + grpcDialOption grpc.DialOption needleMapKind storage.NeedleMapType FixJpgOrientation bool @@ -33,7 +35,6 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, fixJpgOrientation bool, readRedirect bool) *VolumeServer { - LoadConfiguration("security", false) v := viper.GetViper() signingKey := v.GetString("jwt.signing.key") enableUiAccess := v.GetBool("access.ui") @@ -45,6 +46,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, needleMapKind: needleMapKind, FixJpgOrientation: fixJpgOrientation, ReadRedirect: readRedirect, + grpcDialOption: security.LoadClientTLS(viper.Sub("grpc"), "volume"), } vs.MasterNodes = masterNodes vs.store = storage.NewStore(port, ip, publicUrl, folders, maxCounts, vs.needleMapKind) |
