From 0f02c9540c633b46256ec486ec8ab967ed9050f8 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 9 Oct 2018 13:03:37 +0100 Subject: [PATCH] s3: make --s3-v2-auth flag This is an alternative to setting the region to "other-v2-signature" which is inconvenient for multi-region providers. --- backend/s3/s3.go | 13 ++++++++++++- docs/content/s3.md | 14 ++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 0d4ab1521..0da73a151 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -582,6 +582,16 @@ for more info. Some providers (eg Aliyun OSS or Netease COS) require this set to false.`, Default: true, Advanced: true, + }, { + Name: "v2_auth", + Help: `If true use v2 authentication. + +If this is false (the default) then rclone will use v4 authentication. +If it is set then rclone will use v2 authentication. + +Use this only if v4 signatures don't work, eg pre Jewel/v10 CEPH.`, + Default: false, + Advanced: true, }}, }) } @@ -616,6 +626,7 @@ type Options struct { SessionToken string `config:"session_token"` UploadConcurrency int `config:"upload_concurrency"` ForcePathStyle bool `config:"force_path_style"` + V2Auth bool `config:"v2_auth"` } // Fs represents a remote s3 server @@ -790,7 +801,7 @@ func s3Connection(opt *Options) (*s3.S3, *session.Session, error) { // awsConfig.WithLogLevel(aws.LogDebugWithSigning) ses := session.New() c := s3.New(ses, awsConfig) - if opt.Region == "other-v2-signature" { + if opt.V2Auth || opt.Region == "other-v2-signature" { fs.Debugf(nil, "Using v2 auth") signer := func(req *request.Request) { // Ignore AnonymousCredentials object diff --git a/docs/content/s3.md b/docs/content/s3.md index a59851952..cfb640390 100644 --- a/docs/content/s3.md +++ b/docs/content/s3.md @@ -894,6 +894,20 @@ Some providers (eg Aliyun OSS or Netease COS) require this set to false. - Type: bool - Default: true +#### --s3-v2-auth + +If true use v2 authentication. + +If this is false (the default) then rclone will use v4 authentication. +If it is set then rclone will use v2 authentication. + +Use this only if v4 signatures don't work, eg pre Jewel/v10 CEPH. + +- Config: v2_auth +- Env Var: RCLONE_S3_V2_AUTH +- Type: bool +- Default: false + ### Anonymous access to public buckets ###