Skip to content

Commit

Permalink
Merge branch 'master' into hotfix-seaweedfs#4668
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislusf committed Oct 19, 2023
2 parents e1aacb2 + 612fd72 commit 3e37ec6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions weed/s3api/s3api_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import (
"context"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/s3_pb"
"github.com/seaweedfs/seaweedfs/weed/util/grace"
"net"
"net/http"
"strings"
Expand Down Expand Up @@ -61,6 +63,15 @@ func NewS3ApiServer(router *mux.Router, option *S3ApiServerOption) (s3ApiServer
filerGuard: security.NewGuard([]string{}, signingKey, expiresAfterSec, readSigningKey, readExpiresAfterSec),
cb: NewCircuitBreaker(option),
}
if option.Config != "" {
grace.OnReload(func() {
if err := s3ApiServer.iam.loadS3ApiConfigurationFromFile(option.Config); err != nil {
glog.Errorf("fail to load config file %s: %v", option.Config, err)
} else {
glog.V(0).Infof("Loaded %d identities from config file %s", len(s3ApiServer.iam.identities), option.Config)
}
})
}
s3ApiServer.bucketRegistry = NewBucketRegistry(s3ApiServer)
if option.LocalFilerSocket == "" {
s3ApiServer.client = &http.Client{Transport: &http.Transport{
Expand Down

0 comments on commit 3e37ec6

Please sign in to comment.