How to upload from CLI using tus?
I found this documentation on how to upload to Sharry using curl.
This is not really suitable for large files (several GiB), as it doesn't leverage the tus protocol.
I tried using tusc and tusc.sh, but couldn't get it to work.
Would appreciate any pointers!
hi @ldericher sorry for the late reply!! So this is currently not possible I think. The tus endpoint is created on each file of a share. So it could work once a share exists -- but currently sharry uses a quite old version of tus - not the current 1.0. So I think getting it to work is not easy. You could look at the js client used in the sharry webapp, perhaps there exists something that works like this.
@eikek
this is currently not possible I think
This bothered me so I've started building a binary crate in Rust to enable sharry upload from CLI … will also push to GH once it's done: https://code.yavook.de/jmm/shrupl
Will ping you once I consider it finished – maybe you'll let me know if you ever plan to change something related to tus ☺
@ldericher very nice, thanks for the effort and info! I'm currently not planning anything for the short term. I would like to upgrade to tus 1.0 (alongside with other changes) at some point but I'm currently too busy to start working on that.
Hey @eikek , I finished what I consider the first working version of what I call "ShrUpl" the sharry upload tool
Although still a bit rough around the edges, mind giving it a go? Download via code.yavook.de, sources: https://code.yavook.de/jmm/shrupl
I'm rather impressed by how it fits into a single packed binary of less than 2 MB, with no lib dependencies at all 👍
hi @ldericher that looks nice, thanks for providing it! When I try it to upload to my instance, I get this error:
Welcome to ShrUpl!
Error! probably wrong: URL – "io: failed to lookup address information: Name does not resolve"
I have a https address, using arguments https://my.sharry.site xy-alias-id ./file.pdf as arguments. The url is correct, I copied it from the browser address bar, just to be sure.
that's what I mean by "a bit rough around the edges" :-D
shrupl just expects the base URL without protocol, so in your case using arguments my.sharry.site xy-alias-id ./file.pdf. I'll fix that in the next release!
currently, https is the default, but may be set to actually any other protocol with the --protocol/-p CLI option.
Ah thank you! It didn't occur to me to try out without the protocol. Now it's working nicely 🎉
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. This only applies to 'question' issues. Always feel free to reopen or create new issues. Thank you!