next-s3-upload icon indicating copy to clipboard operation
next-s3-upload copied to clipboard

Enable S3 IPv6 support

Open miyurusankalpa opened this issue 2 years ago • 3 comments

Added option to use IPv6 enabled dual-stack endpoints.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/dual-stack-endpoints.html#dual-stack-endpoints-description

miyurusankalpa avatar Sep 02 '21 06:09 miyurusankalpa

Thanks for the PR!

Could you explain the bug that this PR fixes? I think using dualstack is fine, but it also changes the hostname of the uploaded file, which will potentially break existing users next/image configuration.

Just wanting a little more context around this before we make dualstack the default option.

ryanto avatar Sep 03 '21 15:09 ryanto

I have a IPv6 only server that was failing to connect to the s3 endpoint as it was not IPv6 enabled.

You have a valid point regarding the next/image configuration and I think the best way to move forward is,

  1. Update the readme to handle the dualstack domains.
  2. Adding the dualstack endpoint as env variable.
  3. Set it to false by default now and set to true it at a later release.

miyurusankalpa avatar Sep 05 '21 17:09 miyurusankalpa

Ok thanks! That makes a lot of sense.

I think it's best to let users opt into dual stack, similar how the S3 doesn't use dual stack by default but lets users opt in.

The easiest way to do this would be to change the uploadToS3 function to accept optional options. Something like...

uploadToS3(file, { useDualstack: true });

Let me know if you want to do this.

Oh also, I think it's a great idea to still add the dual stack domain to the README... this will make it easier for us switch it in the future if needed.

ryanto avatar Sep 06 '21 16:09 ryanto

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
next-s3-upload ❌ Failed (Inspect) Dec 20, 2022 at 6:50PM (UTC)

vercel[bot] avatar Dec 20 '22 09:12 vercel[bot]