Eigener Sync-Server für Firefox

From
Revision as of 14:20, 23 September 2014 by Tom (talk | contribs) (→‎Info Austausch)
Jump to navigation Jump to search

Theorie

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

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

Module/Komponenten

  • Sync Server
  • Firefox Accounts Server (fxa)

auth-server: manages accounts database

content-server: web-based user interface

Variante 1 - läuft

eigener Sync Server + Firefox Accounts Server von Mozilla

Sync Daten werden auf eigenen Server gespeichert.

Anmeldung/Authentifizierung erfolgt über den Mozilla Server

Variante 2 - läuft (noch) nicht

eigener Sync Server + eigener Firefox Accounts Server

benötigt SSL

Work in Progress

1. Schritt: lokaler sync-server mit mozilla fx-Accounts

Anleitung zu finden unter: https://docs.services.mozilla.com/howtos/run-sync-1.5.html

2. Schritt: fxa-auth-server aufsetzen https://github.com/mozilla/fxa-auth-server

3. Schritt: fxa-content-server aufsetzen https://github.com/mozilla/fxa-content-server

Beachten:

Bower muss installiert werden (npm install -g bower)

und dann im Verzeichnis ein "bower install"

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

4. Schritt: Firefox an eigenen fxa-server anbinden https://docs.services.mozilla.com/howtos/run-fxa.html SSL-Config Damit der Firefox mit den eigenen Servern spricht müssen diese über https erreichbar sein. Dies lässt sich wie folgt gewährleisten:

Zertifikat erstellen (key.pem & cert.pem)

1. content-server

Schlüssel und cert in Hauptordner

./server/config/local.json => "use_https": true, und: "fxaccount_url": "http://your.auth.server.here.org",

2. auth-server

Schlüssel und cert in Hauptordner

./config/config.js => use_https: true

Probleme

Firefox macht während des Logins AJAX Calls vom Content Server an den Auth Server. Bei ihnen ist das kein problem, da die uris:

beide unter die gleiche Domain (firefox.com) fallen. 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.

Lösungsansätze:

Cross Domain requests im Response header des Content-Servers erlauben

Debug Optionen

Firefox: about:sync-log

config: tokenServerURI: http://192.168.56.101:5000/token/1.0/sync/1.5

Notizenhaufen

Evaluieren: bringt uns das was? 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/

BrowserId Verifier?

Paketverkehr monitoring mit tshark

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


Info Austausch

X-Frame-Options:"DENY" - "The page cannot be displayed in a frame, regardless of the site attempting to do so."

X-XSS-Protection:"1; mode=block" - https://www.owasp.org/index.php/List_of_useful_HTTP_headers

x-content-type-options:"nosniff" - https://www.owasp.org/index.php/List_of_useful_HTTP_headers

content-security-policy:"default-src 'self';img-src 'self' data: http://localhost:1112 https://secure.gravatar.com;connect-src 'self' https://localhost:9000 https://localhost:9010 https://localhost:1111;report-uri /_/csp-violation"