Giter Site home page Giter Site logo

adhocore / tusc.sh Goto Github PK

View Code? Open in Web Editor NEW
36.0 3.0 9.0 99 KB

tus 1.0.0 client protocol implementation for bash. Resumable large file upload to Tus sever from terminal using bash script

Home Page: https://github.com/adhocore/tusc.sh

License: MIT License

Shell 100.00%
tus tus-client tus-bash tus-cli tus-protocol file-upload file-uploader resumable-upload resumable-request large-file-upload large-file-transfers shell-script client-protocol adhocore hacktoberfest

tusc.sh's Issues

Missing json

I'm probably doing something wrong, but I tried following the simple startup and I'm getting:

realpath: /home/admin/.tus.json: No such file or directory
./tusc.sh: line 84: $TUSFILE: ambiguous redirect

I'm on an embedded Linux distro, but I installed jq just fine and I'm pretty sure all the other dependencies are in place.

TUS config cache Location must be host specific

currently ~/.tus.json caches location like

{
  "sha1key": {
    "location": "http://somehost/files/path"
  }
}

but this is problematic as tusc is meant to upload a file to many tusd servers as we dont know which server this location data is for.

the solution is to namespace location by host eg:

{
  "sha1key": {
    "lochost1": "http://host1/files/path1",
    "lochost2": "http://host2/files/path2"
  }
}

Tus server replied with empty location

I've tried running on a tus server that works with the js upload library.
However I keep on getting an error with this script
DEBUG=1 ./result/bin/tusc -H https://rustus.sassy.technology -f ../../Downloads/ATDP
_Bitval.pdf -b /files/
HOST : https://myhost
HEADER: /var/folders/m4/1cnl1mnn6qbcnjr7pyshnfd40000gn/T/tus.kJhxpdj8xv
FILE : ATDP_Bitval.pdf
SIZE : 63191
KEY : 8ba20e8bd53cabb96c1ee16fac581125b22f7f12
CHKSUM: sha1 OGJhMjBlOGJkNTNjYWJiOTZjMWVlMTZmYWM1ODExMjViMjJmN2YxMg==

curl -sSLD /var/folders/m4/1cnl1mnn6qbcnjr7pyshnfd40000gn/T/tus.kJhxpdj8xv -H 'Tus-Resumable: 1.0.0' -H 'Upload-Length: 63191' -H 'Upload-Key: 8ba20e8bd53cabb96c1ee16fac581125b22f7f12' -H 'Upload-Checksum: sha1 OGJhMjBlOGJkNTNjYWJiOTZjMWVlMTZmYWM1ODExMjViMjJmN2YxMg==' -H 'Upload-Metadata: filename QVREUF9CaXR2YWwucGRm' -X POST https://myhost/files/
Tus server replied with empty location. Try changing --base-path param.
โœ– Unfinished upload, please rerun the command to resume.

I'm not sure where the problem comes from.

tus version shows as 0.8.1

when doing tusc --help
When you have a moment if you want to update it to 1.0.0 ?
not a big deal though.
Maybe you can make another github release with the latest pr merged as well.
Thanks a lot for making this!

Authentication integration with the tusd server

Firstly, great job. This is awesome!

Can you please provide an example of how to use authentication (username and password) on the tusd server ( I believe this is now done using hooks) and how this would integrate with your code.

I was so happy to see that you added auth into your code.

Can you please provide some guidance as to how I can use your code with the auth and what I need to do to make it use the hooks with the tusd backend.

Thanks in advance.

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.