Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update directory enumeration and FTP server #2271

Merged
merged 18 commits into from
Mar 18, 2021

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Mar 17, 2021

This PR deals with directory listings in the framework.
Using a Vector is inefficient, Directory object is almost as simple and more flexible.

The FTP framework and sample have been updated accordingly, with improvements to demonstrate use of
IFS file permissions.

Fully deprecate fileList and update framework using Directory object instead

Fix command handler in Host mode - requires different EOL character

Various minor updates and fixes to IFS component.

Revise FTP Server

Fix bad TcpConnection write calls
Simplify operation - some logic involving canTransfer doesn't seem to be necessary
Re-structure command handling, add login and file access checks.
More commands available if user isn't logged in, permissions handled by filesystem
Note: Default file permissions for new files written to SPIFFS are read/write for Admin only.
Extended directory listings: displayed 'w' value combines READ attribute with user permissions
Add HELP, NLST, CDUP, XCWD and XPWD commands
Base FtpServer on CustomFtpServer class, user may choose to manage users differently
FTP server can use separate filesystem if required

Update FtpServer_Files sample

Add FWFS and mount together with SPIFFS as a hybrid volume (makes things a bit more interesting)
Add another two user accounts with different roles

@slaff slaff added this to the 4.3.0 milestone Mar 18, 2021
@@ -28,11 +31,14 @@ void connectFail(const String& ssid, MacAddress bssid, WifiDisconnectReason reas

void init()
{
spiffs_mount(); // Mount file system, in order to work with files

Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikee47 I know that this is not something that you have added but would it be possible to remove also the unnecessary comment from line 26 ?

// .. some you code for configuration ..

Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
Serial.systemDebugOutput(true); // Enable debug output to serial

// Mount file system, in order to work with files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can add a bit more text explaining the difference between the three mount commands.

@mikee47 mikee47 force-pushed the feature/directory-enumeration branch from cbc42aa to 208928a Compare March 18, 2021 14:40
@slaff slaff merged commit be370cb into SmingHub:develop Mar 18, 2021
@mikee47 mikee47 deleted the feature/directory-enumeration branch March 18, 2021 16:50
@slaff slaff mentioned this pull request Mar 23, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants