diff options
-rw-r--r-- | Remote/S3.hs | 9 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | doc/special_remotes/S3.mdwn | 3 | ||||
-rw-r--r-- | doc/todo/support_path-style_syntax_for_S3_bucket_specification/comment_1_971ab83e58128a60921e19b822323965._comment | 10 |
4 files changed, 23 insertions, 1 deletions
diff --git a/Remote/S3.hs b/Remote/S3.hs index 961f621fb..d1c6dd3df 100644 --- a/Remote/S3.hs +++ b/Remote/S3.hs @@ -431,7 +431,13 @@ withS3HandleMaybe c u a = do { managerResponseTimeout = Nothing } s3Configuration :: RemoteConfig -> S3.S3Configuration AWS.NormalQuery -s3Configuration c = (S3.s3 proto endpoint False) { S3.s3Port = port } +s3Configuration c = cfg + { S3.s3Port = port + , S3.s3RequestStyle = case M.lookup "requeststyle" c of + Just "path" -> S3.PathStyle + Just s -> error $ "bad S3 requeststyle value: " ++ s + Nothing -> S3.s3RequestStyle cfg + } where proto | port == 443 = AWS.HTTPS @@ -448,6 +454,7 @@ s3Configuration c = (S3.s3 proto endpoint False) { S3.s3Port = port } case reads s of [(p, _)] -> p _ -> error $ "bad S3 port value: " ++ s + cfg = S3.s3 proto endpoint False tryS3 :: Annex a -> Annex (Either S3.S3Error a) tryS3 a = (Right <$> a) `catch` (pure . Left) diff --git a/debian/changelog b/debian/changelog index fca0e1564..cf0a1d0cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,8 @@ git-annex (6.20160127) UNRELEASED; urgency=medium some servers. Thanks, wzhd. * WebDAV: Remove a bogus trailing slash from the end of the url to the temporary store location for a key. Thanks, wzhd. + * S3: Allow configuring with requeststyle=path to use path-style bucket + access instead of the default DNS-style access. -- Joey Hess <id@joeyh.name> Thu, 28 Jan 2016 13:53:09 -0400 diff --git a/doc/special_remotes/S3.mdwn b/doc/special_remotes/S3.mdwn index f6c01c0d0..380311508 100644 --- a/doc/special_remotes/S3.mdwn +++ b/doc/special_remotes/S3.mdwn @@ -59,6 +59,9 @@ the S3 remote. * `host` and `port` - Specify in order to use a different, S3 compatable service. +* `requeststyle` - Set to "path" to use path style requests, instead of the + default DNS style requests. This is needed with some S3 services. + * `bucket` - S3 requires that buckets have a globally unique name, so by default, a bucket name is chosen based on the remote name and UUID. This can be specified to pick a bucket name. diff --git a/doc/todo/support_path-style_syntax_for_S3_bucket_specification/comment_1_971ab83e58128a60921e19b822323965._comment b/doc/todo/support_path-style_syntax_for_S3_bucket_specification/comment_1_971ab83e58128a60921e19b822323965._comment new file mode 100644 index 000000000..3faf2e539 --- /dev/null +++ b/doc/todo/support_path-style_syntax_for_S3_bucket_specification/comment_1_971ab83e58128a60921e19b822323965._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-02-09T19:35:10Z" + content=""" +Sure, I've added that as requeststyle=path. I have not tested it, so once +you get an updated build let me know if it works. + +(Should be available in the daily linux autobuilds within about an hour.) +"""]] |