-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into provider-view-load-all-files
* main: (24 commits) Add missing pt-BR locales for ImageEditor plugin (#4558) Release: uppy@3.11.0 (#4550) @uppy/companion: fix infinite recursion in uploader test (#4536) @uppy/xhr-upload: export `Headers` type (#4549) @uppy/aws-s3-multipart: increase priority of abort and complete (#4542) @uppy/aws-s3: fix remote uploads (#4546) meta: use `corepack yarn` instead of `npm` to launch E2E (#4545) @uppy/aws-s3-multipart: fix upload retry using an outdated ID (#4544) @uppy/status-bar: remove throttled component (#4396) @uppy/aws-s3-multipart: fix Golden Retriever integration (#4526) examples/aws-nodejs: merge multipart and non-multipart examples (#4521) @uppy/companion: bump semver from 7.3.7 to 7.5.3 (#4529) @uppy/aws-s3-multipart: add types to internal fields (#4535) examples/aws-nodejs: update README (#4534) examples/aws-nodejs: showcase an example without preflight requests (#4516) @uppy/aws-s3-multipart: fix pause/resume (#4523) @uppy/status-bar: fix ETA when Uppy recovers its state (#4525) @uppy/aws-s3-multipart: fix resume single-chunk multipart uploads (#4528) @uppy/companion: fix part listing in s3 (#4524) example/aws-php: make it forward-compatible with the next Uppy major (#4522) ...
- Loading branch information
Showing
82 changed files
with
1,148 additions
and
772 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
.yarn/patches/start-server-and-test-npm-1.14.0-841aa34fdf.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/src/utils.js b/src/utils.js | ||
index 1f636c6617a71a68318dc587a1c9e6081020f9aa..b28e840ed08f26a4eadd242a6f541fbaefea0eda 100644 | ||
--- a/src/utils.js | ||
+++ b/src/utils.js | ||
@@ -112,7 +112,7 @@ const getArguments = cliArgs => { | ||
} | ||
|
||
function normalizeCommand (command) { | ||
- return UTILS.isPackageScriptName(command) ? `npm run ${command}` : command | ||
+ return UTILS.isPackageScriptName(command) ? `corepack yarn ${command}` : command | ||
} | ||
|
||
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,109 @@ | ||
# Uppy + AWS S3 with Node.JS | ||
|
||
A simple and fully working example of Uppy and AWS S3 storage with Node.js (and Express.js) It uses presigned URL at the backend level. | ||
A simple and fully working example of Uppy and AWS S3 storage with Node.js (and | ||
Express.js). It uses presigned URL at the backend level. | ||
|
||
This README file starts with AWS as this one need to be resolved first. | ||
## AWS Configuration | ||
|
||
# AWS Configuration | ||
It's assumed that you are familiar with AWS, at least, with the storage service | ||
(S3) and users & policies (IAM). | ||
|
||
It's assumed that you are familiar with AWS, at least, with the storage service (S3) and users & policies (IAM). | ||
These instructions are **not fit for production** but tightening the security is | ||
out of the scope here. | ||
|
||
These instructions are not fit for production but tightening the security is out of the scope here. | ||
|
||
## S3 Setup | ||
### S3 Setup | ||
|
||
- Create new S3 bucket in AWS (e.g. `aws-nodejs`). | ||
- Add a bucket policy. | ||
```{ | ||
|
||
```json | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "PublicAccess", | ||
"Effect": "Allow", | ||
"Principal": "*", | ||
"Action": "s3:GetObject", | ||
"Resource": "arn:aws:s3:::aws-nodejs/*" | ||
} | ||
{ | ||
"Sid": "PublicAccess", | ||
"Effect": "Allow", | ||
"Principal": "*", | ||
"Action": "s3:GetObject", | ||
"Resource": "arn:aws:s3:::aws-nodejs/*" | ||
} | ||
] | ||
} | ||
``` | ||
} | ||
``` | ||
|
||
- Make the S3 bucket public. | ||
- Add CORS configuration. | ||
```[ | ||
|
||
```json | ||
[ | ||
{ | ||
"AllowedHeaders": [ | ||
"*" | ||
], | ||
"AllowedMethods": [ | ||
"GET", | ||
"PUT", | ||
"HEAD", | ||
"POST", | ||
"DELETE" | ||
], | ||
"AllowedOrigins": [ | ||
"*" | ||
], | ||
"ExposeHeaders": [] | ||
"AllowedHeaders": ["*"], | ||
"AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], | ||
"AllowedOrigins": ["*"], | ||
"ExposeHeaders": [] | ||
} | ||
] | ||
``` | ||
] | ||
``` | ||
|
||
## AWS Credentials | ||
### AWS Credentials | ||
|
||
You may use existing AWS credentials or create a new user in the IAM page. | ||
|
||
- Make sure you setup the AWS credentials properly and write down the Access Key ID and Secret Access Key. | ||
- You may configure AWS S3 credentials using [environment variables](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-environment.html) or a [credentials file in `~/.aws/credentials`](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html). | ||
- Make sure you setup the AWS credentials properly and write down the Access Key | ||
ID and Secret Access Key. | ||
- You may configure AWS S3 credentials using | ||
[environment variables](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-environment.html) | ||
or a | ||
[credentials file in `~/.aws/credentials`](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html). | ||
- You will need at least `PutObject` and `PutObjectAcl` permissions. | ||
```{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "VisualEditor0", | ||
"Effect": "Allow", | ||
"Action": [ | ||
"s3:PutObject", | ||
"s3:PutObjectAcl" | ||
], | ||
"Resource": "arn:aws:s3:::aws-nodejs/*" | ||
} | ||
] | ||
|
||
```json | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "VisualEditor0", | ||
"Effect": "Allow", | ||
"Action": ["s3:PutObject", "s3:PutObjectAcl"], | ||
"Resource": "arn:aws:s3:::aws-nodejs/*" | ||
} | ||
] | ||
} | ||
``` | ||
# Install | ||
|
||
## Prerequisites | ||
|
||
Download this code or clone repository into a folder and install dependencies: | ||
|
||
```bash | ||
corepack yarn install | ||
```sh | ||
CYPRESS_INSTALL_BINARY=0 corepack yarn install | ||
``` | ||
|
||
Add a `.env` file to the root directory and define the S3 bucket name and port variables like the example below: | ||
Add a `.env` file to the root directory and define the S3 bucket name and port | ||
variables like the example below: | ||
|
||
``` | ||
S3_BUCKET=aws-nodejs | ||
COMPANION_AWS_BUCKET=aws-nodejs | ||
COMPANION_AWS_REGION=… | ||
COMPANION_AWS_KEY=… | ||
COMPANION_AWS_SECRET=… | ||
PORT=8080 | ||
``` | ||
|
||
# Enjoy it | ||
N.B.: This example uses `COMPANION_AWS_` environnement variables to facilitate | ||
integrations with other examples in this repository, but this example does _not_ | ||
uses Companion at all. | ||
|
||
## Enjoy it | ||
|
||
Start the application: | ||
|
||
```bash | ||
```sh | ||
corepack yarn workspace @uppy-example/aws-nodejs start | ||
``` | ||
|
||
Dashboard demo should now be available at http://localhost:8080. | ||
|
||
You have also a Drag & Drop demo on http://localhost:8080/drag. | ||
|
||
*Feel free to check how the demo works and feel free to open an issue.* | ||
_Feel free to check how the demo works and feel free to open an issue._ |
Oops, something went wrong.