Skip to content

Instantly share code, notes, and snippets.

@csoni111
Last active August 13, 2018 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csoni111/a016a2d0eb6152eeac52b7694f46cd4c to your computer and use it in GitHub Desktop.
Save csoni111/a016a2d0eb6152eeac52b7694f46cd4c to your computer and use it in GitHub Desktop.
GSoC 2018 Final Work Product Submission

Google Summer of Code 2018 with Amahi

Google Summer of Code Logo

Amahi is a personal/home networking, storage and app server with features allowing users to access their files and apps remotely using android and ios clients. During Google Summer of Code 2018 I contributed with Amahi working mainly on the Amahi Anywhere File Server and the Proxy Server. This is my second year participating in GSoC, previous year also I did my GSoC with Amahi but in different project that was in Android app development.

This year the main goal of my project was to improve the backend architecture (written in golang) and add new features to it such as implementation of HTTP/2 protocol for communication between server & client, adding an analytics dashboard for proxy server, designing and implementing advanced features like Non Admin User (NAU) login and Friending.

Work Done

1. HTTP/2 Protocol Implementation

Previously Amahi SPDY library which supports a subset of SPDY/3.1 protocol, was being used for various connections between different amahi servers. This has now been replaced with golang's inbuilt HTTP/2 package. Implementing this has resulted in reduced latency and accelerated content download on modern clients. This task also involved fixing some old bugs which were there due to lack of support in Amahi Spdy library. This feature has been packaged and released for Amahi 11 and Amahi 10.

Relevant Code:

2. Analytics Dashboard for PFE

The task was to add an Analytics Dashboard to the proxy frontend (PFE) to monitor and display various data related to File Server (FS) Clients and system health in form of charts and graphs. Features like number of FS clients connected, currently streaming clients; their versions, architectures etc.; system health stats like RAM, Disk, CPU usage and memory allocation to the program etc. were added to the dashboard. I also worked on adding Basic HTTP Auth to the dashboard and various APIs linked to it for security purpose.

Relevant Code:

3. Non Admin User Login API Design and Implementation

Previously the Anywhere File Server API only supported root/admin user login for accessing shares in the HDA using mobile apps. Introducing this feature allowed other already existing non-admin users in the HDA to login and browse content accessible to them using the mobile apps.

Initially I listed out various options along with their pros and cons to enable NAU login on HDAs considering all the security risks and ease of implementation in Android/iOS apps. Then finally after discussing with mentors, finalized one of the options and designed the complete process for NAU login and also presented to the rest of the team. I implemented the complete backend side for this feature.

Relevant Code:

4. Friending Feature

This feature allows a user to befriend another user of Amahi, so that the latter can be given access to former’s HDA. This will help a lot of users in sharing the content with each other. For this feature I worked in collaboration with another GSoC student Sukhbir, we discussed and designed the initial workflow for complete the process which is documented here.

I have made a demo server in golang for faking the APIs which can be tested using the friending plugin. The feature is complete but needs testing and review after which it will be launched for public.

Relevant Code:

5. Bug Fixes and Minor Changes

Along the way I resolved some of the minor bugs and did code cleansing. This included things like caching issue in file server which was due to lack of cache-control header in the response from the API and also things like

Relevant Code:

Future Work

  1. Planning and deploying NAU login functionality into production for public use.
  2. Testing and resolving any bugs/faults in Friending feature and finally deploying into production.
  3. Designing and implementing caching mechanism for PFE to cache the data passing through it so as to save the bandwidth.
  4. Adding more functionality to PFE dashboard such as monitoring data related to all the mobile clients connected to the PFE.

Final Thoughts

It was a once in a lifetime experience and I enjoyed every bit of it. I learnt so many new things like architecting and designing a feature for a software system in real life, thinking all the edge cases and making it full proof. Apart from that I worked closely with my mentor Carlos (@cpg) during the GSoC period and would like to thank him for guiding me at every step of the way and giving me the opportunity to work on designing and developing advanced features for Amahi all by myself. Also I thank Amahi and the GSoC Team for giving me this platform which allowed me to learn so many new things and work with many different people in a team. I hope to keep contributing to Amahi and add many more features to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment