GithubHelp home page GithubHelp logo

signalapp / tus-server Goto Github PK

View Code? Open in Web Editor NEW
21.0 5.0 6.0 286 KB

An implementation of the TUS server protocol for resumable uploads

License: GNU Affero General Public License v3.0

TypeScript 100.00%

tus-server's Introduction

Overview

tus-server provides an implementation of the TUS protocol for resumable uploads built on cloudflare workers and R2.

Building

You'll need Node.js. If you use nvm run

nvm use

To install dependencies,

npm install

In order to deploy to cloudflare or use non-local dev mode, use the wrangler utility. Follow those instructions to authenticate with your cloudflare account.

Testing

The server assumes an authentication is provided via a signature using a shared secret. You can provide one for development by setting SHARED_AUTH_SECRET in .dev.vars, e.g.

> cat .dev.vars
SHARED_AUTH_SECRET = "test"

To run a dev server you can interact with over localhost

wrangler dev

To run unit tests,

npm test

Deploying

One time setup

  1. Create an R2 bucket and update the binding in wrangler.toml
  2. Add a base64 encoded shared auth secret with wrangler secret put SHARED_AUTH_SECRET
wrangler deploy -e <staging|production>

License

Copyright 2023 Signal Messenger, LLC

Licensed under the AGPLv3

tus-server's People

Contributors

ravi-signal avatar eager-signal avatar

Stargazers

George Kontridze avatar Frank Faubert avatar Jérémy Le Mardelé avatar Dennis Fundi avatar  avatar Daniel Sirakov avatar Grant Burry avatar Chloe Arciniega avatar naporitan avatar Phillip Jones avatar Ashlynne Mitchell avatar Kot C avatar Erisa A avatar Gavry avatar  avatar Flip van Haaren avatar  avatar Fishcake avatar Timo Wilhelm avatar Ernesto Resende avatar Seonghyun Park avatar

Watchers

James Cloos avatar  avatar  avatar  avatar  avatar

tus-server's Issues

Buffering issue

Thanks for sharing this repo. I managed to get it up and running, however I'm facing an issue.

When a request is sent to Cloudflare, it first buffers the entire request body before it sends it to the worker for processing. For instance, if I try to upload a 100MB file, and the connection interrupts after 90MB is uploaded, then nothing will be stored in the R2 bucket as the request hasn't been processed by the Worker at all (it was just buffered by CF). Wondering if you've found a solution around this?

Thanks!

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.