The purpose of this repository is to provide a docker-compose that can be used to self host what otherwise Firefox sync would send to Mozilla's servers.
⚠️ The project is under development⚠️ Expect bugs, breaking changes and headache⚠️ This is not endorsed or supported by Mozilla in any way or form⚠️ Do not solely relay on this project to store your bookmarks, passwords and/or other important items
- syncstorage-rs does NOT support account allowlisting. This means that ANY person that has network access to your server can use it.- This has been implemented with a SQL trigger workaround that prevents the token database to insert more rows when a new user tries to use the server. This is tested and prevents a new account from using your server if the number of MAX_USERS defined in your .env file is already reached.
- Possible alternative (better) solutions:
- implement the feature directly in syncstorage-rs
- add the entire rest of the Mozilla stack so that authentication is performed and validated locally
Mozilla's server side components are open source and Firefox allows to easily change the official endpoints.
Some documentation is provided to install the each component on your own server but this is neither offically supported or very well maintened. Furthermore, there are no official Docker images that can be used to avoid installing everything manually; all the instructions and artifacts provided are focused on setting up a developer environment rather than a production self hosted service. For example, syncstorage-rs
has a docker release on docker-hub but it is targeted to work exclusively with Google Spanner which is what Mozilla uses to provide the service.
- GitHub workflows to create docker images as vanilla as possible from Mozilla's code
- Docker compose to setup required component to self host Mozilla sync components
- examples to configure other parts of the infrastructure
- instructions to setup your browser to use the self hosted infrastructure
All the images are updated weekly to the latest tag available from Mozilla's official repositories
- ghcr.io/porelli/firefox-sync:syncstorage-rs-mysql-latest
- GitHub workflow and logs
- Mozilla's container: added MariaDB CLI client and db_init.sh script
- source code: https://github.com/mozilla-services/syncstorage-rs
- code changes: none
- compile options: built to use MySQL as backend database
- clone this repositoy
- run
./prepare_environment.sh
to automatically prepare your.env
file and conf examples according with your variables - setup your reverse proxy server
- if you use nginx, check the syncstorage-rs.conf as example
- start docker compose:
docker compose up
- OPTIONAL: Install the systemd service (see firefox-sync.service) and enable it
- all the containers are alredy set to restart automatically; stopping Docker (for example when you shutdown your computer) will automatically stop all the services gracefully and restart them once Docker is starting again
Pre-requisite: if you already logged into your Firefox account you need to temporarily disconnect it
The below examples assume your server respond to this domain: firefox-sync.example.com
- point a browser tab to
about:config
and search foridentity.sync.tokenserver.uri
- change it from the default to
https://firefox-sync.example.com/1.0/sync/1.5
- log in to Firefox and start syncing.
- check logs pointing a browser tab to
about:sync-log
- go to App Menu
⋮
>Settings
>About Firefox
and click the logo 5 times. You should see adebug menu enabled
notification - go back to the main setting menu and you will see
Sync Debug
at the top, just under theSyncronize and save your data
box. Tap on it - tap on
Custom Sync server
and set it tohttps://firefox-sync.example.com/1.0/sync/1.5
- log in to Firefox and start syncing.
- go to App Menu
≡
>Settings
and tap 5 times on the version number (i.e.:Firefox 127.1 (42781)
) towards the bottom - go back at the top of the main setting menu and you will see
Advanced Sync Settings
at the top, just under theSync and Save Data
. Tap on it - activate
Use Custom FxA Content Server
and setCustom Account Content Server URI
tohttps://firefox-sync.example.com/1.0/sync/1.5
- log in to Firefox and start syncing.
- Mozilla for Firefox and opensourcing all their software, incuding the backend
- jeena for fxsync-docker which is the inspiration for this project