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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
go fmt
chrislusf805740069a3c
diff --git a/go/security/guard.go b/go/security/guard.goindex b938454484..696b79d69e 100644--- a/go/security/guard.go+++ b/go/security/guard.go@@ -4,8 +4,8 @@ import ("errors""fmt""net"- "regexp""net/http"+ "regexp""github.com/chrislusf/seaweedfs/go/glog")@@ -90,25 +90,24 @@ func (g *Guard) checkWhiteList(w http.ResponseWriter, r *http.Request) error {if err == nil {for _, ip := range g.whiteList {- // If the whitelist entry contains a "/" it- // is a CIDR range, and we should check the- // remote host is within it- match, _ := regexp.MatchString("/", ip)- if ( match ) {- _, cidrnet, err := net.ParseCIDR(ip)- if err != nil {- panic(err)- }- remote := net.ParseIP(host)- if cidrnet.Contains(remote) {- return nil- }- }--- //- // Otherwise we're looking for a literal match.- //+ // If the whitelist entry contains a "/" it+ // is a CIDR range, and we should check the+ // remote host is within it+ match, _ := regexp.MatchString("/", ip)+ if match {+ _, cidrnet, err := net.ParseCIDR(ip)+ if err != nil {+ panic(err)+ }+ remote := net.ParseIP(host)+ if cidrnet.Contains(remote) {+ return nil+ }+ }++ //+ // Otherwise we're looking for a literal match.+ //if ip == host {return nil}diff --git a/go/weed/signal_handling.go b/go/weed/signal_handling.goindex 61554c5dfa..2004bb0883 100644--- a/go/weed/signal_handling.go+++ b/go/weed/signal_handling.go@@ -11,7 +11,7 @@ import (func OnInterrupt(fn func()) {// deal with control+c,etcsignalChan := make(chan os.Signal, 1)- // controlling terminal close, daemon not exit+ // controlling terminal close, daemon not exitsignal.Ignore(syscall.SIGHUP)signal.Notify(signalChan,os.Interrupt,