An FTP server project built in Rust, designed to follow RFC 959. This project serves as a learning experience for the Rust programming language.
- Basic FTP server functionality
- Authentication support
- Initial implementation of RFC 959 commands
- Create types for Data Transfer using the data connection, for now Response::CustomString
- Close existing PASV connection if client sends multiple PASSV to prevent Port DDOS
- File transfers (upload/download)
- Have another receiver in the session to signal data sent
- Ensure user cant have a PORT and PASV command at the same time
- Refactor the Response into maybe an Enum or something else since the data connection usually doesn't care about the code and message
- Use BufReader instead of calling read on the TCP stream (https://doc.rust-lang.org/std/io/struct.BufReader.html)
- Implement transmission modes according to RFC (Block, Compressed etc)
- Add debug statements for data connections (generally improve logging)
- Use timeouts for the connections
- Add more test cases
- Cleanup checks for data connection and probably the entire response
| Command | Arguments | Implemented |
|---|---|---|
| USER | <username> |
[x] |
| PASS | <password> |
[x] |
| ACCT | <account-information> |
[ ] |
| CWD | <pathname> |
[x] |
| CDUP | (none) | [x] |
| SMNT | <pathname> |
[ ] |
| QUIT | (none) | [x] |
| REIN | (none) | [x] |
| PORT | <host-port> |
[x] |
| PASV | (none) | [x] |
| TYPE | <type-code> |
[x] |
| STRU | <structure-code> |
[ ] |
| MODE | <mode-code> |
[ ] |
| RETR | <pathname> |
[x] |
| STOR | <pathname> |
[x] |
| STOU | (none) | [x] |
| APPE | <pathname> |
[x] |
| ALLO | <decimal-integer> [ R <decimal-integer> ] |
[ ] |
| REST | <marker> |
[ ] |
| RNFR | <pathname> |
[ ] |
| RNTO | <pathname> |
[ ] |
| ABOR | (none) | [ ] |
| DELE | <pathname> |
[x] |
| RMD | <pathname> |
[x] |
| MKD | <pathname> |
[x] |
| PWD | (none) | [x] |
| LIST | [<pathname>] |
[x] |
| NLST | [<pathname>] |
[x] |
| SITE | <string> |
[ ] |
| SYST | (none) | [x] |
| STAT | [<pathname>] |
[x] |
| HELP | [<string>] |
[x] |
| NOOP | (none) | [x] |
- Rust (latest stable version recommended)
- Cargo package manager
git clone https://github.com/Norris1z/bahn.git
cd bahn
mv .env.example .env #update with preferred envcargo runContributions are welcome! Feel free to open issues or submit pull requests.
MIT License