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

From
Jump to navigation Jump to search
(TODOs für Dienstag)
Line 175: Line 175:


== Ubuntu einrichtung ==
== Ubuntu einrichtung ==
Einrichtung über [https://github.com/ansible/ansible Ansible]:
'''TODO''' yaml file und templates packen und verlinken



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


1. Firefox Services Installieren (+ Abhängigkeiten)
1. Firefox Services Installieren (+ Abhängigkeiten)
- Syncserver
- Syncserver

Revision as of 20:46, 29 September 2014

Theorie

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

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.

WICHTIG für Selbstgebaute Zertifikate: vorher manuel als Ausnahme hinzufügen (folgende Seiten besuchen)

https://sync.accounts.devlocal

https://api.accounts.devlocal

https://accounts.devlocal

https://verify.accounts.devlocal

Lösungsansätze:

nginx für eigene domain der https verwaltet.

Debug Optionen

Firefox: about:sync-log

config: tokenServerURI: https://sync.accounts.devlocal/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

Ports:

Sync: 5000

API: 9000

content: 3030

verify: 7070

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

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"

about:config

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


Ubuntu einrichtung

Einrichtung über Ansible: TODO yaml file und templates packen und verlinken


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