Skip to content
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

Adds optional COMPANION_S3_PREFIX for companion #4312

Closed
wants to merge 2 commits into from
Closed

Adds optional COMPANION_S3_PREFIX for companion #4312

wants to merge 2 commits into from

Conversation

mojowill
Copy link
Contributor

@mojowill mojowill commented Feb 9, 2023

As per #4050 this adds an optional environment variable that can be used when in standalone server mode to set the AWS S3 Prefix for a file.

* @returns {string}
*/
function getS3Prefix () {
return `${process.env.COMPANION_S3_PREFIX}/ || ''`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the pr! did you actually test this? 😅

`${undefined}/ || ''` becomes "undefined/ || ''"

`${'myprefix'}/ || ''` becomes "myprefix/ || ''"

on another note I think we shouldn't put env variables inside getS3Prefix because this function is also used by the non-standalone companion, which doesn't use process.env at all. I think the prefix should be an argument to defaultGetKey

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not gonna lie. No I didn't test. It was a very quick attempt to get the ball rolling. Plus too many years as a manager means I am definitely not a Javascript developer!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mifi Had another crack

mifi added a commit to transloadit/uppy.io that referenced this pull request Feb 15, 2023
@mifi
Copy link
Contributor

mifi commented Feb 15, 2023

thanks! there was still some issues so I had to make some edits, but you haven't allowed me to push to your PR branch so I created a new PR: #4320 - closing this

@mifi mifi closed this Feb 15, 2023
@mojowill mojowill deleted the s3-prefixes branch March 15, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants