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

Feature request - rclone serve ftp #2151

Closed
ghost opened this issue Mar 18, 2018 · 5 comments
Closed

Feature request - rclone serve ftp #2151

ghost opened this issue Mar 18, 2018 · 5 comments
Milestone

Comments

@ghost
Copy link

ghost commented Mar 18, 2018

I would like to be able to access an rclone remote as though it were a directory on an FTP server. Basically, rclone would be the ftp server, and remotes are subdirectories under the root. I could then use the client of my choice (filezilla) to do things like move files via drag-n-drop and rename files/folders. Of course, I shouldn't be able to delete the remotes, but everything else should work as though it were a normal file or folder on an ftp server. Any reason this would not be feasible?

@danielloader
Copy link
Contributor

Tried using webDAV for this? Need a different client like filezilla pro, but windows and other operating systems can mount webDAV as a drive without extra software.

@ncw
Copy link
Member

ncw commented Mar 20, 2018

At the moment we have rclone serve webdav and rclone serve http for read only access.

I could imagine an rclone serve ftp or rclone serve sftp.

Another choice you have is to use rclone mount and then serve the mounted directory with an ftp server.

@ncw ncw added this to the Help Wanted milestone Mar 20, 2018
@sapk
Copy link
Contributor

sapk commented Mar 22, 2018

I can try something if that is ok? I find serve command to be very usefull to use rclone inside container without extra permissions to serve as a proxy to external hosting and ftp protocol should be a good addition to it.

I would suggest using https://github.com/fclairamb/ftpserver or https://github.com/goftp/server.

To compare ftp features that they offer :

FTP Commands: https://www.iana.org/assignments/ftp-commands-extensions/ftp-commands-extensions.xhtml

Both use standard library (except fclairamb/ftpserver that use go-kit for logging)

@ncw
Copy link
Member

ncw commented Mar 23, 2018

@sapk yes that would be great if you wanted to have a go.

You should find the vfs layer gives you objects which do everything you need nearly. I note that in goftp the file objects are nearly os.FileInfo - I might be inclined to add the Owner() and Group() methods to the vfs Node object.

I'd start from the webdav code which has the boiler plate for making a VFS. From there it should be reasonably straight forward to plug either of those FTP servers in.

For unit tests, you can wire up the ftp backend to unit test the ftp server - that is what I did with webdav and I think it worked quite well.

As for which to choose... goftp/server is a slightly more active project. I'm not sure about the features though, so I don't have a strong preference! I'd probably prefer not to import go-kit.

sapk added a commit to sapk-fork/rclone that referenced this issue Apr 10, 2018
@sapk sapk mentioned this issue Apr 10, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue Apr 15, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue Apr 15, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue Apr 21, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue Apr 21, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue Apr 29, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue Apr 29, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue Apr 30, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue May 6, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue May 25, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue May 28, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue May 28, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue Jun 10, 2018
sapk added a commit to sapk-fork/rclone that referenced this issue Jul 13, 2018
ncw pushed a commit that referenced this issue Sep 3, 2018
@ncw
Copy link
Member

ncw commented Sep 17, 2018

Thanks to @sapk this is now done!

rclone now has a serve ftp command.

Find it in the latest beta (in 15-30 mins) and it will be in v1.44.

Please put any issues found in a new issue - thanks.

@ncw ncw closed this as completed Sep 17, 2018
@ncw ncw modified the milestones: Help Wanted, v1.44 Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants