Compare commits

..

No commits in common. "1e1a339917131bbe47d96e4d2f5a0220b3bfe9e9" and "84df3789ccb0291d2c0dc2bf0ca40c925937fc12" have entirely different histories.

2 changed files with 4 additions and 44 deletions

View file

@ -55,31 +55,5 @@ services:
- ./idhub2__pilot-xo9b:/opt/idhub
- sharedsecret:/sharedsecret:rw
idhub3:
init: true
image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest
environment:
- DOMAIN=idhub3-xo9b.demo.pangea.org
- SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd}
- STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/}
- MEDIA_ROOT=${IDHUB_MEDIA_ROOT:-/media/}
- PORT=${IDHUB_PORT:-9003}
- DEFAULT_FROM_EMAIL=${IDHUB_DEFAULT_FROM_EMAIL}
- EMAIL_HOST=${IDHUB_EMAIL_HOST}
- EMAIL_HOST_USER=${IDHUB_EMAIL_HOST_USER}
- EMAIL_HOST_PASSWORD=${IDHUB_EMAIL_HOST_PASSWORD}
- EMAIL_PORT=${IDHUB_EMAIL_PORT}
- EMAIL_USE_TLS=${IDHUB_EMAIL_USE_TLS}
- EMAIL_BACKEND=${IDHUB_EMAIL_BACKEND}
- SUPPORTED_CREDENTIALS=['FinancialVulnerabilityCredential']
- SYNC_ORG_DEV=${IDHUB_SYNC_ORG_DEV}
- OIDC_ORGS=examples/organizations__pilot_xo9b.csv
- OIDC_REDIRECT=true
ports:
- 9003:9003
volumes:
- ./idhub3__pilot-xo9b:/opt/idhub
- sharedsecret:/sharedsecret:rw
volumes:
sharedsecret:

View file

@ -35,10 +35,6 @@ deployment_strategy() {
# warn admin that it should re-enter password to keep the service working
./manage.py send_mail_admins
else
# this file helps all docker containers to guess number of hosts involved
# right now is only needed by new deployment for oidc
touch /sharedsecret/${DOMAIN}
# move the migrate thing in docker entrypoint
# inspired by https://medium.com/analytics-vidhya/django-with-docker-and-docker-compose-python-part-2-8415976470cc
echo "INFO detected NEW deployment"
@ -64,24 +60,14 @@ _get() {
sqlite3 -json db.sqlite3 "select * from oidc4vp_organization;"
}
_lines () {
local myfile="${1}"
cat "${myfile}" | wc -l
}
config_oidc4vp() {
# populate your config
local file="${DOMAIN}"
data="$(_get)"
echo "${data}" | jq --arg domain "${DOMAIN}" '{ ($domain): .}' > /sharedsecret/${DOMAIN}
echo "${data}" | jq --arg domain "${DOMAIN}" '{ ($domain): .}' > /sharedsecret/${file}
while true; do
echo wait the other idhubs to write, this is the only oportunity to sync with other idhubs in the docker compose
## break when no empty files left
if ! wc -l /sharedsecret/* | awk '{print $1;}' | grep -qE '^0$'; then
break
fi
sleep 1
done
echo wait the other idhubs to write, this is the only oportunity to sync with other idhubs in the docker compose
sleep 2
# get other configs
for host in /sharedsecret/*; do
# we are flexible on querying for DOMAIN: the first one based on regex