Skip to content

Commit

Permalink
Merge pull request #33 from genonullfree/update-docs
Browse files Browse the repository at this point in the history
Rename application to `teleporter` for crates.io

This closes #29 and closes #32
  • Loading branch information
genonullfree authored Oct 16, 2021
2 parents 7e2b351 + 79c6073 commit 468f435
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/**
test/**
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
[package]
name = "teleport"
version = "0.4.3"
name = "teleporter"
version = "0.4.4"
authors = ["geno nullfree <[email protected]>"]
license = "BSD-3-Clause"
description = "A small utility to send files quickly from point A to point B"
readme = "README.md"
homepage = "https://github.com/genonullfree/teleport.git"
repository = "https://github.com/genonullfree/teleport.git"
keywords = ["netcat", "teleport", "teleporter", "transfer", "send"]
categories = ["command-line-utilities", "network-programming"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
30 changes: 30 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BSD 3-Clause License

Copyright (c) 2021, Geno Nullfree
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

54 changes: 30 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# Teleport
# Teleporter

Teleport is a small utility in the vein of netcat to send files quickly from point A to point B. It is more convenient than netcat in that you don't have to run a separate command with file redirection for each file you wish to transfer.
Teleporter is a small utility in the vein of netcat to send files quickly from point A to point B. It is more convenient than netcat in that you don't have to run a separate command with file redirection for each file you wish to transfer.

Teleport lets you pass the destination and a list of files you wish to send and it will create those files with the proper filenames on the receiving end. Each Teleport binary can act as a client or a server so there's no need to move multiple software packages around.
Teleporter lets you pass the destination and a list of files you wish to send and it will create those files with the proper filenames on the receiving end. Each Teleporter binary can act as a client or a server so there's no need to move multiple software packages around.

Teleport can recursively copy files as well, just pass a directory name and it will copy files all the way down.
Teleporter can recursively copy files as well, just pass a directory name and it will copy files all the way down.

Teleport now does delta file transfers using the Blake3 hashing algorithm for files being overwritten that are larger than 1Mb. Testing has shown this to increase speedup for large files by about half.
Teleporter now does delta file transfers using the Blake3 hashing algorithm for files being overwritten.

The protocol Teleporter implements to transfer files is called Teleport.

# Usage
```
Teleport is a simple application for sending files from Point A to Point B
Teleporter is a simple application for sending files from Point A to Point B
USAGE:
teleport [FLAGS] [OPTIONS]
teleporter [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
Expand All @@ -22,35 +24,43 @@ FLAGS:
-V, --version Prints version information
OPTIONS:
-d, --dest <dest> Destination teleport IP address [default: 127.0.0.1]
-i, --input <input>... List of filepaths to files that will be teleported [default: ]
-p, --port <port> Destination teleport Port, or Port to listen on [default: 9001]
-d, --dest <dest> Destination teleporter IP address [default: 127.0.0.1]
-i, --input <input>... List of filepaths to files that will be teleportered [default: ]
-p, --port <port> Destination teleporter Port, or Port to listen on [default: 9001]
```

To start a teleport in server (receiving) mode, just run:
To start a teleporter in server (receiving) mode, just run:
```
./teleport
./teleporter
```
or
```
cargo run
```
Teleport will default to listening on `0.0.0.0:9001` for incoming connections.
Teleporter will default to listening on `0.0.0.0:9001` for incoming connections.

To start a teleport in client (sending) mode, run:
To start a teleporter in client (sending) mode, run:
```
./teleport -d <destination IP> -i <file> [[file2] [file3] ...]
./teleporter -d <destination IP> -i <file> [[file2] [file3] ...]
```

Teleport will transfer files with their name information as well as their file permissions. Any file path information will be lost. All the received files will be written out in the CWD where the server side was started.
Teleporter will transfer files with their name information as well as their file permissions. Any file path information will be lost. All the received files will be written out in the CWD where the server side was started.

# Installation

If you have Rust and Cargo installed, Teleporter can be quickly compiled and installed by running the following command:
```
cargo install teleporter
```
This will install Teleporter to `~/.cargo/bin/teleporter`, which might need to be added to your shell's `PATH` variable.

# Example output

## Server (receiving from 2 different clients)

```
$ target/debug/teleport
Teleport Server listening for connections on 0.0.0.0:9001
$ target/debug/teleporter
Teleporter Server listening for connections on 0.0.0.0:9001
Receiving: ["testfile", "otherfile", "testfile2", "testfile3"] => Received file: testfile2 from: 127.0.0.1:41330
Receiving: ["testfile", "otherfile", "testfile3", "testfile4"] => Received file: testfile3 from: 127.0.0.1:41332
Receiving: ["testfile", "otherfile", "testfile4"] => Received file: testfile from: 127.0.0.1:41326
Expand All @@ -63,8 +73,8 @@ Receiving: ["otherfile", "testfileC"]
## Client (sending)

```
$ target/debug/teleport -i ./test/testfile ./test/testfile2 ./test/testfile3 ./test/testfile4
Teleport Client
$ target/debug/teleporter -i ./test/testfile ./test/testfile2 ./test/testfile3 ./test/testfile4
Teleporter Client
Sending file 1/4: "testfile"
=> 2.000G of 2.000G (100.00%) done!
Sending file 2/4: "testfile2"
Expand All @@ -75,7 +85,3 @@ Sending file 4/4: "testfile4"
=> 20.000M of 20.000M (100.00%) done!
```

# WIP Disclaimer

Teleport is currently a work in progress. Use at your own risk.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn scope_dir(dir: &Path) -> Result<Vec<String>, Error> {

/// Client function sends filename and file data for each filepath
pub fn run(opt: Opt) -> Result<(), Error> {
println!("Teleport Client {}", VERSION);
println!("Teleporter Client {}", VERSION);

let files = get_file_list(&opt);

Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ mod client;
mod server;
mod utils;

/// Teleport is a simple application for sending files from Point A to Point B
/// Teleporter is a simple application for sending files from Point A to Point B

#[derive(Debug, StructOpt)]
pub struct Opt {
/// List of filepaths to files that will be teleported
#[structopt(short, long, parse(from_os_str), default_value = "")]
input: Vec<PathBuf>,

/// Destination teleport IP address
/// Destination teleporter IP address
#[structopt(short, long, default_value = "127.0.0.1")]
dest: String,

/// Destination teleport Port, or Port to listen on
/// Destination teleporter Port, or Port to listen on
#[structopt(short, long, default_value = "9001")]
port: u16,

Expand Down
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn run(opt: Opt) -> Result<(), Error> {
};

println!(
"Teleport Server {} listening for connections on 0.0.0.0:{}",
"Teleporter Server {} listening for connections on 0.0.0.0:{}",
VERSION, &opt.port
);

Expand Down

0 comments on commit 468f435

Please sign in to comment.