weed filer, weed master: add option to disable http

This commit is contained in:
Chris Lu
2019-03-21 16:00:46 -07:00
parent 531add52c2
commit a3490b600c
5 changed files with 20 additions and 15 deletions

View File

@@ -34,6 +34,7 @@ type FilerOption struct {
DirListingLimit int
DataCenter string
DefaultLevelDbDir string
DisableHttp bool
}
type FilerServer struct {
@@ -74,7 +75,9 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
notification.LoadConfiguration(v.Sub("notification"))
handleStaticResources(defaultMux)
defaultMux.HandleFunc("/", fs.filerHandler)
if !option.DisableHttp {
defaultMux.HandleFunc("/", fs.filerHandler)
}
if defaultMux != readonlyMux {
readonlyMux.HandleFunc("/", fs.readonlyFilerHandler)
}