From 06e52eadb01e24fab5684053a0af02d02dd5bb4d Mon Sep 17 00:00:00 2001 From: Markus <9neblung@informatik.uni-hamburg.de> Date: Tue, 19 Dec 2023 18:09:02 +0100 Subject: [PATCH 1/2] update Installation part in readme --- .env.dev | 2 +- .env.test | 2 +- .gitignore | 1 + README.md | 16 +++++++++------- start_dev_db.sh | 19 +++++++++++++++++++ 5 files changed, 31 insertions(+), 9 deletions(-) create mode 100755 start_dev_db.sh diff --git a/.env.dev b/.env.dev index 4c463ee3..eba208c6 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 5f4fae38..71d7707b 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 9451df29..6862df00 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 66127a0a..3d0fb452 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 00000000..a18639f1 --- /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 From 55d4b9def03cfc6c225361307ed77ba6c6d844e0 Mon Sep 17 00:00:00 2001 From: Timon Engelke Date: Tue, 19 Dec 2023 20:07:36 +0100 Subject: [PATCH 2/2] Add newline --- start_dev_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_dev_db.sh b/start_dev_db.sh index a18639f1..d60aad98 100755 --- a/start_dev_db.sh +++ b/start_dev_db.sh @@ -16,4 +16,4 @@ exec docker run \ -v $STORE_DIR:/var/lib/postgresql/data \ -p 5432:5432 \ $@ \ - docker.io/postgres \ No newline at end of file + docker.io/postgres