Skip to content

Commit

Permalink
fix: invalid configuration after version upgrade (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilczaja committed Sep 25, 2024
1 parent da9640a commit 602aaa3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions docker/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion src/app/core/config/app-config-initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function loadAppConfig(): Promise<AppConfig> {
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));
}
Expand Down

0 comments on commit 602aaa3

Please sign in to comment.