Skip to content

No PHP production settings in Nextcloud 21-apache Docker image #1597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
oviserv opened this issue Oct 1, 2021 · 1 comment
Closed

No PHP production settings in Nextcloud 21-apache Docker image #1597

oviserv opened this issue Oct 1, 2021 · 1 comment

Comments

@oviserv
Copy link

oviserv commented Oct 1, 2021

In the Docker image generic production settings for PHP are not configured. For example the display_errors setting has value On while the recommendation in php.ini-production is Off. From a security view this can be seen as a suboptimal configuration. Is this an opportunity for a security improvement?

The solution is quite easy as the php.ini-production file provides a template. During the image build the template file can be copied and modified on a few places to suit the Nextcloud demands. In a Dockerfile:

RUN  cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini && \
    sed -i 's/^memory_limit/;memory_limit/' /usr/local/etc/php/php.ini && \
    sed -i 's/^post_max_size/;post_max_size/' /usr/local/etc/php/php.ini && \
    sed -i 's/^upload_max_filesize/;upload_max_filesize/' \
      /usr/local/etc/php/php.ini && \
    sed -i 's/^expose_php.*$/expose_php = Off/' /usr/local/etc/php/php.ini && \
    sed -i 's/^max_execution_time.*$/max_execution_time = 3600/' \
      /usr/local/etc/php/php.ini && \
    sed -i 's/^max_input_time.*$/max_input_time = 3600/' \
      /usr/local/etc/php/php.ini

The first three sed's comment out values that are already set in ./conf.d/nextcloud.ini. The fourth sed disables the not needed X-Powered-By header and the last two sed's are a prerequisite to enable large file upload. This change was tested on a Nextcloud production server(21.0.5) and seems to run without errors. Can this change be applied to the Nextcloud 21-apache Docker image (and other images?).

@J0WI
Copy link
Contributor

J0WI commented Feb 2, 2022

Duplicate of docker-library/php#873

@J0WI J0WI marked this as a duplicate of docker-library/php#873 Feb 2, 2022
@J0WI J0WI closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants