Skip to content

Instantly share code, notes, and snippets.

@almet
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almet/b68e76068a043f56f22f to your computer and use it in GitHub Desktop.
Save almet/b68e76068a043f56f22f to your computer and use it in GitHub Desktop.
run you own sync server with nix

Change the configuration in firefox (with about:config):

services.sync.tokenServerURI: http://localhost:5000/token/1.0/sync/1.5

See the pull request to have the packages for nix.

The nix commands are:

$ nix-build ./default.nix -A pythonPackages.syncserver -o syncserver
$ nix-build ./default.nix -A pythonPackages.pasteScript -o paste

Then, start your very own shiny new server with:

$ PYTHONPATH=$(pwd)/syncserver/lib/python2.7/site-packages ./paste/bin/paster serve syncserver.ini
[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = 5000
[app:main]
use = egg:syncserver
[syncserver]
# This must be edited to point to the public URL of your server,
# i.e. the URL as seen by Firefox.
public_url = http://localhost:5000/
# This defines the database in which to store all server data.
sqluri = sqlite:////tmp/syncserver.db
# This is a secret key used for signing authentication tokens.
# It should be long and randomly-generated.
# The following command will give a suitable value on *nix systems:
#
# head -c 20 /dev/urandom | sha1sum
#
# If not specified then the server will generate a temporary one at startup.
secret = 7e19d94410b4c77b8c6bb08c694efec10fb79553
# Set this to "false" to disable new-user signups on the server.
# Only request by existing accounts will be honoured.
# allow_new_users = false
# Uncomment and edit the following to use a local BrowserID verifier
# rather than posing assertions to the mozilla-hosted verifier.
# Audiences should be set to your public_url without a trailing slash.
[browserid]
backend = tokenserver.verifiers.LocalVerifier
audiences = http://localhost:5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment