Ihr nutzt auf mehreren Geräten wie PC, Handy und Tablet Mozilla Firefox? Mit dem Firefox Sync haltet ihr Lesezeichen, Chronik, Offene Tabs, Add-ons, Zugangsdaten und Einstellungen auf allen Geräten synchron.
Ich zeige euch wie ihr einen eigenen Firefox Sync Server unter Debian 9 mit Apache 2.4 aufsetzen könnt, ohne dabei eure persönlichen Daten bei Mozilla abzulegen.
Punkt 1: Debian 9 vorbereiten
Zuerst installieren wir die nötigen Pakete.
|
1 |
apt-get install python-dev git-core python-virtualenv g++ apache2 libapache2-mod-wsgi make |
Punkt 2: Syncserver klonen und bauen
Wir wechseln nach /opt, klonen das Github Repository und bauen den Sync Server.
|
1 2 3 4 |
cd /opt git clone https://github.com/mozilla-services/syncserver cd syncserver make build |
Punkt 3: Sync Server Konfiguration
Wir erstellen uns ein Secret.
|
1 2 |
localhost:/opt/syncserver# head -c 20 /dev/urandom | sha1sum 38ae4684a8eff0664a03806fb93073f0e2635a5c - |
Dieses Secret (in diesem Beispiel: 38ae4684a8eff0664a03806fb93073f0e2635a5c) übernehmen wir in Zeile 32 unserer Konfiguration.
Die public_url passt ihr bitte auf die spätere Ziel-Adresse an, die auch in der Apache2 Konfiguration hinterlegt wird (Zeile 14).
In Zeile 23, sqluri, legen wir den Ort unserer SQLite Datenbank fest
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
[server:main] use = egg:gunicorn host = 0.0.0.0 port = 5000 workers = 1 timeout = 30 [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 = https://sync.adminforge.de/ # By default, syncserver will accept identity assertions issued by # any BrowserID issuer. The below restricts it to accept assertions # from just the production Firefox Account servers. If you are hosting # your own account server, put its public URL here instead. identity_provider = https://accounts.firefox.com/ # This defines the database in which to store all server data. sqluri = sqlite:////opt/syncserver/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 = 38ae4684a8eff0664a03806fb93073f0e2635a5c # Set this to "false" to disable new-user signups on the server. # Only requests by existing accounts will be honoured. # allow_new_users = false # Set this to "true" to work around a mismatch between public_url and # the application URL as seen by python, which can happen in certain reverse- # proxy hosting setups. It will overwrite the WSGI environ dict with the # details from public_url. This could have security implications if e.g. # you tell the app that it's on HTTPS but it's really on HTTP, so it should # only be used as a last resort and after careful checking of server config. force_wsgi_environ = false |
Punkt 4: Apache 2.4 konfigurieren
Wir erstellen uns einen Firefox Sync Benutzer und setzten die Rechte.
|
1 2 |
useradd -d /opt/syncserver/ -l -r -U ffsync chown -R ffsync:ffsync /opt/syncserver/ |
Bitte passt eure Domain im virtuellen Host entsprechend an.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<IfModule mod_ssl.c> <VirtualHost *:443> ServerName sync.adminforge.de DocumentRoot /opt/syncserver SSLEngine on SSLCertificateFile /etc/ssl/private/sync.adminforge.de_ecc/fullchain.cer SSLCertificateKeyFile /etc/ssl/private/sync.adminforge.de_ecc/sync.adminforge.de.key SSLCertificateChainFile /etc/ssl/private/sync.adminforge.de_ecc/ca.cer WSGIProcessGroup ffsync WSGIDaemonProcess ffsync user=ffsync group=users processes=2 threads=25 python-path=/opt/syncserver/local/lib/python2.7/site-packages/ WSGIPassAuthorization On WSGIScriptAlias / /opt/syncserver/syncserver.wsgi CustomLog /var/log/apache2/access_sync.adminforge.de.log combined ErrorLog /var/log/apache2/error_sync.adminforge.de.log LogLevel warn <Directory /opt/syncserver> Require all granted Options -Indexes </Directory> </VirtualHost> </IfModule> |
WICHTIG: Nutzt unbedingt SSL! Ich erkläre in diesem Artikel wie ihr einfach an ein Let’s Encrypt Zertifikat kommt: Let’s Encrypt via acme.sh für Apache und Nginx
Punkt 5: vHost aktivieren und Apache neu starten
|
1 2 |
a2ensite sync.adminforge.de.conf systemctl restart apache2.service |
Punkt 6: Firefox einrichten
- Öffnet Firefox und gebt in der Adressleiste
about:configein, bestätigt den Warnhinweis. - Sucht nach
identity.sync.tokenserver.uri. Es sollte ein Eintrag erscheinen. - Ändert mit Doppelklick den Wert auf eure Sync Server-Adresse:
https://sync.adminforge.de/token/1.0/sync/1.5 - Startet Firefox neu.
Nun könnt ihr im Menü rechts oben auf „Bei Sync anmelden“ klicken, dort dann auf „Anmelden“ und auf „Konto erstellen“ gehen.
Punkt 7: Neue Benutzer verbieten
Nachdem ihr euren Benutzer auf den Firefox Sync Server losgelassen habt, sperren wir weitere Benutzer.
Dazu einfach allow_new_users in der Konfiguration einkommentieren (auf false setzen).
|
1 |
allow_new_users = false |
Punkt 8: Updates
Updates führen wir wie folgt durch. Sollte es ein Update gegeben haben muss der Webserver neu gestartet werden.
|
1 2 3 4 5 |
cd /opt/syncserver git stash # to save any local changes to the config file git pull # to fetch latest updates from github git stash pop # to re-apply any local changes to the config file make build # to pull in any updated dependencies |
PS: Das Konto selbst liegt auf den Mozilla Servern, die Daten auf eurem eigenen! Ich finde das ist der relevante Part.
Viel Spaß beim Syncen!
Das Betreiben der Dienste, Webseite und Server machen wir gerne, kostet aber leider auch Geld.Unterstütze unsere Arbeit mit einer Spende. |
