Browse Source

s3: use static configuration by default

So that users can still use the previous configuration files.

If leave it empty, s3 will try to use the version from filer
pull/1681/head
Chris Lu 4 years ago
parent
commit
26731694f8
  1. 9
      weed/s3api/auth_credentials.go

9
weed/s3api/auth_credentials.go

@ -38,13 +38,14 @@ func NewIdentityAccessManagement(option *S3ApiServerOption) *IdentityAccessManag
iam := &IdentityAccessManagement{ iam := &IdentityAccessManagement{
domain: option.DomainName, domain: option.DomainName,
} }
if err := iam.loadS3ApiConfigurationFromFiler(option); err != nil {
glog.Warningf("fail to load config: %v", err)
}
if len(iam.identities) == 0 && option.Config != "" {
if option.Config != "" {
if err := iam.loadS3ApiConfigurationFromFile(option.Config); err != nil { if err := iam.loadS3ApiConfigurationFromFile(option.Config); err != nil {
glog.Fatalf("fail to load config file %s: %v", option.Config, err) glog.Fatalf("fail to load config file %s: %v", option.Config, err)
} }
} else {
if err := iam.loadS3ApiConfigurationFromFiler(option); err != nil {
glog.Warningf("fail to load config: %v", err)
}
} }
return iam return iam
} }

Loading…
Cancel
Save