diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 66de316b..caee4b95 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,7 +2,7 @@ name: build env: CARGO_TERM_COLOR: always - RUST_VERSION: 1.76.0 + RUST_VERSION: 1.78.0 on: push: @@ -18,65 +18,65 @@ jobs: runs-on: ubuntu-latest if: ${{ github.ref != 'refs/heads/master' }} steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_VERSION }} - override: true - default: true - components: rustfmt - - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - name: Checkout code + uses: actions/checkout@v3 + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_VERSION }} + override: true + default: true + components: rustfmt + - name: Check formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check clippy: - runs-on: ubuntu-latest - if: ${{ github.ref != 'refs/heads/master' }} - steps: - - name: Checkout sources - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: Install rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_VERSION }} - override: true - default: true - components: clippy - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-features --workspace -- -D warnings + runs-on: ubuntu-latest + if: ${{ github.ref != 'refs/heads/master' }} + steps: + - name: Checkout sources + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_VERSION }} + override: true + default: true + components: clippy + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all-features --workspace -- -D warnings test: - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - name: Install rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_VERSION }} - override: true - default: true - target: x86_64-unknown-linux-gnu - components: rust-docs - - name: Install build dependencies - run: sudo apt-get update && sudo apt-get install -y libpam-dev - - name: Run tests - run: > - cargo test - --verbose --workspace --exclude 'unftp-sbe-gcs*' - - name: Doc tests - run: cargo test --doc --workspace - - name: Build Examples - run: cargo build --examples --workspace - - name: Build Code - run: cargo build --workspace - - name: Build Docs - run: cargo doc --workspace --no-deps + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_VERSION }} + override: true + default: true + target: x86_64-unknown-linux-gnu + components: rust-docs + - name: Install build dependencies + run: sudo apt-get update && sudo apt-get install -y libpam-dev + - name: Run tests + run: > + cargo test + --verbose --workspace --exclude 'unftp-sbe-gcs*' + - name: Doc tests + run: cargo test --doc --workspace + - name: Build Examples + run: cargo build --examples --workspace + - name: Build Code + run: cargo build --workspace + - name: Build Docs + run: cargo doc --workspace --no-deps diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c174a25..f162e2a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,13 @@ # Changelog -### Upcoming +### libunftp 0.20.0 -- Compile against Rust 1.76.0 +- Compile against Rust 1.78.0 +- Added support for Capsicum on FreeBSD (#481) +- Fixed proxy protocol issue #494 when removing stale data channel - Upgraded dependencies +- Code cleanup and documentation improvements +- BREAKING: Introduced a new `ServerBuilder` struct to build the `Server`. ### libunftp 0.19.1 @@ -30,11 +34,12 @@ _tag: libunftp-0.19.0_ - [#471](https://github.com/bolcom/libunftp/pull/471) Added unFTP documentation link to help command output - Include libunftp version in help command output -- [#470](https://github.com/bolcom/libunftp/pull/470) Fixed issue with modified datetime formatting for `Fileinfo` where old +- [#470](https://github.com/bolcom/libunftp/pull/470) Fixed issue with modified datetime formatting for `Fileinfo` where + old dates didn't render correctly. - [#482](https://github.com/bolcom/libunftp/pull/482) Fixed RUSTSEC-2023-0052 - Compile against Rust 1.72.0 -- BREAKING: Upgrade to latest bitflags dependency. Bitflags are exposed in the API +- BREAKING: Upgrade to latest bitflags dependency. Bitflags are exposed in the API for the TlsFlags option. - Improved tests - Upgraded dependencies @@ -44,8 +49,10 @@ _tag: libunftp-0.19.0_ - [#449](https://github.com/bolcom/libunftp/pull/449) GCS Backend has had a cleanup (deduplication, modularization) - [#461](https://github.com/bolcom/libunftp/pull/461) Better GCS error mapping to FTP and convey the causing - [#465](https://github.com/bolcom/libunftp/pull/465) Handle paginated results for LIST fixing issue #464 -- [#466](https://github.com/bolcom/libunftp/pull/465) Fixed an (unreleased) issue regarding root directory affecting list and cwd -- [#467](https://github.com/bolcom/libunftp/pull/467) Added more verbose error details for HTTP responses with error body +- [#466](https://github.com/bolcom/libunftp/pull/465) Fixed an (unreleased) issue regarding root directory affecting + list and cwd +- [#467](https://github.com/bolcom/libunftp/pull/467) Added more verbose error details for HTTP responses with error + body - [#478](https://github.com/bolcom/libunftp/pull/468) Fixed CWD on / error when the directory was empty ### libunftp 0.18.9 @@ -53,11 +60,15 @@ _tag: libunftp-0.19.0_ _tag: libunftp-0.18.9_ - [#461](https://github.com/bolcom/libunftp/pull/461) Cleaned INFO log output -- [#461](https://github.com/bolcom/libunftp/pull/461) New metrics (ftp_transferred_total, ftp_sent_bytes, ftp_received_bytes) -- [#461](https://github.com/bolcom/libunftp/pull/461) Useful new log messages such as data command summary with transfer speed +- [#461](https://github.com/bolcom/libunftp/pull/461) New metrics (ftp_transferred_total, ftp_sent_bytes, + ftp_received_bytes) +- [#461](https://github.com/bolcom/libunftp/pull/461) Useful new log messages such as data command summary with transfer + speed - [#461](https://github.com/bolcom/libunftp/pull/461) Fixed bug where REST command didn't work correctly -- [#461](https://github.com/bolcom/libunftp/pull/461) Various other bug fixes (RETR reply on missing data connection, mapping to correct ftp errors) -- [#458](https://github.com/bolcom/libunftp/pull/458), [66756f1](https://github.com/bolcom/libunftp/commit/66756f1af19515c2df65fa58518d7c874fb2497a) Added partial support for FTP Active Mode. See `Server::active_passive_mode` +- [#461](https://github.com/bolcom/libunftp/pull/461) Various other bug fixes (RETR reply on missing data connection, + mapping to correct ftp errors) +- [#458](https://github.com/bolcom/libunftp/pull/458), [66756f1](https://github.com/bolcom/libunftp/commit/66756f1af19515c2df65fa58518d7c874fb2497a) + Added partial support for FTP Active Mode. See `Server::active_passive_mode` - [#453](https://github.com/bolcom/libunftp/pull/453) Added support for the BYE command - Upgraded dependencies and Rust version @@ -93,7 +104,8 @@ _tag: libunftp-0.18.8_ ### 2022-09-25 libunftp 0.18.6 -- [#429](https://github.com/bolcom/libunftp/pull/429) Await proxy protocol header in a separate task, fixes issue [#208](https://github.com/bolcom/libunftp/issues/208) +- [#429](https://github.com/bolcom/libunftp/pull/429) Await proxy protocol header in a separate task, fixes + issue [#208](https://github.com/bolcom/libunftp/issues/208) - [#428](https://github.com/bolcom/libunftp/pull/428) Support Elliptic Curve Private Keys - Upgraded dependencies @@ -103,8 +115,10 @@ _tag: libunftp-0.18.8_ _tag: unftp-auth-jsonfile-0.2.1_ -- [#416](https://github.com/bolcom/libunftp/pull/416) GCS support for `RMD`. Plus `CWD` now checks target directory existence -- [#415](https://github.com/bolcom/libunftp/pull/415) Support directory timestamps in GCS. To resolve issues with some UI FTP clients, such as Cyberduck +- [#416](https://github.com/bolcom/libunftp/pull/416) GCS support for `RMD`. Plus `CWD` now checks target directory + existence +- [#415](https://github.com/bolcom/libunftp/pull/415) Support directory timestamps in GCS. To resolve issues with some + UI FTP clients, such as Cyberduck ### unftp-auth-* v0.2.1 @@ -121,7 +135,8 @@ _tag: unftp-auth-jsonfile-0.2.1_ _tag: libunftp-0.18.5_ - [#414](https://github.com/bolcom/libunftp/pull/414) Fixed path display issues for Windows clients. -- [#413](https://github.com/bolcom/libunftp/pull/413) Fixed issue where the `OPTS UTF8` command was not handled correctly +- [#413](https://github.com/bolcom/libunftp/pull/413) Fixed issue where the `OPTS UTF8` command was not handled + correctly as seen with the FTP client included in Windows Explorer. - Upgraded dependencies @@ -129,12 +144,14 @@ _tag: libunftp-0.18.5_ _tag: libunftp-0.18.4_ -- [#343](https://github.com/bolcom/libunftp/pull/343), anti - brute force password guessing feature, choose from different failed login attempts policies: deters +- [#343](https://github.com/bolcom/libunftp/pull/343), anti - brute force password guessing feature, choose from + different failed login attempts policies: deters successive failed login attempts based on IP, username or the combination of both -- [#403](https://github.com/bolcom/libunftp/pull/403), [#404](https://github.com/bolcom/libunftp/pull/404) Improved logging: The username and file path are logged in +- [#403](https://github.com/bolcom/libunftp/pull/403), [#404](https://github.com/bolcom/libunftp/pull/404) Improved + logging: The username and file path are logged in separate fields in more places. -- [#405](https://github.com/bolcom/libunftp/pull/405) Improved metrics: The `ftp_reply_total` and `ftp_error_total` - counters now have new labels `event` and `event_type` to allow correlation with the event for which a reply is given +- [#405](https://github.com/bolcom/libunftp/pull/405) Improved metrics: The `ftp_reply_total` and `ftp_error_total` + counters now have new labels `event` and `event_type` to allow correlation with the event for which a reply is given or for which an error occurred. - [#402](https://github.com/bolcom/libunftp/pull/402) Allow `OPTS UTF8 ..` without needing to authenticate. - Upgraded dependencies @@ -143,7 +160,8 @@ _tag: libunftp-0.18.4_ _tag: libunftp-0.18.3_ -- [#394](https://github.com/bolcom/libunftp/pull/394) Implemented a new API (`Server.notify_data` and `Server.notify_presence`) +- [#394](https://github.com/bolcom/libunftp/pull/394) Implemented a new API (`Server.notify_data` + and `Server.notify_presence`) to allow listening for file events. - Upgraded dependencies @@ -151,7 +169,8 @@ _tag: libunftp-0.18.3_ _tag: libunftp-0.18.2_ -- [#386](https://github.com/bolcom/libunftp/issues/386) Implemented graceful shutdown through the Server.shutdown_indicator method. +- [#386](https://github.com/bolcom/libunftp/issues/386) Implemented graceful shutdown through the + Server.shutdown_indicator method. - Upgraded to rustls v0.20.0 - Upgraded other minor dependency versions - Testing improvements @@ -161,14 +180,14 @@ _tag: libunftp-0.18.2_ _tag: libunftp-0.18.1_ - Replace futures with futures-util and use Tokio's mpsc channels -- [#371](https://github.com/bolcom/libunftp/pull/371), [#377](https://github.com/bolcom/libunftp/pull/377) Fixed an - issue where rclone reported all file sizes as 0. The fix was to include the number of links to a file in the output +- [#371](https://github.com/bolcom/libunftp/pull/371), [#377](https://github.com/bolcom/libunftp/pull/377) Fixed an + issue where rclone reported all file sizes as 0. The fix was to include the number of links to a file in the output to the client. - Fixed a unit tests - Upgraded dependencies -- [#379](https://github.com/bolcom/libunftp/pull/379) Fixed an issue where the `Permissions` struct could not be used +- [#379](https://github.com/bolcom/libunftp/pull/379) Fixed an issue where the `Permissions` struct could not be used even though it was public. -- [#380](https://github.com/bolcom/libunftp/pull/380), [#381](https://github.com/bolcom/libunftp/pull/381) Return STAT +- [#380](https://github.com/bolcom/libunftp/pull/380), [#381](https://github.com/bolcom/libunftp/pull/381) Return STAT response as a multi-line in accordance with RFC 959 in order to fix an issue with the Cyberduck client. ## 2021-07-13 Release of all crates @@ -177,19 +196,19 @@ _tag: libunftp-0.18.1_ _tag: libunftp-0.18.0_ -- [#356](https://github.com/bolcom/libunftp/pull/356) Authenticators can now also take the connection source IP, and +- [#356](https://github.com/bolcom/libunftp/pull/356) Authenticators can now also take the connection source IP, and the client certificate chain into account in addition to the password when performing authentication. -- [#356](https://github.com/bolcom/libunftp/pull/356/files) **Breaking**: The `Authenticator::authenticate` method now +- [#356](https://github.com/bolcom/libunftp/pull/356/files) **Breaking**: The `Authenticator::authenticate` method now takes a `Credentials` structure reference instead of a `str` reference for the second parameter. -- [#373](https://github.com/bolcom/libunftp/pull/373) **Breaking**: The `StorageBackend` methods were all changed to +- [#373](https://github.com/bolcom/libunftp/pull/373) **Breaking**: The `StorageBackend` methods were all changed to take a reference of a user (`&User`) instead of an optional reference to it (`&Option`). - Dependency upgrades and cleanups - Fixed an issue where OPTS UTF8 returned the wrong FTP reply code - [#361](https://github.com/bolcom/libunftp/issues/361) Don't allow consecutive PASS commands - Added support for TLS client certificates -- [#358](https://github.com/bolcom/libunftp/pull/358/files) Added the ability for authenticators to do password-less - authentication when the user presents a valid client certificate. See the `Authenticator.cert_auth_sufficient` method. - +- [#358](https://github.com/bolcom/libunftp/pull/358/files) Added the ability for authenticators to do password-less + authentication when the user presents a valid client certificate. See the `Authenticator.cert_auth_sufficient` method. + ### unftp-auth-jsonfile v0.2.0 _tag: unftp-auth-jsonfile-0.2.0_ @@ -214,14 +233,16 @@ _tag: unftp-auth-jsonfile-0.2.0_ _tag: unftp-sbe-gcs-0.1.1_ - Added an extension trait that adds a `Server::with_gcs` constructor. -- Added support for the `SITE MD5` FTP command. Also see [Server::sitemd5](https://docs.rs/libunftp/0.17.4/libunftp/struct.Server.html#method.sitemd5) in libunftp. +- Added support for the `SITE MD5` FTP command. Also + see [Server::sitemd5](https://docs.rs/libunftp/0.17.4/libunftp/struct.Server.html#method.sitemd5) in libunftp. ## 2021-05-22 libunftp 0.17.4 _tag: libunftp-0.17.4_ -- Added a new `SITE MD5` command that allows FTP clients to obtain the MD5 checksum of a remote file. The feature is - disabled for anonymous users by default. See [Server::sitemd5](https://docs.rs/libunftp/0.17.4/libunftp/struct.Server.html#method.sitemd5). +- Added a new `SITE MD5` command that allows FTP clients to obtain the MD5 checksum of a remote file. The feature is + disabled for anonymous users by default. + See [Server::sitemd5](https://docs.rs/libunftp/0.17.4/libunftp/struct.Server.html#method.sitemd5). ## 2021-05-02 libunftp v0.17.3 @@ -240,12 +261,12 @@ _tag: unftp-auth-jsonfile-0.1.1_ _tag: libunftp-0.17.2_ - Fixed output formatting of the FEAT command. -- Fixed the SIZE command that wrongly took the REST restart position into account and also caused number overflows +- Fixed the SIZE command that wrongly took the REST restart position into account and also caused number overflows because of that. -- Removed panics that could happen when failing to load the TLS certificate or key, these errors are now propagated via +- Removed panics that could happen when failing to load the TLS certificate or key, these errors are now propagated via the `Server::listen` method. - Implemented TLS session resumption with server side session IDs. -- Implemented TLS session resumption with [tickets](https://tools.ietf.org/html/rfc5077). +- Implemented TLS session resumption with [tickets](https://tools.ietf.org/html/rfc5077). - Added the `Server::ftps_tls_flags` method to allow switching TLS features on or off. ## 2021-04-18 libunftp v0.17.1 @@ -255,7 +276,8 @@ _tag: libunftp-0.17.1_ Changes in this release: - [#327](https://github.com/bolcom/libunftp/issues/327) Allow PROT and PBSZ without requiring authentication. -- [#330](https://github.com/bolcom/libunftp/pull/330) Load TLS certificates only once at startup instead of on every connect. +- [#330](https://github.com/bolcom/libunftp/pull/330) Load TLS certificates only once at startup instead of on every + connect. ## 2021-03-26 Newly splitted auth and storage back-ends @@ -269,8 +291,7 @@ Changes in this release: _tag: libunftp-0.17.0_ - -The main focus of this release was the removal of contained authentication and storage back-ends from the libunftp crate +The main focus of this release was the removal of contained authentication and storage back-ends from the libunftp crate and into their own crates. As you can imagine this brings about breaking changes. Source code for these crates can still be found in this repository under the `crates` directory. @@ -283,16 +304,15 @@ Breaking Changes: - Split the PAM authenticator into crate [unftp-auth-pam](https://crates.io/crates/unftp-auth-pam) - Split the REST authenticator into crate [unftp-auth-rest](https://crates.io/crates/unftp-auth-rest) - Changed some public API names to adhere to Rust naming conventions: - - PAMAuthenticator became PamAuthenticator - - PassiveHost::IP became PassiveHost::Ip - - PassiveHost::DNS became PassiveHost::Dns - - RestError::HTTPStatusError became RestError::HttpStatusError - - RestError::JSONDeserializationError became RestError::JsonDeserializationError - - RestError::JSONSerializationError became RestError::JsonSerializationError + - PAMAuthenticator became PamAuthenticator + - PassiveHost::IP became PassiveHost::Ip + - PassiveHost::DNS became PassiveHost::Dns + - RestError::HTTPStatusError became RestError::HttpStatusError + - RestError::JSONDeserializationError became RestError::JsonDeserializationError + - RestError::JSONSerializationError became RestError::JsonSerializationError - The `Server::with_fs` method moved into the `ServerExt` extension trait of `unftp-sbe-fs` - The `Server::with_fs_and_auth` method was removed. Use the `Server::with_authenticator` method instead. - Other changes: - Upgraded outdated dependencies diff --git a/Cargo.toml b/Cargo.toml index 21e4e349..1b4d86d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libunftp" -version = "0.19.1" # remember to update html_root_url +version = "0.20.0" # remember to update html_root_url authors = [ "Agoston Horvath ", "Dávid Kosztka ", @@ -9,7 +9,7 @@ authors = [ "Maarten Dirkse ", "Steven Meunier ", "Rob klein Gunnewiek ", - ] +] description = "Extensible, async, cloud orientated FTP(S) server library." documentation = "https://docs.rs/libunftp/" repository = "https://github.com/bolcom/libunftp" @@ -37,42 +37,42 @@ missing_docs = "deny" all = "deny" [dependencies] -async-trait = "0.1.77" -bitflags = "2.4.2" -bytes = "1.5.0" -chrono = { version = "0.4.34", default-features = false, features = ["clock", "std"] } +async-trait = "0.1.80" +bitflags = "2.5.0" +bytes = "1.6.0" +chrono = { version = "0.4.38", default-features = false, features = ["clock", "std"] } derive_more = { version = "0.99.17", features = ["display"] } futures-util = { version = "0.3.30", default-features = false, features = ["alloc", "sink"] } -getrandom = "0.2.12" +getrandom = "0.2.15" lazy_static = "1.4.0" md-5 = "0.10.6" moka = { version = "0.11.3", default-features = false, features = ["sync"] } nix = { version = "0.28.0", default-features = false, features = ["fs"] } -prometheus = { version = "0.13.3", default-features = false } +prometheus = { version = "0.13.4", default-features = false } proxy-protocol = "0.5.0" -rustls = "0.21.10" +rustls = "0.21.12" rustls-pemfile = "1.0.4" slog = { version = "2.7.0", features = ["max_level_trace", "release_max_level_info"] } slog-stdlog = "4.1.1" -thiserror = "1.0.57" -tokio = { version = "1.36.0", features = ["macros", "rt", "net", "process", "sync", "io-util", "time"] } +thiserror = "1.0.60" +tokio = { version = "1.37.0", features = ["macros", "rt", "net", "process", "sync", "io-util", "time"] } tokio-rustls = "0.24.1" -tokio-util = { version = "0.7.10", features = ["codec"] } +tokio-util = { version = "0.7.11", features = ["codec"] } tracing = { version = "0.1.40", default-features = false } tracing-attributes = "0.1.27" -uuid = { version = "1.7.0", features = ["v4"] } +uuid = { version = "1.8.0", features = ["v4"] } x509-parser = "0.16.0" dashmap = "5.5.3" libc = "0.2" [dev-dependencies] pretty_assertions = "1.4.0" -tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } -unftp-sbe-fs = { path = "../libunftp/crates/unftp-sbe-fs"} +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"] } +unftp-sbe-fs = { path = "../libunftp/crates/unftp-sbe-fs" } [patch.crates-io] -capsicum = { git = "https://github.com/asomers/capsicum-rs", rev = "24330ee"} -casper-sys = { git = "https://github.com/asomers/capsicum-rs", rev = "24330ee"} +capsicum = { git = "https://github.com/asomers/capsicum-rs", rev = "24330ee" } +casper-sys = { git = "https://github.com/asomers/capsicum-rs", rev = "24330ee" } [lints] -workspace=true +workspace = true diff --git a/README.md b/README.md index 94b18494..94ea6de7 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,23 @@ [![API Docs](https://docs.rs/libunftp/badge.svg)](https://docs.rs/libunftp) [![Build Status](https://github.com/bolcom/libunftp/actions/workflows/rust.yml/badge.svg?branch=master)](https://github.com/bolcom/libunftp/actions/workflows/rust.yml) [![Crate License](https://img.shields.io/crates/l/libunftp.svg)](https://crates.io/crates/libunftp) -[![Follow on Telegram](https://img.shields.io/badge/Follow%20on-Telegram-brightgreen.svg)](https://t.me/unftp) - +[![Follow on Telegram](https://img.shields.io/badge/Follow%20on-Telegram-brightgreen.svg)](https://t.me/unftp) When you need to FTP, but don't want to. ![logo](logo.png) -[**Website**](https://unftp.rs) | [**API Docs**](https://docs.rs/libunftp) | [**unFTP**](https://github.com/bolcom/unFTP) +[**Website**](https://unftp.rs) | [**API Docs**](https://docs.rs/libunftp) | [**unFTP +**](https://github.com/bolcom/unFTP) -The libunftp library drives [unFTP](https://github.com/bolcom/unFTP). It's an extensible, async, cloud orientated FTP(S) +The libunftp library drives [unFTP](https://github.com/bolcom/unFTP). It's an extensible, async, cloud orientated FTP(S) server implementation in [Rust](https://rust-lang.org) brought to you by the [bol.com techlab](https://techlab.bol.com). Because of its plug-able authentication (e.g. PAM, JSON File, Generic REST) and storage backends (e.g. local filesystem, [Google Cloud Storage](https://cloud.google.com/storage)) it's more flexible than traditional FTP servers and a perfect match for the cloud. -It runs on top of the [Tokio](https://tokio.rs) asynchronous run-time and tries to make use of Async IO as much as +It runs on top of the [Tokio](https://tokio.rs) asynchronous run-time and tries to make use of Async IO as much as possible. Feature highlights: @@ -39,15 +39,18 @@ Feature highlights: Known storage back-ends: -* [unftp-sbe-fs](https://crates.io/crates/unftp-sbe-fs) - Stores files on the local filesystem +* [unftp-sbe-fs](https://crates.io/crates/unftp-sbe-fs) - Stores files on the local filesystem * [unftp-sbe-gcs](https://crates.io/crates/unftp-sbe-gcs) - Stores files in Google Cloud Storage -* [unftp-sbe-rooter](https://crates.io/crates/unftp-sbe-rooter) - Wraps another storage back-end in order to root a user to a specific home directory. -* [unftp-sbe-restrict](https://crates.io/crates/unftp-sbe-rooter) - Wraps another storage back-end in order to restrict the FTP operations a user can do i.e. provide authorization. +* [unftp-sbe-rooter](https://crates.io/crates/unftp-sbe-rooter) - Wraps another storage back-end in order to root a user + to a specific home directory. +* [unftp-sbe-restrict](https://crates.io/crates/unftp-sbe-rooter) - Wraps another storage back-end in order to restrict + the FTP operations a user can do i.e. provide authorization. Known authentication back-ends: * [unftp-auth-jsonfile](https://crates.io/crates/unftp-auth-jsonfile) - Authenticates against JSON text. -* [unftp-auth-pam](https://crates.io/crates/unftp-auth-pam) - Authenticates via [PAM](https://en.wikipedia.org/wiki/Linux_PAM). +* [unftp-auth-pam](https://crates.io/crates/unftp-auth-pam) - Authenticates + via [PAM](https://en.wikipedia.org/wiki/Linux_PAM). * [unftp-auth-rest](https://crates.io/crates/unftp-auth-rest) - Consumes an HTTP API to authenticate. ## Prerequisites @@ -66,7 +69,6 @@ Add the libunftp and tokio crates to your project's dependencies in `Cargo.toml` a [storage back-end implementation](https://crates.io/search?page=1&per_page=10&q=unftp-sbe) to add. Here we choose the [file system back-end](https://crates.io/crates/unftp-sbe-fs): - ```toml [dependencies] libunftp = "0.19.0" @@ -85,8 +87,10 @@ pub async fn main() { let ftp_home = std::env::temp_dir(); let server = libunftp::Server::with_fs(ftp_home) .greeting("Welcome to my FTP server") - .passive_ports(50000..65535); - + .passive_ports(50000..65535) + .build() + .unwrap(); + server.listen("127.0.0.1:2121").await; } ``` @@ -106,10 +110,11 @@ For more help refer to: ## Getting help and staying informed -Support is given on a best effort basis. You are welcome to engage us on [the discussions page](https://github.com/bolcom/libunftp/discussions) +Support is given on a best effort basis. You are welcome to engage us +on [the discussions page](https://github.com/bolcom/libunftp/discussions) or create a Github issue. -You can also follow news and talk to us on [Telegram](https://t.me/unftp) +You can also follow news and talk to us on [Telegram](https://t.me/unftp) ## Contributing @@ -117,9 +122,10 @@ Thank you for your interest in contributing to libunftp! Please feel free to create a Github issue if you encounter any problems. -Want to submit a feature request or develop your own storage or authentication back-end? Then head over to +Want to submit a feature request or develop your own storage or authentication back-end? Then head over to our [contribution guide (CONTRIBUTING.md)](CONTRIBUTING.md). ## License -You're free to use, modify and distribute this software under the terms of the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0). +You're free to use, modify and distribute this software under the terms of +the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0). diff --git a/RELEASE-CHECKLIST.md b/RELEASE-CHECKLIST.md index 4ded452e..3d5639a8 100644 --- a/RELEASE-CHECKLIST.md +++ b/RELEASE-CHECKLIST.md @@ -10,21 +10,21 @@ * Run `make pr-prep`, ensuring everything is green * Before releasing libunftp itself, run unFTP while pointing to the new version of libunftp * Update CHANGELOG.md for all the crates affected -* Prepare release notes for the Github release page -* Make a new commit (don't push) indicating the crate name and version number e.g. - > Release libunftp version x.y.x +* Prepare release notes for the GitHub release page +* Make a new commit (don't push) indicating the crate name and version number e.g. + > Release libunftp version x.y.x - or + or - > Release unftp-sbe-fs version x.y.x + > Release unftp-sbe-fs version x.y.x - or + or - > Release all + > Release all * Run `make publish` -* Push to Github -* Create the release in Github using tag format {component}-{version} e.g. +* Push to GitHub +* Create the release in GitHub using tag format {component}-{version} e.g. > libunftp-0.17.1 or - > unftp-sbe-fs-0.1.1 + > unftp-sbe-fs-0.1.1 * Notify the Telegram channel. diff --git a/crates/unftp-auth-jsonfile/Cargo.toml b/crates/unftp-auth-jsonfile/Cargo.toml index df4f3674..713c1f69 100644 --- a/crates/unftp-auth-jsonfile/Cargo.toml +++ b/crates/unftp-auth-jsonfile/Cargo.toml @@ -18,25 +18,25 @@ repository = "https://github.com/bolcom/libunftp/tree/master/crates/unftp-auth-j readme = "README.md" [dependencies] -async-trait = "0.1.77" +async-trait = "0.1.80" base64 = "0.21.7" -bytes = "1.5.0" +bytes = "1.6.0" ipnet = "2.9.0" iprange = "0.6.7" -libunftp = { version="0.19.1", path="../../"} +libunftp = { version = "0.20.0", path = "../../" } ring = "0.16.20" -serde = { version = "1.0.196", features = ["derive"] } -serde_json = "1.0.113" -tokio = { version = "1.36.0", features = ["rt", "time"] } +serde = { version = "1.0.202", features = ["derive"] } +serde_json = "1.0.117" +tokio = { version = "1.37.0", features = ["rt", "time"] } tracing = { version = "0.1.40", default-features = false } tracing-attributes = "0.1.27" valid = "0.3.1" -flate2 = "1.0.28" +flate2 = "1.0.30" [dev-dependencies] pretty_env_logger = "0.5.0" -tokio = { version = "1.36.0", features = ["macros"] } -unftp-sbe-fs = { version="0.2.2", path="../unftp-sbe-fs"} +tokio = { version = "1.37.0", features = ["macros"] } +unftp-sbe-fs = { version = "0.2.2", path = "../unftp-sbe-fs" } [lints] workspace = true diff --git a/crates/unftp-auth-pam/Cargo.toml b/crates/unftp-auth-pam/Cargo.toml index 298e1d13..7d4bf911 100644 --- a/crates/unftp-auth-pam/Cargo.toml +++ b/crates/unftp-auth-pam/Cargo.toml @@ -19,8 +19,8 @@ repository = "https://github.com/bolcom/libunftp/tree/master/crates/unftp-auth-p readme = "README.md" [dependencies] -async-trait = "0.1.77" -libunftp = { version="0.19.1", path="../../"} +async-trait = "0.1.80" +libunftp = { version = "0.20.0", path = "../../" } tracing = { version = "0.1.40", default-features = false } tracing-attributes = "0.1.27" @@ -28,7 +28,7 @@ tracing-attributes = "0.1.27" pam-auth = { package = "pam", version = "0.7.0" } [dev-dependencies] -tokio = { version = "1.36.0", features = ["macros"] } +tokio = { version = "1.37.0", features = ["macros"] } [lints] workspace = true diff --git a/crates/unftp-auth-rest/Cargo.toml b/crates/unftp-auth-rest/Cargo.toml index 60b22cc5..e3831f22 100644 --- a/crates/unftp-auth-rest/Cargo.toml +++ b/crates/unftp-auth-rest/Cargo.toml @@ -18,23 +18,23 @@ repository = "https://github.com/bolcom/libunftp/tree/hannes/crates/unftp-auth-r readme = "README.md" [dependencies] -async-trait = "0.1.77" +async-trait = "0.1.80" hyper = { version = "0.14.28", features = ["client", "runtime", "stream", "http1"] } hyper-rustls = "0.24.2" -libunftp = { version="0.19.1", path="../../"} +libunftp = { version = "0.20.0", path = "../../" } percent-encoding = "2.3.1" -regex = "1.10.3" -serde = { version = "1.0.196", features = ["derive"] } -serde_json = "1.0.113" -tokio = { version = "1.36.0", features = ["rt", "net", "sync", "io-util", "time"] } +regex = "1.10.4" +serde = { version = "1.0.202", features = ["derive"] } +serde_json = "1.0.117" +tokio = { version = "1.37.0", features = ["rt", "net", "sync", "io-util", "time"] } tracing = { version = "0.1.40", default-features = false } tracing-attributes = "0.1.27" [dev-dependencies] pretty_env_logger = "0.5.0" -tokio = { version = "1.36.0", features = ["macros"] } -unftp-sbe-fs = { version="0.2.2", path="../unftp-sbe-fs"} +tokio = { version = "1.37.0", features = ["macros"] } +unftp-sbe-fs = { version = "0.2.2", path = "../unftp-sbe-fs" } [lints] workspace = true diff --git a/crates/unftp-sbe-fs/Cargo.toml b/crates/unftp-sbe-fs/Cargo.toml index 80023390..755c2363 100644 --- a/crates/unftp-sbe-fs/Cargo.toml +++ b/crates/unftp-sbe-fs/Cargo.toml @@ -19,35 +19,35 @@ repository = "https://github.com/bolcom/libunftp/tree/master/crates/unftp-sbe-fs readme = "README.md" [dependencies] -async-trait = "0.1.77" +async-trait = "0.1.80" cfg-if = "1.0" cap-std = "2.0" futures = { version = "0.3.30", default-features = false, features = ["std"] } lazy_static = "1.4.0" -libunftp = { version="0.19.1", path="../../"} +libunftp = { version = "0.20.0", path = "../../" } path_abs = "0.5.1" -tokio = { version = "1.36.0", features = ["rt", "net", "sync", "io-util", "time", "fs"] } -tokio-stream = "0.1.14" +tokio = { version = "1.37.0", features = ["rt", "net", "sync", "io-util", "time", "fs"] } +tokio-stream = "0.1.15" tracing = { version = "0.1.40", default-features = false } tracing-attributes = "0.1.27" [dev-dependencies] async_ftp = "6.0.0" -async-trait = "0.1.77" +async-trait = "0.1.80" more-asserts = "0.3.1" nix = { version = "0.26.4", default-features = false, features = ["user"] } pretty_assertions = "1.4.0" pretty_env_logger = "0.5.0" -regex = "1.10.3" +regex = "1.10.4" rstest = "0.18.2" -serde = { version = "1.0.196", features = ["derive"] } -serde_json = "1.0.113" +serde = { version = "1.0.202", features = ["derive"] } +serde_json = "1.0.117" slog-async = "2.8.0" -slog-term = "2.9.0" -tempfile = "3.10.0" -tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } +slog-term = "2.9.1" +tempfile = "3.10.1" +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"] } tracing-subscriber = "0.3.18" -getrandom = "0.2.12" +getrandom = "0.2.15" [target.'cfg(target_os = "freebsd")'.dev-dependencies] capsicum = { version = "0.3.0", features = ["casper"] } diff --git a/crates/unftp-sbe-fs/README.md b/crates/unftp-sbe-fs/README.md index c341765d..ce7ffe72 100644 --- a/crates/unftp-sbe-fs/README.md +++ b/crates/unftp-sbe-fs/README.md @@ -21,7 +21,7 @@ Add the libunftp and tokio crates to your project's dependencies in `Cargo.toml` ```toml [dependencies] -libunftp = "0.19.1" +libunftp = "0.20.0" unftp-sbe-fs = "0.2.2" tokio = { version = "1", features = ["full"] } ``` @@ -57,10 +57,11 @@ For more help refer to: ## Getting help and staying informed -Support is given on a best effort basis. You are welcome to engage us on [the discussions page](https://github.com/bolcom/libunftp/discussions) +Support is given on a best effort basis. You are welcome to engage us +on [the discussions page](https://github.com/bolcom/libunftp/discussions) or create a Github issue. -You can also follow news and talk to us on [Telegram](https://t.me/unftp) +You can also follow news and talk to us on [Telegram](https://t.me/unftp) ## Contributing @@ -68,9 +69,10 @@ Thank you for your interest in contributing to unftp-sbe-fs! Please feel free to create a Github issue if you encounter any problems. -Want to submit a feature request or develop your own storage or authentication back-end? Then head over to +Want to submit a feature request or develop your own storage or authentication back-end? Then head over to our [contribution guide (CONTRIBUTING.md)](../../CONTRIBUTING.md). ## License -You're free to use, modify and distribute this software under the terms of the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0). +You're free to use, modify and distribute this software under the terms of +the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0). diff --git a/crates/unftp-sbe-gcs/Cargo.toml b/crates/unftp-sbe-gcs/Cargo.toml index 0024557f..de10c9b2 100644 --- a/crates/unftp-sbe-gcs/Cargo.toml +++ b/crates/unftp-sbe-gcs/Cargo.toml @@ -18,22 +18,22 @@ repository = "https://github.com/bolcom/libunftp/tree/master/crates/unftp-sbe-gc readme = "README.md" [dependencies] -async-trait = "0.1.77" +async-trait = "0.1.80" base64 = "0.21.7" -bytes = "1.5.0" -chrono = { version = "0.4.34", default-features = false, features = ["std", "serde"] } +bytes = "1.6.0" +chrono = { version = "0.4.38", default-features = false, features = ["std", "serde"] } futures = { version = "0.3.30", default-features = false, features = ["std"] } hyper = { version = "0.14.28", features = ["client", "runtime", "stream", "http1"] } hyper-rustls = "0.24.2" -libunftp = { version="0.19.1", path="../../"} +libunftp = { version = "0.20.0", path = "../../" } mime = "0.3.17" percent-encoding = "2.3.1" -serde = { version = "1.0.196", features = ["derive"] } -serde_json = "1.0.113" -time = "0.3.34" -tokio = { version = "1.36.0", features = ["rt", "net", "sync", "io-util", "time", "fs"] } -tokio-stream = "0.1.14" -tokio-util = { version = "0.7.10", features = ["codec", "compat"] } +serde = { version = "1.0.202", features = ["derive"] } +serde_json = "1.0.117" +time = "0.3.36" +tokio = { version = "1.37.0", features = ["rt", "net", "sync", "io-util", "time", "fs"] } +tokio-stream = "0.1.15" +tokio-util = { version = "0.7.11", features = ["codec", "compat"] } tracing = { version = "0.1.40", default-features = false } tracing-attributes = "0.1.27" yup-oauth2 = "8.3.2" @@ -49,7 +49,7 @@ pretty_env_logger = "0.5.0" slog = { version = "2.7.0", features = ["max_level_trace", "release_max_level_info"] } slog-async = "2.8.0" slog-stdlog = "4.1.1" -slog-term = "2.9.0" -tempfile = "3.10.0" -tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } +slog-term = "2.9.1" +tempfile = "3.10.1" +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"] } tracing-subscriber = "0.3.18" diff --git a/crates/unftp-sbe-gcs/README.md b/crates/unftp-sbe-gcs/README.md index 2ac5c9a5..d214b0da 100644 --- a/crates/unftp-sbe-gcs/README.md +++ b/crates/unftp-sbe-gcs/README.md @@ -5,7 +5,8 @@ [![Crate License](https://img.shields.io/crates/l/unftp-sbe-gcs.svg)](https://crates.io/crates/unftp-sbe-gcs) [![Follow on Telegram](https://img.shields.io/badge/Follow%20on-Telegram-brightgreen.svg)](https://t.me/unftp) -An storage back-end for [libunftp](https://github.com/bolcom/libunftp) that let you store files in [Google Cloud Storage](https://cloud.google.com/storage). +An storage back-end for [libunftp](https://github.com/bolcom/libunftp) that let you store files +in [Google Cloud Storage](https://cloud.google.com/storage). Please refer to the documentation and the examples directory for usage instructions. ## Usage @@ -14,7 +15,7 @@ Add the needed dependencies to Cargo.toml: ```toml [dependencies] - libunftp = "0.19.1" + libunftp = "0.20.0" unftp-sbe-gcs = "0.2.5" tokio = { version = "1", features = ["full"] } ``` @@ -55,15 +56,18 @@ The above example uses the `ServerExt` extension trait. You can also call one of } ``` -For more usage information see the `examples` directory and the [libunftp API documentation](https://docs.rs/libunftp/latest/libunftp/). +For more usage information see the `examples` directory and +the [libunftp API documentation](https://docs.rs/libunftp/latest/libunftp/). ## Getting help and staying informed -Support is given on a best effort basis. You are welcome to engage us on [Github the discussions page](https://github.com/bolcom/libunftp/discussions) +Support is given on a best effort basis. You are welcome to engage us +on [Github the discussions page](https://github.com/bolcom/libunftp/discussions) or create a Github issue. You can also follow news and talk to us on [Telegram](https://t.me/unftp) ## License -You're free to use, modify and distribute this software under the terms of the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0). +You're free to use, modify and distribute this software under the terms of +the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0). diff --git a/crates/unftp-sbe-gcs/src/lib.rs b/crates/unftp-sbe-gcs/src/lib.rs index 54c31352..054ff9f9 100644 --- a/crates/unftp-sbe-gcs/src/lib.rs +++ b/crates/unftp-sbe-gcs/src/lib.rs @@ -9,7 +9,7 @@ //! //! ```toml //! [dependencies] -//! libunftp = "0.19.1" +//! libunftp = "0.20.0" //! unftp-sbe-gcs = "0.2.5" //! tokio = { version = "1", features = ["full"] } //! ``` diff --git a/src/lib.rs b/src/lib.rs index fa43944a..ec683263 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/libunftp/0.19.1")] +#![doc(html_root_url = "https://docs.rs/libunftp/0.20.0")] //! libunftp is an extensible, async, cloud orientated FTP(S) server library. //! @@ -17,7 +17,7 @@ //! //! ```toml //! [dependencies] -//! libunftp = "0.19.1" +//! libunftp = "0.20.0" //! unftp-sbe-fs = "0.2.0" //! tokio = { version = "1", features = ["full"] } //! ```