mozilla-services / syncserver

Run-Your-Own Firefox Sync Server
Mozilla Public License 2.0
1.87k stars 143 forks source link

GET /.well-known/fxa-client-configuration HTTP/1.1" 404 #267

Open thematrixdev opened 3 years ago

thematrixdev commented 3 years ago

Helo there. I am setting up syncserver with a reverse-proxy.

docker-compose.yml

mozilla-syncserver-container: container_name: mozilla-syncserver-container image: mozilla/syncserver:latest volumes:

  • type: bind source: ./data/mozilla-syncserver target: /data environment: SYNCSERVER_PUBLIC_URL: "https://mozillasyncserver.myserver.com" SYNCSERVER_SECRET: "dummy" SYNCSERVER_SQLURI: "sqlite:////data/syncserver.db" SYNCSERVER_BATCH_UPLOAD_ENABLED: "true" SYNCSERVER_FORCE_WSGI_ENVIRON: "true" PORT: 5000 restart: unless-stopped

nginx sites

server{ location / { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_redirect off; proxy_read_timeout 120; proxy_connect_timeout 10; proxy_pass http://mozilla-syncserver-container:5000/; } server_name mozillasyncserver.myserver.com; listen 443 ssl http2; ssl_certificate /etc/nginx/ssl/myserver.com/cert.pem; ssl_certificate_key /etc/nginx/ssl/myserver.com/private.key; ssl_client_certificate /etc/nginx/ssl/cloudflare/origin-pull-ca.pem; ssl_verify_client on; }

Visiting from web browser: https://mozillasyncserver.myserver.com/ gives "it works!" https://mozillasyncserver.myserver.com/.well-known/fxa-client-configuration gives "0"

However, clicking "Sign in to Sync" in Firefox, this line is shown in Nginx log: [21/Dec/2020:07:09:07 +0000] "GET /.well-known/fxa-client-configuration HTTP/1.1" 404 1 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0"

May anyone please help? Thanks.

rfk commented 3 years ago

GET /.well-known/fxa-client-configuration

This URL is served by the Firefox Account server; if you want to self-host the account server as well as syncserver it is unfortunately a much more complex process, ref https://moz-services-docs.readthedocs.io/en/latest/howtos/run-fxa.html

thematrixdev commented 3 years ago

It seems I can self-host syncserver and use Account Server hosted by Mozilla? How should I configure Firefox for this?

GET /.well-known/fxa-client-configuration

This URL is served by the Firefox Account server; if you want to self-host the account server as well as syncserver it is unfortunately a much more complex process, ref https://moz-services-docs.readthedocs.io/en/latest/howtos/run-fxa.html

rfk commented 3 years ago

It seems I can self-host syncserver and use Account Server hosted by Mozilla? How should I configure Firefox for th

Yes, this is also possible. What Firefox are you setting up? (Desktop, Android, iOS..?)

On Desktop, you should be able to make this work by leaving the identity.fxaccounts.autoconfig.uri preference at its default value, and instead just setting the identity.sync.tokenserver.uri preference as documented here.

thematrixdev commented 3 years ago

Great! I see HTTP-200 in Ngninx logs. The server is correctly set-up except I have modified the incorrect config in Firefox. May I know how to modify the config for Android Firefox as well?

thematrixdev commented 3 years ago

Btw is data in LockWise synced to this self-hosted server?