S.A.B.R.E. — Special API Brigade for Real Emergencies
JavaScript Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ansible
service
.gitignore
README.md
TODO.md
Vagrantfile

README.md

_________ .__                .__
\_   ___ \|  | _____    _____|  |__
/    \  \/|  | \__  \  /  ___/  |  \
\     \___|  |__/ __ \_\___ \|   Y  \
 \______  /____(____  /____  >___|  /
        \/          \/     \/     \/
        __
_____ _/  |_
\__  \\   __\
 / __ \|  |
(____  /__|
     \/
________                               .__                       .___
\______ \   ____   _____   ____   ____ |  |__   ____ _____     __| _/
 |    |  \_/ __ \ /     \ /  _ \ /    \|  |  \_/ __ \\__  \   / __ |
 |    `   \  ___/|  Y Y  (  <_> )   |  \   Y  \  ___/ / __ \_/ /_/ |
/_______  /\___  >__|_|  /\____/|___|  /___|  /\___  >____  /\____ |
        \/     \/      \/            \/     \/     \/     \/      \/

Getting Started

First install Virtualbox and Vagrant.

Then install Ansible with:

$ brew install python
$ sudo pip install ansible

Then run:

$ vagrant up

At this point, the service/ directory is synced to a Vagrant VM's /srv/service and the Node app is running on the VM's port 8080. localhost:8080 on your machine points to the VM's port 80, where an Nginx process is running and proxying all requests through to Node. A Postgres process should also be running with a database named clash_at_demonhead and user named www with the very, very secret password of secret.

If you want to check the state of the monitored processes, go to localhost:2812 for the Monit web dashboard. The username is clash-at-demonhead, and the password is bob-ombs-away.

Run Migrations

Inside the Vagrant /srv/service directory:

$ make migrate

Run Specs

Inside the Vagrant /srv/service directory:

$ make test

Restart the Server

Inside the Vagrant /srv/service directory:

$ make restart

Access Postgres

Inside the Vagrant /srv/service directory:

$ make postgres

From there you just have an ordinary Postgres prompt; you can use \dt to show tables, or \d users to show the columns of the users table. \dt+ shows extended information about tables, including storage information, and \d+ users would do the same for the users table.