Skip to content

Commit

Permalink
Release 0.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesdejager committed Oct 3, 2020
1 parent b962653 commit c9fbf63
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 54 deletions.
53 changes: 30 additions & 23 deletions Cargo.lock

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

16 changes: 11 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unftp"
version = "0.12.0"
version = "0.12.1"
authors = [
"Agoston Horvath <[email protected]>",
"Dávid Kosztka <[email protected]>",
Expand All @@ -11,19 +11,24 @@ authors = [
"Rob klein Gunnewiek <[email protected]>"
]
edition = "2018"
description = "When you need to FTP, but don't want to."
description = "When you need to FTP, but don't want to. An async, cloud orientated FTP(S) server built on libunftp"
repository = "https://github.com/bolcom/unFTP"
homepage = "https://github.com/bolcom/unFTP"
license = "Apache-2.0"
readme = "README.md"
keywords = ["ftp", "ftps", "server"]
categories = ["servers"]
documentation = "https://github.com/bolcom/unFTP"

[workspace]

[dependencies.redislog]
[dependencies.slog-redis]
path="crates/redislog"
version="0.1.0"

[dependencies]
async-trait = "0.1.37"
libunftp = {git = "https://github.com/bolcom/libunftp.git", rev = "52c9a9109a3b62c69ebbc4287db0ca6fdcebbcdf"}
libunftp = { version = "0.13.0" }
slog = { version = "2.4.1", features = ["max_level_trace", "release_max_level_info"] }
slog-term = "2.6.0"
slog-async = "2.3.0"
Expand Down Expand Up @@ -59,4 +64,5 @@ built = "0.3"

[profile.release]
debug = false
# lto = true
lto = "fat"
codegen-units = 1
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RUST_VERSION=1.45.2
RUST_VERSION=1.46.0
DOCKER_TAG=$(shell git describe --tags)
DOCKER_TEMPLATES:=$(wildcard *.Dockerfile.template)
DOCKER_FILES=$(DOCKER_TEMPLATES:%.template=%)
Expand Down Expand Up @@ -83,3 +83,6 @@ clean: # Removes generated files
cargo clean
rm -rf release
rm *.Dockerfile

publish:
cargo publish --verbose --features rest_auth,jsonfile_auth,cloud_storage
132 changes: 108 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,59 @@ unFTP is a FTP(S) server written in [Rust](https://www.rust-lang.org) and built

- Configurable Authentication (e.g. Anonymous, [PAM](https://en.wikipedia.org/wiki/Linux_PAM) or a JSON file).
- Configurable storage back-ends (e.g. [GCS](https://cloud.google.com/storage/) or filesystem)
- An HTTP server with health endpoints for use for example in Kubernetes for readiness and liveness probes.
- Integration with [Prometheus](https://prometheus.io) for monitoring.
- A proxy protocol mode for use behind proxies like HA Proxy and Nginx.

With unFTP, you can present RFC compliant FTP(S) to the outside world while freeing yourself to use modern APIs and
techniques on the inside of your perimeter.

**unFTP is still in development and therefore not suitable for use in production yet.**
## Installation

## Prerequisites
### Binaries

You'll need [Rust](https://rust-lang.org) 1.41 (including `cargo`) or higher to build unFTP.
[Precompiled binaries for unFTP are available](https://github.com/bolcom/unFTP/releases) for Linux and macOS. These
binaries are static executables.

### From Source

#### Prerequisites

You'll need [Rust](https://rust-lang.org) 1.45 (including `cargo`) or higher to build unFTP.

Run `make help` to see an overview of the supplied *make* targets.

## Running
#### Features

To run with default settings:
unFTP offers optional features in its Cargo.toml:

- `pam`: enables the PAM authentication module
- `jsonfile_auth`: enables the JSON file authentication module
- `cloud_storage`: enables the Google Cloud Storage (GCS) storage backend

## Usage

Both command line arguments and environment variables are available in unFTP. To show a list of available
program arguments:

```sh
cargo run
unftp --help
```

To show a list of program arguments:
To run with default settings:

```sh
cargo run -- \
--help
unftp
```

Example running an instance with a filesystem back-end and custom port
Example running an instance with a filesystem back-end and custom port:

```sh
cargo run -- \
unftp \
--root-dir=/home/unftp/data \
--bind-address=0.0.0.0:2121
--bind-address=0.0.0.0:2121 \
--passive-ports=50000-51000 \
-vv
```

With FTPS enabled:
Expand All @@ -61,37 +80,77 @@ openssl req \
-days 3650 \
-subj '/CN=www.myunftp.domain/O=My Company Name LTD./C=NL'

# Run, pointing to cert and key
cargo run -- \
# Run, pointing to cert and key and require TLS on the control channel
unftp \
--root-dir=/home/unftp/data \
--ftps-certs-file=/home/unftp/unftp.crt \
--ftps-key-file=/home/unftp/unftp.key
--ftps-key-file=/home/unftp/unftp.key \
--ftps-required-on-control-channel=all
```

Enabling the [Prometheus](https://prometheus.io) exporter on (`http://../metrics`), binding to port 8080:

```sh
cargo run -- \
unftp \
--bind-address=0.0.0.0:2121 \
--bind-address-http=0.0.0.0:8080 \
--root-dir=/home/unftp/data
```

With the GCS back-end:
Run with the GCS (Google Cloud Storage) back-end:

```sh
cargo run -- \
unftp \
--sbe-type=gcs \
--sbe-gcs-bucket=mybucket \
--sbe-gcs-key-file=file
```

Run behind a proxy in [proxy protocol](https://www.haproxy.com/blog/haproxy/proxy-protocol/) mode:

```sh
unftp \
--proxy-external-control-port=2121
```

Run sending logs to a Redis list:

```sh
unftp \
--log-redis-host=2121 \
--log-redis-key=logs-key \
--log-redis-port=6379
```

Authenticate with credentials stored in a JSON file:

Create a credentials file (e.g. credentials.json):

```json
[
{
"username": "alice",
"password": "12345678"
},
{
"username": "bob",
"password": "secret"
}
]
```

```sh
unftp \
--auth-type=json \
--auth-json-path=credentials.json
```

## Docker image

The project contains templated Dockerfiles . To get a list of available commands, run:

```sh
make
make help
```

We offer 3 different options for building an unFTP docker image:
Expand All @@ -106,13 +165,38 @@ To build the alpine docker image:
make docker-image-alpine
```

## Features
Alternatively you can download pre-made images from docker hub:

unFTP offers optional features in its Cargo.toml:
```sh
docker pull bolcom/unftp:v0.12.1-alpine
```

- `pam`: enables the PAM authentication module
- `jsonfile_auth`: enables the JSON file authentication module
- `cloud_storage`: enables the Google Cloud Storage (GCS) storage backend
Example running it:

```sh
docker run \
-e ROOT_DIR=/ \
-e UNFTP_LOG_LEVEL=info \
-e UNFTP_FTPS_CERTS_FILE='/unftp.crt' \
-e UNFTP_FTPS_KEY_FILE='/unftp.key' \
-e UNFTP_PASSIVE_PORTS=50000-50005 \
-e UNFTP_SBE_TYPE=gcs \
-e UNFTP_SBE_GCS_BUCKET=the-bucket-name \
-e UNFTP_SBE_GCS_KEY_FILE=/key.json \
-p 2121:2121 \
-p 50000:50000 \
-p 50001:50001 \
-p 50002:50002 \
-p 50003:50003 \
-p 50004:50004 \
-p 50005:50005 \
-p 8080:8080 \
-v /Users/xxx/unftp/unftp.key:/unftp.key \
-v /Users/xxx/unftp/unftp.crt:/unftp.crt \
-v /Users/xxx/unftp/the-key.json:/key.json \
-ti \
bolcom/unftp:v0.12.1-alpine
```

## License

Expand Down
Loading

0 comments on commit c9fbf63

Please sign in to comment.