Share files between devices using your Wi-Fi network.

Overview

swift_file

Rust implementation of transferring files between devices over Wi-Fi network using a QR code. Tool is inspired by claudiodangelis/qrcp.

How does it work?

The sf server is bound to the IP address of a default network interface of the machine the server is running on. Alternatively, the IP address (--port), particular network interface (--interface), and port (--port) can be selected by the user.

The QR code that is printed encodes a http URL which is typically of the following format:

http://{ip}:{port}/{download|receive}/[optional suffix]

Known limitations

  • Some browsers on iOS are unable to download the file. It always works with Safari but fails with Brave. The failed download might also occur on other Chromium-based iOS browsers.

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.

Installation options

Install with cargo

swift_file is published on crates.io. In order to install a Rust crate from crates.io, it is required to have Rust and cargo installed on your system.

cargo install swift_file

Manual installation from an archive

Latest release page provides an option to manually install the sf binary from an archive. The archive is available for Linux, MacOS, and Windows. Download, extract and move the binary to the desired directory, and set execution permissions.

Linux

  1. Download the Linux tar.gz archive from the latest release
  2. Extract the archive
tar xf swift_file_*_x86_64-unknown-linux-musl.tar.gz
  1. Move the binary
sudo mv sf /usr/local/bin
  1. Set execution permissions
sudo chmod +x /usr/local/bin/sf
  1. Run sf
sf --help

MacOS

  1. Download the MacOS (apple-darwin) ZIP archive from the latest release
  2. Extract the archive
unzip swift_file_*_x86_64-apple-darwin.zip
  1. Move the binary
sudo mv sf /usr/local/bin
  1. Set execution permissions
sudo chmod +x /usr/local/bin/sf
  1. Run sf
sf --help

Windows

  1. Download the Windows ZIP archive from the latest release
  2. Extract the archive
  3. Run sf.exe

CLI Usage

Send or receive files between devices using Wi-Fi network

Usage: sf [OPTIONS] <COMMAND>

Commands:
  send     Send a file
  receive  Receive a file
  help     Print this message or the help of the given subcommand(s)

Options:
      --ip <IP>                IP Address to bind to
  -i, --interface <INTERFACE>  Network interface to use (ignored if --ip provided)
  -p, --port <PORT>            Server port
  -h, --help                   Print help
  -V, --version                Print version

Sending a file to another device

Send a file

Usage: sf send [OPTIONS] <FILE>

Arguments:
  <FILE>  File path to send

Options:
      --ip <IP>                IP Address to bind to
  -i, --interface <INTERFACE>  Network interface to use (ignored if --ip provided)
  -p, --port <PORT>            Server port
  -h, --help                   Print help

Receiving files from another device

Receive files

Usage: sf receive [OPTIONS]

Options:
  -d, --dest-dir <DEST_DIR>    Destination directory
      --ip <IP>                IP Address to bind to
  -i, --interface <INTERFACE>  Network interface to use (ignored if --ip provided)
      --no-open                Disable opening the received file automatically using the system default program
  -p, --port <PORT>            Server port
  -h, --help                   Print help
You might also like...
Experiments with Rust CRDTs using Tokio web application framework Axum.

crdt-genome Synopsis Experiments with Rust CRDTs using Tokio web application framework Axum. Background Exploring some ideas of Martin Kleppmann, part

Scratch-Containerised Rust GraphQL-API using Dataloaders

Dockerize Graphql Rust More current version at https://github.com/jayy-lmao/rust-cult-graphql-server This project is currently for demonstrating the u

A very basic "clone" of Reddit's r/place written in Rust using warp

r(usty)/place A very basic "clone" of r/place written in Rust using warp. Instead of rendering the image on the client side, the image is encoded as P

Web Application with using Rust(Actix, Diesel and etc)
Web Application with using Rust(Actix, Diesel and etc)

Santa Service App Used technology stack Web Server with using Rust (Actix, Actix-web, Diesel) Data base (Postgres) Console Application (Tokio) Tasks o

A simple authentication flow using Rust and Actix-web, with a PostgreSQL database and a sveltekit frontend.

Rust-auth-example This repository aims to represent a simple authentication flow using Rust and Actix-web, with a PostgreSQL database and a sveltekit

Proof of concept writing a monolith BBS using Rust, GraphQL, WASM, and SQL. WILL BE ARCHIVED ONCE PROVEN

GraphQL Forum Important DO NOT even think about using this in production, lest your sanity be destroyed and credentials lost! Loosely following the aw

Rust GraphQL server using simple type-only schema

SimpleGQL This library allows a simplified GraphQL schema to be given and will run a server with a backend store (currently only SQLite) and a set of

Rust HTTP API Template using PostgreSQL, Redis, RabbitMQ, and Hexagonal Architecture

Rust Template HTTP API Rust API Template using PostgreSQL, Redis, RabbitMQ, and Hexagonal Architecture The following template provides a basic structu

JWT Authentication in Rust using Axum Framework

Are you interested in building a secure authentication system for your Rust web application? Look no further than the Axum framework and JSON Web Tokens (JWTs)! Axum is a fast and scalable Rust web framework that provides a reliable and efficient platform for developing microservices and APIs.

Comments
  • --no-open still opens the received file

    --no-open still opens the received file

    Hi, I'm having issues with the --no-open flag as it still opens the file after the file was received.

    This is my command and the output:

    > sf receive --no-open
    URL: http://192.168.169.68:1024/receive
    <QR CODE>
    Server launched on 0.0.0.0:1024
    File `file.jpg` with content type `image/jpeg`, size 72823 bytes has been transferred to /path/to/file.jpg
    File opened using a default program.
    

    I'm using version 0.1.5 of swift_file on Ubuntu 22.04.2 LTS x86_64

    Thanks for the awesome project!

    bug 
    opened by d0tcc 1
  • Is there a way to specify the IP or network interface?

    Is there a way to specify the IP or network interface?

    sf seems to bind to the first device it finds. In my case these are not accessible from outside the computer, so my mobile cannot connect.

    Can I specify which IP address or what network device (lo, wlo1, enx806d973060ab, etc...) sf will use?

    enhancement 
    opened by bronsen 1
Releases(0.1.6)
Owner
Mateo Radman
Backend Engineer
Mateo Radman
Autumn is the microservice responsible for storing files and attachments.

Autumn Description Autumn is the microservice responsible for storing files and attachments. Features: Save files locally or on S3. Support for differ

Revolt 30 Dec 26, 2022
Download .crate files of all versions of all crates from crates.io

get-all-crates Download .crate files of all versions of all crates from crates.io. Useful for things like noisy-clippy which need to analyze the sourc

David Tolnay 18 Jan 3, 2023
Oso is an open source policy engine for authorization that’s embedded in your application

Oso What is Oso? Oso is an open source policy engine for authorization that’s embedded in your application. It provides a declarative policy language

oso 2.8k Jan 4, 2023
Sentinel: The Sentinel of Your Microservices

Sentinel: The Sentinel of Your Microservices (WIP) Introduction As distributed systems become increasingly popular, the reliability between services i

Sentinel Group 74 Dec 26, 2022
Build, bundle & ship your Rust WASM application to the web.

Trunk Build, bundle & ship your Rust WASM application to the web. ”Pack your things, we’re going on an adventure!” ~ Ferris Trunk is a WASM web applic

Anthony Dodd 2.2k Jan 7, 2023
Search Confluence from Alfred and open results in your browser.

Alfred Confluence Workflow Search Confluence from Alfred and open results in your browser. Features Search Confluence from Alfred and open results in

Johan M. 26 Nov 7, 2022
Proxies all incoming connections to a minecraft server of your choosing, while also logging all ping and login requests to a json file and discord webhook.

minecraft-honeypot Proxies all incoming connections to a minecraft server of your choosing, while also logging all ping and login requests to a json f

Cleo 19 Jan 4, 2023
Deserialize (potentially nested) environment variables into your custom structs

envious allows you to deserialize your serde enabled structs from environment variables. See it in action: use serde::{Deserialize, Serialize}; #[der

Marcel Müller 46 Feb 19, 2023
Axum + JWT authentication Middleware that allows you to start building your application fast

axum_jwt_ware Integration Guide Simple Axum + JWT authentication middleware with implemented Login and refresh token. Goal I aim to simplify the proce

Eze Sunday 3 Dec 2, 2023
A Google-like web search engine that provides the user with the most relevant websites in accordance to his/her query, using crawled and indexed textual data and PageRank.

Mini Google Course project for the Architecture of Computer Systems course. Overview: Architecture: We are working on multiple components of the web c

Max 11 Aug 10, 2022