Repository navigation
Gen3 - #6
Merged
Merged
Gen3#6
Conversation
CosmosFtpServer 2.0.0 is a plain net10.0 library over System.Net.Sockets and System.IO, with no Cosmos reference: a Gen3 kernel runs it on its network stack and VFS through the socket and file plugs, and a desktop runs it as is. The CosmosVFS parameter is gone; the server takes the directory it serves, which clients see as / and cannot climb out of. One thread serves every client, polling each connection, since the kernel's socket plugs are not thread-safe. Replies follow RFC 959: 150 and 226 around transfers, 227 with the address in h1,h2,h3,h4,p1,p2 form, 257 for PWD. EPSV, EPRT, FEAT, SIZE, APPE, NLST and RNFR/RNTO are new. Passive ports come from a configurable range, so a QEMU user-mode guest can forward them, and a data connection is only taken from, or opened to, the client's own address. Logins go through an optional Authenticate callback.
The tests run a server on a temporary directory and drive it through a bare socket client, so they see the replies as an FTP client parses them: login, transfers over PASV, EPSV and EPRT, listings, directory and file management, paths that climb above the root, refused PORTs, two clients at once and Close. Path resolution is unit-tested on its own.
How to reference 2.0.0 from a Gen3 kernel and start it on a thread, the data connection modes, the ports to forward from a QEMU user-mode guest, and how to run the tests. Gen2 kernels are pointed to 1.x.
A PASV reply named the server's address as the client's connection sees it, which behind NAT is one the client cannot reach: a QEMU user-mode guest names 10.0.2.15. curl and Python ignore that address, but FileZilla connects to it, so its listings and transfers ended in a 425. PassiveAddress, when set, is the address PASV names instead: 127.0.0.1 for a client on the QEMU host. Listen refuses one that is not IPv4, and EPSV, which names no address, is unchanged.
Rename directories, project files, namespaces, package ID and README references from CosmosFtpServer to Cosmos.Network.Ftp.
Build, test and pack on every push and pull request. A v<version> tag also publishes that version, trading GitHub's OIDC token for a short-lived nuget.org key instead of storing one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.