This is experimental. Do not trust it.
This repository makes it easy to run your own Firefox Sync 1.5 server in a virtual machine.
It uses Vagrant to create VirtualBox VMs running Ubuntu 14.04 LTS, and it uses Ansible to configure them.
Ansible is particularly nice in that it doesn't require prior experience for its "playbooks" to be readable, and it doesn't require installing any special software on target VMs. Ubuntu is nice as Canonical releases official Vagrant images for Ubuntu's LTS versions. Plus, Ubuntu is Debian-based and I'm Debian-biased.
Running the server:
- Install Vagrant, Ansible, and VirtualBox.
- Clone this repository and
cd
into it. - Run
vagrant up
.
Configuring Firefox:
- Disconnect from Firefox Sync, if previously configured.
- Open about:config.
- Change
services.sync.tokenServerURI
tohttp://192.168.33.78/token/1.0/sync/1.5
- Sign into Firefox Sync.
- Disconnect from Firefox Sync, which will also reset your
services.sync.tokenServerURI
. - Run
vagrant destroy
inside this repository. - Uninstall Vagrant, Ansible, and VirtualBox.
- By default, you can only connect to the sync server from the host it's running on.
- No SSL. Which is kind of moot, given the above.
- Must run on port 80.
- Regenerates the signing secret on every provision, which causes an error to appear on connected browsers.
- Uses Mozilla's hosted Firefox Accounts service for authentication, rather than handling authentication itself.
- No access control, happily stores data for any and all users that attempt to contact it.
- Checks out the current development head of mozilla-services/syncserver, rather than a specific release or tag.
- Firefox for Android is not yet supported.
To understand what's going on:
- Read the
ansible.yml
file. - Use
vagrant ssh
to get a shell on the VM. - Watch for logs in
/var/log/upstart/syncserver.log
on the VM. - Watch for Sync traffic in the Firefox browser log (Cmd+Shift+J).
- Check for Sync errors in about:sync-log.
To expose the service more publicly:
-
Change the Vagrantfile to use a public, bridged network adapter or use port forwarding to route external traffic to the VM.
-
Run
vagrant reload
to restart the VM with the new networking configuration. -
Edit
ansible.yml
and change thesever_hostname
to reflect the way you'll be accessing the service. For example,server_hostname: sync.example.org
would correspond to aservices.sync.tokenServerURI
ofhttp://sync.example.org/token/1.0/sync/1.5
. -
Run
vagrant provision
to update the syncserver configuration.
To disable account creation:
- Edit
ansible.yml
and changeallow_signups
tofalse
. - Run
vagrant provision
to apply your changes.
To set a static secret:
- Follow the directions in
secret.yml.example
.