-
Notifications
You must be signed in to change notification settings - Fork 2k
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
add COMPANION_AWS_FORCE_PATH_STYLE support #5066
Conversation
Diff output filesdiff --git a/packages/@uppy/companion/lib/server/s3-client.js b/packages/@uppy/companion/lib/server/s3-client.js
index 7ff225f..9d6827e 100644
--- a/packages/@uppy/companion/lib/server/s3-client.js
+++ b/packages/@uppy/companion/lib/server/s3-client.js
@@ -30,6 +30,7 @@ module.exports = (companionOptions, createPresignedPostMode = false) => {
/** @type {import('@aws-sdk/client-s3').S3ClientConfig} */
let s3ClientOptions = {
region: s3.region,
+ forcePathStyle: Boolean(s3.forcePathStyle),
};
if (s3.useAccelerateEndpoint) {
// https://github.com/transloadit/uppy/issues/4809#issuecomment-1847320742
diff --git a/packages/@uppy/companion/lib/standalone/helper.js b/packages/@uppy/companion/lib/standalone/helper.js
index d42c91c..878b711 100644
--- a/packages/@uppy/companion/lib/standalone/helper.js
+++ b/packages/@uppy/companion/lib/standalone/helper.js
@@ -124,6 +124,7 @@ const getConfigFromEnv = () => {
useAccelerateEndpoint: process.env.COMPANION_AWS_USE_ACCELERATE_ENDPOINT === "true",
expires: parseInt(process.env.COMPANION_AWS_EXPIRES || "800", 10),
acl: process.env.COMPANION_AWS_ACL,
+ forcePathStyle: process.env.COMPANION_AWS_FORCE_PATH_STYLE === "true",
},
server: {
host: process.env.COMPANION_DOMAIN, |
@@ -29,6 +29,7 @@ module.exports = (companionOptions, createPresignedPostMode = false) => { | |||
/** @type {import('@aws-sdk/client-s3').S3ClientConfig} */ | |||
let s3ClientOptions = { | |||
region: s3.region, | |||
forcePathStyle: Boolean(s3.forcePathStyle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to convert it to a boolean?
forcePathStyle: Boolean(s3.forcePathStyle) | |
forcePathStyle: s3.forcePathStyle |
thanks! do you mind also updating the docs? https://github.com/transloadit/uppy.io |
The docs now live in uppy, not uppy.io |
0e2e84c
to
4b7f745
Compare
| Package | Version | Package | Version | | ---------------------- | ------- | ---------------------- | ------- | | @uppy/companion | 4.15.0 | @uppy/drag-drop | 3.1.1 | | @uppy/companion-client | 3.8.2 | @uppy/form | 3.2.2 | | @uppy/core | 3.13.1 | uppy | 3.27.2 | - @uppy/form: do not emit `'submit'` event more than once (Merlijn Vos / #5299) - @uppy/companion: add `s3.forcePathStyle` option (Nadeem Reinhardt / #5066) - meta: fix broken workflow status badges in README (Alexander Zaytsev / #5298) - @uppy/core: add `clearUploadedFiles` to type definition (Augustine Smith / #5295) - @uppy/companion: add `oauthOrigin` option (Antoine du Hamel / #5297) - meta: add dark-mode Transloadit logo in README (Alexander Zaytsev / #5291) - docs,@uppy/drag-drop: `uppy.io/docs` - fix typos/broken links (Evgenia Karunus / #5296) - meta: Bump docker/build-push-action from 6.1.0 to 6.2.0 (dependabot[bot] / #5290)
i believe this was merged prematurely |
This adds support for setting the S3 client's forcePathStyle option. That is necessary to use uppy/companion alongside localstack in development environments.
Subdomain based access to localstack S3 buckets is not supported and AWS has not announced a sunset date for path style access yet.
Alternatively, this is also possible via a Dockerfile, e.g: