Skip to content

A self hosted real-time file transfer service for CLI or browser

License

Notifications You must be signed in to change notification settings

proofrock/fileway

Repository files navigation

🚠 fileway v0.7.0

1. tl;dr

Fileway is a real-time file transfer service that works through a web browser or command line. It lets two users exchange files through an intermediary server without storing data or requiring direct access to each other’s systems - like a live-streaming version of WeTransfer™[1].

You can jump in following the tutorial or read on for an architectural overview.

2. Overview

fileway is a client/server application that transfer single files (well, technically…​). It accepts an upload and blocks it until a download is initiated, then processes the upload and sends the data to the downloading client.

It can be used to relay files from a server to another, if the two servers can’t easily "see" each other but can see a third server, where fileway is installed.

Sequence diagram
Figure 1. Sequence diagram

The transfer is secure: a unique link is generated, and you should only take care to serve it via HTTPS (discussed below).

Uploads can be done with a web interface - works on mobile, too - or via a python3 script, for shells. Downloads can be done via a browser or using the commandline, e.g. curl. The uploading script or web session must be kept online until the transfer is done. Of course, multiple concurrent transfers are possible, and it transfers one file at a time.

fileway doesn’t store anything on the server, it just keeps a buffer to make transfers smooth. It doesn’t have any dependency other than go. It’s distributed as a docker image, but you can easily build it yourself. Also provided, a docker image that includes caddy for simple HTTPS provisioning.

3. Tutorial

For a quick test, you can run it locally. Prerequisites are docker, a file to upload, nothing else.

Run the server:

docker run --rm -p 8080:8080 -e FILEWAY_SECRET_HASHES='$2a$10$I.NhoT1acD9XkXmXn1IMSOp0qhZDd63iSw1RfHZP7nzyg/ItX5eVa' ghcr.io/proofrock/fileway:latest
Tip

Please note the single quotes around the secret. It contains some $, so if you use a double quote, bash will treat them as env vars.

Then open http://localhost:8080 to access the upload web page. Put mysecret as the secret, and choose a file. Press the Upload button.

In the two boxes that will be displayed, you’ll find an URL to be open directly in a browser; and a curl commandline to download the file.

Note

You can use anything to download that URL, as long as it supports taking the filename from the Content-Disposition header. That’s the -J switch for curl and the --content-disposition one for wget (still marked experimental).

4. Documentation

Let me know if you need more info!


1. WeTransfer™ is a trademark of WeTransfer B.V.