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

tus 1.0 compatibility? #20

Open
kvz opened this issue Sep 5, 2017 · 10 comments
Open

tus 1.0 compatibility? #20

kvz opened this issue Sep 5, 2017 · 10 comments

Comments

@kvz
Copy link

kvz commented Sep 5, 2017

Hi, have/would you consider(ed) https://tus.io compatibility?

@pgaertig
Copy link
Owner

pgaertig commented Sep 5, 2017

Hi, Absolutely there is an option to gradually adopt NBU as TUS-compatible server mostly for benefit of available client libraries (uppy!). BTW I was considering TUS for other private project a few years ago, however still there was a need of resumable SHA1/CRC32 for efficient content addressable storage.

@kvz
Copy link
Author

kvz commented Sep 5, 2017

That's awesome! Would be great to list you over at https://tus.io/implementations.html, I'm sure a good share of people would prefer plugging tus support into their existing nginx setup, vs running dedicated upload servers in addition to their webservers.

If there's anything that we (as tus creators, but unfortunately no lua/nginx experts) can do to assist I'd love to hear.

PS, have you seen our checksum extension? Would that cater to your crc32 needs? (admittedly I'm not entirely sure yet what the objective there)

@pgaertig
Copy link
Owner

pgaertig commented Sep 5, 2017

You use checksums as chunk integrity check, am I right? Here, otther than integrity, CRC32 is calculated to feed on-the-fly resumable ZIP downloads with mod_zip, then SHA1 makes use in content-addressable storages, deduplication etc. Both are currently calculated on-the-fly over entire stream with resumability. That especially pays off with large (>1GB) files where back-end doesn't have to access files again to recalculate these checksums.

Aside, I think TUS-only fork would be more appropriate as mixing two possibly conflicting protocols would increase the effort and complexity of this module. By the way Lua/nginx knowledge is less than week effort, worth to comprehend for some other hiperf nginx plumbing. Just joined your slack to keep in touch.

@kvz
Copy link
Author

kvz commented Sep 5, 2017

That sounds really good! And welcome to our community 👌 /cc @Acconut

@Acconut
Copy link

Acconut commented Sep 7, 2017

You use checksums as chunk integrity check, am I right?

Yes, you are.

Here, otther than integrity, CRC32 is calculated to feed on-the-fly resumable ZIP downloads with mod_zip, then SHA1 makes use in content-addressable storages, deduplication etc. Both are currently calculated on-the-fly over entire stream with resumability. That especially pays off with large (>1GB) files where back-end doesn't have to access files again to recalculate these checksums.

That's a very interesting situation. However, I believe that computing the CRC32 and SHA1 is the responsibility of only the server. What role should the client have in this case?

Aside, I think TUS-only fork would be more appropriate as mixing two possibly conflicting protocols would increase the effort and complexity of this module.

I agree, this makes sense.

Just joined your slack to keep in touch.

Welcome :)

@mmatuska
Copy link
Contributor

mmatuska commented Sep 26, 2019

I have started looking into this and done some first coding.

@pgaertig tus requires the upload offset ("Upload-Offset") to be reported to the client on a HEAD request (and on PATCH request of course). How can I get that information from the storage backend to the request processor in headers state? If this issue is resolved it should be pretty easy to add tus compatibility. An OPTIONS request will deliver necessary information to the tus client and all other request will need to include the "Tus-Resumable: 1.0.0" header.

The Upload-Offset combined with Content-Length and Upload-Length can be used to calculate the range values. This is pretty portable.

In tus there is no Session-ID, but a final URL path is used instead (e.g. http://somehost/upload/abcdefgh12345678). We could consider the path as the Session-ID, this will work and make it compatilbe with current code.

@Acconut
Copy link

Acconut commented Sep 27, 2019

@mmatuska Nice plan 👍 Just wanted to offer my help if you have a question regarding tus itself!

@mmatuska
Copy link
Contributor

@Acconut looks like reimplementing from scratch is going to be easier. But this module is a big inspiration for that. I am considering introducing a lua-resty-tus module. For starters I will support creation, checksum and termination extensions.

By the way protocol.md is missing the description of the creation-with-upload extension.

@mmatuska
Copy link
Contributor

@Acconut
Copy link

Acconut commented Sep 30, 2019

Amazing work!

By the way protocol.md is missing the description of the creation-with-upload extension.

That's correct. It still lives inside a PR (tus/tus-resumable-upload-protocol#88) since we haven't been able to test its effectiveness in a proper production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants