From 93c581090beb11c9c0e1efcf53a04334fd049eba Mon Sep 17 00:00:00 2001 From: Nicola Tarocco Date: Fri, 9 Jul 2021 16:08:25 +0200 Subject: [PATCH 1/2] Fix QR code redirection for calculator-cern * Adds the missing URL args to the Nginx configuration when redirecting from /calculator to /calculator-cern. * closes #177 --- app-config/nginx/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app-config/nginx/nginx.conf b/app-config/nginx/nginx.conf index e2e45836..fb69f77a 100644 --- a/app-config/nginx/nginx.conf +++ b/app-config/nginx/nginx.conf @@ -99,7 +99,7 @@ http { } location /calculator { - return 302 /calculator-cern; + return 302 /calculator-cern$is_args$args; } location /calculator-cern { From ae52961361f221c73e47b330f254c49f40cc6673 Mon Sep 17 00:00:00 2001 From: Nicola Tarocco Date: Fri, 9 Jul 2021 16:09:33 +0200 Subject: [PATCH 2/2] Fix docker-compose and update README --- README.md | 18 ++++++++++++++++++ app-config/docker-compose.yml | 11 +++++++++++ 2 files changed, 29 insertions(+) diff --git a/README.md b/README.md index 983ba94c..3a036087 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,24 @@ pytest ./cara s2i build file://$(pwd) --copy --keep-symlinks --context-dir ./app-config/nginx/ centos/nginx-112-centos7 cara-nginx-app s2i build file://$(pwd) --copy --keep-symlinks --context-dir ./ centos/python-36-centos7 cara-webservice s2i build file://$(pwd) --copy --keep-symlinks --context-dir ./app-config/auth-service centos/python-36-centos7 auth-service +``` + +Get the client secret from the CERN Application portal for the `cara-test` app. See [CERN-SSO-integration](#CERN-SSO-integration) for more info. +``` +read CLIENT_SECRET +``` + +Define some env vars (copy/paste): +``` +export COOKIE_SECRET=$(openssl rand -hex 50) +export OIDC_SERVER=https://auth.cern.ch/auth +export OIDC_REALM=CERN +export CLIENT_ID=cara-test +export CLIENT_SECRET +``` + +Run docker-compose: +``` cd app-config docker-compose up ``` diff --git a/app-config/docker-compose.yml b/app-config/docker-compose.yml index 145d1253..e322e394 100644 --- a/app-config/docker-compose.yml +++ b/app-config/docker-compose.yml @@ -10,6 +10,15 @@ services: environment: - COOKIE_SECRET - APP_NAME=cara-webservice + - CARA_CALCULATOR_PREFIX=/calculator-cern + - CARA_THEME=cara/apps/calculator/themes/cern + + cara-calculator-open: + image: cara-webservice + environment: + - COOKIE_SECRET + - APP_NAME=cara-webservice + - CARA_CALCULATOR_PREFIX=/calculator-open auth-service: image: auth-service @@ -27,6 +36,8 @@ services: depends_on: cara-webservice: condition: service_started + cara-calculator-open: + condition: service_started cara-app: condition: service_started auth-service: