I love Firefox. Aside from the quite awesome levels of cross-platform support, I’m a big fan of the built-in Sync feature. For those concerned about security and privacy, Mozilla provide instructions for setting up your own Sync server, and the good news is that it’s a snap to get a basic server up and running.
For a start, on an Ubuntu 10.04 x86 VirtualBox VM, I followed the “Prerequisites” and “Building the server” sections here:
http://docs.services.mozilla.com/howtos/run-sync.html
My server VM is running with bridged networking on my local network with its own IP address.
Upon running the server and attempting to connect from other Firefox clients, I ran into two problems which I don’t believe are documented at the above link.
First, I could not get clients to connect successfully to the server using the handy “Add a Device” Sync feature. To troubleshoot and resolve this, I performed the following steps.
Set up Firefox sync on the relevant client browser.
In the Firefox client, launch the Firefox configuration page by entering about:config in the address bar (more information on this may be found here).
Use the search filter to narrow down the entries relevant to Sync settings.
I noted that the setting named services.sync.serverURL was correctly pointing towards my server. I would have thought that this was sufficient to get Sync working, but apparently not: in my case, the setting named services.sync.clusterURL was pointing to localhost, and this also needed to be set to the server address (i.e. identical to the value set for services.sync.serverURL). Once done, the client could then successfully connect to the Sync server.
Update to the above: This is resolved by modifying the fallback_node property of the Sync server sync.conf file. There is a somewhat misleading reference to this in the official documentation, which says (at the time of writing):
“Warning: If you run behind a server, you need to set up the fallback_node option in the [auth] section accordingly…”
What is actually meant is if the server is serving multiple remote (i.e. non-local) clients, then the server address should be set in the fallback_node property. By default, the property is set to the following in the sync.conf file:
[auth]
backend = services.auth.sql.SQLAuth
sqluri = sqlite:////tmp/test.db
pool_size = 100
pool_recycle = 3600
create_tables = true
fallback_node = http://localhost:5000
If the IP address of my server is 192.168.1.4, then I would modify this to read:
[auth]
backend = services.auth.sql.SQLAuth
sqluri = sqlite:////tmp/test.db
pool_size = 100
pool_recycle = 3600
create_tables = true
fallback_node = http://192.168.1.4:5000
Clients should then connect to the Sync server seamlessly.
Second, once my clients were happily syncing up with my server, upon rebooting the server every one of them crapped out with a Sync authentication error. It turns out that the authentication database by default is stored at /tmp, so on reboot of course everything goes kablooey. Again, this is not documented clearly in the setup guide, but it can be resolved by performing the following.
Inspecting the contents of the Sync sync.conf file, the location of the storage and authentication databases can be specified. By default, the locations are defined as follows:
[storage]
backend = syncstorage.storage.sql.SQLStorage
sqluri = sqlite:////tmp/test.db
standard_collections = false
use_quota = true
quota_size = 5120
pool_size = 100
pool_recycle = 3600
reset_on_return = true
display_config = true
create_tables = true
[auth]
backend = services.auth.sql.SQLAuth
sqluri = sqlite:////tmp/test.db
pool_size = 100
pool_recycle = 3600
create_tables = true
fallback_node = http://localhost:5000
I changed these to point to a database that will instead be created at /var/sync:
[storage]
backend = syncstorage.storage.sql.SQLStorage
sqluri = sqlite:////var/sync/sync.db
standard_collections = false
use_quota = true
quota_size = 5120
pool_size = 100
pool_recycle = 3600
reset_on_return = true
display_config = true
create_tables = true
[auth]
backend = services.auth.sql.SQLAuth
sqluri = sqlite:////var/sync/sync.db
pool_size = 100
pool_recycle = 3600
create_tables = true
fallback_node = http://localhost:5000/
After reconfiguring all Firefox client Sync connections, authentication then continues to function after the Sync server is rebooted.
Sync also works successfully from Firefox running on the Eee Slider Pad as well, if the first troubleshooting step is performed.
See also: http://www.wenks.ch/fabian/mozilla-custom-sync-server/
Like this:
Like Loading...