d-avko / DenCloud.Core

An implementation of "cloud storage" based on FTP / FTPS. Supports SSL/TLS encryption, database authentication, file logging. Server supports raw ftp commands and some essential FTP extensions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"DenCloud" Library

This is simple "Cloud-storage" implementation using File Transfer Protocol, which is meant to be run on one machine.

Warning: Current version doesn't support SSL certificates passwords. To use SSL, just make sure your certificate does not have a password and is installed on your machine.

Tip: If you're planning on handling big amount of users using this program, you should make sure that port range difference(MaxPort - MinPort) is more than 10

API Usage: As a rule, you must use DI pattern in this API(DenInject), which leads us to:

  1. Registering dependencies:
var configBuilder = new DiConfigBuilder();

configBuilder.UseNeccessaryClasses();

configBuilder.UseFileSystem();

//using default implementation.
configBuilder.UseAuthentication();

//custom logger
configBuilder.UseLogger<InterfaceLogger>();

//Dependency provider is ready.
DiContainer.Construct(configBuilder);

2.Validation of your provider before starting the server as:

 DiContainer.ValidateProvider();
  1. Resolving Ftp Server dependency, i.e:
 var server = DiContainer.Provider.Resolve<FtpServer>();
  1. Starting the server:
 Task.Run(() => server.Start(IsEncryptionUsed));

To access storage, users can:

1. Use 'anonymous' login and any password.
2. USE SITE REG <login> <password> command while logged in as 'anonymous'(Using SSL of course) - This will register user in database as <login> with password <password>.

For any other questions, you can browse this repo, which itself is an example of API usage.

About

An implementation of "cloud storage" based on FTP / FTPS. Supports SSL/TLS encryption, database authentication, file logging. Server supports raw ftp commands and some essential FTP extensions.

License:MIT License


Languages

Language:C# 100.0%