Giter Site home page Giter Site logo

tusc's Introduction

tusc

build status

TUS Command line (tusc) is a small static binary for both server and client of tus resumable upload protocol.

Personally, I need tusc for uploading files in a CI process and a simple UI for downloading (like nginx autoindex). The chunked and resumable feature make it possible to bypass some payload size limitation imposed by proxy (e.g. cloudflare). Also, small size of binary make it convenient to be included in docker image.

Quick Start

Visit releases page and download the tusc binary.

$ curl -LO https://github.com/jackhftang/tusc/releases/download/<version>/tusc_linux_amd64 -o tusc
$ chmod u+x tusc 

Start server

$ tusc server -b 127.0.0.1 -p 8080

Create and upload a file

$ echo test > test.txt
$ tusc client http://127.0.0.1:8080/files/ text.txt     # not resumable
$ tusc client http://127.0.0.1:8080/files/ text.txt -r  # resumable

And then visit to file listing page

Command

Server

TUSC is a wrapper of tusd with an additional listing page. Features like S3, GCS, Prometheus, Hooks are removed from tusd, in favor of smaller binary size.

Options

$ tusc s --help
tusc server

Usage:
  tusc (server|s) [options]
  tusc (server|s) --help

Options:
  -u --url URL                    Url of HTTP server [default: http://localhost:1080]
  -b --bind ADDR                  Address to bind HTTP server to [default: 0.0.0.0]
  -p --port PORT                  Port to bind HTTP server to [default: 1080]
  -d --dir PATH                   Directory to store uploads in [default: ./data]
  --listing-endpoint PATH         Http path for flies listing [default: /]
  --files-endpoint PATH           Http path for files [default: /files/]
  --unix-sock PATH                If set will listen to a UNIX socket at this location instead of a TCP socket
  --max-size SIZE                 Maximum size of a single upload in bytes [default: 0]
  --store-size BYTE               Size of space allowed for storage [default: 0]
  --timeout TIMEOUT               Read timeout for connections in milliseconds.  A zero value means that reads will not timeout [default: 30*1000]
  --behind-proxy                  Respect X-Forwarded-* and similar headers which may be set by proxies [default: false]

Client

TUSC is a command line implementation of this excellent library go-tusd.

Options

$ tusc c --help
tusc client

Usage:
  tusc (client|c) <url> <file> [-H <header>]... [options]
  tusc (client|c) --help

Options:
  -r --resumable            Save meta data for resumable uploads [default: false]
  --store PATH              Path to save meta data for resume [default: ./.tusc]
  --chunk-size BYTE         Size of chunks of file [default: 2097152]
  --override-patch-method   Sending a POST request instead of PATCH [default: false]

tusc's People

Contributors

gbonnefille avatar jackhftang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tusc's Issues

Spelling errors in README.md file

The command to start the server should have -b instead of -h.
The create and upload files commands use different file names(test.txt is created, upload command has name text.txt)

Metadata

It looks like you're automatically including filename as part of the Upload-Metadata?

Would you be open to adding some way that I could include additional metadata with my upload? I'm using your tool in an embedded Linux laboratory application and would like to include more information when I upload binaries so the server can categorize them after upload.

Thanks for the great tool.

client should be able to delete files

Hi.
Nice tool.

Could you add a flag to client for deleting a file?

./tusc_linux_amd64 c -d 'http://0.0.0.0:8472/files/' 'e9bfa97199951b93bf07d5b36b45f2ea'

How to pass authentication token?

My TUS server use a TOKEN for authentication. I have to fill the X-Auth-AccessKey: HTTP Header for that.

How can I set such information?

very out of date

cant do a go mod upgrade because package paths in github.com/eventials/go-tus have changed quite bit.

If this is abandoned i can fork and upgrade.

please let me know ...

Cannot make requests to other ports than 80

E.g.

.\tusc_windows_amd64.exe c http://localhost:5010/files/ 'My-FILE'
http:///files/a2fc8d45-8f7d-4068-83d5-fa73eb99bb8d
Upload incomplete
Patch http:///files/a2fc8d45-8f7d-4068-83d5-fa73eb99bb8d: http: no Host in request URL

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.