Git Product home page Git Product logo

Comments (5)

dup2 avatar dup2 commented on June 13, 2024 1

I implemented a custom storage backend for all this which was the easiest way IMHO.

Resumable SHA256 can be achieved by using FFI and dumping/reading the memory of the SHA256_CTX into a file to resume processing, it obviously depends on chunk order.

Thanks for your support and implementation of the server!

from tus-ruby-server.

janko avatar janko commented on June 13, 2024

If all individual chunks passed checksum validation, doesn't that mean the whole upload passed it too? Why is additionally validating the total checksum at the end needed?

from tus-ruby-server.

dup2 avatar dup2 commented on June 13, 2024

Thanks for the fast reply!

It is meant for post-processing and later reference - i.e. we keep the checksum in a journal, use it for signing the document etc in the application. It is not meant for validating the upload but rather for later usage in the application where it would be very handy to have it computed on the fly instead of having to do a full pass later on when the file is uploaded.

We did use the nginx-upload-module which provides this (but does not provide chunk based resumable upload) so I'm looking into a way to provide this as well.

from tus-ruby-server.

janko avatar janko commented on June 13, 2024

Aha, I understand. For the request body IO objects that are rewindable (depends on the web server and its configuration), a hook triggered after upload might work. The only thing is that I don't know how you would resume calculating the hash between requests.

Alternatively, it could be possible to override the #patch_file method on the storage object, and update the info hash passed as the argument there after upload.

from tus-ruby-server.

dup2 avatar dup2 commented on June 13, 2024

Thanks for this information - is the hook "after_upload" already available?

Resume calculating the hash would work by dumping/reading the OpenSSL SHA256_CTX context but I see now that with ruby, I can not get hold of it in an easy way..

from tus-ruby-server.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.