Eigener Sync-Server für Firefox: Difference between revisions

From
Jump to navigation Jump to search
Line 59: Line 59:


Der Nutzer wird aufegordert die Adresse des Sync Servers anzugeben, das Plug-in setzt dann alle benötigten Einträge in about:config
Der Nutzer wird aufegordert die Adresse des Sync Servers anzugeben, das Plug-in setzt dann alle benötigten Einträge in about:config

services.sync.tokenServerURI

identity.fxaccounts.auth.uri

identity.fxaccounts.remote.force_auth.uri

identity.fxaccounts.remote.signin.uri

identity.fxaccounts.remote.signup.uri

identity.fxaccounts.settings.uri


= Hindernisse =
= Hindernisse =

Revision as of 08:56, 1 October 2014

Theorie

Überblick

https://wiki.mozilla.org/images/f/ff/Firefox_Accounts_and_Sync_Architecture.png

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

Sync-Server

Speichert (verschlüsselt) die zu synchronisierenden Daten der angemeldeten Nutzer ab. Die bereitgestellte Konfiguration nutzt eine SQLite DB unter (/tmp/syncserver.db). Spricht mit dem BrowserId-Verifier. Läuft lokal auf Port 5000

fxa-auth-server

Verwaltet die Accounts. Gibt die Bestätigungs-Mail-Links aus TODO DB, Config, Spricht mit

fxa-content-server

Liefert das Web-Frontend für den auth-server: login/anmelden/verwaltung TODO DB, Config, Spricht mit

browserid-verifier

TODO DB, Config, Spricht mit

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
  • Einrichtung Netzwerk
  • Auf Host: ansible_hosts ip des Gastes in gruppe [vms] eintragen

2. Befehle

Test ansible vms -m ping --ask-pass -i ./ansible_hosts

Check syntax ansible-playbook --syntax-check --list-tasks -i ./ansible_hosts ./ansible.yml

Run ansible-playbook --ask-pass --ask-sudo-pass -i ./ansible_hosts ./ansible.yml

Plug-in

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

Der Nutzer wird aufegordert die Adresse des Sync Servers anzugeben, das Plug-in setzt dann alle benötigten Einträge in about:config

services.sync.tokenServerURI

identity.fxaccounts.auth.uri

identity.fxaccounts.remote.force_auth.uri

identity.fxaccounts.remote.signin.uri

identity.fxaccounts.remote.signup.uri

identity.fxaccounts.settings.uri

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

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