Skip to content

An implementation of the TUS server protocol for resumable uploads

Notifications You must be signed in to change notification settings

Cap-go/hono-r2-tus-uploader

Repository files navigation

Overview

Deploy to Cloudflare Workers

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

Demo TUS

Building

You'll need Bun.sh. (The code is in TS, it remove the need to transpile, You can use Nodejs with --experimental-strip-types and npm)

To install dependencies,

bun 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 work without authentification, but a empty middleware is provided to help you set it up.

To run a dev server you can interact with over localhost with local wrangler

bun run start:server

Open another shell and run:

bun run start:demo

Deploying

Notes

Change the auth system, to implement your own current one works with a shared secret, that is used in tus-server and tus-resumable-upload-js

One time setup

  1. Create an R2 bucket and update the binding in wrangler.toml
  2. Change the auth system to your needs
  3. Deploy with wrangler
bunx wrangler deploy -e <staging|production>

License

Copyright 2024 Capgo, Digital shift OU

Licensed under the AGPLv3

Credit

This is a hard fork of https://github.com/signalapp/tus-server/blob/main/README.md

Rewrited to work in the Capgo (live update for CapacitorJS apps) tech stack, and in frontend

About

An implementation of the TUS server protocol for resumable uploads

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published