Easy file sharing server
- 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]
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]
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]
MIT