From 534354482207cc27ca830903a459d3ca47eec074 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Nov 2016 11:49:34 -0400 Subject: [PATCH] S3: Support the special case endpoint needed for the cn-north-1 region. * S3: Support the special case endpoint needed for the cn-north-1 region. * Webapp: Don't list the Frankfurt region, as this (and some other new regions) need V4 authorization which the aws library does not yet use. This commit was sponsored by Nick Daly on Patreon. --- CHANGELOG | 3 +++ Remote/Helper/AWS.hs | 9 ++++++++- ...nt_37_9fa2adc324ba25428a681158e58a5300._comment | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 doc/special_remotes/comment_37_9fa2adc324ba25428a681158e58a5300._comment diff --git a/CHANGELOG b/CHANGELOG index 56ce655841..cfba35d16e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,9 @@ git-annex (6.20161032) UNRELEASED; urgency=medium 7.3, which don't support Include. When used with an older version of ssh, any ServerAliveInterval in ~/.ssh/config will be overridden by .git/annex/ssh.config. + * S3: Support the special case endpoint needed for the cn-north-1 region. + * Webapp: Don't list the Frankfurt region, as this (and some other new + regions) need V4 authorization which the aws library does not yet use. -- Joey Hess Tue, 01 Nov 2016 14:02:06 -0400 diff --git a/Remote/Helper/AWS.hs b/Remote/Helper/AWS.hs index 4919b4b403..7d23ac63d1 100644 --- a/Remote/Helper/AWS.hs +++ b/Remote/Helper/AWS.hs @@ -50,12 +50,18 @@ regionInfo service = map (\(t, r) -> (t, fromServiceRegion r)) $ [ ("US East (N. Virginia)", [S3Region "US", GlacierRegion "us-east-1"]) , ("US West (Oregon)", [BothRegion "us-west-2"]) , ("US West (N. California)", [BothRegion "us-west-1"]) - , ("EU (Frankfurt)", [BothRegion "eu-central-1"]) , ("EU (Ireland)", [S3Region "EU", GlacierRegion "eu-west-1"]) , ("Asia Pacific (Singapore)", [S3Region "ap-southeast-1"]) , ("Asia Pacific (Tokyo)", [BothRegion "ap-northeast-1"]) , ("Asia Pacific (Sydney)", [S3Region "ap-southeast-2"]) , ("South America (São Paulo)", [S3Region "sa-east-1"]) + -- These need signature V4 support, which has not landed in + -- the aws library. + -- See https://github.com/aristidb/aws/pull/199 + -- , ("EU (Frankfurt)", [BothRegion "eu-central-1"]) + -- , ("Asia Pacific (Seoul)", [S3Region "ap-northeast-2"]) + -- , ("Asia Pacific (Mumbai)", [S3Region "ap-south-1"]) + -- , ("US East (Ohio)", [S3Region "us-east-2"]) ] fromServiceRegion (BothRegion s) = s @@ -69,6 +75,7 @@ regionInfo service = map (\(t, r) -> (t, fromServiceRegion r)) $ s3HostName :: Region -> B.ByteString s3HostName "US" = "s3.amazonaws.com" s3HostName "EU" = "s3-eu-west-1.amazonaws.com" +s3HostName "cn-north-1" = "s3.cn-north-1.amazonaws.com.cn" s3HostName r = encodeUtf8 $ T.concat ["s3-", r, ".amazonaws.com"] s3DefaultHost :: String diff --git a/doc/special_remotes/comment_37_9fa2adc324ba25428a681158e58a5300._comment b/doc/special_remotes/comment_37_9fa2adc324ba25428a681158e58a5300._comment new file mode 100644 index 0000000000..6c6acd250b --- /dev/null +++ b/doc/special_remotes/comment_37_9fa2adc324ba25428a681158e58a5300._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 37""" + date="2016-11-07T14:58:17Z" + content=""" +@bec.watson, better to open a bug report for this kind of problem. + +Seems that the [AWS library](http://hackage.haskell.org/package/aws) +that git-annex is using does not use V4 authorization yet. Work is in +progress: + +As to the endpoint hostname, that must be a special case for +China, so I've made git-annex aware of that special case. +"""]]