-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Update directory enumeration and FTP server #2271
Conversation
@@ -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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Put spiffs_mount() after serial init, so any error messages can be seen Add FWFS volume to make file listing a bit more interesting
`canTransfer` doesn't seem to be necessary, so remove `onSent` not required
Set default data port to 20 as per spec.
Check folder for write access if file doesn't exist Displayed 'w' value combines READ attribute with user permissions
Applications may choose to restrict FTP access to separate filesystem
cbc42aa
to
208928a
Compare
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 usingDirectory
object insteadFix 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 necessaryRe-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
onCustomFtpServer
class, user may choose to manage users differentlyFTP 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