This is a guide to setup Firefox Sync Server 1.5 in Alpine Linux. This guide is based off the official documentation available from Mozilla.

Prerequisites

Let’s install the things we need to get moving.

apk install python-dev git py-virtualenv build-base sqlite

Download and build

Now that the pre-reqs are setup, we can download the code and build it.

mkdir /opt
cd /opt

git clone https://github.com/mozilla-services/syncserver
cd syncserver
make build

Configure

Edit /opt/syncserver.ini

  1. Update public_url to use proper domain name or ip address
  2. Un-comment line with sqluri configuration, and change the path for syncserver.db to a directory outside of /tmp (i.e. /opt/syncserver/data.db.
  3. Set up secret by running head -c 20 /dev/urandom | sha1sum to get new value and pasting in syncserver.ini

Run

Run make serve from the /opt/syncserver directory. You should be able to hit the sync server from a web browser and get an it works! message. If not, you should get some helpful error message.

Start at system boot

First, you need to enable the local service

rc-update add local

Next we need to add a script for the local service to run on startup. Create the file /etc/local.d/firefox_sync.start and past in the following code:

#!/bin/sh
/usr/bin/make serve --directory /opt/syncserver

Save the file, and make it executable:

chmod +x /etc/local.d/firefox_sync.start

Test it by running: /etc/local.d/firefox_sync.start. You should see the sync server starting up.

Fully test by restarting the Alpine server. After logging in, you should be able to see the gunicorn server running when you run the top command.

Setting up Firefox

You now need to setup Firefox to point at your Sync Server.

To configure desktop Firefox to talk to your new Sync server, go to about:config, search for identity.sync.tokenserver.uri and change its value to the URL of your server with a path of token/1.0/sync/1.5.

Example: http://sync.myurl.com:5000/token/1.0/sync/1.5

You should now be able to log in with your Firefox Account and sync your data to your personal Sync Server.