Eigener Sync-Server für Firefox

From
Jump to navigation Jump to search

Theorie

Überblick

Unsortierte

https://blog.mozilla.org/services/2014/02/07/a-better-firefox-sync/

https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol

https://developer.mozilla.org/en-US/Firefox_Accounts

https://wiki.mozilla.org/Identity/Firefox-Accounts

Aufgabenbereiche der einzelnen Server

auth-server: manages accounts database

content-server: web-based user interface

TODO Datenbank/Backend?

Lösung

MVP: lokaler Syncserver angebunden an FXA-System

Anleitung zu finden unter:

https://docs.services.mozilla.com/howtos/run-sync-1.5.html

TODO SSL-Konfig dieser Lösung?

Überblick

Manuelle Vorbereitung

Zertifikate erstellen

Hosts Config

Einrichtung über Ansible

1. Vorbereitung vm

  • Ubuntu vm
  • ssh + keys von host
  • sudo?


TODO yaml-file und templates packen und hochladen

Plug-in (done)

automatische Konfiguration des Clients zur Nutzung der eigenen sync und fxa server

Hindernisse

Content Server braucht nach npm install noch bower run

Bower muss installiert werden (npm install -g bower)

und dann im Verzeichnis ein "bower install"

Server nur über https ansprechbar

about:accounts gibt in der browser console folgenden Fehler aus:

"Firefox Account Error: Couldn't init Firefox Account wrapper: Firefox Accounts server must use HTTPS " aboutaccounts.js:28

Connection Reset

TODO silent connection reset bei nicht akzeptiertem zertifikat: Wireshark? Reproduzierbar? für Selbstgebaute Zertifikate: vorher manuell als Ausnahme hinzufügen (folgende Seiten besuchen)

https://sync.accounts.devlocal

https://api.accounts.devlocal

https://accounts.devlocal

https://verify.accounts.devlocal

Cross Origin Ajax Calls

Firefox macht während des Logins AJAX Calls vom Content Server an den Auth Server. Bei Mozilla ist das kein problem, da die uris für API/Content Server subdomains von firefox.com sind:

Wenn die Server allerdings lokal laufen, schlägt der Ajax-Request mit einem Cross-Domain Fehler fehl (was ja eigentlich auch gut so ist). In unserem Fall ist das aber ein Problem.

TODO Bild

Lösungsansatz: NGINX, Apache reverse proxy

Anbindung an Browserid-verifier

502 bei lokal Verifier, trailing/slash, audiences

Umstellung von Subdomains auf virtuelle Ordner

relative links im content-server

aufruf von /.well-known/...

TODOs

Ansible

https://www.digitalocean.com/community/tutorials/how-to-create-ansible-playbooks-to-automate-system-configuration-on-ubuntu

1. Firefox Services Installieren (+ Abhängigkeiten) - Syncserver gunicorn - fxa-account-server - fxa-content-server

2. Services konfigurieren - Syncserver - fxa-account-server - fxa-content-server

3. CA/Zertifikate generieren

4. Nginx Installieren sudo apt-get install nginx /etc/nginx/sites-available/default

5. Nginx Konfig

6. Hosts datei

Firefox-Plugin

https://blog.mozilla.org/addons/2014/06/05/how-to-develop-firefox-extension/

config-Einträge ändern per Plugin

http://stackoverflow.com/questions/6157173/a-firefox-extension-that-changes-a-value-in-the-aboutconfig

https://addons.mozilla.org/en-US/firefox/files/browse/98518/file/bootstrap.js

https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Services.jsm


https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/preferences_service

https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Preferences

Informationenhaufen

Links

nginx rewrite: http://wiki.apache.org/couchdb/Nginx_As_a_Reverse_Proxy

Virtualbox HostNetwork: http://www.thomas-krenn.com/de/wiki/Netzwerkkonfiguration_in_VirtualBox#Host-only_networking


https://github.com/mozilla/fxa-dev

https://blog.mozilla.org/services/2014/05/08/firefox-accounts-sync-1-5-and-self-hosting/

http://comments.gmane.org/gmane.comp.mozilla.sync.devel/924

https://github.com/callahad/selfhosted-sync

https://github.com/mozilla-services/syncserver

http://www.ncalexander.net/blog/2014/07/05/how-to-connect-firefox-for-android-to-self-hosted-services/

http://meta.wikimedia.org/wiki/Help:Wikitext_examples

Debug Infos

Firefox: about:sync-log

Config

Ports

Ports:

Sync: 5000

API: 9000

content: 3030

verify: 7070

Firefox

syncserver: services.sync.tokenServerURI

https://sync.accounts.devlocal/token/1.0/sync/1.5 --> https://accounts.devlocal/ffs/token/1.0/sync/1.5

auth-services: identity.fxaccounts.auth.uri

https://api.accounts.devlocal/v1 --> https://accounts.devlocal/api/v1

identity.fxaccounts.remote.force_auth.uri

https://accounts.devlocal/force_auth?service=sync&context=fx_desktop_v1

identity.fxaccounts.remote.signin.uri

https://accounts.devlocal/signin?service=sync&context=fx_desktop_v1

identity.fxaccounts.remote.signup.uri

https://accounts.devlocal/signup?service=sync&context=fx_desktop_v1

identity.fxaccounts.settings.uri

https://accounts.devlocal/settings