From 31da235e9f3b0d8278c5e11a2f9eeca972f4123f Mon Sep 17 00:00:00 2001 From: Tim van Oostrom Date: Mon, 4 Dec 2023 08:09:02 +0100 Subject: [PATCH] Mijn-7276 cert loading (#60) --- app/config.py | 3 ++- azure-pipelines.yaml | 2 -- conf/docker-entrypoint.sh | 7 +++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/config.py b/app/config.py index 2d4559a..68f02e4 100644 --- a/app/config.py +++ b/app/config.py @@ -80,11 +80,12 @@ "": ["AO2", "AO5", "DBS", "KVB", "WMH", "AAN", "FIE"], } +# Server security / certificates for ZorgNed SERVER_CLIENT_CERT = os.getenv("MIJN_DATA_CLIENT_CERT") SERVER_CLIENT_KEY = os.getenv("MIJN_DATA_CLIENT_KEY") # TODO: Add other AZ env conditions after migration. -if IS_TEST: +if IS_TAP and SERVER_CLIENT_CERT is not None: # https://stackoverflow.com/a/46570364/756075 # Server security / certificates cert = tempfile.NamedTemporaryFile(delete=False) diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml index f4dfde1..763f09e 100644 --- a/azure-pipelines.yaml +++ b/azure-pipelines.yaml @@ -52,8 +52,6 @@ variables: - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - name: btdDeploy value: ${{ parameters.btdDeploy }} - - name: dtapName - value: t - ${{ if ne(parameters.dtapName, 'none') }}: - name: dtapName value: ${{ parameters.dtapName }} diff --git a/conf/docker-entrypoint.sh b/conf/docker-entrypoint.sh index 549dd97..eb0e5d5 100644 --- a/conf/docker-entrypoint.sh +++ b/conf/docker-entrypoint.sh @@ -2,10 +2,9 @@ set -e # AZ AppService allows SSH into a App instance. -if [ $MA_OTAP_ENV == "test" ] -then - # echo "Starting SSH ..." -service ssh start +if [ "$MA_OTAP_ENV" = "test" ]; then + echo "Starting SSH ..." + service ssh start fi uwsgi --uid www-data --gid www-data --ini /api/uwsgi.ini \ No newline at end of file