Git Product home page Git Product logo

dray's People

Contributors

dependabot[bot] avatar tnewman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dray's Issues

Home Directory Missing

WinSCP displays errors when the home directory is missing. The home directory should be implicitly created.

Graceful Shutdown

On SIGINT:

  1. Stop accepting new connections
  2. Allow existing connections to finish their work

Graceful shutdown is very important to make sure clients are not interrupted during scale-in, maintenance, etc.

Since SFTP is connection oriented, there will need to be a limit to how long to wait.

Test Containers Not Cleaned Up

Test Containers are not cleaned up because they are static, so drop is never run.

Creating a separate container for each test results in intermittent failures.

One idea: Get rid of Test Containers and switch back to Docker Compose. Each test will create it's own directory to provide isolation. The directory will get pruned at the end of the test. The Dray server can also be shared for all tests to avoid spawning a separate server for each test.

Home Directory Permission Error

When using WinSCP, the client will receive a permission error trying to lstat the home directory.

[2022-12-30T16:33:49Z INFO  dray::sftp_session] Received request: Realpath(Path { id: 3856, path: "/home/tnewman/.." })
[2022-12-30T16:33:49Z INFO  dray::sftp_session] Sending response: Name(Name { id: 3856, files: [File { file_name: "/home", file_attributes: FileAttributes { size: None, uid: None, gid: None, permissions: Some(16895), atime: None, mtime: None } }] })
[2022-12-30T16:33:49Z INFO  dray::sftp_session] Received request: Lstat(Path { id: 4103, path: "/home" })
[2022-12-30T16:33:49Z ERROR dray::sftp_session] Received error while processing request: Permission denied.
[2022-12-30T16:33:49Z INFO  dray::sftp_session] Sending response: Status(Status { id: 4103, status_code: PermissionDenied, error_message: "The client has insufficient privileges to perform the requested operation." })

Logging and Tracing

Knowing what went wrong when errors occur is somewhat difficult right now. Ideally, we would have logging and tracing to be able to easily correlate logs.

Publishing as a crate

Thank you for what you do, but there is a question. Why don't you publish it as a crate? This can be used as a good and simple out-of-the-box sftp server implementation

Windows OpenSSH Bug

With Windows OpenSSH (C:\Windows\System32\OpenSSH\sftp.exe) , the REALPATH request gets split into 2 packets, so it is not successfully parsed:

0000000a and 1000000001000000012e

0000000a: Length 10
10: Type 16 (SSH2_FXP_REALPATH)
00000001: Id 1
00000001: String length 1
2e: String Data - .

Log:
[2022-12-31T00:02:34Z INFO dray::sftp_session] Received request: Init(Init { version: 0 })
[2022-12-31T00:02:34Z INFO dray::sftp_session] Sending response: Version(Version { version: 3 })
[2022-12-31T00:02:34Z DEBUG dray::protocol::response] Response bytes: 000000050200000003
[2022-12-31T00:02:34Z DEBUG russh::cipher] writing, seqn = 10
[2022-12-31T00:02:34Z DEBUG russh::cipher] padding length 5
[2022-12-31T00:02:34Z DEBUG russh::cipher] packet_length 24
[2022-12-31T00:02:34Z DEBUG russh::cipher] reading, len = [212, 244, 33, 52]
[2022-12-31T00:02:34Z DEBUG russh::cipher] reading, seqn = 10
[2022-12-31T00:02:34Z DEBUG russh::cipher] reading, clear len = 40
[2022-12-31T00:02:34Z DEBUG russh::cipher] read_exact 44
[2022-12-31T00:02:34Z DEBUG russh::cipher] read_exact done
[2022-12-31T00:02:34Z DEBUG russh::cipher] reading, padding_length 10
[2022-12-31T00:02:34Z DEBUG dray::protocol::request] Request bytes: 0000000a
[2022-12-31T00:02:34Z ERROR dray::ssh_server] Received unparsable request!
[2022-12-31T00:02:34Z DEBUG russh::cipher] reading, len = [70, 180, 113, 89]
[2022-12-31T00:02:34Z DEBUG russh::cipher] reading, seqn = 11
[2022-12-31T00:02:34Z DEBUG russh::cipher] reading, clear len = 40
[2022-12-31T00:02:34Z DEBUG russh::cipher] read_exact 44
[2022-12-31T00:02:34Z DEBUG russh::cipher] read_exact done
[2022-12-31T00:02:34Z DEBUG russh::cipher] reading, padding_length 4
[2022-12-31T00:02:34Z DEBUG dray::protocol::request] Request bytes: 1000000001000000012e
[2022-12-31T00:02:34Z ERROR dray::ssh_server] Received unparsable request!

Cross Platform Test Suite

The test suite currently does not run on Windows (and possibly other platforms) because it shells out to the sftp command and assumes a certain set of functionality.

  1. Update the test suite to use a Rust library for sftp instead of shelling out. https://github.com/veeso/remotefs-rs is an example.
  2. Update the GitHub Actions build matrix to build on Windows and Mac OSX

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.