Firefox/Sync Server

From Gentoo Wiki
Jump to:navigation Jump to:search
 As of July 14, 2015, the information in this article is probably outdated. You can help the Gentoo community by verifying and updating this article.

This article explains how to run a private Firefox Sync server instance.

Installation

Unless using a very particular setup with registration and storage servers in different locations install the www-misc/mozilla-sync-server-full package which is available through the klondike overlay.

Emerging

After setting up the desired flags remove the keywords from the packages and run:

root #emerge --ask www-misc/mozilla-sync-server-full

Configuration

The package is now installed and the default configuration is in /etc/mozilla-sync-server/. The configuration of the daemon can be set using the .ini files whilst the configuration of sync itself is done in the .conf files. All of them are .ini-style files.

The first step is replacing the following line by the .conf file to use on the .ini file:

FILE {{{filename}}}Log configuration
:configuration = file:%(here)s/sync.conf

Then ensure logs are saved in the proper place:

FILE {{{filename}}}Log location
class = handlers.RotatingFileHandler
args = ('/tmp/sync-error.log',)

Then you may need to edit the server.wsgi file so they load the proper .ini files for that replace the following line by the correct file:

FILE {{{filename}}}ini_file
:ini_file = os.path.join(_CURDIR, 'development.ini')

Finally edit the .conf file with the desired settings. The most important ones are the sqluri which define the path to the SQL databases and the fallback_node which defines the URL to the server as seen by the client you may also want to disable the captcha.

For a list of parameters check: http://docs.services.mozilla.com/server-devguide/configuration.html

Testing the server

Once configured test the server by following this line in /etc/mozilla-sync-server/:

root #bin/paster serve development.ini

This will start the server listening on the port 5000. You will need to have paster installed. In general using this approach to run the server is a bad idea so you can run it behind a web server instead

Running behind a web server

Apache

Emerge www-apache/mod_wsgi:

root #emerge --ask www-apache/mod_wsgi

Create the mozsync user on the mozsync group if has not been created.

Merge the following with the vhost configuration (the first line may require modification):

FILE {{{filename}}}Vhost configuration
WSGIDaemonProcess sync user=mozsync group=mozsync processes=2 threads=25 python-path=/usr/lib64/python2.7/site-packages/syncreg/

<Directory "/etc/mozilla-sync-server">
    Options None
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

WSGIProcessGroup sync
WSGIPassAuthorization On
WSGIScriptAlias / /etc/mozilla-sync-server/server.wsgi

External resources