Skip to content

Commit

Permalink
feat: remotefs 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Sep 30, 2024
1 parent 6b99298 commit 74321e9
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 24 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

- [Changelog](#changelog)
- [0.4.0](#040)
- [0.3.1](#031)
- [0.3.0](#030)
- [0.2.1](#021)
Expand All @@ -14,6 +15,12 @@

---

## 0.4.0

Released on 30/09/2024

- bump `remotefs` to `0.3.0`

## 0.3.1

Released on 09/07/2024
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Always mind that your suggestion, may be rejected: I'll always provide a feedbac

At the moment, these kind of contributions are more appreciated and should be preferred:

- Fix for issues described in [Known Issues](./README.md#known-issues-) or [issues reported by the community](https://github.com/veeso/remotefs/issues)
- Fix for issues described in [Known Issues](./README.md#known-issues-) or [issues reported by the community](https://github.com/remotefs-rs/remotefs/issues)
- New file transfers: for further details see [Implementing File Transfer](#implementing-file-transfers)
- Code optimizations: any optimization to the code is welcome

Expand Down
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ categories = ["network-programming"]
description = "remotefs SSH client library"
documentation = "https://docs.rs/remotefs-ssh"
edition = "2021"
homepage = "https://veeso.github.io/remotefs-rs-ssh/"
include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.md"]
keywords = ["remotefs", "ssh-client", "scp-client", "sftp-client"]
license = "MIT"
name = "remotefs-ssh"
readme = "README.md"
repository = "https://github.com/veeso/remotefs-rs-ssh"
version = "0.3.1"
repository = "https://github.com/remotefs-rs/remotefs-rs-ssh"
version = "0.4.0"

[dependencies]
chrono = "^0.4"
lazy-regex = "3"
log = "^0.4"
remotefs = "^0.2"
remotefs = "^0.3"
ssh2-config = "^0.2"
ssh2 = "^0.9"

Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
<p align="center">~ Remotefs SSH client ~</p>

<p align="center">Developed by <a href="https://veeso.github.io/" target="_blank">@veeso</a></p>
<p align="center">Current version: 0.3.1 (09/07/2024)</p>
<p align="center">Current version: 0.4.0 (30/09/2024)</p>

<p align="center">
<a href="https://opensource.org/licenses/MIT"
><img
src="https://img.shields.io/badge/License-MIT-teal.svg"
alt="License-MIT"
/></a>
<a href="https://github.com/veeso/remotefs-rs-ssh/stargazers"
<a href="https://github.com/remotefs-rs/remotefs-rs-ssh/stargazers"
><img
src="https://img.shields.io/github/stars/veeso/remotefs-rs-ssh.svg"
src="https://img.shields.io/github/stars/remotefs-rs/remotefs-rs-ssh.svg"
alt="Repo stars"
/></a>
<a href="https://crates.io/crates/remotefs-ssh"
Expand All @@ -41,24 +41,24 @@
/></a>
</p>
<p align="center">
<a href="https://github.com/veeso/remotefs-rs-ssh/actions"
<a href="https://github.com/remotefs-rs/remotefs-rs-ssh/actions"
><img
src="https://github.com/veeso/remotefs-rs-ssh/workflows/Linux/badge.svg"
src="https://github.com/remotefs-rs/remotefs-rs-ssh/workflows/Linux/badge.svg"
alt="Linux CI"
/></a>
<a href="https://github.com/veeso/remotefs-rs-ssh/actions"
<a href="https://github.com/remotefs-rs/remotefs-rs-ssh/actions"
><img
src="https://github.com/veeso/remotefs-rs-ssh/workflows/MacOS/badge.svg"
src="https://github.com/remotefs-rs/remotefs-rs-ssh/workflows/MacOS/badge.svg"
alt="MacOS CI"
/></a>
<a href="https://github.com/veeso/remotefs-rs-ssh/actions"
<a href="https://github.com/remotefs-rs/remotefs-rs-ssh/actions"
><img
src="https://github.com/veeso/remotefs-rs-ssh/workflows/Windows/badge.svg"
src="https://github.com/remotefs-rs/remotefs-rs-ssh/workflows/Windows/badge.svg"
alt="Windows CI"
/></a>
<a href="https://coveralls.io/github/veeso/remotefs-rs-ssh"
<a href="https://coveralls.io/github/remotefs-rs/remotefs-rs-ssh"
><img
src="https://coveralls.io/repos/github/veeso/remotefs-rs-ssh/badge.svg"
src="https://coveralls.io/repos/github/remotefs-rs/remotefs-rs-ssh/badge.svg"
alt="Coveralls"
/></a>
<a href="https://docs.rs/remotefs-ssh"
Expand All @@ -72,7 +72,7 @@

## About remotefs-ssh ☁️

remotefs-ssh is a client implementation for [remotefs](https://github.com/veeso/remotefs-rs), providing support for the SFTP/SCP protocol.
remotefs-ssh is a client implementation for [remotefs](https://github.com/remotefs-rs/remotefs-rs), providing support for the SFTP/SCP protocol.

---

Expand All @@ -81,7 +81,8 @@ remotefs-ssh is a client implementation for [remotefs](https://github.com/veeso/
First of all, add `remotefs-ssh` to your project dependencies:

```toml
remotefs-ssh = "^0.3"
remotefs = "0.3"
remotefs-ssh = "^0.4"
```

these features are supported:
Expand Down
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

//! # remotefs-ssh
//!
//! remotefs-ssh is a client implementation for [remotefs](https://github.com/veeso/remotefs-rs), providing support for the SCP/SFTP protocols.
//! remotefs-ssh is a client implementation for [remotefs](https://github.com/remotefs-rs/remotefs-rs), providing support for the SCP/SFTP protocols.
//!
//! ## Get started
//!
Expand Down Expand Up @@ -50,6 +50,12 @@
//!
#![doc(html_playground_url = "https://play.rust-lang.org")]
#![doc(
html_favicon_url = "https://raw.githubusercontent.com/remotefs-rs/remotefs-rs/main/assets/logo-128.png"
)]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/remotefs-rs/remotefs-rs/main/assets/logo.png"
)]

// -- crates
#[macro_use]
Expand Down
4 changes: 2 additions & 2 deletions src/ssh/scp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ impl RemoteFs for ScpFs {
metadata.size,
Some((modified, accessed)),
) {
Ok(channel) => Ok(WriteStream::from(Box::new(channel) as Box<dyn Write>)),
Ok(channel) => Ok(WriteStream::from(Box::new(channel) as Box<dyn Write + Send>)),
Err(err) => {
error!("Failed to create file: {}", err);
Err(RemoteError::new_ex(RemoteErrorType::FileCreateDenied, err))
Expand All @@ -630,7 +630,7 @@ impl RemoteFs for ScpFs {
self.session.as_mut().unwrap().set_blocking(true);
trace!("blocked channel");
match self.session.as_mut().unwrap().scp_recv(path.as_path()) {
Ok((channel, _)) => Ok(ReadStream::from(Box::new(channel) as Box<dyn Read>)),
Ok((channel, _)) => Ok(ReadStream::from(Box::new(channel) as Box<dyn Read + Send>)),
Err(err) => {
error!("Failed to open file: {}", err);
Err(RemoteError::new_ex(RemoteErrorType::CouldNotOpenFile, err))
Expand Down
6 changes: 3 additions & 3 deletions src/ssh/sftp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,13 @@ impl RemoteFs for SftpFs {
})
}

// -- override (std::io::copy is VERY slow on SFTP <https://github.com/veeso/remotefs-rs/issues/6>)
// -- override (std::io::copy is VERY slow on SFTP <https://github.com/remotefs-rs/remotefs-rs/issues/6>)

fn append_file(
&mut self,
path: &Path,
metadata: &Metadata,
mut reader: Box<dyn Read>,
mut reader: Box<dyn Read + Send>,
) -> RemoteResult<u64> {
if self.is_connected() {
let mut stream = self.append(path, metadata)?;
Expand Down Expand Up @@ -505,7 +505,7 @@ impl RemoteFs for SftpFs {
&mut self,
path: &Path,
metadata: &Metadata,
mut reader: Box<dyn std::io::Read>,
mut reader: Box<dyn std::io::Read + Send>,
) -> RemoteResult<u64> {
if self.is_connected() {
let mut stream = self.create(path, metadata)?;
Expand Down

0 comments on commit 74321e9

Please sign in to comment.