Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> Install Dependencies
- apt install python-dev git-core python-virtualenv g++ make sqlite3
- >> Download and Setup Firefox Syncserver 1.5
- cd /opt
- git clone https://github.com/mozilla-services/syncserver
- cd syncserver
- make build
- head -c 20 /dev/urandom | sha1sum < Copy this output <
- nano syncserver.ini
- #########################################################################################
- # Change the following
- # if your running FFSyncin a LXD Container change this to your Static IP of the container
- # Yes you can leave it to listen to all interfaces (the 0.0.0.0) but i dislike that ...
- host = 0.0.0.0
- # edit this for the public domain / virtual host of nginx. FFSync is the location on my
- # Nginx Reverse proxy, you can change it to what you like but keep this location in mind
- # we will need it later
- public_url = https://domain.com/ffsync/
- # This is the server database.
- sqluri = sqlite:////opt/syncserver/syncserver.db
- # Paste here the result of the "head -c 20 /dev/urandom | sha1sum" Command
- secret = <Content<
- # Because this runs on HTTP and i was reverse proxy it through HTTPS, i was getting an error
- # and locking me out of the server, change this to true to avoid this
- force_wsgi_environ = true
- # This is not needed NOW, but once your done uncomment this line.
- #allow_new_users = false
- ###########################################################################################
- >> Create the service
- nano /etc/systemd/system/ffsync.services
- ###########################################################################################
- [Unit]
- Description=A gunicorn server running Mozilla's Firefox sync server
- After=syslog.target network.target
- [Service]
- ExecStart=/opt/syncserver/local/bin/gunicorn --paste /opt/syncserver/syncserver.ini --log-file=/var/log/sync.log
- [Install]
- WantedBy=multi-user.target
- ###########################################################################################
- systemctl daemon-reload
- systemctl start ffsync
- systemctl status ffsync
- >> Configure the reverse proxy
- nano /etc/nginx/sites-available/domain.com
- ###########################################################################################
- # i m just adding the location block, if you changed the location to something else in the
- # Firefox Syncservice change the location block, also change the proxy_pass parameter.
- location /ffsync/ {
- access_log /var/log/nginx/access.ffsync.domain.com.log;
- error_log /var/log/nginx/error.ffsync.domain.com.log;
- rewrite ^/ffsync(.+)$ $1 break;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $http_host;
- proxy_pass http://1.0.0.1:5000;
- proxy_redirect off;
- }
- ###########################################################################################
- >> Configure FireFox
- about:config > identity.sync.tokenserver.uri = https://domain.com/ffsync/token/1.0/sync/1.5/
- Next go to settings, Sync create an account (since your only hosting the server for the data and
- not for the authentication, create a firefox account (you will get an email from them)
- To see Firefox syncing with your server in the reverse proxy server do this and force Firefox Sync:
- tail -f /var/log/nginx/access.ffsync.domain.com.log
- Your done, don't forget to uncomment "allow_new_users" and set it to false and restart the
- Firefox Syncserver.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement