3 stable releases

7.0.2 May 21, 2024
7.0.1 Apr 21, 2024
7.0.0 Apr 17, 2024

#162 in Network programming

Download history 125/week @ 2024-04-14 164/week @ 2024-04-21 19/week @ 2024-04-28 186/week @ 2024-05-19 4/week @ 2024-05-26 6/week @ 2024-06-02

196 downloads per month

MIT/Apache

105KB
2K SLoC

aft
GitHub Workflow Status (with event)GitHub release (with filter)

aft (Advanced File Transfer) is a minimal and secure tool for sharing files between two parties easily and efficiently. Works in Windows, Linux and macOS.

Features

  • Encryption.
  • Fast.
  • Lightweight (on RAM and storage).
  • Security is top priority.
  • Peer to Peer mode.
  • Relay mode.
  • Blocking senders.
  • No IP self-lookup.
  • fail2ban support.

Modes

There are a couple of modes to use with this program:

Peer to Peer

The sender is directly connected to the receiver, and the transfer process is happening directly.

Relay

Allows using a relay instead of two devices connecting to each other directly. It allows a few benefits such as:

  • No port forward needed on the receiver's end.
  • No direct contact between the receiver and the sender.
  • Better privacy - no IP sharing.

Usage

aft - file transfer done easily

Usage:
    aft sender [--address <address>] [--port <port>] [--identifier <identifier>] <filename>
    aft receiver [-p <port>]
    aft download -a <address> [-p <port>] [-i <identifier>]
    aft relay [-p <port>]
    aft <mode> [options ...]

Positional arguments:
    mode

Optional arguments:
    -a --address ADDRESS        Address.
    -p --port PORT              Port.
    -i --identifier IDENTIFIER  Identifier to find the receiver. Used only when its not P2P.
    -v --verbose VERBOSE        Verbose level. Default is 1 (warnings only). Range 1-3.
    -c --config CONFIG          Config location.
    -v --version                Show version.
    -e --encryption ALGORITHM   Possbile values: [AES128, AES256].

Installation

Install using cargo

Run cargo install aft, and you should be able to run the program immediately.

Automatic install

Run the following command to install aft: curl --proto '=https' -sf https://raw.githubusercontent.com/dd-dreams/aft/master/install.sh | sudo sh -s -- install.

If you want to modify the config, you can create a new file at your home directory (%USERPROFILE% for Windows and ~/ for Unix) within .aft directory, named: "config". Look into docs/CONFIG.md to see more.

Run the following command to uninstall aft: curl --proto '=https' -sf https://raw.githubusercontent.com/dd-dreams/aft/master/install.sh | sudo sh -s -- uninstall.

Manual install

Navigate to the releases page and choose your platform. For Windows you can export the archive contents by double clicking. For Linux and macOS you can use gzip for extracting the contents. gzip should be included by default. Run: gzip -dN <archive>. You can export the program anywhere you like, but make sure you add it to PATH so you can easily access it.

Systemd setup

  • Copy the aft program into /usr/local/bin/.
  • Copy aft-relay.service into /etc/systemd/system/.
  • Start the program with: sudo systemctl start aft-relay.

Notice that the service requires a new user called aft. If you want the service to be ran with root, remove the User=aft line, though it's not recommended for security reasons.

This service only runs the relay mode.

fail2ban setup

  • Copy assets/fail2ban/aft-relay-filter.conf into /etc/fail2ban/filter.d/.
  • Copy assets/fail2ban/aft-relay.conf into /etc/fail2ban/jail.d/
  • Restart the service: sudo systemctl restart fail2ban

You can modify the bantime and maxretries in aft-relay.conf.

Notice

fail2ban only works on relay mode. fail2ban doesn't work on Windows.

Building

Building is really simple: cargo build --release and the output will be at target/release/aft.

License

Licensed under either of:

  • Apache License, Version 2.0
  • MIT License.

Dependencies

~6–18MB
~201K SLoC