From b17c426e9910b280b751ac04cff07b96574bc8c9 Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 13 Jan 2022 22:49:49 -0800 Subject: [PATCH] weed server: optionally start IAM service related to https://github.com/chrislusf/seaweedfs/issues/2560 --- weed/command/server.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/weed/command/server.go b/weed/command/server.go index dcf0411fd..fe58e20bb 100644 --- a/weed/command/server.go +++ b/weed/command/server.go @@ -28,6 +28,7 @@ var ( masterOptions MasterOptions filerOptions FilerOptions s3Options S3Options + iamOptions IamOptions webdavOptions WebDavOption msgBrokerOptions MessageBrokerOptions ) @@ -71,6 +72,7 @@ var ( isStartingVolumeServer = cmdServer.Flag.Bool("volume", true, "whether to start volume server") isStartingFiler = cmdServer.Flag.Bool("filer", false, "whether to start filer") isStartingS3 = cmdServer.Flag.Bool("s3", false, "whether to start S3 gateway") + isStartingIam = cmdServer.Flag.Bool("iam", false, "whether to start IAM service") isStartingWebDav = cmdServer.Flag.Bool("webdav", false, "whether to start WebDAV gateway") isStartingMsgBroker = cmdServer.Flag.Bool("msgBroker", false, "whether to start message broker") @@ -134,6 +136,8 @@ func init() { s3Options.auditLogConfig = cmdServer.Flag.String("s3.auditLogConfig", "", "path to the audit log config file") s3Options.allowEmptyFolder = cmdServer.Flag.Bool("s3.allowEmptyFolder", true, "allow empty folders") + iamOptions.port = cmdServer.Flag.Int("iam.port", 8111, "iam server http listen port") + webdavOptions.port = cmdServer.Flag.Int("webdav.port", 7333, "webdav server http listen port") webdavOptions.collection = cmdServer.Flag.String("webdav.collection", "", "collection to create the files") webdavOptions.replication = cmdServer.Flag.String("webdav.replication", "", "replication to create the files") @@ -161,6 +165,9 @@ func runServer(cmd *Command, args []string) bool { if *isStartingS3 { *isStartingFiler = true } + if *isStartingIam { + *isStartingFiler = true + } if *isStartingWebDav { *isStartingFiler = true } @@ -227,25 +234,27 @@ func runServer(cmd *Command, args []string) bool { if *isStartingFiler { go func() { time.Sleep(1 * time.Second) - filerOptions.startFiler() - }() } if *isStartingS3 { go func() { time.Sleep(2 * time.Second) - s3Options.startS3Server() + }() + } + if *isStartingIam { + go func() { + time.Sleep(2 * time.Second) + iamOptions.startIamServer() }() } if *isStartingWebDav { go func() { time.Sleep(2 * time.Second) - webdavOptions.startWebDav() }()