Skip to content

mschorsch/transfer-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

transfer-rs

Easy file sharing server

Usage (file sharing from the command line)

  • PUT /upload/[filename]
curl --upload-file [FILENAME] https://localhost:8080/upload/[FILENAME]
cat [FILENAME] | gpg -ac -o- | curl -X PUT --upload-file https://localhost:8080/upload/[FILENAME]
  • POST /upload
curl -i -X POST -H "Content-Type: multipart/form-data" -F "data=@[FILENAME]" https://localhost:8080/upload/[FILENAME]
  • GET /download/[token]/[filename]
 curl --remote-name https://localhost:8080/download/[TOKEN]/[FILENAME]

Installation

Install Rust

curl -sSf https://static.rust-lang.org/rustup.sh | sh

Clone this repository

git clone [REPO]

Install OpenSSL

apt-get install openssl libssl-dev

Build the server

cargo build --release

Run (http)

./target/release/transer-rs -p 8080

or (https)

./target/release/transer-rs -p 8080 -ssl --ssl [CERT_PATH] --ssl-key [KEY_PATH]

Command line options

USAGE:
    transfer-rs [FLAGS] [OPTIONS]

FLAGS:
    -h, --help       Prints help information
        --ssl        Enables ssl
    -V, --version    Prints version information

OPTIONS:
    -b, --basedir <BASEDIR>                         Sets the base directory [default: /tmp/]
        --loglevel <LOGLEVEL>                       Sets the log level [default: info]  [values: error, warn, info,
                                                    debug, trace]
    -p, --port <PORT>                               Sets the server port
        --ssl-cert <SSL-CERTIFICATE>                Sets the ssl certificate
        --ssl-cert-chain <SSL-CERTIFICATE-CHAIN>    Sets the ssl certificate chain
        --ssl-key <SSL-PRIVATE-KEY>                 Sets the ssl private key
        --storage <STORAGE>                         Sets the storage provider [default: local]  [values: local]

Similar projects

License

MIT