sharry icon indicating copy to clipboard operation
sharry copied to clipboard

How to upload from CLI using tus?

Open ldericher opened this issue 9 months ago • 7 comments

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!

ldericher avatar Apr 11 '25 12:04 ldericher

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 avatar May 07 '25 06:05 eikek

@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 avatar May 24 '25 00:05 ldericher

@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.

eikek avatar May 25 '25 09:05 eikek

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 👍

ldericher avatar Jun 05 '25 17:06 ldericher

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.

eikek avatar Jun 21 '25 08:06 eikek

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.

ldericher avatar Jun 24 '25 00:06 ldericher

Ah thank you! It didn't occur to me to try out without the protocol. Now it's working nicely 🎉

eikek avatar Jun 24 '25 21:06 eikek

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!

github-actions[bot] avatar Jul 25 '25 03:07 github-actions[bot]