diff --git a/.env.example b/.env.example index f5a27d4186..656dbba063 100644 --- a/.env.example +++ b/.env.example @@ -14,12 +14,26 @@ COMPANION_SECRET=development # NOTE: Only enable this in development. Enabling it in production is a security risk COMPANION_ALLOW_LOCAL_URLS=true -COMPANION_DROPBOX_KEY=*** -COMPANION_DROPBOX_SECRET=*** +# to enable S3 +COMPANION_AWS_KEY="YOUR AWS KEY" +COMPANION_AWS_SECRET="YOUR AWS SECRET" +# specifying a secret file will override a directly set secret +# COMPANION_AWS_SECRET_FILE="PATH/TO/AWS/SECRET/FILE" +COMPANION_AWS_BUCKET="YOUR AWS S3 BUCKET" +COMPANION_AWS_REGION="AWS REGION" +# to enable S3 Transfer Acceleration (default: false) +# COMPANION_AWS_USE_ACCELERATE_ENDPOINT="false" +# to set X-Amz-Expires query param in presigned urls (in seconds, default: 300) +# COMPANION_AWS_EXPIRES="300" +# to set a canned ACL for uploaded objects: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +# COMPANION_AWS_ACL="public-read" COMPANION_BOX_KEY=*** COMPANION_BOX_SECRET=*** +COMPANION_DROPBOX_KEY=*** +COMPANION_DROPBOX_SECRET=*** + COMPANION_GOOGLE_KEY=*** COMPANION_GOOGLE_SECRET=*** diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 9a440323dd..4f60669130 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -45,11 +45,24 @@ jobs: env: COMPANION_UNSPLASH_KEY: ${{secrets.COMPANION_UNSPLASH_KEY}} COMPANION_UNSPLASH_SECRET: ${{secrets.COMPANION_UNSPLASH_SECRET}} + VITE_COMPANION_URL: http://localhost:3020 VITE_TRANSLOADIT_KEY: ${{secrets.TRANSLOADIT_KEY}} VITE_TRANSLOADIT_SECRET: ${{secrets.TRANSLOADIT_SECRET}} VITE_TRANSLOADIT_TEMPLATE: ${{secrets.TRANSLOADIT_TEMPLATE}} VITE_TRANSLOADIT_SERVICE_URL: ${{secrets.TRANSLOADIT_SERVICE_URL}} - CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_RECORD_KEY}} + COMPANION_AWS_KEY: ${{secrets.COMPANION_AWS_KEY}} + COMPANION_AWS_SECRET: ${{secrets.COMPANION_AWS_SECRET}} + COMPANION_AWS_BUCKET: ${{secrets.COMPANION_AWS_BUCKET}} + COMPANION_AWS_REGION: ${{secrets.COMPANION_AWS_REGION}} + COMPANION_AWS_DISABLE_ACL: 'true' + - name: Upload videos in case of failure + uses: actions/upload-artifact@v3 + if: failure() + with: + name: videos-and-screenshots + path: | + e2e/cypress/videos/ + e2e/cypress/screenshots/ - name: Remove 'pending end-to-end tests' label # Remove the 'pending end-to-end tests' label if tests ran successfully if: github.event.pull_request && contains(github.event.pull_request.labels.*.name, 'pending end-to-end tests') diff --git a/e2e/clients/dashboard-aws-multipart/app.js b/e2e/clients/dashboard-aws-multipart/app.js new file mode 100644 index 0000000000..de5bac4cbb --- /dev/null +++ b/e2e/clients/dashboard-aws-multipart/app.js @@ -0,0 +1,16 @@ +import { Uppy } from '@uppy/core' +import Dashboard from '@uppy/dashboard' +import AwsS3 from '@uppy/aws-s3-multipart' + +import '@uppy/core/dist/style.css' +import '@uppy/dashboard/dist/style.css' + +const uppy = new Uppy() + .use(Dashboard, { target: '#app', inline: true }) + .use(AwsS3, { + limit: 2, + companionUrl: process.env.VITE_COMPANION_URL, + }) + +// Keep this here to access uppy in tests +window.uppy = uppy diff --git a/e2e/clients/dashboard-aws-multipart/index.html b/e2e/clients/dashboard-aws-multipart/index.html new file mode 100644 index 0000000000..ff8fd1dd5e --- /dev/null +++ b/e2e/clients/dashboard-aws-multipart/index.html @@ -0,0 +1,11 @@ + + + + + dashboard-aws-multipart + + + +
+ + diff --git a/e2e/clients/dashboard-aws/app.js b/e2e/clients/dashboard-aws/app.js new file mode 100644 index 0000000000..9a4307126d --- /dev/null +++ b/e2e/clients/dashboard-aws/app.js @@ -0,0 +1,16 @@ +import { Uppy } from '@uppy/core' +import Dashboard from '@uppy/dashboard' +import AwsS3 from '@uppy/aws-s3' + +import '@uppy/core/dist/style.css' +import '@uppy/dashboard/dist/style.css' + +const uppy = new Uppy() + .use(Dashboard, { target: '#app', inline: true }) + .use(AwsS3, { + limit: 2, + companionUrl: process.env.VITE_COMPANION_URL, + }) + +// Keep this here to access uppy in tests +window.uppy = uppy diff --git a/e2e/clients/dashboard-aws/index.html b/e2e/clients/dashboard-aws/index.html new file mode 100644 index 0000000000..4b14700fda --- /dev/null +++ b/e2e/clients/dashboard-aws/index.html @@ -0,0 +1,11 @@ + + + + + dashboard-aws + + + +
+ + diff --git a/e2e/clients/index.html b/e2e/clients/index.html index 695aa3277c..26f3296753 100644 --- a/e2e/clients/index.html +++ b/e2e/clients/index.html @@ -8,6 +8,8 @@

Test apps