Skip to content

Commit

Permalink
feat: set apache LimitRequestBody
Browse files Browse the repository at this point in the history
  • Loading branch information
adripo committed Sep 13, 2023
1 parent 12390fb commit e67c86e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile-debian.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN set -ex; \
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
ENV PHP_MEMORY_LIMIT 512M
ENV PHP_UPLOAD_LIMIT 512M
%%VARIANT_EXTRAS_ENV%%
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
Expand Down
9 changes: 8 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ declare -A base=(
[fpm-alpine]='alpine'
)

declare -A extras_env=(
[apache]='ENV APACHE_BODY_LIMIT 1073741824'
[fpm]=''
[fpm-alpine]=''
)

declare -A extras=(
[apache]='\nRUN a2enmod headers rewrite remoteip ;\\\n {\\\n echo RemoteIPHeader X-Real-IP ;\\\n echo RemoteIPInternalProxy 10.0.0.0/8 ;\\\n echo RemoteIPInternalProxy 172.16.0.0/12 ;\\\n echo RemoteIPInternalProxy 192.168.0.0/16 ;\\\n } > /etc/apache2/conf-available/remoteip.conf;\\\n a2enconf remoteip'
[apache]='\nRUN a2enmod headers rewrite remoteip ; \\\n { \\\n echo '\''RemoteIPHeader X-Real-IP'\''; \\\n echo '\''RemoteIPInternalProxy 10.0.0.0/8'\''; \\\n echo '\''RemoteIPInternalProxy 172.16.0.0/12'\''; \\\n echo '\''RemoteIPInternalProxy 192.168.0.0/16'\''; \\\n } > /etc/apache2/conf-available/remoteip.conf; \\\n a2enconf remoteip\n\n# set apache config LimitRequestBody\nRUN { \\\n echo '\''LimitRequestBody ${APACHE_BODY_LIMIT}'\''; \\\n } > /etc/apache2/conf-available/apache-limits.conf; \\\n a2enconf apache-limits'
[fpm]=''
[fpm-alpine]=''
)
Expand Down Expand Up @@ -130,6 +136,7 @@ function create_variant() {
s/%%DOWNLOAD_URL%%/'"$(sed -e 's/[\/&]/\\&/g' <<< "$url")"'/g;
s/%%DOWNLOAD_URL_ASC%%/'"$(sed -e 's/[\/&]/\\&/g' <<< "$ascUrl")"'/g;
s/%%CMD%%/'"${cmd[$variant]}"'/g;
s|%%VARIANT_EXTRAS_ENV%%|'"${extras_env[$variant]}"'|g;
s|%%VARIANT_EXTRAS%%|'"${extras[$variant]}"'|g;
s/%%APCU_VERSION%%/'"${pecl_versions[APCu]}"'/g;
s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g;
Expand Down

0 comments on commit e67c86e

Please sign in to comment.