Serveur de synchro Firefox / Iceweasel

ATTENTION

A partir de Firefox 29 ce tutoriel n’est plus valide, visiter ce site, pour la nouvelle procédure.. Lire aussi l’url officielle

Prérequis

Il faut installer python, make, mercurial et sqlite3:

sudo apt-get install python-dev mercurial sqlite3 python-virtualenv

Compiler le serveur

On récupère les sources depuis le mercurial de mozilla :

jmfrouin@secure:~/sync$ hg clone https://hg.mozilla.org/services/server-full
destination directory: server-full
requesting all changes
adding changesets
adding manifests
adding file changes
added 539 changesets with 1470 changes to 346 files (+1 heads)
updating to branch default
60 files updated, 0 files merged, 0 files removed, 0 files unresolved

On entre dans la copie locale :

jmfrouin@secure:~/sync$ cd server-full/

Et on lance la compilation :

jmfrouin@secure:~/sync/server-full$ make build
virtualenv –distribute –no-site-packages .
New python executable in ./bin/python
Installing


Building the app
Checking the environ [ok]
Updating the repo [ok]
Building Services dependencies
Getting server-core [ok]
Getting server-reg [ok]
Getting server-storage [ok] [ok]
Building External dependencies [ok]
Now building the app itself [ok]
[done]

Pre-compile mako templates into the correct directories.

for TMPL in find . -name '*.mako'; do ./bin/python -c “from mako.template import Template; Template(filename=‘$TMPL’, module_directory=’dirname $TMPL’, uri=’basename $TMPL’)“; done;

J’ai pas eu le problème, mais si y’en a avec pysqlite, il faut l’installer :

./bin/pip install pysqlite

Configuration

[global]
clean_shutdown = false

[captcha] use = false public_key = PUBLIC_KEY private_key = PRIVATE_KEY use_ssl = false

[storage] backend = syncstorage.storage.sql.SQLStorage sqluri = mysql://mysql_user:mysql_password@localhost/sync_db standard_collections = false use_quota = true quota_size = 25120 pool_size = 100 pool_recycle = 3600 reset_on_return = true display_config = true create_tables = true

[auth] backend = services.user.sql.SQLUser sqluri = mysql://mysql_user:mysql_password@localhost/sync_db pool_size = 100 pool_recycle = 3600 create_tables = true

Uncomment the next line to disable creation of new user accounts.

allow_new_users = true

[nodes] fallback_node = http://sync.domain.com:5000/

[smtp] host = localhost port = 25 sender = sync@frouin.me

[cef] use = true file = syslog vendor = mozilla version = 0 device_version = 1.3 product = weave

[reset_codes] backend = services.resetcodes.rc_sql.ResetCodeSQL sqluri = mysql://mysql_user:mysql_password@localhost/sync_db create_tables = True

Lancement du serveur

bin/paster serve development.ini
Starting server in PID 29951.
serving on 0.0.0.0:5000 view at http://127.0.0.1:5000

En action

Ainsi on note, que sous firefox, on peut utiliser la synchro des modules complémentaires (les extensions) alors que sous iceaweasel non.

Les 5 restants :

- les marques-pages

- les mots de passe

- les préférences

- l’historique

- les onglets

étant communs aux deux navigateurs.

Suite à la mise à jour sous wheezy :

cp etc/sync.conf ~/
hg revert etc/sync.conf
hg pull
hg update
make build
bin/easy_install Mysql-Python
cp ~/sync.conf /etc

Je reviendrai éditer ce billet, pour ajouter la configuration avec nginx du serveur.

Ce billet est largement inspiré de cette page