10 ms·
Ffsend – Share Files from the CLI: A Firefox Send Client Written in Rust
- wildchild 7y agoNew big thing "written in Rust".
- jedisct1 7y agoWhat does the fact that it's written in Rust do? Do we get more storage space? Can files being downloaded faster?
- Filligree 7y agoIt might use less battery time?
- outadoc 7y agoThanks for your extremely useful sarcastic comment. Maybe the author just wanted to play with the language and share their knowledge through a cool open-source tool. Maybe it's just the best language for the job.
- Heliosmaster 7y agoyes but they do have a point. 'Written in Rust' adds nothing to the tool itself. Edit: I see now. Thanks
- lytedev 7y agoThat's not true! See other comments in this thread.
- heavenlyblue 7y agoIt does actually a lot - I know that when I contribute to this project I have a much lower probability of shooting myself in the foot compared to most of the other languages
- lhnz 7y agoAren't many of us programmers? Don't we gain something from reading source code in languages we might be interested in using?
- hombre_fatal 7y agoWe are craftspeople. Of course we care about how tools are made. Else we'd be at ProductHunt.
- the_mitsuhiko 7y agoConveys the ecosystem. When I see “CLI tool written in Python” vs “CLI tool written in Rust/Go” I pick the latter because Python’s packaging situation for command line tools is beyond awful.
- more-coffee 7y agoBy packaging situation do you mean the user-side of things, i.e. how to install stuff separately of each other? For that I've had good experience using https://pypi.org/project/pipx https://pypi.org/project/pipx to install several cli tools without conflicts. Uninstalling them has also been a breeze.
- the_mitsuhiko 7y agoI wrote a tool called pipsi which I believe has influenced pipx but despite the existence of such tools I have no idea these days how to install python packages any more. Ir has become only more confusing and complex. Both for cli tools as well as libraries.
- j88439h84 7y agoPipx is the replacement for pipsi. It's good for installing cli tools. For managing project dependencies, Poetry is the current best. It means I dont have to interact with virtualenv or pip or setuptools or pip-tools or manifest.in.
- kissgyorgy 7y agoThis is very surprising to read. When I read something like this from others, I was always arguing that "it's not anymore", but I'm absolutely sure you know better than me. Would you mind elaborating actual problems or writing a blog post about it? I am VERY curious about your experience and opinion in this topic!
- simias 7y agoPersonally it's more about familiarity, I dev Rust so I know that I have all the prerequisites and setting this up should be trivial, meanwhile I don't do a lot of Python work so getting that to work might be a bigger commitment. I don't do a lot of Go either but at least Go generates freestanding binaries so if I install it in precompiled form I know that it will be fairly frictionless and won't rely on half a billion dependencies (which may or may not conflict with something else). I use a bunch of Go programs regularly (like docker or Arch's yay package manager) and it never gets on in the way. On the other hand if it's an npm package I don't even think about it.
- reacharavindh 7y agoTo me, it sets expectations for - single binary deploy(unlike Python) - fast (llvm) - memory efficient (no GC) - newer (by virtue of the newness of the language itself). Nothing wrong with setting expectations in title ;-)
- gigatexal 7y agoGCs have come a long way. I think the bit about being memory efficient for not using a GC is FUD.
- heavenlyblue 7y ago>> GCs have come a long way Aha. I have a web server written in rust that literally uses about 5Mb memory on RPi. And that one actually has a proper web framework, not something barebones. Good luck doing that in Python.
- gigatexal 7y agoI was thinking about Go not Python when writing the above.
- dnpp123 7y agoWhich crate/framework do you use ? I'm looking at REST API frameworks for rust these days, but nothing looks decent...
- heavenlyblue 7y agoI went with Rocket. Basically I wanted to control the switching of devices on my sound amplifier using USB infrared remote. So I built the UI using yew and the web server using Rocket - but I wanted to do it fast and only in Rust.
- kbutler 7y agoBut I bet it took a lot more code than: python3 -m http.server Note also that Python is primarily reference counted, with GC used only to detect cyclic references.
- badatseciruty 7y agoUnnecessary sarcasm aside, I'm Keen to look at it simple because it's written in Rust. I like Rust so this is interesting for that reason alone. Besides that, Mozilla and the Firefox community have a lot of Rust devs so writing this in Rust may make this more likely to get PRs from people involved in the FF Send project
- megous 7y agoNothing. You can get the same secure sharing service with zero hassle with a simple shell script: sum=$(sha1sum "$1" | cut -f 1 -d ' ') ssh your-vps mkdir /srv/http/files/$sum scp "$1" your-vps:/srv/http/files/$sum/ echo https://your-vps/files/$sum/$1 + nginx or whatever
- ubercow13 7y agoThat isn't really comparable in that it's not E2EE
- megous 7y agoIt is, as all ends belong either to you (source computer, vps) or the destination device, and it uses ssh and https.
- ubercow13 7y agoThe VPS doesn't really belong to you. Google has exactly the same ability to view your secret file shared unencrypted over Drive as they do to view your file stored on your f1-micro instance.
- megous 7y agoThat's just your assumption. VPS != Google. It's just a virtual machine running on some HW. I agree that if that HW is not owned by you, it can be a problem. If that's a problem you can just add another layer of encryption to the mix, like a GPG command. I can and do own that HW. At least as much as one can own anything - it's located in my appartment. You can just as well run the web server from your own workstation/laptop. The only reason to put shared files on other computer is that the other computer is more available.
- rvz 7y agoWell I can't use this on Windows nor can I guarantee that this cryptic shell script will run on my friends computer who still uses Windows. Even so, he wouldn't know how to run it. Also it can't be a "secure sharing service" if you're still using 'sha1sum' and it not being end-to-end encrypted...
- weavie 7y agoI might not be that interested in using it, but now I might be interested in reading a bit of the source.
- throwGuardian 7y agoPrevents people from forking and submitting PRs, given rust's abysmally low usage, and higher complexity for beginners.
- duckerude 7y agoI like that this removes some of the need to trust the service. When you open a link in a browser it's tedious to verify that the webpage doesn't send the secret to anyone, but this way you only have to trust the command line tool, which can't be replaced unpredictably.
- mschwaig 7y agoI mostly use Firefox Send to transmit data between my own devices and devices I do not trust. I wish the web client could generate QR codes to make that easier. Probably I could combine Fsend and another CLI tool to enable that use case. Right now I'm manually typing links into different devices. EDIT: Fsend can do this by itself!
- timvisee 7y agoJust want to note that QR code generation is a feature in `ffsend`. Simply use the `-Q` flag while uploading.
- mschwaig 7y agoWow, that's great! Thanks.
- deleted 7y ago[deleted]
- wodenokoto 7y agoPrinting an ascii QR code to stdout would be a pretty cool feature.
- tekknolagi 7y agoAccording to the author, use -Q.
- sdan 7y agoLooks cool! Personally, however, I’ve been using croc (https://github.com/schollz/croc https://github.com/schollz/croc) and can’t recommend it enough. I use it almost on a daily basis and is a super easy file transfer tool.
- cyphar 7y agoIt's crazy how incredibly similar to magic-wormhole[1] this looks. EDIT: Ah, they mention magic-wormhole in the acknowledgements as being an inspiration. [1]: https://github.com/warner/magic-wormhole https://github.com/warner/magic-wormhole
- qrv3w 7y agoYeah, I made croc because wormhole wasn't easy to install on Windows and wormhole also doesn't support resuming transfers.
- deleted 7y ago[deleted]
- cerberusss 7y agoGreat tip. It's astonishing how well done the packaging is; all platforms are covered. Except mobile; it would be quite awesome if that were to exist as well.
- timvisee 7y agoDeveloper here. Thanks for posting! Feel free to ask my any questions.
- jeltz 7y agoUpload is very slow for me, about 40 kB/s compared to the about 400 kB/s I get with scp. Is that normal? Edit: It seems equally slow to me when using the website, so I suspect the issue is with Mozilla's sever, not the client.
- timvisee 7y agoIf might be because of slow cryptography, that isn't hardware accelerated. What system are you running on? I can easily reach 20MB/s.
- jeltz 7y agoFeels too slow even for slow cyrpto. I suspect either that I am rate limited by the server or there is some bug somewhere. CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz Kernel: Linux 4.19.0-6-amd64 Distro: Debian 10.2 Rust: rustc 1.40.0 (73528e339 2019-12-16) Program: ffsend 0.2.57
- timvisee 7y agoThat should definitely work fine, yeah! I'm assuming it has to do with the network or their server as well. Sorry I can't be of much help.
- deleted 7y ago[deleted]
- RomanPushkin 7y agoCan you move the repo to GitHub? GitLab UI is ugly, I refuse to use it
- deleted 7y ago[deleted]
- timvisee 7y agohttps://github.com/timvisee/ffsend https://github.com/timvisee/ffsend
- cyphar 7y agoAnother really neat solution to sending data between two machines that don't have a pre-existing channel is magic-wormhole[1]. It's much simpler because it's just a number and some easy-to-distinquish code words like 1-stethoscope-zulu. [1]: https://github.com/warner/magic-wormhole https://github.com/warner/magic-wormhole
- twoodfin 7y agoVery cool! I dove in to see how they solve the routing / firewall problem. Turns out you’re relying on the kindness of strangers and a public WebSocket relay. Hard to see how they could do any better, alas. IMO one of the big holes in the architecture of the web is the lack of a standard peer-to-peer “content-addressable routing” protocol, perhaps based on any of a number of distributed hash table schemes. It’d be perfect for something like this.
- noman-land 7y agoFar from a standard but have you checked out libp2p? It's pretty far along as a modular p2p networking util. https://libp2p.io/ https://libp2p.io/
- twoodfin 7y agoExcellent! Yeah, I often daydream about a web where something very much like that had become foundational. Unfortunately, the academic work on DHTs emerged at around the same time as both the stultifying dominance of Internet Explorer and the panic over Napster et al.
- Seirdy 7y agoA better solution for p2p E2EE file-transfer is croc [0] because it can compile to a statically-linked binary without runtime dependencies. Sending files: `croc [files]` Receiving files: `croc code-phrase` Custom code-phrases are supported. More information on design decisions are documented in a blog post [1]. [0]: https://github.com/schollz/croc#usage https://github.com/schollz/croc#usage [1]: https://schollz.com/blog/croc6/ https://schollz.com/blog/croc6/
- msravi 7y agotermux + woof woof -i <ip_address> -p <port> <filename> termux: https://play.google.com/store/apps/details?id=com.termux https://play.google.com/store/apps/details?id=com.termux woof: http://www.home.unix-ag.org/simon/woof.html http://www.home.unix-ag.org/simon/woof.html 1. Allows directory upload/download (tar/gzip/bzip2 compressed) 2. Local file server (doesn't need to go over the internet) 3. Allows upload form (-U option) 4. Allows file to be served <count> number of times (-c option)
- heyflyguy 7y agoThese are all very interesting, I am currently facing an issue getting BitTorrent file transfer to pierce an "unfriendly" firewall that I can't change permissions on. I've tried a VPN out with no luck. I wish I knew if one of these would allow me to get out.
- kibwen 7y agoFirefox Send is a web page, so if you can access the web you can use it. Also, a firewall that you can access the web from will have ports 80 (http) and 443 (https) open, so configure your tools to use one of those (preferably 443). If both machines are standard internet-facing Unix-likes that you have accounts on, you'll already have scp preinstalled for easy file transfer.
- sudosysgen 7y agoMany modern firewalls do Deep Packet Inspection, so obfuscation might be needed too.
- kibwen 7y agoAs long as your traffic is encrypted (which ssh/scp is) and as long as your machine isn't compromised then a firewall can tell so little about your traffic that it would have to be pretty paranoid to attempt to block any of it. It'll work at a Starbucks, but perhaps not in China.
- sudosysgen 7y agoDeep packet inspection will almost invariably be able to recognize ssh/scp from the packet sizes, the patterns, the ports and so on. You really do need some kind of obfuscation. Starbucks won't catch it, but I know for a fact my former high school does, for example.
- big_chungus 7y agoShadowsocks can get past most. Many have yet to update to catch wireguard, too.
- wildduck 7y agoOr with python just going to dir you want to share: python 2.7 >python -m SimpleHTTPServer 8080 python 3 > python -m http.server 8080
- simias 7y agoThat's not the same thing, Firefox Send stores the files on the cloud, it's accessible from anywhere without requiring your computer to remain accessible.
- matthewmacleod 7y agoYou can also recreate Dropbox just by combining an FTP Server with curlftpfs and SVN :) Python’s built-in HTTP server is pretty useful. It doesn’t really overlap with the functionality of use-cases of a Send client much at all.
- api 7y agoIt's 2020. Is it finally possible to send a file over the Internet directly from one machine to another? Only if you are not behind symmetric NAT I suppose. Tangent: why does symmetric NAT exist? It seems like the kind of thing firewall fetishists do "for security" without considering the problems it causes and without any clue of what sort of attack it thwarts that mere stateful firewalling does not thwart. Realize that without symmetric NAT, TURN would be largely unnecessary.
- johnisgood 7y agoI am pretty sure there are many people on here who have not forgotten (it is not even that old! :P) and still use any variations of netcat, or even rsync. Nmap's Ncat is cross-platform (I use MSYS2 on Windows so it does not matter much to me), supports SSL, proxies, connection brokering, and a lot of other stuff[1][2]. [1] https://nmap.org/ncat/guide/ https://nmap.org/ncat/guide/ [2] https://en.wikipedia.org/wiki/Netcat#ncat https://en.wikipedia.org/wiki/Netcat#ncat
- api 7y agoAll that stuff doesn't work between systems behind firewalls or NATs.
- deleted 7y ago[deleted]
- johnisgood 7y ago> A basic file transfer is very simple: Start Ncat in listen mode on one end, start Ncat in connect mode on the other end, and pipe the file over the connection. There are two ways to do this that differ only in which end listens, the sender or the receiver. Sometimes you can't create a listening socket on one end of the transfer because of a lack or permissions, NAT, or filtering. As long as you can listen on at least one end, though, you can use this technique.[1] This works with most if not all netcat implementations. > The basic file transmission technique described at the beginning of this section fails if neither participating host is capable of listening, or the two hosts can't communicate directly. This situation has become common with the prevalence of network address translation. A way to work around it is to use a third host as an intermediary. The intermediate host listens in connection brokering mode and the other two hosts connect to it. Recall from the section called “Connection Brokering” that in connection brokering mode any input received on one socket is copied and sent out to all other sockets. With just two hosts connected this is especially simple: anything coming from one host gets forwarded to the other. This example shows host1 sending inputfile to outputfile on host2, using host3 as an intermediary.[1] This works nicely with Nmap's Ncat. [1] https://nmap.org/ncat/guide/ncat-file-transfer.html https://nmap.org/ncat/guide/ncat-file-transfer.html
- deleted 7y ago[deleted]
- archie2 7y agoSomebody that knows zilch about Rust with a question: I like to write CLI tools with Go, the built-in libs and the simpleness of the language make it really easy for writing good tools quickly. What advantages does Rust have over Go that one would use it for this purpose?
- iudqnolq 7y agoI'm not certain, just learning it. You might find this blog post that does a code review of ripgrep interesting, though. It's a deep dive into a serious-scale cli tool. https://web.archive.org/web/20190401042439/http://blog.mbrt.it/2016-12-01-ripgrep-code-review/ https://web.archive.org/web/20190401042439/http://blog.mbrt.... Here's what the main function looks like: fn main() { match Args::parse().and_then(run) { Ok(count) if count == 0 => process::exit(1), Ok(_) => process::exit(0), Err(err) => { eprintln!("{}", err); process::exit(1); } } }
- PrototypeNM1 7y agoI don't know the current state of go package management but I do know the equivalent Go project cited Rust's package manager Cargo as a good reference for developing their own. You forget Rust's standard library is quite minimalist and you get to sample competing libraries which often use interchangeable interfaces. In particular there are several crates (libraries) which make handling CLI arguments convenient. If your code is stateful the typestate pattern is particularly easy to write in Rust - http://cliffle.com/blog/rust-typestate/ http://cliffle.com/blog/rust-typestate/
- archie2 7y agoI've never heard of the TypeState Pattern, thanks for the link and it even got me interested in getting to know more about Rust. Thanks a bunch!
- thrwaway69 7y agoThat's pretty neat. Currently I use dat, resync or ipfs to move big files around on CLI. Maybe I will try this next time I wanna share big files. Obligatory web alternatives that are peer to peer - [1]: https://github.com/kern/file.pizza https://github.com/kern/file.pizza https://file.pizza https://file.pizza [2]: https://github.com/cowbell/sharedrop https://github.com/cowbell/sharedrop https://sharedrop.io https://sharedrop.io [3]: https://github.com/webtorrent/instant.io https://github.com/webtorrent/instant.io https://instant.io https://instant.io [4]: https://github.com/RobinLinus/snapdrop https://github.com/RobinLinus/snapdrop https://snapdrop.net https://snapdrop.net
- anderspitman 7y agoI'll go ahead and plug https://patchbay.pub https://patchbay.pub here. If you're somewhat less concerned about having encryption, you can do CLI transfers of files of arbitrary size without installing anything (assuming you have an HTTP client like curl already), and without needing an account: Sender: curl https://patchbay.pub/random-channel-chosen-by-you https://patchbay.pub/random-channel-chosen-by-you --data-binary @file.mp4 Receiver: curl https://patchbay.pub/random-channel-chosen-by-you https://patchbay.pub/random-channel-chosen-by-you As mentioned by others, https://file.pizza https://file.pizza is great if both devices have browsers, and the WebRTC connection between them succeeds.
- rakoo 7y agoYour service sends everything through the instance so we rely on the bandwidth you're willing to share. It already is amazing, but the same thing through WebRTC would be really great. I know it means work would mostly be on the client side though, and curl wouldn't be enough anymore
- uberneo 7y agofew more similar (python based) command line options for Firefox Send - https://github.com/nneonneo/ffsend https://github.com/nneonneo/ffsend & https://github.com/ehuggett/send-cli https://github.com/ehuggett/send-cli Would be great to have something like curl -X POST @myFilePath "https://api.send.firefox.com" https://api.send.firefox.com"