Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

fix master static resource display problem

Chris Lu4af6b4eb0eb9
diff --git a/weed/server/common.go b/weed/server/common.go
index 215ee10367..9b9ed76597 100644
--- a/weed/server/common.go
+++ b/weed/server/common.go
@@ -20,6 +20,7 @@ import (
_ "github.com/chrislusf/seaweedfs/weed/statik"
statik "github.com/rakyll/statik/fs"
+ "github.com/gorilla/mux"
)
var serverStats *stats.ServerStats
@@ -198,3 +199,8 @@ func handleStaticResources(defaultMux *http.ServeMux) {
defaultMux.Handle("/favicon.ico", http.FileServer(statikFS))
defaultMux.Handle("/seaweedfsstatic/", http.StripPrefix("/seaweedfsstatic", http.FileServer(statikFS)))
}
+
+func handleStaticResources2(r *mux.Router) {
+ r.Handle("/favicon.ico", http.FileServer(statikFS))
+ r.PathPrefix("/seaweedfsstatic/").Handler(http.StripPrefix("/seaweedfsstatic", http.FileServer(statikFS)))
+}
diff --git a/weed/server/master_server.go b/weed/server/master_server.go
index 07a398ead6..a0d7e96051 100644
--- a/weed/server/master_server.go
+++ b/weed/server/master_server.go
@@ -69,6 +69,7 @@ func NewMasterServer(r *mux.Router, port int, metaFolder string,
ms.guard = security.NewGuard(whiteList, secureKey)
+ handleStaticResources2(r)
r.HandleFunc("/", ms.uiStatusHandler)
r.HandleFunc("/ui/index.html", ms.uiStatusHandler)
r.HandleFunc("/dir/assign", ms.proxyToLeader(ms.guard.WhiteList(ms.dirAssignHandler)))