fix back-compat with old git-annex
Unfortunately, "port" has to be set by default, or the old git-annex will crash when trying to enable the S3 remote. So, when protocol=https is specified, it needs to override port=80, since it may be a default setting.
This commit is contained in:
parent
2a99d7ffc0
commit
06cbaa4233
1 changed files with 8 additions and 1 deletions
|
@ -146,6 +146,7 @@ s3Setup' ss u mcreds c gc
|
|||
[ ("datacenter", T.unpack $ AWS.defaultRegion AWS.S3)
|
||||
, ("storageclass", "STANDARD")
|
||||
, ("host", AWS.s3DefaultHost)
|
||||
, ("port", "80")
|
||||
, ("bucket", defbucket)
|
||||
]
|
||||
|
||||
|
@ -581,7 +582,13 @@ s3Configuration c = cfg
|
|||
port = case M.lookup "port" c of
|
||||
Just s ->
|
||||
case reads s of
|
||||
[(p, _)] -> p
|
||||
[(p, _)]
|
||||
-- Let protocol setting override
|
||||
-- default port 80.
|
||||
| p == 80 -> case cfgproto of
|
||||
Just AWS.HTTPS -> 443
|
||||
_ -> p
|
||||
| otherwise -> p
|
||||
_ -> giveup $ "bad S3 port value: " ++ s
|
||||
Nothing -> case cfgproto of
|
||||
Just AWS.HTTPS -> 443
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue