diff --git a/Containers/mastercontainer/start.sh b/Containers/mastercontainer/start.sh index 1380760c..38c38975 100755 --- a/Containers/mastercontainer/start.sh +++ b/Containers/mastercontainer/start.sh @@ -112,6 +112,14 @@ It is set to '$NEXTCLOUD_UPLOAD_LIMIT'." exit 1 fi fi +if [ -n "$NEXTCLOUD_MAX_TIME" ]; then + if ! echo "$NEXTCLOUD_MAX_TIME" | grep -q '^[0-9]\+$'; then + echo "You've set NEXTCLOUD_MAX_TIME but not to an allowed value. +The string must be a number. E.g. '3600'. +It is set to '$NEXTCLOUD_MAX_TIME'." + exit 1 + fi +fi if [ -n "$APACHE_PORT" ]; then if ! check_if_number "$APACHE_PORT"; then echo "You provided an Apache port but did not only use numbers. diff --git a/Containers/nextcloud/Dockerfile b/Containers/nextcloud/Dockerfile index 0776b2e6..1cac5bc7 100644 --- a/Containers/nextcloud/Dockerfile +++ b/Containers/nextcloud/Dockerfile @@ -21,6 +21,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 10G +ENV PHP_MAX_TIME 3600 RUN set -ex; \ \ apk add --no-cache --virtual .build-deps \ @@ -96,6 +97,8 @@ RUN { \ echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ + echo 'max_execution_time=${PHP_MAX_TIME}'; \ + echo 'max_input_time=${PHP_MAX_TIME}'; \ } > /usr/local/etc/php/conf.d/nextcloud.ini; \ \ mkdir /var/www/data; \ diff --git a/docker-compose.yml b/docker-compose.yml index b60b1539..42688d0c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,7 @@ services: # - DOCKER_SOCKET_PATH=/var/run/docker.sock # Needs to be specified if the docker socket on the host is not located in the default '/var/run/docker.sock'. Otherwise mastercontainer updates will fail. # - DISABLE_BACKUP_SECTION=true # Setting this to true allows to hide the backup section in the AIO interface. # - NEXTCLOUD_UPLOAD_LIMIT=10G # Can be adjusted if you need more. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-upload-limit-for-nextcloud + # - NEXTCLOUD_MAX_TIME=3600 # Can be adjusted if you need more. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-max-execution-time-for-nextcloud # # Optional: Caddy reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md # # You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588 diff --git a/manual-install/update-yaml.sh b/manual-install/update-yaml.sh index af67194e..fdce6675 100644 --- a/manual-install/update-yaml.sh +++ b/manual-install/update-yaml.sh @@ -63,6 +63,7 @@ sed -i 's|COLLABORA_DICTIONARIES=|COLLABORA_DICTIONARIES=de_DE en_GB en_US es_ES sed -i 's|NEXTCLOUD_DATADIR=|NEXTCLOUD_DATADIR=nextcloud_aio_nextcloud_data # You can change this to e.g. "/mnt/ncdata" to map it to a location on your host. It needs to be adjusted before the first startup and never afterwards!|' sample.conf sed -i 's|NEXTCLOUD_MOUNT=|NEXTCLOUD_MOUNT=/mnt/ # This allows the Nextcloud container to access directories on the host. It must never be equal to the value of NEXTCLOUD_DATADIR!|' sample.conf sed -i 's|NEXTCLOUD_UPLOAD_LIMIT=|NEXTCLOUD_UPLOAD_LIMIT=10G # This allows to change the upload limit of the Nextcloud container|' sample.conf +sed -i 's|NEXTCLOUD_MAX_TIME=|NEXTCLOUD_MAX_TIME=3600 # This allows to change the upload time limit of the Nextcloud container|' sample.conf sed -i 's|UPDATE_NEXTCLOUD_APPS=|UPDATE_NEXTCLOUD_APPS=no # When setting to yes, it will automatically update all installed Nextcloud apps upon container startup on saturdays.|' sample.conf sed -i 's|APACHE_PORT=|APACHE_PORT=443 # Changing this to a different value than 443 will allow you to run it behind a reverse proxy.|' sample.conf sed -i 's|TALK_PORT=|TALK_PORT=3478 # This allows to adjust the port that the talk container is using.|' sample.conf diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index df05080d..e87cc039 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -509,6 +509,13 @@ class ConfigurationManager return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue); } + public function GetNextcloudMaxTime() : string { + $envVariableName = 'NEXTCLOUD_MAX_TIME'; + $configName = 'nextcloud_max_time'; + $defaultValue = '3600'; + return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue); + } + public function GetDockerSocketPath() : string { $envVariableName = 'DOCKER_SOCKET_PATH'; $configName = 'docker_socket_path'; diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index bdef2199..8be3b675 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -306,6 +306,8 @@ class DockerActionManager } } elseif ($out[1] === 'NEXTCLOUD_UPLOAD_LIMIT') { $replacements[1] = $this->configurationManager->GetNextcloudUploadLimit(); + } elseif ($out[1] === 'NEXTCLOUD_MAX_TIME') { + $replacements[1] = $this->configurationManager->GetNextcloudMaxTime(); } else { $replacements[1] = $this->configurationManager->GetSecret($out[1]); } diff --git a/readme.md b/readme.md index e15a5acc..f7d9c293 100644 --- a/readme.md +++ b/readme.md @@ -428,6 +428,9 @@ By default will the talk container use port `3478/UDP` and `3478/TCP` for connec ### How to adjust the upload limit for Nextcloud? By default are uploads to Nextcloud limited to a max of 10G. You can adjust the upload limit by providing `-e NEXTCLOUD_UPLOAD_LIMIT=10G` to the docker run command of the mastercontainer and customize the value to your fitting. It must start with a number and end with `G` e.g. `10G`. +### How to adjust the max execution time for Nextcloud? +By default are uploads to Nextcloud limited to a max of 3600s. You can adjust the upload time limit by providing `-e NEXTCLOUD_MAX_TIME=3600` to the docker run command of the mastercontainer and customize the value to your fitting. It must be a number e.g. `3600`. + ### What can I do to fix the internal or reserved ip-address error? If you get an error during the domain validation which states that your ip-address is an internal or reserved ip-address, you can fix this by first making sure that your domain indeed has the correct public ip-address that points to the server and then adding `--add-host yourdomain.com:` to the initial docker run command which will allow the domain validation to work correctly. And so that you know: even if the `A` record of your domain should change over time, this is no problem since the mastercontainer will not make any attempt to access the chosen domain after the initial domain validation. diff --git a/tests/QA/060-environmental-variables.md b/tests/QA/060-environmental-variables.md index 89d99c86..8cff4438 100644 --- a/tests/QA/060-environmental-variables.md +++ b/tests/QA/060-environmental-variables.md @@ -8,6 +8,7 @@ - [ ] When starting the mastercontainer with `-e NEXTCLOUD_DATADIR="/mnt/testdata"` it should map that location from `/mnt/testdata` to `/mnt/ncdata` inside the Nextcloud container. Not having adjusted the permissions correctly before starting the Nextcloud container the first time will not allow the Nextcloud container to start correctly. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir for allowed values. - [ ] When starting the mastercontainer with `-e NEXTCLOUD_MOUNT="/mnt/"` it should map `/mnt/` to `/mnt/` inside the Nextcloud container. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host for allowed values. - [ ] When starting the mastercontainer with `-e NEXTCLOUD_UPLOAD_LIMIT=11G` it should change Nextclouds upload limit to 11G. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-upload-limit-for-nextcloud for allowed values. +- [ ] When starting the mastercontainer with `-e NEXTCLOUD_MAX_TIME=4000` it should change Nextclouds upload max time 4000s. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-max-execution-time-for-nextcloud for allowed values. - [ ] When starting the mastercontainer with `-e DOCKER_SOCKET_PATH="/var/run/docker.sock.raw"` it should map `/var/run/docker.sock.raw` to `/var/run/docker.sock` inside the watchtower container which allow to update the mastercontainer on macos and with docker rootless. - [ ] When starting the mastercontainer with `-e DISABLE_BACKUP_SECTION=true` it should hide the backup section that gets shown after AIO is set up (everything of [020-backup-and-restore](./020-backup-and-restore.md)) and simply show that the backup section is disabled.