Closed joeyh closed 1 year ago
Fixing this seems to need an additional field in S3Configuration
s3Region :: Maybe ByteString
And then:
region = fromMaybe (s3ExtractRegion s3Endpoint) s3Region
Apparently it's common for other S3 libraries/utilities to support an environment variable AWS_DEFAULT_REGION
for this. I don't think that aws necessarily needs to support that environment variable, but that shows that it's common enough to need to set the region to something custom that other libraries support it.
https://garagehq.deuxfleurs.fr/ is a S3 implementation that requires queries to have a region such as "garage". When running that server on example.com, it is not possible to use this library to send such a query.
The problem is that s3SignQuery has
And s3Endpoint has to be a hostname, because it's also used to get the host:
So, s3Endpoint has to be "example.com", but then s3ExtractRegion will also use "example.com", there is no way to get
region = "garage"
.An example of this bug affecting a git-annex user: https://git-annex.branchable.com/bugs/S3_remote_errors_with_garage_endpoint/