-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from genonullfree/cleanup-imports
Cleanup imports
- Loading branch information
Showing
10 changed files
with
187 additions
and
177 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "teleporter" | ||
version = "0.10.3" | ||
version = "0.10.4" | ||
authors = ["geno nullfree <[email protected]>"] | ||
license = "BSD-3-Clause" | ||
description = "A small utility to send files quickly from point A to point B" | ||
|
@@ -14,6 +14,14 @@ rust-version = "1.64.0" | |
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[lib] | ||
name = "teleporter" | ||
path = "src/lib.rs" | ||
|
||
[[bin]] | ||
name = "teleporter" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
clap = { version = "4.0", features = ["derive"] } | ||
byteorder = "1.4" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
use clap::Parser; | ||
use std::path::PathBuf; | ||
|
||
pub mod errors; | ||
pub mod listen; | ||
pub mod send; | ||
|
||
mod crypto; | ||
mod teleport; | ||
mod utils; | ||
|
||
pub const PROTOCOL: u64 = 0x54524f50454c4554; | ||
pub const VERSION: &str = env!("CARGO_PKG_VERSION"); | ||
|
||
#[derive(Clone, Debug, Parser, PartialEq, Eq)] | ||
pub struct SendOpt { | ||
/// List of filepaths to files that will be teleported | ||
#[arg(short, long, num_args = ..)] | ||
input: Vec<PathBuf>, | ||
|
||
/// Destination teleporter host | ||
#[arg(short, long, default_value = "localhost")] | ||
dest: String, | ||
|
||
/// Destination teleporter port | ||
#[arg(short, long, default_value = "9001")] | ||
port: u16, | ||
|
||
/// Overwrite remote file | ||
#[arg(short, long)] | ||
overwrite: bool, | ||
|
||
/// Recurse into directories on send | ||
#[arg(short, long)] | ||
recursive: bool, | ||
|
||
/// Encrypt the file transfer using ECDH key-exchange and random keys | ||
#[arg(short, long)] | ||
encrypt: bool, | ||
|
||
/// Disable delta transfer (overwrite will transfer entire file) | ||
#[arg(short, long)] | ||
no_delta: bool, | ||
|
||
/// Keep path info (recreate directory path on remote server) | ||
#[arg(short, long)] | ||
keep_path: bool, | ||
|
||
/// Backup the destination file to a ".bak" extension if it exists and is being overwritten (consecutive runs will replace the *.bak file) | ||
#[arg(short, long)] | ||
backup: bool, | ||
|
||
/// If the destination file exists, append a ".1" (or next available number) to the filename instead of overwriting | ||
#[arg(short, long)] | ||
filename_append: bool, | ||
} | ||
|
||
#[derive(Clone, Debug, Parser, PartialEq, Eq)] | ||
pub struct ListenOpt { | ||
/// Allow absolute and relative file paths for transfers (server only) [WARNING: potentially dangerous option, use at your own risk!] | ||
#[arg(long)] | ||
allow_dangerous_filepath: bool, | ||
|
||
/// Require encryption for incoming connections to the server | ||
#[arg(short, long)] | ||
must_encrypt: bool, | ||
|
||
/// Port to listen on | ||
#[arg(short, long, default_value = "9001")] | ||
port: u16, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.