Compare commits
2 commits
84df3789cc
...
1e1a339917
Author | SHA1 | Date | |
---|---|---|---|
1e1a339917 | |||
d990d46dd9 |
|
@ -55,5 +55,31 @@ services:
|
||||||
- ./idhub2__pilot-xo9b:/opt/idhub
|
- ./idhub2__pilot-xo9b:/opt/idhub
|
||||||
- sharedsecret:/sharedsecret:rw
|
- 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:
|
volumes:
|
||||||
sharedsecret:
|
sharedsecret:
|
||||||
|
|
|
@ -35,6 +35,10 @@ deployment_strategy() {
|
||||||
# warn admin that it should re-enter password to keep the service working
|
# warn admin that it should re-enter password to keep the service working
|
||||||
./manage.py send_mail_admins
|
./manage.py send_mail_admins
|
||||||
else
|
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
|
# move the migrate thing in docker entrypoint
|
||||||
# inspired by https://medium.com/analytics-vidhya/django-with-docker-and-docker-compose-python-part-2-8415976470cc
|
# inspired by https://medium.com/analytics-vidhya/django-with-docker-and-docker-compose-python-part-2-8415976470cc
|
||||||
echo "INFO detected NEW deployment"
|
echo "INFO detected NEW deployment"
|
||||||
|
@ -60,14 +64,24 @@ _get() {
|
||||||
sqlite3 -json db.sqlite3 "select * from oidc4vp_organization;"
|
sqlite3 -json db.sqlite3 "select * from oidc4vp_organization;"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_lines () {
|
||||||
|
local myfile="${1}"
|
||||||
|
cat "${myfile}" | wc -l
|
||||||
|
}
|
||||||
|
|
||||||
config_oidc4vp() {
|
config_oidc4vp() {
|
||||||
# populate your config
|
# populate your config
|
||||||
local file="${DOMAIN}"
|
|
||||||
data="$(_get)"
|
data="$(_get)"
|
||||||
echo "${data}" | jq --arg domain "${DOMAIN}" '{ ($domain): .}' > /sharedsecret/${file}
|
echo "${data}" | jq --arg domain "${DOMAIN}" '{ ($domain): .}' > /sharedsecret/${DOMAIN}
|
||||||
|
|
||||||
|
while true; do
|
||||||
echo wait the other idhubs to write, this is the only oportunity to sync with other idhubs in the docker compose
|
echo wait the other idhubs to write, this is the only oportunity to sync with other idhubs in the docker compose
|
||||||
sleep 2
|
## break when no empty files left
|
||||||
|
if ! wc -l /sharedsecret/* | awk '{print $1;}' | grep -qE '^0$'; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
# get other configs
|
# get other configs
|
||||||
for host in /sharedsecret/*; do
|
for host in /sharedsecret/*; do
|
||||||
# we are flexible on querying for DOMAIN: the first one based on regex
|
# we are flexible on querying for DOMAIN: the first one based on regex
|
||||||
|
|
Reference in a new issue