From d53b35fff48934e511fc6c5d9382b8353cbdd7a7 Mon Sep 17 00:00:00 2001 From: pedro Date: Wed, 7 Feb 2024 12:43:52 +0100 Subject: [PATCH] idhub deployment var no longer needed you just enable DEBUG whenever is necessary --- .env.example | 3 --- docker-compose__instance-autotest.yml | 4 +--- docker-compose__instance-nightly.yml | 4 +--- docker-compose__pilot-generic.yml | 2 +- docker-compose__pilot-lafede.yml | 1 - docker-compose__pilot-pangea.yml | 2 -- docker-compose__pilot-setem.yml | 2 -- docker/idhub.entrypoint.sh | 30 +++++---------------------- 8 files changed, 8 insertions(+), 40 deletions(-) diff --git a/.env.example b/.env.example index 12ea06b..f658ce6 100644 --- a/.env.example +++ b/.env.example @@ -69,8 +69,6 @@ DEVICEHUB_URL_MANUALS='http://localhost:4000' IDHUB_TIME_ZONE='Europe/Madrid' #IDHUB_SECRET_KEY='uncomment-it-and-fill-this' # enable dev flags when DEVELOPMENT deployment -IDHUB_DEPLOYMENT='DEVELOPMENT' -#IDHUB_DEPLOYMENT='PROD' # adapt to your domain in a production/reverse proxy env IDHUB_CSRF_TRUSTED_ORIGINS='https://idhub.example.org' @@ -93,7 +91,6 @@ IDHUB_EMAIL='admin@example.org' # by default it is set to 'y' to facilitate idhub dev when outside docker IDHUB_SYNC_ORG_DEV='n' -IDHUB_PILOT_TEST__IDHUB_DEPLOYMENT='PILOTS_EARLY' IDHUB_PILOT_TEST__ADMIN_EMAIL='idhub_admin@example.com' IDHUB_PILOT_LAFEDE__ADMIN_EMAIL='masked@example.com' diff --git a/docker-compose__instance-autotest.yml b/docker-compose__instance-autotest.yml index a44aa80..3428e1b 100644 --- a/docker-compose__instance-autotest.yml +++ b/docker-compose__instance-autotest.yml @@ -5,9 +5,7 @@ services: init: true image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest environment: - #- DEPLOYMENT=${IDHUB_PILOT_TEST__IDHUB_DEPLOYMENT} - # temp disable 2fa login - - DEPLOYMENT=DEVELOPMENT + - DEBUG=true - ADMIN_EMAIL=${IDHUB_PILOT_TEST__ADMIN_EMAIL} - CREATE_TEST_USERS=true - ENABLE_EMAIL=false diff --git a/docker-compose__instance-nightly.yml b/docker-compose__instance-nightly.yml index 530d063..55c170d 100644 --- a/docker-compose__instance-nightly.yml +++ b/docker-compose__instance-nightly.yml @@ -5,9 +5,7 @@ services: init: true image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest environment: - #- DEPLOYMENT=${IDHUB_PILOT_TEST__IDHUB_DEPLOYMENT} - # temp disable 2fa login - - DEPLOYMENT=DEVELOPMENT + - DEBUG=true - ADMIN_EMAIL=${IDHUB_PILOT_TEST__ADMIN_EMAIL} - CREATE_TEST_USERS=true - ENABLE_EMAIL=false diff --git a/docker-compose__pilot-generic.yml b/docker-compose__pilot-generic.yml index 4397ca9..8e8af3a 100644 --- a/docker-compose__pilot-generic.yml +++ b/docker-compose__pilot-generic.yml @@ -5,9 +5,9 @@ services: init: true image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest environment: + - DEBUG=true - ADMIN_EMAIL=${IDHUB_PILOT_TEST__ADMIN_EMAIL} - CREATE_TEST_USERS=true - - DEPLOYMENT=PILOTS_EARLY - SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd} - ALLOWED_HOSTS=${IDHUB_ALLOWED_HOSTS:-*} - STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/} diff --git a/docker-compose__pilot-lafede.yml b/docker-compose__pilot-lafede.yml index 2f11406..1fa6d96 100644 --- a/docker-compose__pilot-lafede.yml +++ b/docker-compose__pilot-lafede.yml @@ -6,7 +6,6 @@ services: image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest environment: - ADMIN_EMAIL=${IDHUB_PILOT_LAFEDE__ADMIN_EMAIL} - - DEPLOYMENT=PILOTS_EARLY - SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd} - ALLOWED_HOSTS=${IDHUB_ALLOWED_HOSTS:-*} - STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/} diff --git a/docker-compose__pilot-pangea.yml b/docker-compose__pilot-pangea.yml index b1cee1b..3b3957e 100644 --- a/docker-compose__pilot-pangea.yml +++ b/docker-compose__pilot-pangea.yml @@ -41,7 +41,6 @@ services: init: true image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest environment: - - DEPLOYMENT=${IDHUB_DEPLOYMENT} - SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd} - ALLOWED_HOSTS=${IDHUB_ALLOWED_HOSTS:-*} - STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/} @@ -73,7 +72,6 @@ services: init: true image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest environment: - - DEPLOYMENT=${IDHUB_DEPLOYMENT} - SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd} - ALLOWED_HOSTS=${IDHUB_ALLOWED_HOSTS:-*} - STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/} diff --git a/docker-compose__pilot-setem.yml b/docker-compose__pilot-setem.yml index 727de6e..eece994 100644 --- a/docker-compose__pilot-setem.yml +++ b/docker-compose__pilot-setem.yml @@ -5,7 +5,6 @@ services: init: true image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest environment: - - DEPLOYMENT=${IDHUB_DEPLOYMENT} - SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd} - ALLOWED_HOSTS=${IDHUB_ALLOWED_HOSTS:-*} - STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/} @@ -37,7 +36,6 @@ services: init: true image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest environment: - - DEPLOYMENT=${IDHUB_DEPLOYMENT} - SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd} - ALLOWED_HOSTS=${IDHUB_ALLOWED_HOSTS:-*} - STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/} diff --git a/docker/idhub.entrypoint.sh b/docker/idhub.entrypoint.sh index 09658af..1260825 100755 --- a/docker/idhub.entrypoint.sh +++ b/docker/idhub.entrypoint.sh @@ -19,18 +19,6 @@ inject_env_vars() { # related https://www.kenmuse.com/blog/avoiding-dubious-ownership-in-dev-containers/ git config --global --add safe.directory "${idhub_dir}" export GIT_COMMIT="$(git log --pretty=format:'%h' -n 1)" - - # enable dev flags when DEVELOPMENT deployment - case "${DEPLOYMENT}" in - DEVELOPMENT) - export DEBUG=True - export DEVELOPMENT=True - ;; - PILOTS_EARLY) - export DEBUG=True - export DEVELOPMENT=False - ;; - esac } deployment_strategy() { @@ -45,20 +33,12 @@ deployment_strategy() { echo "INFO detected NEW deployment" ./manage.py migrate - case "${DEPLOYMENT}" in - DEVELOPMENT|PILOTS_EARLY) - printf "This is DEVELOPMENT/PILOTS_EARLY DEPLOYMENT: including demo hardcoded data\n creating initial Datas\n" >&2 - ./manage.py initial_datas + printf "This is DEVELOPMENT/PILOTS_EARLY DEPLOYMENT: including demo hardcoded data\n creating initial Datas\n" >&2 + ./manage.py initial_datas - if [ "${RESPONSE_URI:-}" ]; then - config_oidc4vp - fi - ;; - PROD) - printf "creating superuser \n user: ${DJANGO_SUPERUSER_USERNAME}\n password: ${DJANGO_SUPERUSER_PASSWORD}\n email: ${DJANGO_SUPERUSER_EMAIL}\n" >&2 - ## thanks https://stackoverflow.com/questions/6244382/how-to-automate-createsuperuser-on-django/59467533#59467533 - ./manage.py createsuperuser --no-input - esac + if [ "${RESPONSE_URI:-}" ]; then + config_oidc4vp + fi fi }