From 932152ec67e474a70424fedbae2d6266a94f8042 Mon Sep 17 00:00:00 2001 From: Brooke Date: Wed, 18 Dec 2024 21:30:24 +0000 Subject: [PATCH] Update entrypoint.sh.tmpl The old command would place "X_FRAME_OPTIONS_ALLOW_FROM" outside of the square brackets ``` protected $allowedChildSrcDomains = []; 'example.org', ``` The changes to the sed command places them inline, also allowing for multiple domains to be set ``` protected $allowedChildSrcDomains = [ 'example.org', 'exampletwo.org' ]; ``` --- entrypoint.sh.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index c2e5ab6..fa9fdad 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -30,7 +30,7 @@ echo "Giving the db container some time to come up"; sleep 20 {{ if eq (env "X_FRAME_OPTIONS_ENABLED") "1" }} if ! [[ $(grep {{ env "X_FRAME_OPTIONS_ALLOW_FROM" }} lib/public/AppFramework/Http/ContentSecurityPolicy.php) ]]; then - sed -i "91 a\\\t\t'{{ env "X_FRAME_OPTIONS_ALLOW_FROM" }}', " lib/public/AppFramework/Http/ContentSecurityPolicy.php + sed -i "s|protected \$allowedChildSrcDomains = \[\];|protected \$allowedChildSrcDomains = [ {{ env \"X_FRAME_OPTIONS_ALLOW_FROM\" }} ];|" lib/public/AppFramework/Http/ContentSecurityPolicy.php fi {{ end }}