Skip to content

Commit

Permalink
Merge pull request #690 from IntersectMBO/chore/678-setting-cors-poli…
Browse files Browse the repository at this point in the history
…cy-for-metadata-validation-service-in-dev-environment

[#678] Setting CORS policy for metadata validation service in dev environment
  • Loading branch information
placek authored Apr 11, 2024
2 parents b703d8d + 51b9431 commit 2fc7e74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/govtool/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ clear:
$(output_dirs):
mkdir -p $@

$(target_config_dir)/docker-compose.yml: $(template_config_dir)/docker-compose.yml.tpl $(target_config_dir)/
$(docker_compose_file): $(template_config_dir)/docker-compose.yml.tpl $(target_config_dir)/
if [[ "$(env)" == "dev" ]]; then CSP_ALLOWED_HOSTS=",http://localhost"; else CSP_ALLOWED_HOSTS=; fi; \
sed -e "s|<DOMAIN>|$(domain)|g" \
-e "s|<DOCKER_USER>|$(docker_user)|g" \
Expand Down
4 changes: 4 additions & 0 deletions scripts/govtool/config/templates/docker-compose.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ services:
- "traefik.http.routers.metadata-validation.rule=Host(`<DOMAIN>`) && PathPrefix(`/metadata-validation`)"
- "traefik.http.middlewares.metadata-validation-stripprefix.stripprefix.prefixes=/metadata-validation"
- "traefik.http.routers.metadata-validation.middlewares=metadata-validation-stripprefix@docker"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolallowmethods=*"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolallowheaders=*"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolalloworiginlist=https://<DOMAIN><CSP_ALLOWED_HOSTS>"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolmaxage=100"
- "traefik.http.routers.metadata-validation.entrypoints=websecure"
- "traefik.http.routers.metadata-validation.tls.certresolver=myresolver"
- "traefik.http.services.metadata-validation.loadbalancer.server.port=3000"
Expand Down

0 comments on commit 2fc7e74

Please sign in to comment.