LitusProject/Litus — pull request #225 by bgotink (2014-12-21 02:46:44+00:00)
Title: Vagrant support

[Vagrant is a development environment manager using virtual machines.]

This PR __proposes__ usage of vagrant for the following reasons:
- It's _easy_ to set-up.
- The development environment will be the same for everyone using it, so no quirks genre "it works on my set-up". The environment in which litus runs will be the same for every dev, even those running Windows.
- Vagrant allows sharing of an environment, giving you a public address you can share with everyone to access _your vagrant guest environment on your machine_. This makes testing easier, e.g. in case someone has a bug but the rest cannot reproduce it.

Other changes required for vagrant to work:
- Allow sockets to work with default addresses if the litus webpage runs on a non-default port (i.e. not 80 for HTTP and 443 for HTTPS)
- Allow configuration of the node path. This should be integrated with travis, as the travis install script now contains quite the mess to get everything set-up in `/usr/local`. This change should also make setting up in production easier because node is installed in `/usr` there as well. The path defaults to `/usr/local`, so existing set-ups won't be broken.

How to use:

```bash
# Install vagrant (see https://www.vagrantup.com/ if you don't use brew-cask)
brew cask install vagrant

cd /path/to/project

# creates the vagrant environment, takes a while to set up
vagrant up

# now you can visit http://localhost:54887

# if you need to run bin/update.sh, run:
vagrant provision

# to publish changes you made to the repository to the vagrant host
vagrant rsync

# to automatically sync all changes to the vagrant host
vagrant rsync-auto # just leave this running, or start in background

# to enter the vagrant environment
# note:
# - sudo does not require a password
# - litus lives in /vagrant
vagrant ssh

# to stop the vagrant environment
vagrant halt # use `vagrant up` to start it again

# to pause/unpause the environment (preferred over stopping/starting because it's faster
vagrant suspend
vagrant resume

# to load changes in the Vagrantfile, also restarts the virtual machine
vagrant reload
```