Skip to content

Fixes #497 by adding support for an optional new env variable, S3_BUCKET_URL_BASE #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 13, 2017

Conversation

francisli
Copy link
Contributor

So, with these changes, you can support us-east-1 by just manually setting the S3_BUCKET_URL_BASE to https://s3.amazonaws.com/. Or, if you've got a CNAME mapped to your bucket, you can specify that instead.

Before your pull request is reviewed and merged, make sure you

  • there are no linting errors -- npm run lint
  • code is in uniquely-named feature branch, and has been rebased on top of latest master. If you're asked to make more changes make sure you rebase onto master then too!
  • pull request is descriptively named and links to an issue number, i.e. Fixes #123

Thank you!

@catarak
Copy link
Member

catarak commented Dec 8, 2017

thanks for this! can you add a a description of this variable to the README?

@francisli
Copy link
Contributor Author

Sure thing... added a new section to the README and pushed it up...

@catarak
Copy link
Member

catarak commented Dec 13, 2017

thanks!

@catarak catarak merged commit 76a81bb into processing:master Dec 13, 2017
@francisli francisli deleted the s3-cname-support branch December 15, 2017 02:21
@simonpfish
Copy link

simonpfish commented Dec 29, 2017

I see that when you set the s3bucket variable you use S3_BUCKET_URL_BASE as the full URL, which should include the bucket name in it:

const s3Bucket = process.env.S3_BUCKET_URL_BASE ||
                 `https://s3-${process.env.AWS_REGION}.amazonaws.com/${process.env.S3_BUCKET}/`;

So maybe we should rename it to S3_BUCKET_URL and update the README to be clear about this, or fix the code so that it uses it only as the base url. What do you think? I can create a new PR for fixing this.

@dhoizner
Copy link

This just bit me in the form of a few hours wrestling with what i thought was AWS being stubborn about CORS... @catarak are you hosting with buckets that are using this variable, or do you think it's safe enough to change it to actually be a base rather than the full url?

@francisli
Copy link
Contributor Author

@dhoizner Sorry to see this conversation so long after it was started (somehow Github notifications aren't always reaching me)...

I think @simonpfish is correct that better naming and documentation of the variable is needed. However, updating the code to always append it with the S3_BUCKET would break its use with custom CNAME mapped buckets.

@dhoizner
Copy link

@francisli ah, good call! For now I added a bit to the README in #1475

@catarak
Copy link
Member

catarak commented Jun 29, 2020

This just bit me in the form of a few hours wrestling with what i thought was AWS being stubborn about CORS...

Sorry the documentation wasn't clear!! Thank you for updating it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants