jackyzy823 / fxa-selfhosting

Selfhosting your own Firefox Accounts (FxA)!
Mozilla Public License 2.0
94 stars 13 forks source link

channelserver setup #7

Closed DavidGhiro closed 3 years ago

DavidGhiro commented 3 years ago

Here is my local setup for channelserver. Not ready for PR but for testing. Using subdomain channelserver. In Windows, the QR code to connect new devices is now displayed after logging in.

docker-compose.yml:

  fxa-content-server:
    environment:
    - PAIRING_SERVER_BASE_URI=wss://channelserver.${NGINX_DOMAIN_NAME}

  channelserver:
    image: mozilla/channelserver:1.0.0
    expose:
    - "8000"
#    environment:
#    - PAIR_debug=true
#    - PAIR_verbose=true
    restart: unless-stopped

_init/nginx/fxa_nossl.conf.tmpl:

map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
}

upstream websocket {
        server channelserver:8000;
}

server {
        server_name channelserver.${NGINX_DOMAIN_NAME};
        listen 80;
        listen [::]:80;

        location / {
                proxy_pass http://websocket;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $connection_upgrade;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

}
jackyzy823 commented 3 years ago

Thanks for your work! I will try to merge this in.

jackyzy823 commented 3 years ago

implement in master branch. use channelserver as a option.

haven't test yet.