Advertisement
Guest User

FirefoxSync

a guest
Mar 14th, 2017
315
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. >> Install Dependencies
  2. apt install python-dev git-core python-virtualenv g++ make sqlite3
  3.  
  4. >> Download and Setup Firefox Syncserver 1.5
  5. cd /opt
  6. git clone https://github.com/mozilla-services/syncserver
  7. cd syncserver
  8. make build
  9. head -c 20 /dev/urandom | sha1sum < Copy this output <
  10.  
  11. nano syncserver.ini
  12. #########################################################################################
  13. # Change the following
  14. # if your running FFSyncin a LXD Container change this to your Static IP of the container
  15. # Yes you can leave it to listen to all interfaces (the 0.0.0.0) but i dislike that ...
  16. host = 0.0.0.0
  17. # edit this for the public domain / virtual host of nginx. FFSync is the location on my
  18. # Nginx Reverse proxy, you can change it to what you like but keep this location in mind
  19. # we will need it later
  20. public_url = https://domain.com/ffsync/
  21. # This is the server database.
  22. sqluri = sqlite:////opt/syncserver/syncserver.db
  23. # Paste here the result of the "head -c 20 /dev/urandom | sha1sum" Command
  24. secret = <Content<
  25. # Because this runs on HTTP and i was reverse proxy it through HTTPS, i was getting an error
  26. # and locking me out of the server, change this to true to avoid this
  27. force_wsgi_environ = true
  28. # This is not needed NOW, but once your done uncomment this line.
  29. #allow_new_users = false
  30. ###########################################################################################
  31.  
  32. >> Create the service
  33. nano /etc/systemd/system/ffsync.services
  34. ###########################################################################################
  35. [Unit]
  36. Description=A gunicorn server running Mozilla's Firefox sync server
  37. After=syslog.target network.target
  38.  
  39. [Service]
  40. ExecStart=/opt/syncserver/local/bin/gunicorn --paste /opt/syncserver/syncserver.ini --log-file=/var/log/sync.log
  41.  
  42. [Install]
  43. WantedBy=multi-user.target
  44. ###########################################################################################
  45.  
  46. systemctl daemon-reload
  47. systemctl start ffsync
  48. systemctl status ffsync
  49.  
  50. >> Configure the reverse proxy
  51. nano /etc/nginx/sites-available/domain.com
  52. ###########################################################################################
  53. # i m just adding the location block, if you changed the location to something else in the
  54. # Firefox Syncservice change the location block, also change the proxy_pass parameter.
  55.        location /ffsync/ {
  56.  
  57.                access_log /var/log/nginx/access.ffsync.domain.com.log;
  58.                error_log /var/log/nginx/error.ffsync.domain.com.log;
  59.  
  60.                rewrite  ^/ffsync(.+)$ $1 break;
  61.                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  62.                proxy_set_header Host $http_host;
  63.                proxy_pass http://1.0.0.1:5000;
  64.                proxy_redirect off;
  65.        }
  66. ###########################################################################################
  67.  
  68. >> Configure FireFox
  69. about:config > identity.sync.tokenserver.uri = https://domain.com/ffsync/token/1.0/sync/1.5/
  70. Next go to settings, Sync create an account (since your only hosting the server for the data and
  71. not for the authentication, create a firefox account (you will get an email from them)
  72.  
  73. To see Firefox syncing with your server in the reverse proxy server do this and force Firefox Sync:
  74. tail -f /var/log/nginx/access.ffsync.domain.com.log
  75.  
  76. Your done, don't forget to uncomment "allow_new_users" and set it to false and restart the
  77. Firefox Syncserver.
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement