diff --git a/Cargo.lock b/Cargo.lock index 8587d1c..56722e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -750,8 +750,9 @@ dependencies = [ [[package]] name = "libunftp" -version = "0.10.0" -source = "git+https://github.com/bolcom/libunftp.git?rev=1382781bf4a185acefbc7beecaecb36753566100#1382781bf4a185acefbc7beecaecb36753566100" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f2890ad821bf3b05797e535cc1f5cf3c56d2d60ac068fded3ab1c6534204f6e" dependencies = [ "async-trait", "bytes 0.5.4", @@ -1843,7 +1844,7 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "unftp" -version = "0.9.0" +version = "0.10.0" dependencies = [ "async-trait", "built", diff --git a/Cargo.toml b/Cargo.toml index 0a34103..38f5656 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unftp" -version = "0.9.0" +version = "0.10.0" authors = [ "Agoston Horvath ", "Dávid Kosztka ", @@ -18,7 +18,7 @@ readme = "README.md" [dependencies] async-trait = "0.1.30" -libunftp = {git = "https://github.com/bolcom/libunftp.git", rev = "1382781bf4a185acefbc7beecaecb36753566100"} +libunftp = "0.11.0" log = "0.4" env_logger = "0.6" redis = "0.9.0" diff --git a/README.md b/README.md index 2456cca..9d43168 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Example running an instance with a filesystem back-end and custom port ```sh cargo run -- \ --root-dir=/home/unftp/data \ - --bind-address=0.0.0.0:2100 + --bind-address=0.0.0.0:2121 ``` With FTPS enabled: @@ -66,7 +66,7 @@ cargo run -- \ --ftps-key-file=/home/unftp/unftp.key ``` -Enabling the [Prometheus](https://prometheus.io) exporter, binding to port 8080: +Enabling the [Prometheus](https://prometheus.io) exporter on (`http://../metrics`), binding to port 8080: ```sh cargo run -- \ @@ -84,9 +84,9 @@ cargo run -- \ --sbe-gcs-key-file=file ``` -## Docker +## Docker image -Dockerfile is templated. To get a list of available commands, run: +The project contains templated Dockerfiles . To get a list of available commands, run: ```sh make @@ -94,20 +94,14 @@ make We offer 3 different options for building an unFTP docker image: -- `minimal`: an empty image containing a static build of unFTP. *WARNING*: this is broken right now, as Cargo can only compile static binary if all the dependent libraries is also statically built. -- `alpine` (default): build unftp in rust-slim and deploy in alpine. This image is built with musl instead of a full-blown libc. Resulting image is about 20MB. -- `full`: build & run on the rust-slim base. Resulting image is over 1GB. +- `scratch` +- `alpine` (default): build unftp in rust-slim and deploy in alpine. This image is built with musl instead of a full-blown libc. +- `alpine-debug`: build & run on the rust-slim base and adds some tools like libunftp -To build the default docker image: +To build the alpine docker image: ```sh -make docker-image -``` - -To build and run unFTP inside the default docker image in the foreground: - -```sh -make docker-run +make docker-image-alpine ``` ## Features diff --git a/src/main.rs b/src/main.rs index fb55eb3..247c6d8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -273,14 +273,10 @@ where // Setup proxy protocol mode. if let Some(port) = arg_matches.value_of(args::PROXY_EXTERNAL_CONTROL_PORT) { - let port_num = String::from(port).parse::().map_err(|e| { - format!( - "unable to parse proxy protocol external control port {}: {}", - port, e - ) - })?; - server = server - .proxy_protocol_mode(port_num); + let port_num = String::from(port) + .parse::() + .map_err(|e| format!("unable to parse proxy protocol external control port {}: {}", port, e))?; + server = server.proxy_protocol_mode(port_num); } // Setup FTPS