FubarDevelopment / FtpServer

Portable FTP server written in .NET
http://fubardevelopment.github.io/FtpServer/
MIT License
473 stars 161 forks source link

Google Cloud Storage as file system #70

Open sebastianbk opened 5 years ago

sebastianbk commented 5 years ago

Hi,

I implemented Google Cloud Storage as a backend in this project and, just as I published it, I realized it would probably be a much better idea to just include it in your project.

Could you help me out make the changes required and create the pull request? The bulk of the work is already done, as all of the interfaces have already been implemented and tested.

If needed, I could provide a Google Cloud Storage bucket for testing.

Looking forward to hearing from you. :smiley:

fubar-coder commented 5 years ago

Hi,

your project looks really good.

Here are my thoughts to make it easier for others to use:

Prepare for FTP server V3.0

It would be good if you could target the latest 3.0 rc of the FTP server.

Server application

Maybe you can create the "GcsFtpServer" as additional sample application with a docker file? A README.md would be good too 😁 .

Docker support

It would be nice if you could load the following from the file system:

Ideally, the server should load the files from Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "GcsFtpServer").

BTW: You can use EXPOSE 10000-10009 in the docker file.

This should be the goal for using the docker container:

cd samples/GcsFtpServer
dotnet publish -c Release
docker build -t sebastianbk/google-storage-ftp .
docker run -it \
    -p 21:21 \
    -p 10000-10009:10000-10009 \
    -v /usr/share/GcsFtpServer \
    sebastianbk/google-storage-ftp \
    ftpserver

The FTP server always uses port 21. It doesn't use ports 989/990 or port 20 (yet), but port 20 is only used for active connections, which usually doesn't work.

Configuration

I think that it might be beneficial if you could leverage Microsoft.Extensions.Configuration for configuring the application.

You could also use:

The configuration file should cover the following parts:

Logging

Authorization (membership provider)

I'm not sure what the best solution would be. I guess that supporting a build variable or environment variable to configure the password might or might not be sufficient.