Tari.in
Batteries not included.
  • Nav
  • Bottom
  • Tux
  • Kowalski
  • Rico
  • Skipper
  • Private
  • Comment
  • Contact
  • Top
  • There are no visitor comments on this page

    Installing Firefox Sync on WebFaction

    Below is a complete set of commands needed to install the Firefox Sync server on your WebFaction shared account. Tested on CentOS 7.

    Preparation

    Go to the Webfaction Control Panel and follow these steps:

    1. Ceate a new application: mod_wsgi + mod_wsgi x.x.x/Python 2.7
    2. Ceate a new subdomain: Default settings
    3. Ceate a new website: Sync subdomain + Sync application
    4. Ceate a new database: PostgreSQL + Unicode + Tsearch2

    Now SSH into your WebFaction account and start pasting.

    Variables

    Copy the values for the DOMAIN_SYNC, APPNAME_SYNC, DBNAME_SYNC, DBUSER_SYNC and DBPASS_SYNC variables from the WebFaction control panel.

    APPNAME_SYNC="example_com_sync"
    DOMAIN_SYNC="sync.example.com"
    DBNAME_SYNC="example_com_sync"
    DBUSER_SYNC="username"
    DBPASS_SYNC="abc123"
    MAIL_FF_ACCOUNT="username@example.com"
    

    Installation

    pip2.7 install virtualenv
    cd ~/webapps/$APPNAME_SYNC
    git clone https://github.com/mozilla-services/syncserver
    cd syncserver
    make build
    sed -i "s@public_url = http://localhost:5000/@public_url = http://$DOMAIN_SYNC/@" syncserver.ini
    sed -i "s@#sqluri = sqlite:////tmp/syncserver.db@sqluri = postgresql://$DBUSER_SYNC:$DBPASS_SYNC\@localhost:5432/$DBNAME_SYNC@" syncserver.ini
    sed -i "s@#secret = INSERT_SECRET_KEY_HERE@secret = `head -c 20 /dev/urandom | sha1sum | tr -dc 'a-zA-Z0-9'`@" syncserver.ini
    cd $HOME/webapps/$APPNAME_SYNC/apache2/conf
    sed -i "s@DirectoryIndex index.py@#DirectoryIndex index.py@" httpd.conf
    sed -i "s@DocumentRoot $HOME/webapps/$APPNAME_SYNC/htdocs@DocumentRoot $HOME/webapps/$APPNAME_SYNC/syncserver@" httpd.conf
    sed -i "s@python-path=$HOME/webapps/$APPNAME_SYNC/lib/python2.7@python-path=$HOME/webapps/$APPNAME_SYNC/syncserver/local/lib/python2.7/site-packages/@" httpd.conf
    echo "" >> httpd.conf
    echo "WSGIPassAuthorization On" >> httpd.conf
    echo "WSGIScriptAlias / $HOME/webapps/$APPNAME_SYNC/syncserver/syncserver.wsgi" >> httpd.conf
    sed -i "s@<Directory $HOME/webapps/$APPNAME_SYNC/htdocs>@<Directory $HOME/webapps/$APPNAME_SYNC/syncserver>@" httpd.conf
    sed -i "s@Options +ExecCGI@Require all granted@" httpd.conf
    sed -i "/AddHandler wsgi-script .py/d" httpd.conf
    

    Firefox settings

    1. Go to about:config and change the value of identity.sync.tokenserver.uri to http://DOMAIN_SYNC/token/1.0/sync/1.5 (replace DOMAIN_SYNC with your own)
    2. Disconnect all devices from your Firefox account
    3. Re-enable sync on all devices

    Finish and clean up

    cd ~/webapps/$APPNAME_SYNC/syncserver
    sed -i "s@# allow_new_users = false@allow_new_users = false@" syncserver.ini
    local/bin/python2.7 bin/delete_user_data.py $MAIL_FF_ACCOUNT
    $HOME/webapps/$APPNAME_SYNC/apache2/bin/restart
    


    Found an error in this article?

    Add your comment to this page

    Note: If you wish to report a bug, request a feature, or ask a question about an application - please do so by using the appropriate GitHub link on the application's page.

    5 + 7 =
    Please wait, this could take a second...