Skip to content

Commit

Permalink
Merge branch 'main' into provider-view-load-all-files
Browse files Browse the repository at this point in the history
* 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
Murderlon committed Jul 10, 2023
2 parents 8d3ed92 + c7a77a9 commit 4ae3544
Show file tree
Hide file tree
Showing 82 changed files with 1,148 additions and 772 deletions.
13 changes: 13 additions & 0 deletions .yarn/patches/start-server-and-test-npm-1.14.0-841aa34fdf.patch
@@ -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
}

/**
2 changes: 1 addition & 1 deletion BUNDLE-README.md
@@ -1,7 +1,7 @@
# Uppy

Hi, thanks for trying out the bundled version of the Uppy File Uploader. You can use
this from a CDN (`<script src="https://releases.transloadit.com/uppy/v3.10.0/uppy.min.js"></script>`) or bundle it with your webapp.
this from a CDN (`<script src="https://releases.transloadit.com/uppy/v3.11.0/uppy.min.js"></script>`) or bundle it with your webapp.

Note that the recommended way to use Uppy is to install it with yarn/npm and use a
bundler like Webpack so that you can create a smaller custom build with only the
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,43 @@ Please add your entries in this format:

In the current stage we aim to release a new version at least every month.

## 3.11.0

Released: 2023-07-06

| Package | Version | Package | Version |
| ---------------------- | ------- | ---------------------- | ------- |
| @uppy/aws-s3 | 3.2.1 | @uppy/golden-retriever | 3.1.0 |
| @uppy/aws-s3-multipart | 3.4.1 | @uppy/status-bar | 3.2.1 |
| @uppy/companion | 4.6.0 | @uppy/tus | 3.1.2 |
| @uppy/companion-client | 3.2.0 | @uppy/xhr-upload | 3.3.1 |
| @uppy/core | 3.3.0 | uppy | 3.11.0 |

- @uppy/companion: fix infinite recursion in uploader test (Mikael Finstad / #4536)
- @uppy/xhr-upload: export `Headers` type (Masum ULU / #4549)
- @uppy/aws-s3-multipart: increase priority of abort and complete (Stefan Schonert / #4542)
- @uppy/aws-s3: fix remote uploads (Antoine du Hamel / #4546)
- meta: use `corepack yarn` instead of `npm` to launch E2E (Antoine du Hamel / #4545)
- @uppy/aws-s3-multipart: fix upload retry using an outdated ID (Antoine du Hamel / #4544)
- @uppy/status-bar: remove throttled component (Artur Paikin / #4396)
- @uppy/aws-s3-multipart: fix Golden Retriever integration (Antoine du Hamel / #4526)
- examples/aws-nodejs: merge multipart and non-multipart examples (Antoine du Hamel / #4521)
- @uppy/companion: bump semver from 7.3.7 to 7.5.3 (dependabot[bot] / #4529)
- @uppy/aws-s3-multipart: add types to internal fields (Antoine du Hamel / #4535)
- examples/aws-nodejs: update README (Antoine du Hamel / #4534)
- examples/aws-nodejs: showcase an example without preflight requests (Antoine du Hamel / #4516)
- @uppy/aws-s3-multipart: fix pause/resume (Antoine du Hamel / #4523)
- @uppy/status-bar: fix ETA when Uppy recovers its state (Antoine du Hamel / #4525)
- @uppy/aws-s3-multipart: fix resume single-chunk multipart uploads (Antoine du Hamel / #4528)
- @uppy/companion: fix part listing in s3 (Antoine du Hamel / #4524)
- example/aws-php: make it forward-compatible with the next Uppy major (Antoine du Hamel / #4522)
- @uppy/golden-retriever: refactor to modernize the codebase (Antoine du Hamel / #4520)
- examples/aws-nodejs: upgrade to AWS-SDK v3 (Antoine du Hamel / #4515)
- @uppy/companion: implement refresh for authentication tokens (Mikael Finstad / #4448)
- @uppy/aws-s3-multipart: disable pause/resume for remote uploads in the UI (Artur Paikin / #4500)
- @uppy/tus: retry on 423 HTTP error code (Antoine du Hamel / #4512)


## 3.10.0

Released: 2023-06-19
Expand Down
98 changes: 49 additions & 49 deletions README.md

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions e2e/cypress/integration/dashboard-aws-multipart.spec.ts
Expand Up @@ -34,8 +34,9 @@ describe('Dashboard with @uppy/aws-s3-multipart', () => {

cy.intercept('POST', '/s3/multipart', { statusCode: 200, times: 1, body: JSON.stringify({ key:'mocked-key-attempt1', uploadId:'mocked-uploadId-attempt1' }) }).as('createMultipartUpload-attempt1')
cy.intercept('GET', '/s3/multipart/mocked-uploadId-attempt1/1?key=mocked-key-attempt1', { forceNetworkError: true }).as('signPart-fails')
cy.intercept('DELETE', '/s3/multipart/mocked-uploadId-attempt1?key=mocked-key-attempt1', { statusCode: 200, body: '{}' }).as('abortAttempt-1')
cy.get('.uppy-StatusBar-actions > .uppy-c-btn').click()
cy.wait(['@createMultipartUpload-attempt1', '@signPart-fails'])
cy.wait(['@createMultipartUpload-attempt1', '@signPart-fails', '@abortAttempt-1'])
cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Upload failed')

cy.intercept('POST', '/s3/multipart', { statusCode: 200, times: 1, body: JSON.stringify({ key:'mocked-key-attempt2', uploadId:'mocked-uploadId-attempt2' }) }).as('createMultipartUpload-attempt2')
Expand All @@ -46,9 +47,10 @@ describe('Dashboard with @uppy/aws-s3-multipart', () => {
},
body: JSON.stringify({ url:'/put-fail', expires:8 }),
}).as('signPart-toFail')
cy.intercept('DELETE', '/s3/multipart/mocked-uploadId-attempt2?key=mocked-key-attempt2', { statusCode: 200, body: '{}' }).as('abortAttempt-2')
cy.intercept('PUT', '/put-fail', { forceNetworkError: true }).as('put-fails')
cy.get('.uppy-StatusBar-actions > .uppy-c-btn').click()
cy.wait(['@createMultipartUpload-attempt2', '@signPart-toFail', ...Array(5).fill('@put-fails')], { timeout: 10_000 })
cy.wait(['@createMultipartUpload-attempt2', '@signPart-toFail', ...Array(5).fill('@put-fails'), '@abortAttempt-2'], { timeout: 10_000 })
cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Upload failed')

cy.intercept('GET', '/s3/multipart/mocked-uploadId-attempt2/1?key=mocked-key-attempt2', {
Expand All @@ -66,7 +68,7 @@ describe('Dashboard with @uppy/aws-s3-multipart', () => {
}).as('put-attempt2')
cy.intercept('POST', '/s3/multipart/mocked-uploadId-attempt2/complete?key=mocked-key-attempt2', { forceNetworkError: true }).as('completeMultipartUpload-fails')
cy.get('.uppy-StatusBar-actions > .uppy-c-btn').click()
cy.wait(['@createMultipartUpload-attempt2', '@signPart-attempt2', '@put-attempt2', '@completeMultipartUpload-fails'])
cy.wait(['@createMultipartUpload-attempt2', '@signPart-attempt2', '@put-attempt2', '@completeMultipartUpload-fails', '@abortAttempt-2'])
cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Upload failed')

cy.intercept('POST', '/s3/multipart', { statusCode: 200, times: 1, body: JSON.stringify({ key:'mocked-key-attempt3', uploadId:'mocked-uploadId-attempt3' }) }).as('createMultipartUpload-attempt3')
Expand Down
123 changes: 65 additions & 58 deletions examples/aws-nodejs/README.md
@@ -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._

0 comments on commit 4ae3544

Please sign in to comment.