Run-Your-Own Firefox Sync Server

Overview

Run-Your-Own Firefox Sync Server

https://circleci.com/gh/mozilla-services/syncserver/tree/master.svg?style=svg https://img.shields.io/docker/automated/mozilla-services/syncserver.svg?style=flat-square

This is an all-in-one package for running a self-hosted Firefox Sync server. It bundles the "tokenserver" project for authentication and the "syncstorage" project for storage, to produce a single stand-alone webapp.

Complete installation instructions are available at:

https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html

Quickstart

The Sync Server software runs using python 2.7, and the build process requires make and virtualenv. You will need to have the following packages (or similar, depending on your operating system) installed:

  • python2.7
  • python2.7-dev
  • python-virtualenv
  • gcc and g++
  • make
  • libstdc++
  • libffi-dev
  • mysql-dev
  • musl-dev
  • ncurses-dev
  • openssl-dev

Take a checkout of this repository, then run "make build" to pull in the necessary python package dependencies:

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

To sanity-check that things got installed correctly, do the following:

$ make test

Now you can run the server:

$ make serve

This should start a server on http://localhost:5000/.

Now go into Firefox's about:config page, search for a setting named "tokenServerURI", and change it to point to your server:

identity.sync.tokenserver.uri:  http://localhost:5000/token/1.0/sync/1.5

(Prior to Firefox 42, the TokenServer preference name for Firefox Desktop was "services.sync.tokenServerURI". While the old preference name will work in Firefox 42 and later, the new preference is recommended as the old preference name will be reset when the user signs out from Sync causing potential confusion.)

Firefox should now sync against your local server rather than the default Mozilla-hosted servers.

For more details on setting up a stable deployment, see:

https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html

Customization

All customization of the server can be done by editing the file "syncserver.ini", which contains lots of comments to help you on your way. Things you might like to change include:

  • The client-visible hostname for your server. Edit the "public_url" key under the [syncerver] section.
  • The database in which to store sync data. Edit the "sqluri" setting under the [syncserver] section.
  • The secret key to use for signing auth tokens. Find the "secret" entry under the [syncserver] section and follow the instructions in the comment to replace it with a strong random key.

Database Backend Modules

If your python installation doesn't provide the "sqlite" module by default, you may need to install it as a separate package:

$ ./local/bin/pip install pysqlite2

Similarly, if you want to use a different database backend you will need to install an appropriate python module, e.g:

$ ./local/bin/pip install PyMySQL
$ ./local/bin/pip install psycopg2

Runner under Docker

Dockerhub Page

There is experimental support for running the server inside a Docker container. The docker image runs with UID/GID 1001/1001. Build the image like this:

$ docker build -t syncserver:latest .

Then you can run the server by passing in configuration options as environment variables, like this:

$ docker run --rm \
    -p 5000:5000 \
    -e SYNCSERVER_PUBLIC_URL=http://localhost:5000 \
    -e SYNCSERVER_SECRET= \
    -e SYNCSERVER_SQLURI=sqlite:////tmp/syncserver.db \
    -e SYNCSERVER_BATCH_UPLOAD_ENABLED=true \
    -e SYNCSERVER_FORCE_WSGI_ENVIRON=false \
    -e SYNCSERVER_DEBUG_ENABLED=true \
    -e PORT=5000 \
    mozilla/syncserver:latest

or

$ docker run --rm \
    -p 5000:5000 \
    -e SYNCSERVER_PUBLIC_URL=http://localhost:5000 \
    -e SYNCSERVER_SECRET_FILE= \
    -e SYNCSERVER_SQLURI=sqlite:////tmp/syncserver.db \
    -e SYNCSERVER_BATCH_UPLOAD_ENABLED=true \
    -e SYNCSERVER_FORCE_WSGI_ENVIRON=false \
    -e PORT=5000 \
    -v /secret/file/at/host:  \
    mozilla/syncserver:latest

Don't forget to generate a random secret key to use in the SYNCSERVER_SECRET environment variable or mount your secret key file!

And you can test whether it's running correctly by using the builtin function test suite, like so:

$ /usr/local/bin/python -m syncstorage.tests.functional.test_storage \
    --use-token-server http://localhost:5000/token/1.0/sync/1.5

If you'd like a persistent setup, you can mount a volume as well:

$ docker run -d \
    -v /syncserver:/data \
    -p 5000:5000 \
    -e SYNCSERVER_PUBLIC_URL=http://localhost:5000 \
    -e SYNCSERVER_SECRET= \
    -e SYNCSERVER_SQLURI=sqlite:////data/syncserver.db \
    -e SYNCSERVER_BATCH_UPLOAD_ENABLED=true \
    -e SYNCSERVER_FORCE_WSGI_ENVIRON=false \
    -e PORT=5000 \
    mozilla/syncserver:latest

Make sure that /syncserver is owned by 1001:1001

Docker Compose can also be used for structured deployments:

version: '3.7'
services:
    syncserver:
        container_name: syncserver
        image: mozilla/syncserver:latest
        volumes:
            - /syncserver:/data
        ports:
            - 5000:5000
        environment:
            SYNCSERVER_PUBLIC_URL: 'http://localhost:5000'
            SYNCSERVER_SECRET: ''
            SYNCSERVER_SQLURI: 'sqlite:////data/syncserver.db'
            SYNCSERVER_BATCH_UPLOAD_ENABLED: 'true'
            SYNCSERVER_FORCE_WSGI_ENVIRON: 'false'
            PORT: '5000'
        restart: always

Removing Mozilla-hosted data

If you have previously uploaded Firefox Sync data to the Mozilla-hosted storage service and would like to remove it, you can use the following script to do so:

$ pip install PyFxA
$ python ./bin/delete_user_data.py [email protected]

Questions, Feedback

Owner
Mozilla Services
see also http://blog.mozilla.com/services
Mozilla Services
Import Apex legends mprt files exported from Legion

Apex-mprt-importer-for-Blender Import Apex legends mprt files exported from Legion. REQUIRES CAST IMPORTER Usage: Use a VPK extracter to extract the m

15 Dec 18, 2022
Repls goes to sleep due to inactivity, but to keep it awake, simply host a webserver and ping it.

Repls goes to sleep due to inactivity, but to keep it awake, simply host a webserver and ping it. This repo will help you make a webserver with a bit of console controls.

2 Mar 01, 2022
This scrypt for auto brightness control

God damn. This scrypt for auto brightness control. The scrypt has voice assistant. You should move this script to auto-upload folder. What do you need

0 Jul 25, 2022
GUI tool to manage the contents of chests in Botw

Botw chest manager is a small gui tool allowing to easily manage chests. Sometimes Ice Spear can be very time consuming when adding a simple chest. The purpose of this light tool is to add a new ches

3 Aug 25, 2022
SimplePyBLE - Python bindings for SimpleBLE

The ultimate fully-fledged cross-platform Python BLE library, designed for simplicity and ease of use.

Open Bluetooth Toolbox 27 Aug 28, 2022
Simple Python Gemini browser with nice formatting

gg I wasn't satisfied with any of the other available Gemini clients, so I wrote my own. Requires Python 3.9 (maybe older, I haven't checked) and opti

Sarah Taube 2 Nov 21, 2021
This python code will get requests from SET (The Stock Exchange of Thailand) a previously-close stock price and return it in Thai Baht currency using beautiful soup 4 HTML scrapper.

This python code will get requests from SET (The Stock Exchange of Thailand) a previously-close stock price and return it in Thai Baht currency using beautiful soup 4 HTML scrapper.

Andre 1 Oct 24, 2022
Binary++ is an esoteric programming language based on* binary

Binary++ is an esoteric programming language based on* binary. * It's meant to be based on binary, but you can write Binary++ code using different mea

Supercolbat 3 Feb 18, 2022
ClamNotif: A tool to send you ClamAV notifications

A tool to forward notifications to different recipients categorised by two severity levels of the regular health reports produced by `clamscan` bundled with the ClamAV antivirus engine.

PiSoft Company Ltd. 1 Nov 15, 2021
Hasklig - a code font with monospaced ligatures

Hasklig – Ligatures for code Programming languages are limited to relatively few characters. As a result, combined character operators surfaced quite

Ian Tuomi 5.3k Jan 03, 2023
log4shell pwner for vulnerable minecraft servers

Log4-hell name supposed to be Log4$hell but oh well log4shell pwner for vulnerable minecraft servers install all reqs python + a minecraft client for

1 Jan 05, 2022
This is a library which aiming to save all my code about cpp. It will help me to code conveniently.

This is a library which aiming to save all my code about cpp. It will help me to code conveniently.

Paul Leo 21 Dec 06, 2021
Example python package with pybind11 cpp extension

Developing C++ extension in Python using pybind11 This is a summary of the commands used in the tutorial.

55 Sep 04, 2022
MobaXterm-GenKey

MobaXterm-GenKey 你懂的!! 本地启动 需要安装Python3!!!

malaohu 328 Dec 29, 2022
A very basic ciphering/deciphering tool

ckrett-python-library This is an useful python library for people who care about privacy, this library is useful to cipher and decipher text using 4 s

SasiVatsal 8 Oct 18, 2022
🙌Kart of 210+ projects based on machine learning, deep learning, computer vision, natural language processing and all. Show your support by ✨ this repository.

ML-ProjectKart 📌 Repository This kart showcases the finest collection of all projects based on machine learning, deep learning, computer vision, natu

Prathima Kadari 203 Dec 28, 2022
Add-In for Blender to automatically save files when rendering

Autosave - Render: Automatically save .blend, .png and readme.txt files when rendering with Blender Purpose This Blender Add-On provides an easy way t

Volker 9 Aug 10, 2022
SkyPort console user terminal written in python

SkyPort terminal implemented as a console script written in Python Description Sky Port is an universal bus between user software and compute resource

Sky Workflows 1 Oct 23, 2022
This library is an ongoing effort towards bringing the data exchanging ability between Java/Scala and Python

PyJava This library is an ongoing effort towards bringing the data exchanging ability between Java/Scala and Python

Byzer 6 Oct 17, 2022
Generate Azure Blob Storage account authentication headers for Munki

Azure Blob Storage Authentication for Munki The Azure Blob Storage Middleware allows munki clients to connect securely, and directly to a munki repo h

Oliver Kieselbach 10 Apr 12, 2022