#!/bin/bash

if [ -z "$1" ]; then
    echo usage: $0 "[initdb | createdb | dropdb | syncdb | runserver | resetdb | dumpdata]"
    exit
fi

XOS_DIR=/opt/xos
BACKUP_DIR=/opt/xos_backups
DBNAME=planetstack

DJANGO_17=`python -c "import django; from distutils.version import StrictVersion; print int(StrictVersion(django.get_version()) >= StrictVersion('1.7'))"`

cd $XOS_DIR

function ensure_postgres_running {
    # "sudo -u postgres pg_ctl -D /var/lib/postgres/data status" doesn't work
    # right on Vicci, so let's try to detect it by seeing if the port is
    # being listened on

    netstat -nl | grep -i ":5432 "
    if [[ $? == 0 ]]; then
        echo "Postgres is already running"
        return
    fi

    service postgresql initdb
    service postgresql start

    netstat -nl | grep -i ":5432 "
    if [[ $? != 0 ]]; then
        # it's still not running
        echo "Trying fallback mechanism to start Postgres"
        sudo -u postgres initdb -D /var/lib/pgsql/data/
        sudo -u postgres pg_ctl -D /var/lib/pgsql/data -l logfile start
    fi

}
function createdb {
    echo "Creating XOS database..."
    sudo -u postgres createdb $DBNAME
}
function dropdb {
    echo "Dropping XOS database..."
    sudo -u postgres dropdb $DBNAME
}
function syncdb {
    echo "Syncing XOS services..."
    python $XOS_DIR/manage.py syncdb --noinput
    if [[ $DJANGO_17 ]]; then
        echo "Loading initial data from fixture..."
        python $XOS_DIR/manage.py --noobserver --nomodelpolicy loaddata $XOS_DIR/core/fixtures/initial_data.json
    fi
}
function evolvedb {
    echo "Evolving XOS services..."
    python $XOS_DIR/manage.py evolve --hint --execute --noinput
}
function migratedb {
    echo "Migrating XOS services..."
    python $XOS_DIR/manage.py migrate
}
function stopserver {
    echo "Stopping any running XOS Service(s)"
    pkill -f "python.*runserver"
}
function runserver {
    ensure_postgres_running
    PUBLIC_HOSTNAME=`$XOS_DIR/xos-config.py get server_hostname $HOSTNAME`
    echo "Starting XOS Service on $PUBLIC_HOSTNAME:8000"
    python manage.py runserver  $PUBLIC_HOSTNAME:8000&
}

function dumpdata {
    mkdir -p $BACKUP_DIR
    FN="$BACKUP_DIR/dumpdata-`date +%Y-%m-%d_%H:%M:%S`.json"
    echo "Saving data to $FN"
    python manage.py dumpdata core hpc syndicate_storage requestrouter -a --indent 4 > $FN
    if [[ ! -f $FN ]]; then
        echo "FAILED to create $FN"
        exit
    fi
    SIZE=$(du -k "$FN" | cut -f 1)
    if [[ $SIZE -lt 9 ]]; then
        echo "Dumpdata was empty. Deleting and aborting"
        rm $FN
        exit
    fi
    rm -f $BACKUP_DIR/dumpdata-latest.json
    ln -s $FN $BACKUP_DIR/dumpdata-latest.json
}

function genkeys {
    mkdir -p public_keys
    mkdir -p private_keys
    echo "Generating keys"
	keyczart create --location=private_keys --name="OpenCloud" --purpose=crypt --asymmetric=rsa
	keyczart addkey --location=private_keys --status=primary --size=1024
	keyczart pubkey --location=private_keys --destination=public_keys
    if [[ ! -f public_keys/1 ]]; then
        echo "FAILED to create keys"
        exit
    fi
}

COMMAND=$1

if [ "$COMMAND" = "initdb" ]; then
    stopserver
    ensure_postgres_running
    createdb
    syncdb
fi
if [ "$COMMAND" = "repairdb" ]; then
    stopserver
    ensure_postgres_running
    dumpdata
    # TODO: This is where we could run migration scripts to upgrade the
    #   dumped data to the new models.
    mv $XOS_DIR/core/fixtures/initial_data.json $XOS_DIR/core/fixtures/initial_data.json-old
    cp $BACKUP_DIR/dumpdata-latest.json $XOS_DIR/core/fixtures/initial_data.json
    dropdb
    createdb
    syncdb
fi
if [ "$COMMAND" = "restoredb" ]; then
    if [[ ! -f $BACKUP_DIR/dumpdata-latest.json ]]; then
       echo There is no dumpdata to restore
       exit
    fi
    stopserver
    ensure_postgres_running
    mv $XOS_DIR/core/fixtures/initial_data.json $XOS_DIR/core/fixtures/initial_data.json-old
    cp $BACKUP_DIR/dumpdata-latest.json $XOS_DIR/core/fixtures/initial_data.json
    dropdb
    createdb
    syncdb
fi
if [ "$COMMAND" = "evolvedb" -o "$COMMAND" = "migratedb" ]; then
    stopserver
    ensure_postgres_running
    if [[ $DJANGO_17 ]]; then
        migratedb
    else
        evolvedb
    fi
fi
if [ "$COMMAND" = "resetdb" ]; then
    stopserver
    dropdb
    createdb
    syncdb
fi
if [ "$COMMAND" = "syncdb" ]; then
    stopserver
    syncdb
fi
if [ "$COMMAND" = "runserver" ]; then
    stopserver
    runserver
fi
if [ "$COMMAND" = "stopserver" ]; then
    stopserver
fi
if [ "$COMMAND" = "dumpdata" ]; then
    dumpdata
fi
if [ "$COMMAND" = "genkeys" ]; then
    genkeys
fi
