From 471ca7fe5899facfe7ba3c7bdf57860ee5bd0c9d Mon Sep 17 00:00:00 2001 From: Stefano Alberto Russo Date: Sat, 22 Jan 2022 01:47:28 +0100 Subject: [PATCH] Fixed a few misconfigurations. --- docker-compose-default.yml | 11 +++++++++++ services/api-gateway/run_api-gateway.sh | 6 +++++- services/gui/Dockerfile | 4 ++++ services/proxy/000-default.conf | 8 +++++++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/docker-compose-default.yml b/docker-compose-default.yml index 539821c..05fd924 100644 --- a/docker-compose-default.yml +++ b/docker-compose-default.yml @@ -10,6 +10,17 @@ services: - DJANGO_DEBUG=True - DJANGO_LOG_LEVEL=CRITICAL #- DJANGO_SECRET_KEY="" + - OIDC_RP_CLIENT_ID= + - OIDC_RP_CLIENT_SECRET= + - OIDC_OP_JWKS_ENDPOINT=https://iam-escape.cloud.cnaf.infn.it/jwk + - OIDC_OP_AUTHORIZATION_ENDPOINT=https://iam-escape.cloud.cnaf.infn.it/authorize + - OIDC_OP_TOKEN_ENDPOINT=https://iam-escape.cloud.cnaf.infn.it/token + - OIDC_OP_USER_ENDPOINT=https://iam-escape.cloud.cnaf.infn.it/userinfo + - LOGIN_REDIRECT_URL=https://localhost/esap-gui/login + - LOGOUT_REDIRECT_URL=https://localhost/esap-gui/logout + - LOGIN_REDIRECT_URL_FAILURE=https://localhost/esap-gui/error + - RUCIO_HOST=https://escape-rucio.cern.ch + - RUCIO_AUTH_HOST=https://escape-rucio-auth.cern.ch/ ports: - "8000:8000" #volumes: diff --git a/services/api-gateway/run_api-gateway.sh b/services/api-gateway/run_api-gateway.sh index 7355d28..670dd06 100644 --- a/services/api-gateway/run_api-gateway.sh +++ b/services/api-gateway/run_api-gateway.sh @@ -20,7 +20,11 @@ cd /opt/esap-api-gateway/esap/ && # Apply migrations if any # Note: this will also indirectly wait for the DB to become up and reachable echo "Applying migrations if any..." -python3 manage.py migrate --noinput --settings=esap.settings.dev +python3 manage.py migrate accounts --database=accounts --settings=esap.settings.dev --no-input +python3 manage.py migrate rucio --database=rucio --settings=esap.settings.dev --no-input +python3 manage.py migrate ida --database=ida --settings=esap.settings.dev --no-input +python3 manage.py migrate --settings=esap.settings.dev --no-input + EXIT_CODE=$? echo "Exit code: $EXIT_CODE" if [[ "x$EXIT_CODE" != "x0" ]] ; then diff --git a/services/gui/Dockerfile b/services/gui/Dockerfile index 306fee1..3081cb6 100644 --- a/services/gui/Dockerfile +++ b/services/gui/Dockerfile @@ -44,6 +44,10 @@ COPY sudoers /etc/sudoers RUN cd /opt && git clone https://git.astron.nl/astron-sdc/esap-gui.git RUN cd /opt/esap-gui && git pull && git checkout 2882da5a + +# Chenge hardcoded API URL +RUN sed -i 's#http://localhost:5555/esap-api/#/esap-api/#g' /opt/esap-gui/src/contexts/GlobalContext.js +RUN sed -i 's#https://sdc-dev.astron.nl/esap-api/#/esap-api/#g' /opt/esap-gui/src/contexts/GlobalContext.js RUN cd /opt/esap-gui && npm install RUN cd /opt/esap-gui && npm run build diff --git a/services/proxy/000-default.conf b/services/proxy/000-default.conf index f282240..c146640 100644 --- a/services/proxy/000-default.conf +++ b/services/proxy/000-default.conf @@ -47,7 +47,13 @@ ProxyPass / http://gui:8001/ ProxyPassReverse / http://gui:8001/ - + # Or, alternatively: + #ProxyPass /esap-gui/ http://gui:8001/esap-gui/ + #ProxyPassReverse /esap-gui/ http://gui:8001/esap-gui/ + #ProxyPass /static/ http://gui:8001/static/ + #ProxyPassReverse /static/ http://gui:8001/static/ + + -- GitLab