mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
security master use access.ui
This commit is contained in:
parent
5fb60b7135
commit
eadbba5c95
|
@ -13,10 +13,6 @@ services:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
- 18080:18080
|
- 18080:18080
|
||||||
command: "volume -mserver=master:9333 -port=8080 -ip=volume -max=0 -preStopSeconds=1"
|
command: "volume -mserver=master:9333 -port=8080 -ip=volume -max=0 -preStopSeconds=1"
|
||||||
volumes:
|
|
||||||
- type: bind
|
|
||||||
source: /Volumes/mobile_disk/data
|
|
||||||
target: /data
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- master
|
- master
|
||||||
filer:
|
filer:
|
||||||
|
|
|
@ -82,6 +82,9 @@ func NewMasterServer(r *mux.Router, option *MasterOption, peers []string) *Maste
|
||||||
v.SetDefault("master.replication.treat_replication_as_minimums", false)
|
v.SetDefault("master.replication.treat_replication_as_minimums", false)
|
||||||
replicationAsMin := v.GetBool("master.replication.treat_replication_as_minimums")
|
replicationAsMin := v.GetBool("master.replication.treat_replication_as_minimums")
|
||||||
|
|
||||||
|
v.SetDefault("access.ui", true)
|
||||||
|
enableUiAccess := v.GetBool("access.ui")
|
||||||
|
|
||||||
var preallocateSize int64
|
var preallocateSize int64
|
||||||
if option.VolumePreallocate {
|
if option.VolumePreallocate {
|
||||||
preallocateSize = int64(option.VolumeSizeLimitMB) * (1 << 20)
|
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)
|
ms.guard = security.NewGuard(ms.option.WhiteList, signingKey, expiresAfterSec, readSigningKey, readExpiresAfterSec)
|
||||||
|
|
||||||
if !ms.option.DisableHttp {
|
if enableUiAccess {
|
||||||
handleStaticResources2(r)
|
handleStaticResources2(r)
|
||||||
r.HandleFunc("/", ms.proxyToLeader(ms.uiStatusHandler))
|
r.HandleFunc("/", ms.proxyToLeader(ms.uiStatusHandler))
|
||||||
r.HandleFunc("/ui/index.html", 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/assign", ms.proxyToLeader(ms.guard.WhiteList(ms.dirAssignHandler)))
|
||||||
r.HandleFunc("/dir/lookup", ms.guard.WhiteList(ms.dirLookupHandler))
|
r.HandleFunc("/dir/lookup", ms.guard.WhiteList(ms.dirLookupHandler))
|
||||||
r.HandleFunc("/dir/status", ms.proxyToLeader(ms.guard.WhiteList(ms.dirStatusHandler)))
|
r.HandleFunc("/dir/status", ms.proxyToLeader(ms.guard.WhiteList(ms.dirStatusHandler)))
|
||||||
|
|
Loading…
Reference in a new issue