Skip to content

Commit

Permalink
Add higher imagick restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecraank committed Feb 26, 2024
1 parent 7f35e11 commit 948123a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ RUN echo "php_value post_max_size 100M" >> /var/www/html/public/.htaccess

# Allow pdf imaging
RUN sed -ri -e 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<policy domain="coder" rights="read|write" pattern="PDF" \/>/g' /etc/ImageMagick-6/policy.xml
# change <policy domain="resource" name="disk" value="1GiB"/>
# to <policy domain="resource" name="disk" value="8GiB"/>
# more resources for imagick
RUN sed -ri -e 's/<policy domain="resource" name="memory" value="256MiB"\/>/<policy domain="resource" name="memory" value="2GiB"\/>/g' /etc/ImageMagick-6/policy.xml
RUN sed -ri -e 's/<policy domain="resource" name="map" value="512MiB"\/>/<policy domain="resource" name="map" value="8GiB"\/>/g' /etc/ImageMagick-6/policy.xml
RUN sed -ri -e 's/<policy domain="resource" name="disk" value="1GiB"\/>/<policy domain="resource" name="disk" value="8GiB"\/>/g' /etc/ImageMagick-6/policy.xml



USER root
RUN chown -R www-data:www-data /var/www/html/

0 comments on commit 948123a

Please sign in to comment.