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
server: add filer-specific disableHttp flag (#11360)
Chris Lu0c7beec697dc
diff --git a/weed/command/server.go b/weed/command/server.goindex 6a53c44670..2942dd0355 100644--- a/weed/command/server.go+++ b/weed/command/server.go@@ -115,6 +115,7 @@ func init() {filerOptions.port = cmdServer.Flag.Int("filer.port", 8888, "filer server http listen port")filerOptions.portGrpc = cmdServer.Flag.Int("filer.port.grpc", 0, "filer server grpc listen port")filerOptions.publicPort = cmdServer.Flag.Int("filer.port.public", 0, "filer server public http listen port")+ filerOptions.disableHttp = cmdServer.Flag.Bool("filer.disableHttp", false, "disable filer HTTP requests, only gRPC operations are allowed")filerOptions.allowedOrigins = cmdServer.Flag.String("filer.allowedOrigins", "*", "comma separated list of allowed origins")filerOptions.defaultReplicaPlacement = cmdServer.Flag.String("filer.defaultReplicaPlacement", "", "default replication type. If not specified, use master setting.")filerOptions.disableDirListing = cmdServer.Flag.Bool("filer.disableDirListing", false, "turn off directory listing")@@ -333,7 +334,7 @@ func runServer(cmd *Command, args []string) bool {mqBrokerOptions.rack = serverRacks3Options.dataCenter = serverDataCentersftpOptions.dataCenter = serverDataCenter- filerOptions.disableHttp = serverDisableHttp+ *filerOptions.disableHttp = *filerOptions.disableHttp || *serverDisableHttpmasterOptions.disableHttp = serverDisableHttpfilerAddress := string(pb.NewServerAddress(*serverIp, *filerOptions.port, *filerOptions.portGrpc))diff --git a/weed/command/server_test.go b/weed/command/server_test.gonew file mode 100644index 0000000000..333e01dfca--- /dev/null+++ b/weed/command/server_test.go@@ -0,0 +1,13 @@+package command++import "testing"++func TestServerFilerDisableHttpFlag(t *testing.T) {+ flag := cmdServer.Flag.Lookup("filer.disableHttp")+ if flag == nil {+ t.Fatal("weed server does not expose -filer.disableHttp")+ }+ if flag.DefValue != "false" {+ t.Fatalf("-filer.disableHttp default = %q, want false", flag.DefValue)+ }+}