Monday, 7 December 2015

Introduction to Akka-FTP

The Akka-FTP project is the reactive FTP server which uses Akka actors under the hood. At the moment of this writing it is still in development but the core functionality is implemented. It is the fully functional FTP server with some of the non-vital bits missing.

In this chapter I will explain how to build and run Akka-FTP out of the box.

Download and start the server

  1. Download or clone the project, it is hosted on the GitHub here.
  2. Install SBT, here is the guide.
  3. Go into the akka-ftp directory and type sbt run
At this point SBT will download all the dependencies, compile the source code and run the launcher class. This will take a minute or two. After the FTP server starts up, in the console you should see something like this:
10:17:40 INFO [...] - Bound Akka FTP to 0.0.0.0:2021
10:17:40 INFO [...] - Bound Akka FTP REST service to 0.0.0.0:8021 

That's it, the server is now running. Get your favourite FTP client and connect to localhost:2021. Here how it looks by using telnet:
telnet localhost 2021
Connected
220 Welcome to Akka FTP - the open source FTP server
$ USER anonymous
331 Guest login okay, send your complete e-mail address as password.
$ PASS anon@localhost
230 User logged in, proceed.

To stop the server either ^C or send a GET request to http://localhost:8021/api/action/shutdown

The web dashboard

While still connected to the server, open a web browser and point it to http://localhost:8021 which will bring up the dashboard. Default authentication username and password is "admin/admin" which you can change in the userstore.properties file inside the project resources folder.

The dashboard allows you to see the server information such as bytes transferred and users' connections. You can also stop the server from the server control section.

Configuration

You can change server settings in the application.conf file in the project resources folder. The file is straightforward and self-explanatory. Note, that leaving the hostname property empty will bind the service to all host names.

Conclusion

This FTP server is the example of Akka, Spray and AngularJS working together. In the future chapters we will dig the source code and I will explain how you as a developer may add your own code to the server functionality.

No comments:

Post a Comment