diaspora-installer package helps you set up and run a diaspora* pod on your server.

Read wiki.diasporafoundation.org for more information about diaspora*.


This package makes some choices for you.
- postgresql is used as the database (alternatives include mysql)
- nginx is used as the server (alternatives include apache)

The package is split into diaspora-installer and diaspora-common, because a diaspora package is being planned and diaspora-common will contain files that is common to diaspora-installer and diaspora packages.

diaspora-installer
- contains the database congiuration and diaspora configuration yml files which are copied to (/usr/share/diaspora)
diaspora-common
- contains the init script (which will be copied to /etc/init.d/diaspora)
- contains diaspora.conf that is used during the setup
- contains other scripts (adduser, grantpriv, explained later)

Installation
===
There's no binary to be built.
The scripts and configuration are copied to the following places.
- diaspora.yml and database.yml are put in /usr/share/diaspora/config
- adduser.sh, grantpriv.sh, set-env-nginx.sh are put in /usr/lib/diaspora-common/scripts
- diaspora-common.init becomes the /etc/init.d/diaspora

The "config" file gets run and
- sets all the variables required in /etc/diaspora.conf
- copies nginx.conf.example to /etc/nginx-sites-available/ and symlinks in sites-enabled


postinst does the following:
- runs adduser.sh to create 'diaspora' user with no login possible.
- runs grantpriv.sh to set diaspora_production database's owner to diaspora. Grants diaspora privilege to create database. And grants all privileges on template1 database to diaspora. This database stores permissions and other metadata
- the download of the actual diaspora code from git.
- copies that to /usr/share/diaspora/
- `bundle install` all gems based on Gemfile
- bundle exec rake db:create db:schema:load
- bundle exec rake assets:precompile
- creating and saving secret token
- starting diaspora

You will then be asked to copy ssl certificates and reload nginx

Running
===
/etc/init.d/diaspora {start|stop|status|restart|force-reload}
service diaspora {start|stop|status|restart|force-reload}

Configuration
===
You might want to edit diaspora.yml to make modifications, like integrating social networks. This file can be found in /usr/share/diaspora/config
While editing, you need to be the diaspora user, so use the following command
sudo -u diaspora -E vim /usr/share/diaspora/config/diaspora.yml

Later you can restart diaspora service.
sudo service diaspora restart
