Commit graph

13 commits

Author SHA1 Message Date
Prakash
12de077e6d
remove @uppy/instagram (#6257)
closes #5455 , this PR removes all Instagram support from both the
client and Companion server.

Removed:
- Instagram from @uppy/remote-sources (src, package.json, keywords)
- Instagram export from uppy bundle (bundle.ts, index.ts, package.json)
- Companion Instagram OAuth provider (provider/index.js, grant.js)
- Companion standalone helper Instagram env vars (helper.js,
env_example)
- All Companion Instagram tests (providers.test.js,
provider-manager.test.js, fixtures/index.js, mockserver.js)
2026-05-13 14:42:10 +05:30
Freeman
388f7cfe1a
@uppy/companion: add max filename length env var (#5763)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2025-05-29 10:21:19 +02:00
Dominik Schmidt
e26d1611b5
@uppy/companion: add COMPANION_TUS_DEFERRED_UPLOAD_LENGTH (#5561) 2025-01-13 10:40:40 +01:00
Nadeem Reinhardt
7c174e85b7
@uppy/companion: add s3.forcePathStyle option (#5066)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-07-02 16:13:35 +02:00
Mikael Finstad
41b8563ae2
@uppy/companion: add S3 prefix env variable (#4320)
* Adds optional COMPANION_S3_PREFIX for companion

* Fixing prefix usage

* fix implementation

* add docs

---------

Co-authored-by: Will Wilson <will.wilson@asset.tv>
2023-03-17 12:18:30 +08:00
Mikael Finstad
8c653bb099
@uppy/companion: document how to run many instances (#4227)
Co-authored-by: Kevin van Zonneveld <kevin@vanzonneveld.net>
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2023-01-04 14:01:46 +01:00
Mikael Finstad
56339fc3e5
Rewrite Companion providers to use streams to allow simultaneous upload/download without saving to disk (#3159)
* rewrite to async/await

* Only fetch size (HEAD) if needed #3034

* Update packages/@uppy/companion/src/server/controllers/url.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Change HEAD to GET in getURLMeta

and abort request immediately upon response headers received
https://github.com/transloadit/uppy/issues/3034#issuecomment-908059234

* fix lint

* fix lint

* cut off length of file names

or else we get
"MetadataTooLarge: Your metadata headers exceed the maximum allowed metadata size" in tus / S3

* try to fix flaky test

* remove iife and cleanup code a bit

* fix lint by reordering code

* rename Uploader to MultipartUploader

* Rewrite Uploader to use fs-capacitor #3098

This allows for upload to start almost immediately without having to first download the file.
And it allows for uploading bigger files, because transloadit assembly will not timeout,
as it will get upload progress events all the time.
No longer need for illusive progress.
Also fix eslint warnings and simplify logic

Still TODO: TUS pause/resume has a bug:
https://github.com/tus/tus-js-client/issues/275

* add comment in dev Dashboard and pull out variable

* fix a bug where remote xhr upload would ignore progress events in the UI

* fix bug where s3 multipart cancel wasn't working

* fix also cancel for xhr

* Rewrite providers to use streams

This removes the need for disk space as data will be buffered in memory and backpressure will be respected
https://github.com/transloadit/uppy/issues/3098#issuecomment-907763809
All providers "download" methods will now return a { stream } which can be consumed by uploader.

Also:
- Remove capacitor (no longer needed)
- Change Provider/SearchProvider API to async (Breaking change for custom companion providers)
- Fix the case with unknown length streams (zoom / google drive). Need to be downloaded first
- rewrite controllers deauth-callback, thumbnail, list, logout to async
- getURLMeta: make sure size is never NaN (NaN gets converted to null in JSON.stringify when sent to client but not when used in backend)
- fix purest mock (it wasn't returning statusCode on('response'))
- add missing http mock for "request" for THUMBNAIL_URL and http://url.myendpoint.com/file (these request errors were never caught by tests previously)
- "upload functions with tus protocol" test: move filename checking to new test where size is null. Fix broken expects
- fix some lint

* Implement streamingUpload flag

COMPANION_STREAMING_UPLOAD
Default to false due to backward compatibility
If set to true, will start to upload files at the same time as dowlnoading them, by piping the streams

- Also implement progress for downloading too
- and fix progress duplication logic
- fix test that assumed file was fully downloaded after first progress event

* rearrange validation logic

* add COMPANION_STREAMING_UPLOAD to env.test.sh too

* implement maxFileSize option in companion

for both unknown length and known length downloads

* fix bug

* fix memory leak when non 200 status

streams were being kept

* fix lint

* Add backward-compatibility for companion providers

Implement a new static field "version" on providers, which when not set to 2,
will cause a compatibility layer to be added for supporting old callback style provider api

also fix some eslint and rename some vars

* document new provider API

* remove static as it doesn't work on node 10

* try to fix build issue

* degrade to node 14 in github actions

due to hitting this error: https://github.com/nodejs/node/issues/40030
https://github.com/transloadit/uppy/pull/3159/checks?check_run_id=3544858518

* pull out duplicated logic into reusable function

* fix lint

* make methods private

* re-add unsplash download_location request

got lost in merge

* add try/catch

as suggested https://github.com/transloadit/uppy/pull/3159#discussion_r727149263

* Only set default chunkSize if needed

for being more compliant with previous behavior when streamingUpload = false

* Improve flaky test

Trying to fix this error:

FAIL packages/@uppy/utils/src/delay.test.js
  ● delay › should reject when signal is aborted

    expect(received).toBeLessThan(expected)

    Expected: < 70
    Received:   107

      32 |     const time = Date.now() - start
      33 |     expect(time).toBeGreaterThanOrEqual(30)
    > 34 |     expect(time).toBeLessThan(70)
         |                  ^
      35 |   })
      36 | })
      37 |

      at Object.<anonymous> (packages/@uppy/utils/src/delay.test.js:34:18)

https://github.com/transloadit/uppy/runs/3984613454?check_suite_focus=true

* Apply suggestions from code review

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* fix review feedback & lint

* Apply suggestions from code review

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* remove unneeded ts-ignore

* Update packages/@uppy/companion/src/server/controllers/url.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/companion/src/server/Uploader.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* reduce nesting

* fix lint

* optimize promisify

https://github.com/transloadit/uppy/pull/3159#discussion_r738160576

* Update packages/@uppy/companion/test/__tests__/uploader.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2021-11-01 16:35:25 +07:00
Carter Konz
970ac8df5b
companion,box: Box provider implementation (#2549)
* boilerplate for Box provider

TODO:
  - adapter
  - index
  - website/src/docs
  - tests

* Box provider implementation

- adapter
- index
- npm bufoonery
- lil' fixes

and MORE!

TODO:
- thumbnails 🤬
- tests
- docs

* Box provider: add brand icon, fix file icons

- token issues with thumbnail/logout

* Box provider: fix thumbnails, upload

- fix tokens for box
- implement `size()`
- make debug logging easier to find (bold blue)

learned:
- box needs cookie auth
- thumbnail requests come back as 202s

TODO:
- fix logout with form POST (zoom example)

* Box provider: fix logout

- add client info as formData to revoke post

TODO:
- tests cleanup
- package-lock fix
- docs

* Box provider: docs

TODO:
- tests

* Box provider: cleanup

TODO:
- tests

* fix error msg path for Box

- remove comment

* keeping up

- update ProviderViews import
- fix version string on Box package.json

* companion,box: exclude box from global module/examples while in beta

Co-authored-by: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
2020-11-13 15:37:00 +01:00
Shlomo Zalman Heigh
3856afa238
companion: add option to hide welcome page and metrics (#2521)
* companion: add option to hide welcome and metrics

* fix scoping error

* fix lint errors
2020-10-05 11:20:04 +01:00
mokutsu-coursera
f1ef5bd809
companion,zoom: add implementation for Zoom plugin and Zoom Provider (#2342)
* [WIP] First pass at adding zoom plugin and zoom companion service for allowing imports from zoom cloud

* WIP. Remove zoom example and move zoom companion code into core companion package, update list endpoint to retrieve based on pagination token or dates available, and get size / download endpoint working.

TO DO:
- fix logout / token expiry
- investigate why test for loading config from file is not working as expected
- confirm pagination works

* Modify provider views to allow for cases with zoom provider when insufficient results exist to enable infinite scroll (but users may need to retrieve older results), update types tests. Linters failing on the provider views files

* Update uppy and companion for the zoom integration to use folders to represent months, and retrieve 1 month at a time.

- clean up code around response data items to explicitly show fields, and match style of other provider methods
- update license date to 2020 across repo
- enable download/uploado of json timeline files
- fix companion test to load credentials from file
- remove front end code no longer required now that folders are being used instead of loading more with button

* Change initial check for user authentication to use same endpoint so we can reuse the same app permission list (ie dont require additional permissions to read user data)

* Clean up zoom provider index file, add api call back to retrieve user account information such as created timestamp and email, fix file icons, remove unused strings, remove license date updates from branch

* Add permission list to grant configurations, remove undefined response body check, update error to match style of other providers, reorder svg attribute to match other icons

* Add request to get user email address for when we are retrieving user meetings and meeting recordings within zoom provider, clean up logout api call

* Update adapter to use meeting UUID when returning the meeting id to match the meeting ID associated with the recording file meeting. This should also resolve issues around reused meeting IDs from zoom.

* Fix companion test

* uppy,robodog: do not add zoom yet

* zoom: add publishConfig

* test: remove uppy.Zoom use from typescript e2e test

Co-authored-by: Renée Kooi <renee@kooi.me>
2020-07-30 11:01:21 +01:00
ifedapoolarewaju
c3ea4d384f
companion,facebook: add support for facebook provider 2019-08-22 14:50:48 +01:00
Jonas Thelemann
a8e17bee5f
companion: Secrets From File
Make reading secrets from files specified in "..._SECRET_FILE" environment variables possible to support Docker secrets.
2019-06-05 04:04:49 +02:00
Rustam S
9cd8c519b1 Update and fix docker-compose (#1076)
* Update docker-compose.yml

* Update docker-compose-dev.yml

* Create env_example
2018-10-10 12:55:03 +02:00