From e6ac11fd95f97551c0078ea6b8bac9a7fc0f6b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Thu, 3 Oct 2024 12:16:54 +0200 Subject: [PATCH 1/4] [Tests] IBX-7818: Fixed direct acces to index.php with long URL --- templates/apache2/vhost.template | 2 +- templates/nginx/ez_params.d/ez_rewrite_params | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/apache2/vhost.template b/templates/apache2/vhost.template index 6793ea6..9c9f852 100644 --- a/templates/apache2/vhost.template +++ b/templates/apache2/vhost.template @@ -100,7 +100,7 @@ RewriteRule ^/(css|js|fonts?)/.*\.(css|js|otf|eot|ttf|svg|woff) - [L] # Prevent access to website with direct usage of index.php in URL - RewriteRule ^/([^/]+/)?index\.php([/?#]|$) - [R=404,L] + RewriteRule ^/([^/]+/)*?index\.php([/?#]|$) - [R=404,L] RewriteRule .* /index.php diff --git a/templates/nginx/ez_params.d/ez_rewrite_params b/templates/nginx/ez_params.d/ez_rewrite_params index d2798f0..166f7f8 100644 --- a/templates/nginx/ez_params.d/ez_rewrite_params +++ b/templates/nginx/ez_params.d/ez_rewrite_params @@ -19,7 +19,7 @@ rewrite "^/build/(.*)" "/build/$1" break; rewrite "^/assets/(.*)" "/assets/$1" break; # Prevent access to website with direct usage of index.php in URL -if ($request_uri ~ "^/([^/]+/)?index\.php([/?#]|$)") { +if ($request_uri ~ "^/([^/]+/)*?index\.php([/?#]|$)") { return 404; } From 771f8eb682d82e400d3c4e10e0912c8356cdea63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Mon, 7 Oct 2024 11:17:21 +0200 Subject: [PATCH 2/4] imagick workaround --- php/Dockerfile-8.3 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/php/Dockerfile-8.3 b/php/Dockerfile-8.3 index 85edd7b..6df8fa6 100644 --- a/php/Dockerfile-8.3 +++ b/php/Dockerfile-8.3 @@ -80,8 +80,21 @@ RUN set -xe \ && cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \ \ # Install imagemagick - && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ - && docker-php-ext-enable imagick \ +# && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ +# && docker-php-ext-enable imagick \ + +# Imagick is installed from the archive because regular installation fails +# See: https://github.com/Imagick/imagick/issues/643#issuecomment-1834361716 + && curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz \ + && tar --strip-components=1 -xf /tmp/imagick.tar.gz \ + && phpize \ + && ./configure \ + && make \ + && make install \ + && echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \ + && rm -rf /tmp/* \ + # <<< End of Imagick installation + # Install xdebug && for i in $(seq 1 3); do echo yes | pecl install -o "xdebug" && s=0 && break || s=$? && sleep 1; done; (exit $s) \ # Install blackfire: https://blackfire.io/docs/integrations/docker From d5ea0f6625de38e3acecb5f50774feaefc003908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Mon, 7 Oct 2024 16:03:18 +0200 Subject: [PATCH 3/4] redis 6.0.2 --- php/Dockerfile-7.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/Dockerfile-7.3 b/php/Dockerfile-7.3 index b55d213..26e9519 100644 --- a/php/Dockerfile-7.3 +++ b/php/Dockerfile-7.3 @@ -88,7 +88,7 @@ RUN set -xe \ && docker-php-ext-enable igbinary \ \ # Install redis (manualy build in order to be able to enable igbinary) - && for i in $(seq 1 3); do pecl install -o --nobuild redis && s=0 && break || s=$? && sleep 1; done; (exit $s) \ + && for i in $(seq 1 3); do pecl install -o --nobuild "redis-6.0.2" && s=0 && break || s=$? && sleep 1; done; (exit $s) \ && cd "$(pecl config-get temp_dir)/redis" \ && phpize \ && ./configure --enable-redis-igbinary \ From ce91db629deef5888181cb8e1b358890fcdeb471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Tue, 8 Oct 2024 12:24:46 +0200 Subject: [PATCH 4/4] fixup! imagick workaround --- php/Dockerfile-8.3 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/php/Dockerfile-8.3 b/php/Dockerfile-8.3 index 6df8fa6..0d01e9c 100644 --- a/php/Dockerfile-8.3 +++ b/php/Dockerfile-8.3 @@ -79,10 +79,6 @@ RUN set -xe \ && docker-php-ext-enable opcache \ && cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \ \ -# Install imagemagick -# && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ -# && docker-php-ext-enable imagick \ - # Imagick is installed from the archive because regular installation fails # See: https://github.com/Imagick/imagick/issues/643#issuecomment-1834361716 && curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz \