diff --git a/.env.dev b/.env.dev index 4c463ee..eba208c 100644 --- a/.env.dev +++ b/.env.dev @@ -9,4 +9,4 @@ MAFIASI_OPENID_SYNC_SUPERUSER=false MAFIASI_SECRET_KEY=django-insecure-foobar123 MAFIASI_EMAIL_HOST=mailhost.informatik.uni-hamburg.de MAFIASI_EMAIL_ADDRESSES_PASSWORD= -MAFIASI_DB=postgres://mafiasi-dashboard:mafiasi-dashboard@localhost/mafiasi-dashboard +MAFIASI_DB=postgres://mafiasi_dashboard:mafiasi_dashboard@localhost/mafiasi_dashboard diff --git a/.env.test b/.env.test index 5f4fae3..71d7707 100644 --- a/.env.test +++ b/.env.test @@ -8,7 +8,7 @@ MAFIASI_SECRET_KEY=django-insecure-foobar123 MAFIASI_EMAIL_HOST=mailhost.informatik.uni-hamburg.de MAFIASI_EMAIL_ADDRESSES_PASSWORD= MAFIASI_OPENID_CLIENT_SECRET= -MAFIASI_DB=postgres://mafiasi-dashboard:mafiasi-dashboard@localhost/mafiasi-dashboard +MAFIASI_DB=postgres://mafiasi_dashboard:mafiasi_dashboard@localhost/mafiasi_dashboard MAFIASI_ENABLE_VAULT_INTEGRATION=True MAFIASI_VAULT_URL=https://vault.example.com/ diff --git a/.gitignore b/.gitignore index 9451df2..6862df0 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ staticfiles .pyenv venv db-data +dev_db/ diff --git a/README.md b/README.md index 66127a0..3d0fb45 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,20 @@ docker build -t mafiasi-dashboard . ### From Source -Just install the dependencies, copy example settings and services, migrate database and -execute make: +To install Mafiasi from source, you need the following apt packages: `libgpgme-dev` and `libgraphviz-dev` + +Install the dependencies and start and migrate database: ``` pipenv install -cp mafiasi/settings.py.example mafiasi/settings.py +./start_dev_db.sh pipenv run ./manage.py migrate -make ``` -We try to keep these installation instructions up to date, but we can't -guarantee. - +To run Mafiasi, just start the database and Mafiasi: +``` +./start_dev_db.sh +pipenv run ./manage.py runserver +``` # Notes diff --git a/start_dev_db.sh b/start_dev_db.sh new file mode 100755 index 0000000..a18639f --- /dev/null +++ b/start_dev_db.sh @@ -0,0 +1,19 @@ +#!/usr/bin/bash +set -e + +export USER=mafiasi_dashboard +export PASS=$USER +export DB=$USER +export STORE_DIR=$(realpath $(dirname $(dirname $0)))/dev_db + +mkdir -p $STORE_DIR +echo "Exposing postgres database on psql://$USER:$PASS@localhost:5432/$DB" +exec docker run \ + -it \ + -e POSTGRES_USER=$USER \ + -e POSTGRES_PASSWORD=$PASS \ + -e POSTGRES_DB=$DB \ + -v $STORE_DIR:/var/lib/postgresql/data \ + -p 5432:5432 \ + $@ \ + docker.io/postgres \ No newline at end of file