Based on some of the information I found while working on thesetwo tickets, I think there are some changes that could be made to the env configuration used by Evaporate.
Based on my reading of the Evaporate [docs](https://github.com/TTLabs/EvaporateJS/wiki/Evaporate.create()), the cloudfront and s3Acceleration options exist only to influence the automatic creation of the URL that it eventually tries to OPTIONS/PUT/POST/etc to.
With the current settings, it's generating URLS like: https://prx-up.s3-accelerate.amazonaws.com/prod/8583b674…
Evaporate is creating virtual host-style URLs because s3Acceleration is enabled. Having cloudfront set to true also would do that, but acceleration takes precedence.
All that being said, there's no way to have it create IPv6-friendly URLs without explicitly providing an aws_url value. I think we should support that by using an aws_url like https://prx-up.s3-accelerate.dualstack.amazonaws.com. It sounds like even when you do this, you still need to keep cloudfront explicitly set to true, to prevent the bucket name from being added to the path.
The s3Acceleration option becomes unnecessary when using an explicit aws_url, as they are mutually exclusive.
I would also suggest that the env vars be renamed to include some hint that they are applying to evaporate or uploads. AWS_URL and USE_CLOUDFRONT are quite ambiguous, especially when the app does other things with AWS and CloudFront.
I can't find anywhere in Publish or Styleguide (where a lot of evaporate functionality originates) where there current USE_CLOUDFRONT or AWS_URL values are even being used.
Based on some of the information I found while working on these two tickets, I think there are some changes that could be made to the env configuration used by Evaporate.
Currently, the relevant settings are:
Based on my reading of the Evaporate [docs](https://github.com/TTLabs/EvaporateJS/wiki/Evaporate.create()), the
cloudfront
ands3Acceleration
options exist only to influence the automatic creation of the URL that it eventually tries toOPTIONS
/PUT
/POST
/etc to.With the current settings, it's generating URLS like:
https://prx-up.s3-accelerate.amazonaws.com/prod/8583b674…
Evaporate is creating virtual host-style URLs because
s3Acceleration
is enabled. Havingcloudfront
set to true also would do that, but acceleration takes precedence.All that being said, there's no way to have it create IPv6-friendly URLs without explicitly providing an
aws_url
value. I think we should support that by using anaws_url
likehttps://prx-up.s3-accelerate.dualstack.amazonaws.com
. It sounds like even when you do this, you still need to keepcloudfront
explicitly set totrue
, to prevent the bucket name from being added to the path.The
s3Acceleration
option becomes unnecessary when using an explicitaws_url
, as they are mutually exclusive.I would also suggest that the env vars be renamed to include some hint that they are applying to evaporate or uploads.
AWS_URL
andUSE_CLOUDFRONT
are quite ambiguous, especially when the app does other things with AWS and CloudFront.I can't find anywhere in Publish or Styleguide (where a lot of evaporate functionality originates) where there current
USE_CLOUDFRONT
orAWS_URL
values are even being used.