[GSoC] SWAT2 Report

Martin Kunev martinkunev at gmail.com
Wed Aug 24 15:52:09 MDT 2011


As my project proposal, the new SWAT is separated on different layers.
There are standalone C server, protocol (currently XMLRPC by using libxml2), web interface (mainly written on javascript).

About the server:

I created web server that uses fork() to handle many clients simultaneously. I chose fork() for security reasons.
The server and the clients communicate via XML RPC though it's easy to add support for additional protocols.
The client can request static files, using the GET method or make dynamic requests, using the POST method.
Via a dynamic request, a client asks the server to execute methods.
The server responds with status (success or error code and description) or data if the client requested data.
The server contains session manager that is responsible for handling sessions. It uses pipes to communicate with the client handling processes.

The server contains session methods (login, logout, checking whether the user is logged in),
methods for manipulating the configuration (list, get, set, etc.),
methods for users (create, remove, change password, enable, disable)
methods for starting, stopping, restarting and checking the status of smbd, nmbd and winbind,
methods for getting the current status of the daemons and methods for manipulating the configuration file.
New methods can be easily added to the server.

About the interface:

The web interface is used as a client for the server.
The functional part is written mainly on javascript without using libraries like jquery etc.
The javascript is separated from the template part. The javascript is located in "/interface/core/pages/".
The templates are located in "/interface/templates/default/" where default is the name of the template.
Currently the interface and the server are in test mode, so it doesn't ask for username and password.
There is one .js file called conf.js where you can change some configurations of the interface.
Each option contains help information that is shown when the user tries to modify the option.
I've separated the documentation in static .html files. There is a python script in the server directory for doing this job in the future if there are updates in the smb.conf documentation.
The documentation files are located in (/interface/templates/default/docs/en/)
The interface also displays the connections and the status of the smbd, nmbd and winbind daemons and allows the user to start, stop or restart them.
I've tried to implement all the functionality of the old SWAT interface. I need to make a few modifications to the user part.

More information about the samba-technical mailing list