From 602aaa3fe37da61926d2155de07267b183b216a4 Mon Sep 17 00:00:00 2001 From: Kamil Czaja <46053356+kamilczaja@users.noreply.github.com> Date: Wed, 25 Sep 2024 12:35:04 +0200 Subject: [PATCH] fix: invalid configuration after version upgrade (#847) --- CHANGELOG.md | 1 + docker/Dockerfile | 4 ++-- docker/default.conf.template | 5 +++++ src/app/core/config/app-config-initializer.ts | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e2aba9a3..6621ac404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ the detailed section referring to by linking pull requests or issues. - Used createDataOffer endpoint to create an asset, policies and a contract definition in a single call ([#841](https://github.com/sovity/edc-ui/issues/841)) +- Fixed config not being applied properly after a version upgrade ### Deployment Migration Notes diff --git a/docker/Dockerfile b/docker/Dockerfile index 7c7911514..8642d6426 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -28,9 +28,9 @@ COPY docker/default.conf.template etc/nginx/templates/default.conf.template # so that the automatic envsubst templating is not disabled. COPY docker/99-generate-app-config.sh /docker-entrypoint.d/99-generate-app-config.sh -RUN ln -sf /tmp/app-config.json /usr/share/nginx/html/assets/config/app-config.json \ +RUN ln -sf /tmp/app-config.json /usr/share/nginx/html/assets/config/app-configuration.json \ # Nginx is configured to reject symlinks that point to a file owned by a different user, for security reasons - && chown --no-dereference nginx:root /usr/share/nginx/html/assets/config/app-config.json + && chown --no-dereference nginx:root /usr/share/nginx/html/assets/config/app-configuration.json # Switch back to unprivileged user for runtime USER nginx:nginx diff --git a/docker/default.conf.template b/docker/default.conf.template index 68979ad2c..605cb15fe 100644 --- a/docker/default.conf.template +++ b/docker/default.conf.template @@ -20,4 +20,9 @@ server { index index.html; try_files /index.html =404; } + + location ~* ^/assets/config/app-configuration\.json$ { + add_header Cache-Control "no-store, no-cache, must-revalidate"; + expires -1; + } } diff --git a/src/app/core/config/app-config-initializer.ts b/src/app/core/config/app-config-initializer.ts index d16b426d9..1185fbc19 100644 --- a/src/app/core/config/app-config-initializer.ts +++ b/src/app/core/config/app-config-initializer.ts @@ -11,7 +11,7 @@ export async function loadAppConfig(): Promise { const builder = new AppConfigBuilder(); const fetcher = new AppConfigFetcher(merger); return fetcher - .fetchEffectiveConfig('/assets/config/app-config.json', null) + .fetchEffectiveConfig('/assets/config/app-configuration.json', null) .then((json) => builder.buildAppConfig(json)) .then((config) => (appConfig = config)); }