Synology usage series 36 – Run your own firefox sync server


OK, once I got my own diskstation, I always want my data on my own cloud.

Now I’m seeking to run my own firefox sync server.

Googling it and returns lots of tutorial but they are pretty the same.

All tutorial is about to run php version over apache.

No-no-no. I want the official one.

Here is how I make it works.

  1. Open a browser and login the DSM.
  2. Navigate to Control Panel > System > DSM Settings.

    DSM Settings

    DSM Settings

  3. Click HTTP Service tab.
  4. Modify the Default Port Number – HTTP to some other port rather than 5000. Click Apply button when done.
  5. Navigate to Network Services > Firewall and QoS
  6. Click Create button
  7. Ports: Custom
    Source IP: All
    Action: Allow
  8. Click Custom button.
  9. Type: Destination Port
    Protocol: All
    Ports: 5000

  10. Click OK button twice.
  11. Click Save button to commit the changes.
  12. SSH to the DS
  13. Install the following ipkg packages.


    # sudo su
    # ipkg install bash
    # ipkg install make
    # ipkg install openssl-dev
    # ipkg install pyhton26
    # ipkg install py26-mercurial

  14. Setup virtualenv.


    # bash
    # mkdir ~/tmp
    # cd /root/tmp
    # /usr/syno/bin/wget https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.10.1.tar.gz --no-check-certificate
    # tar xvzf virtualenv-1.10.1.tar.gz
    # cd virtualenv-1.10.1/
    # /opt/bin/python2.6 setup.py install
    # /opt/local/bin/virtualenv ENV
    # rm -r -f /root/tmp

  15. Download the firefox sync server.


    # cd /opt
    # hg clone https://hg.mozilla.org/services/server-full
    # mv server-full firefox-sync

  16. Build the firefox sync server.


    # cd firefox-sync
    # Edit Makefile, update virtualenv to /opt/local/bin/virtualenv
    # make build
    # make test

    The result will look like this

    Ran 236 tests in 116.215s

    OK (SKIP=25)

  17. Configure firefox sync server.


    Edit sync.conf
    # vi /opt/firefox-sync/etc/sync.conf

    • Update fallback_node to the domain name or ip address diskstation with port 5000.

      fallback_node = http://ds.synology.me:5000/

    • Update all the path of sqlite database from /tmp to /opt/tmp.

      sqluri = sqlite:////opt/tmp/test.db


    Edit development.ini
    # vi /opt/firefox-sync/development.ini

    • Edit the path of sync-error.log from /tmp to /opt/tmp.

      args = ('/opt/tmp/sync-error.log',)

  18. Start the server.


    # bash
    # cd /opt/firefox-sync/bin
    #./paster serve ../development.ini &

  19. In order to have the sync server execute for every reboot, create a file S67firefox_sync under /opt/etc/init.d

    # cd /opt/etc/init.d
    # vi S67firefox_sync

    Content of S67firefox_sync

    #!/bin/sh
    #
    # Startup script for firefox sync server
    #
    /opt/firefox-sync/bin/paster serve /opt/firefox-sync/development.ini

  20. Setup the broadband router and add a port forward rule to route traffic of port 5000 to the diskstation with firefox sync server installed.


  21. Open firefox, setup firefox sync. Click create a new account button. In the sync server field, input your DS url as below:

    http://myds.synology.me:5000

Reference Run your own Sync Server





Leave a Reply

Your email address will not be published. Required fields are marked *