CloudServices/Sync/FxSync/Archived/ReferenceServer

From MozillaWiki
Jump to: navigation, search

Back to Labs/Weave.

Synopsis and Usage

Residing within the Weave source code repository is a simple development server script that can be used to develop the Weave client against. It's currently located in Weave HG under scripts/weave_server.py relative to the root of the repository; running it with no options starts up a weave server on localhost at port 8000. To tell your Weave addon to access it, just set your extensions.weave.serverURL preference to http://localhost:8000/.

Features

The development server currently supports full Weave server functionality; that is, the limited subset of DAV methods that the Weave client currently uses, HTTP authentication, user accounts, and the RESTful registration and sharing APIs, including access control lists for directories. It presently has a few limitations and enhancements to standard Weave server behavior, which are documented at the beginning of weave_server.py.

Rationale

The development server is useful for a variety of reasons.

Firstly, the development server decouples development of the Weave client from the particularities of production Weave server implementation. The "real" Weave server is a complex combination of OpenLDAP, PHP, Apache, and Python with a variety of redirects and rewrite rules that make it difficult to debug and develop against (at least when a developer is trying to focus on client-specific behavior). On the other hand, the relatively tiny reference implementation logs all information in one place and makes the interaction between server and client much easier to observe and debug.

Secondly, it's the goal of Mozilla Weave to allow for alternate implementations of the Weave server. As such, the exact behavior of the Weave server needs to be publicly documented, and this is supported by having a standard reference implementation that is as simple and easy to understand as possible.

Compliance Tests

The development reference server also comes with a set of "compliance tests", contained in scripts/weave_server_tester.py, that are intended to be run against any compliant Weave server; the goal is that as long as a candidate Weave server passes these tests, the Weave client should run fine against it.

For instructions on using the compliance tests, just run the aforementioned compliance test script with no command-line arguments.