Skip to content

Commit 56bf4a6

Browse files
committed
Release 0.12.7, includes update to latest libunftp with split extensions
1 parent dc83213 commit 56bf4a6

File tree

7 files changed

+171
-80
lines changed

7 files changed

+171
-80
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ before_script:
2020
- if $DEPLOY; then rustup target add x86_64-unknown-linux-musl; fi
2121

2222
script:
23-
- cargo build --verbose --all --features rest_auth,jsonfile_auth,cloud_storage
24-
- cargo test --verbose --all --features rest_auth,jsonfile_auth,cloud_storage
25-
- if $DEPLOY; then cargo test --verbose --all --all-features --target=x86_64-unknown-linux-musl; else true; fi
23+
- cargo build --verbose --workspace --features rest_auth,jsonfile_auth,cloud_storage
24+
- cargo test --verbose --workspace --features rest_auth,jsonfile_auth,cloud_storage
25+
- if $DEPLOY; then cargo test --verbose --workspace --all-features --target=x86_64-unknown-linux-musl; else true; fi
2626
- if $DEPLOY; then make docker-image; else true; fi
2727

2828
deploy:

Cargo.lock

Lines changed: 108 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unftp"
3-
version = "0.12.6"
3+
version = "0.12.7"
44
authors = [
55
"Agoston Horvath <[email protected]>",
66
"Dávid Kosztka <[email protected]>",
@@ -33,19 +33,27 @@ futures = "0.3.13"
3333
http = "0.2.3"
3434
hyper = { version = "0.14.4", features = ["server", "http1"] }
3535
lazy_static = "1.4.0"
36-
libunftp = "0.16.2"
37-
prometheus = "0.11.0"
36+
libunftp = "0.17.0"
37+
prometheus = "0.12.0"
3838
slog = { version = "2.7.0", features = ["max_level_trace", "release_max_level_info"] }
3939
slog-async = "2.6.0"
4040
slog-term = "2.8.0"
41-
tokio = { version = "1.2.0", features = ["full"] }
41+
tokio = { version = "1.4.0", features = ["full"] }
42+
unftp-sbe-fs = "0.1"
43+
unftp-sbe-gcs = { version = "0.1", optional = true }
44+
unftp-auth-rest = { version = "0.1", optional = true }
45+
unftp-auth-jsonfile = { version = "0.1", optional = true }
46+
47+
[target.'cfg(unix)'.dependencies]
48+
unftp-auth-pam = { version = "0.1", optional = true }
4249

4350
[features]
4451
all = ["pam_auth", "rest_auth", "jsonfile_auth", "cloud_storage"]
45-
cloud_storage = ["libunftp/cloud_storage"]
46-
jsonfile_auth = ["libunftp/jsonfile_auth"]
47-
pam_auth = ["libunftp/pam_auth"]
48-
rest_auth = ["libunftp/rest_auth"]
52+
cloud_storage = ["unftp-sbe-gcs"]
53+
jsonfile_auth = ["unftp-auth-jsonfile"]
54+
pam_auth = ["unftp-auth-pam"]
55+
rest_auth = ["unftp-auth-rest"]
56+
4957

5058
# build everything by default to make sure build works
5159
default = ["rest_auth", "cloud_storage", "jsonfile_auth"]

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RUST_VERSION=1.50.0
1+
RUST_VERSION=1.51.0
22
DOCKER_TAG=$(shell git describe --tags)
33
DOCKER_TEMPLATES:=$(wildcard *.Dockerfile.template)
44
DOCKER_FILES=$(DOCKER_TEMPLATES:%.template=%)
@@ -62,8 +62,8 @@ docker-list: # List the available docker images
6262
pr-prep: # Runs checks to ensure you're ready for a pull request
6363
cargo fmt --all -- --check
6464
cargo clippy --all-features -- -D warnings
65-
cargo build --verbose --all --features rest_auth,jsonfile_auth,cloud_storage
66-
cargo test --verbose --all --features rest_auth,jsonfile_auth,cloud_storage
65+
cargo build --verbose --all --all-features
66+
cargo test --verbose --all --all-features
6767
cargo doc --all-features --no-deps
6868

6969
.PHONY: release-artifacts

crates/redislog/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ homepage = "https://github.com/bolcom/unFTP/tree/master/crates/redislog"
1212
repository = "https://github.com/bolcom/unFTP/tree/master/crates/redislog"
1313
readme = "README.md"
1414

15-
16-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
17-
1815
[dependencies]
1916
chrono = "0.4.6"
2017
r2d2 = "0.8.3"

src/main.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ use tokio::{
3030
runtime::Runtime,
3131
signal::unix::{signal, SignalKind},
3232
};
33+
use unftp_sbe_gcs::options::AuthMethod;
3334
use user::LookupAuthenticator;
3435

3536
#[cfg(feature = "pam_auth")]
36-
use libunftp::auth::pam;
37-
use libunftp::storage::cloud_storage::options::AuthMethod;
37+
use unftp_auth_pam as pam;
3838

3939
fn make_auth(m: &clap::ArgMatches) -> Result<Arc<dyn auth::Authenticator<user::User> + Send + Sync>, String> {
4040
match m.value_of(args::AUTH_TYPE) {
@@ -60,7 +60,7 @@ fn make_pam_auth(m: &clap::ArgMatches) -> Result<Arc<dyn auth::Authenticator<use
6060
#[cfg(feature = "pam_auth")]
6161
{
6262
if let Some(service) = m.value_of(args::AUTH_PAM_SERVICE) {
63-
let pam_auth = pam::PAMAuthenticator::new(service);
63+
let pam_auth = pam::PamAuthenticator::new(service);
6464
return Ok(Arc::new(LookupAuthenticator::new(pam_auth)));
6565
}
6666
Err(format!("--{} is required when using pam auth", args::AUTH_PAM_SERVICE))
@@ -88,7 +88,7 @@ fn make_rest_auth(m: &clap::ArgMatches) -> Result<Arc<dyn auth::Authenticator<us
8888
return Err("REST authenticator error: no body provided for rest request".to_string());
8989
}
9090

91-
let authenticator: auth::rest::RestAuthenticator = match auth::rest::Builder::new()
91+
let authenticator: unftp_auth_rest::RestAuthenticator = match unftp_auth_rest::Builder::new()
9292
.with_username_placeholder("{USER}".to_string())
9393
.with_password_placeholder("{PASS}".to_string())
9494
.with_url(String::from(url))
@@ -124,17 +124,17 @@ fn make_json_auth(m: &clap::ArgMatches) -> Result<Arc<dyn auth::Authenticator<us
124124
.value_of(args::AUTH_JSON_PATH)
125125
.ok_or_else(|| "please provide the json credentials file by specifying auth-json-path".to_string())?;
126126

127-
let authenticator = auth::jsonfile::JsonFileAuthenticator::new(path).map_err(|e| e.to_string())?;
127+
let authenticator = unftp_auth_jsonfile::JsonFileAuthenticator::new(path).map_err(|e| e.to_string())?;
128128
Ok(Arc::new(LookupAuthenticator::new(authenticator)))
129129
}
130130
}
131131

132132
// Creates the filesystem storage back-end
133-
fn fs_storage_backend(log: &Logger, m: &clap::ArgMatches) -> Box<dyn (Fn() -> storage::StorageBE) + Send + Sync> {
133+
fn fs_storage_backend(log: &Logger, m: &clap::ArgMatches) -> Box<dyn (Fn() -> storage::StorageBe) + Send + Sync> {
134134
let p: PathBuf = m.value_of(args::ROOT_DIR).unwrap().into();
135135
let sub_log = Arc::new(log.new(o!("module" => "storage")));
136-
Box::new(move || storage::StorageBE {
137-
inner: storage::InnerStorage::File(libunftp::storage::filesystem::Filesystem::new(p.clone())),
136+
Box::new(move || storage::StorageBe {
137+
inner: storage::InnerStorage::File(unftp_sbe_fs::Filesystem::new(p.clone())),
138138
log: sub_log.clone(),
139139
})
140140
}
@@ -143,7 +143,7 @@ fn fs_storage_backend(log: &Logger, m: &clap::ArgMatches) -> Box<dyn (Fn() -> st
143143
fn gcs_storage_backend(
144144
log: &Logger,
145145
m: &clap::ArgMatches,
146-
) -> Result<Box<dyn (Fn() -> storage::StorageBE) + Send + Sync>, String> {
146+
) -> Result<Box<dyn (Fn() -> storage::StorageBe) + Send + Sync>, String> {
147147
let bucket: String = m
148148
.value_of(args::GCS_BUCKET)
149149
.ok_or_else(|| format!("--{} is required when using storage type gcs", args::GCS_BUCKET))?
@@ -177,8 +177,8 @@ fn gcs_storage_backend(
177177
slog::info!(log, "GCS back-end auth method: {}", auth_method);
178178

179179
let sub_log = Arc::new(log.new(o!("module" => "storage")));
180-
Ok(Box::new(move || storage::StorageBE {
181-
inner: storage::InnerStorage::Cloud(libunftp::storage::cloud_storage::CloudStorage::with_api_base(
180+
Ok(Box::new(move || storage::StorageBe {
181+
inner: storage::InnerStorage::Cloud(unftp_sbe_gcs::CloudStorage::with_api_base(
182182
base_url.clone(),
183183
bucket.clone(),
184184
root_dir.clone(),
@@ -220,12 +220,12 @@ fn get_passive_host_option(log: &Logger, arg_matches: &ArgMatches) -> Result<opt
220220
match passive_host_str {
221221
None | Some("from-connection") => Ok(options::PassiveHost::FromConnection),
222222
Some(ip_or_dns) => match ip_or_dns.parse() {
223-
Ok(IpAddr::V4(ip)) => Ok(options::PassiveHost::IP(ip)),
223+
Ok(IpAddr::V4(ip)) => Ok(options::PassiveHost::Ip(ip)),
224224
Ok(IpAddr::V6(_)) => Err(format!(
225225
"an IP is valid for the '--{}' argument, but it needs to be an IP v4 address",
226226
args::PASSIVE_HOST
227227
)),
228-
Err(_) => resolve_dns(log, ip_or_dns).map(options::PassiveHost::IP),
228+
Err(_) => resolve_dns(log, ip_or_dns).map(options::PassiveHost::Ip),
229229
},
230230
}
231231
}

0 commit comments

Comments
 (0)