From 7850d17f482835c1cf322651e5f07ea2ac6de85a Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Thu, 28 Jul 2016 16:30:33 +0530 Subject: [PATCH] web-browser: disable minio browser when environmental variable MINIO_BROWSER=off (#2315) fixes #2314 --- routers.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/routers.go b/routers.go index b15cfccf3..79189503a 100644 --- a/routers.go +++ b/routers.go @@ -19,6 +19,8 @@ package main import ( "errors" "net/http" + "os" + "strings" router "github.com/gorilla/mux" ) @@ -62,7 +64,13 @@ func configureServerHandler(srvCmdConfig serverCmdConfig) http.Handler { // Register all routers. registerStorageRPCRouter(mux, storageRPC) - registerWebRouter(mux, webHandlers) + + // set environmental variable MINIO_BROWSER=off to disable minio web browser. + // By default minio web browser is enabled. + if !strings.EqualFold(os.Getenv("MINIO_BROWSER"), "off") { + registerWebRouter(mux, webHandlers) + } + registerAPIRouter(mux, apiHandlers) // Add new routers here.