aboutsummaryrefslogtreecommitdiff
path: root/weed/server/master_server.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <lebedev_k@tochka.com>2020-12-03 17:56:39 +0500
committerKonstantin Lebedev <lebedev_k@tochka.com>2020-12-04 12:57:59 +0500
commiteadbba5c955070985ea918cffb724a8a92793572 (patch)
treefa8e523df90160a613d7c9c4a55ae84b9e67de13 /weed/server/master_server.go
parent5fb60b713574d546922b6e13364396bd98325e48 (diff)
downloadseaweedfs-eadbba5c955070985ea918cffb724a8a92793572.tar.xz
seaweedfs-eadbba5c955070985ea918cffb724a8a92793572.zip
security master use access.ui
Diffstat (limited to 'weed/server/master_server.go')
-rw-r--r--weed/server/master_server.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/server/master_server.go b/weed/server/master_server.go
index ccc94ebac..6d27d8035 100644
--- a/weed/server/master_server.go
+++ b/weed/server/master_server.go
@@ -82,6 +82,9 @@ func NewMasterServer(r *mux.Router, option *MasterOption, peers []string) *Maste
v.SetDefault("master.replication.treat_replication_as_minimums", false)
replicationAsMin := v.GetBool("master.replication.treat_replication_as_minimums")
+ v.SetDefault("access.ui", true)
+ enableUiAccess := v.GetBool("access.ui")
+
var preallocateSize int64
if option.VolumePreallocate {
preallocateSize = int64(option.VolumeSizeLimitMB) * (1 << 20)
@@ -108,10 +111,12 @@ func NewMasterServer(r *mux.Router, option *MasterOption, peers []string) *Maste
ms.guard = security.NewGuard(ms.option.WhiteList, signingKey, expiresAfterSec, readSigningKey, readExpiresAfterSec)
- if !ms.option.DisableHttp {
+ if enableUiAccess {
handleStaticResources2(r)
r.HandleFunc("/", ms.proxyToLeader(ms.uiStatusHandler))
r.HandleFunc("/ui/index.html", ms.uiStatusHandler)
+ }
+ if !ms.option.DisableHttp {
r.HandleFunc("/dir/assign", ms.proxyToLeader(ms.guard.WhiteList(ms.dirAssignHandler)))
r.HandleFunc("/dir/lookup", ms.guard.WhiteList(ms.dirLookupHandler))
r.HandleFunc("/dir/status", ms.proxyToLeader(ms.guard.WhiteList(ms.dirStatusHandler)))