diff options
Diffstat (limited to 'weed/server/volume_server.go')
| -rw-r--r-- | weed/server/volume_server.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/weed/server/volume_server.go b/weed/server/volume_server.go index 5d7e5c7b0..a3f072eb7 100644 --- a/weed/server/volume_server.go +++ b/weed/server/volume_server.go @@ -32,6 +32,7 @@ type VolumeServer struct { readBufferSizeMB int SeedMasterNodes []pb.ServerAddress + whiteList []string currentMaster pb.ServerAddress pulseSeconds int dataCenter string @@ -102,7 +103,10 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, hasSlowRead: hasSlowRead, readBufferSizeMB: readBufferSizeMB, ldbTimout: ldbTimeout, + whiteList: whiteList, } + + whiteList = append(whiteList, util.StringSplit(v.GetString("guard.white_list"), ",")...) vs.SeedMasterNodes = masterNodes vs.checkWithMaster() @@ -150,3 +154,11 @@ func (vs *VolumeServer) Shutdown() { vs.store.Close() glog.V(0).Infoln("Shut down successfully!") } + +func (vs *VolumeServer) Reload() { + glog.V(0).Infoln("Reload volume server...") + + util.LoadConfiguration("security", false) + v := util.GetViper() + vs.guard.UpdateWhiteList(append(vs.whiteList, util.StringSplit(v.GetString("guard.white_list"), ",")...)) +} |
