Easily send files from one computer to another.
Repository layout (new idiomatic Go structure)
cmd/push:pushbinary that shares a file via TCP + mDNS (zeroconf).cmd/pop:popbinary that discovers an mDNS announcement and downloads the file.pkg/discovery: helpers for mDNS discovery (extracting theuserand matching IP).pkg/transfer: transfer logic (accepting connections, sending files, progress bar).
Quick Usage
- Build. Both binaries land at the repository root:
./build.sh
# or, by hand:
go build -o push ./cmd/push
go build -o pop ./cmd/popNote that go build ./cmd/pop needs the package directory, not
cmd/pop/main.go: the command is split across main.go and tui.go.
- Send a file from machine A:
./push /path/to/file- On machine B, receive the file (optionally provide the sender's username):
./pop <username>
# without an argument it looks for a file shared by yourself
./pop --force <username> # overwrite an existing file without askingNotes
- The old
push/main.goandpop/main.gofiles have been removed from the repository (their functionalities have been migrated undercmd/).
- Be able to push a directory.
- Be able to resume an interrupted download.
- Use a
.partsuffix for partial downloads. - Resume only if the server supports HTTP Range requests; otherwise, restart from the beginning and warn the user.
- Add a
--forceoption to overwrite existing files without confirmation. Do not handle checksums for now (see below).
- Use a
- Implement using multiple progress bars (e.g.,
mpb). -
(Optional) Implement a mechanism to preallocate the final file size for downloads (file reservation). - (Optional) Add checksum/integrity verification after download (BLAKE3).
- Add IP and username of the user downloading the file (when available) on the push side.
- Client (
pop) now sends theX-PushPop-Userheader. - Server (
push) logs start/end of downloads with IP & username, and hash requests.
- Client (
- Add a TUI (Terminal User Interface) to manage file sharing:
- Allow the user to stop sharing a file manually.
- Display active downloads and connections.
- Blacklist users based on their IP address or username (when available).
- Add daemon mode for push:
- Implement
--daemonor-dflag to run push in the background (not default). - Create a control socket (e.g.,
/tmp/pushpop.sock) for daemon management. - Implement
push --controlto attach a TUI to a running daemon. - Implement
push --stopto gracefully stop a running daemon. - Implement
push --statusto display information about active daemons.
- Implement
- Display the user requesting a BLAKE3 in the push output.
- Fix display of the effective user in push (when pop is run from another machine, push should show the real user, not just the requested name).
popnow sends its own local user inX-PushPop-User, instead of the name it was asked to look for.
- Update push to use Bubble Tea (TUI on the server side).
- Add a progress bar for downloading the BLAKE3 verification file.
- Add a progress bar for computing the BLAKE3 checksum (file parsing).
- It should be possible to bind to a list of interfaces on the push command. And on the pop command?
- Remove blake package if not used anymore.
- Pop: Move the Init()/Update()/View() functions into a tui.go file.
- Pop: adapt the UI to the current window size.
- Use socket unix when downloading on the same machine.
- Provide multiple signature files: sha256/Blake3/etc.
- Better processing when the file exists and/or the part file exists.
- Use IPV6 addresses eventually.
- Implement TUI (with altScreen?) in push.
- Push should be able to provide multiple files in parrallel.
- Push should launch blake3 signature computation asap.
- Log should not appear in the standard output when DEBUG env var is undefined.
- When you change the current window size, then the title line gets duplicated.
- Downloading a file through a socket is really slow. (Maybe we should have a longer chunk downloading buffer?)
- Likely culprit: the
.partfile is reopened and closed for every 128 KiB chunk, and each chunk makes a full round trip through the Bubble Tea event loop.
- Likely culprit: the
-
Sometimes the blake verification progress bar keeps staying a 0%, while the actual processing is progressing.- The speed tick stopped rescheduling itself in the
done && !verifyingwindow, killing the ticker before the verification started.
- The speed tick stopped rescheduling itself in the
- The BLAKE3 bar lags well behind the byte counter on fast disks: the spring animation cannot keep up with hashing.