diff --git a/.env.example b/.env.example index 6117fe9..0897b02 100644 --- a/.env.example +++ b/.env.example @@ -31,11 +31,14 @@ IDHUB_ADMIN_USER='admin' IDHUB_ADMIN_PASSWD='admin' IDHUB_ADMIN_EMAIL='admin@example.org' +IDHUB_SUPPORTED_CREDENTIALS="['CourseCredential', 'EOperatorClaim', 'FederationMembership', 'FinancialVulnerabilityCredential', 'MembershipCard', 'Snapshot']" + # this option needs to be set to 'n' to be able to make work idhub in docker # by default it is set to 'y' to facilitate idhub dev when outside docker IDHUB_SYNC_ORG_DEV='n' -# TODO that is only for testing +# TODO that is only for testing/demo purposes IDHUB_ENABLE_EMAIL=false IDHUB_ENABLE_2FACTOR_AUTH=false IDHUB_ENABLE_DOMAIN_CHECKER=false +IDHUB_PREDEFINED_TOKEN='27f944ce-3d58-4f48-b068-e4aa95f97c95' diff --git a/docker-compose.yml b/docker-compose.yml index 2804ead..05f0764 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,7 @@ services: - ENABLE_EMAIL=${IDHUB_ENABLE_EMAIL:-true} - ENABLE_2FACTOR_AUTH=${IDHUB_ENABLE_2FACTOR_AUTH:-true} - ENABLE_DOMAIN_CHECKER=${IDHUB_ENABLE_DOMAIN_CHECKER:-true} + - PREDEFINED_TOKEN=${IDHUB_PREDEFINED_TOKEN:-} - SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd} - STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/} - MEDIA_ROOT=${IDHUB_MEDIA_ROOT:-/media/} @@ -26,7 +27,7 @@ services: - EMAIL_PORT=${IDHUB_EMAIL_PORT} - EMAIL_USE_TLS=${IDHUB_EMAIL_USE_TLS} - EMAIL_BACKEND=${IDHUB_EMAIL_BACKEND} - - SUPPORTED_CREDENTIALS=['CourseCredential', 'EOperatorClaim', 'FederationMembership', 'FinancialVulnerabilityCredential', 'MembershipCard', 'Snapshot'] + - SUPPORTED_CREDENTIALS=${IDHUB_SUPPORTED_CREDENTIALS:-} - SYNC_ORG_DEV=${IDHUB_SYNC_ORG_DEV} ports: - ${IDHUB_PORT:-9001}:${IDHUB_PORT:-9001} diff --git a/docker-reset.sh b/docker-reset.sh index 3a7e3ad..d31b567 100755 --- a/docker-reset.sh +++ b/docker-reset.sh @@ -15,6 +15,7 @@ main() { cp -v .env.example .env echo "WARNING: .env was not there, .env.example was copied, this only happens once" fi + . ./.env docker compose down -v if [ "${DEV_DOCKER_ALWAYS_BUILD:-}" = 'true' ]; then diff --git a/docker/idhub.entrypoint.sh b/docker/idhub.entrypoint.sh index 52b27e0..b7ebd78 100755 --- a/docker/idhub.entrypoint.sh +++ b/docker/idhub.entrypoint.sh @@ -45,8 +45,10 @@ deployment_strategy() { echo "INFO detected NEW deployment" ./manage.py migrate - 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" >&2 + + PREDEFINED_TOKEN="${PREDEFINED_TOKEN:-}" + ./manage.py demo_data "${PREDEFINED_TOKEN}" if [ "${OIDC_ORGS:-}" ]; then config_oidc4vp