From 86386eb959ed3dcdee9ddda33e446ea55c70cb2e Mon Sep 17 00:00:00 2001 From: Glenn Date: Tue, 13 Aug 2024 17:01:32 +0200 Subject: [PATCH 1/9] debug: display current value of occ status --- hooks/gx.before-starting.www.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hooks/gx.before-starting.www.sh b/hooks/gx.before-starting.www.sh index 8a0f7b1..ca8a57b 100755 --- a/hooks/gx.before-starting.www.sh +++ b/hooks/gx.before-starting.www.sh @@ -18,6 +18,8 @@ cd "$WORKDIR" || exit 1 echo "GX:BEFORE-STARTING:START ($(pwd))" # find . -maxdepth 1 echo "GX:BEFORE-STARTING:STATUS" + +php -d memory_limit=-1 occ status |jq -r '.installed' INSTALLED="$(php -d memory_limit=-1 occ status |jq -r '.installed')" if [ "$INSTALLED" != "true" ]; then echo "WARNING: Not installed yet. Exiting." -- 2.45.2 From daccaad28c20027e8d311ec6ef49e3968a0aeb78 Mon Sep 17 00:00:00 2001 From: Glenn Date: Tue, 13 Aug 2024 17:19:42 +0200 Subject: [PATCH 2/9] fix: better detect not-installed status --- hooks/gx.before-starting.www.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hooks/gx.before-starting.www.sh b/hooks/gx.before-starting.www.sh index ca8a57b..091c9ba 100755 --- a/hooks/gx.before-starting.www.sh +++ b/hooks/gx.before-starting.www.sh @@ -18,11 +18,10 @@ cd "$WORKDIR" || exit 1 echo "GX:BEFORE-STARTING:START ($(pwd))" # find . -maxdepth 1 echo "GX:BEFORE-STARTING:STATUS" - php -d memory_limit=-1 occ status |jq -r '.installed' -INSTALLED="$(php -d memory_limit=-1 occ status |jq -r '.installed')" -if [ "$INSTALLED" != "true" ]; then - echo "WARNING: Not installed yet. Exiting." +# INSTALLED="$(php -d memory_limit=-1 occ status |jq -r '.installed')" +if php -d memory_limit=-1 occ status 2>&1 | grep 'not installed' ; then + echo "WARNING: Nextcloud is not installed yet. Exiting." exit 0 fi -- 2.45.2 From c6c36e877da924ddea22c6bc28a07177b8514f4b Mon Sep 17 00:00:00 2001 From: Glenn Date: Tue, 13 Aug 2024 17:35:48 +0200 Subject: [PATCH 3/9] fix: disable clamscan (to avoid a load of packages) --- .drone.yml | 8 ++++---- Dockerfile | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0ac15a2..c2b0461 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,7 +24,7 @@ steps: from_secret: DOCKERHUB_USERNAME password: from_secret: DOCKERHUB_PASSWORD - cache_from: "glenux/service-nextcloud:latest_${DRONE_BRANCH/\\//-}" + cache_from: "glenux/service-nextcloud:${DRONE_BRANCH/\\//-}_latest" repo: glenux/service-nextcloud tags: "${DRONE_COMMIT_SHA:0:8}" purge: false @@ -43,9 +43,9 @@ steps: from_secret: DOCKERHUB_PASSWORD cache_from: - "glenux/service-nextcloud:${DRONE_COMMIT_SHA:0:8}" - - "glenux/service-nextcloud:latest_${DRONE_BRANCH/\\//-}" + - "glenux/service-nextcloud:${DRONE_BRANCH/\\//-}_latest" repo: glenux/service-nextcloud - tags: "latest_${DRONE_BRANCH/\\//-}" + tags: "${DRONE_BRANCH/\\//-}_latest" purge: false when: branch: @@ -64,7 +64,7 @@ steps: from_secret: DOCKERHUB_PASSWORD cache_from: - "glenux/service-nextcloud:${DRONE_COMMIT_SHA:0:8}" - - "glenux/service-nextcloud:latest_${DRONE_BRANCH/\\//-}" + - "glenux/service-nextcloud:${DRONE_BRANCH/\\//-}_latest" repo: glenux/service-nextcloud tags: latest purge: false diff --git a/Dockerfile b/Dockerfile index e414e19..08630bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,9 +23,11 @@ FROM nextcloud:29.0.3-apache RUN apt-get update \ && apt-get install -y --no-install-recommends \ - clamdscan nano ghostscript jq \ + nano ghostscript \ && apt-get clean +# clamdscan + # ## Enable REDIS extension # RUN pecl channel-update pecl.php.net \ -- 2.45.2 From 4ee48f323e2d499a4df419a4b7a59d0c8636cb07 Mon Sep 17 00:00:00 2001 From: Glenn Date: Tue, 13 Aug 2024 18:00:40 +0200 Subject: [PATCH 4/9] fix: disable clamscan (to avoid a load of packages) --- hooks/gx.before-starting.www.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/gx.before-starting.www.sh b/hooks/gx.before-starting.www.sh index 091c9ba..74d9b58 100755 --- a/hooks/gx.before-starting.www.sh +++ b/hooks/gx.before-starting.www.sh @@ -18,9 +18,9 @@ cd "$WORKDIR" || exit 1 echo "GX:BEFORE-STARTING:START ($(pwd))" # find . -maxdepth 1 echo "GX:BEFORE-STARTING:STATUS" -php -d memory_limit=-1 occ status |jq -r '.installed' +php -d memory_limit=-1 occ status # INSTALLED="$(php -d memory_limit=-1 occ status |jq -r '.installed')" -if php -d memory_limit=-1 occ status 2>&1 | grep 'not installed' ; then +if php -d memory_limit=-1 occ status 2>&1 | grep -q 'not installed' ; then echo "WARNING: Nextcloud is not installed yet. Exiting." exit 0 fi -- 2.45.2 From 69ad000be7a53625f535d7b5fdcd34497b9d5c4d Mon Sep 17 00:00:00 2001 From: Glenn Date: Tue, 13 Aug 2024 20:05:09 +0200 Subject: [PATCH 5/9] ci: improve readability --- .drone.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c2b0461..a947b97 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,7 +24,8 @@ steps: from_secret: DOCKERHUB_USERNAME password: from_secret: DOCKERHUB_PASSWORD - cache_from: "glenux/service-nextcloud:${DRONE_BRANCH/\\//-}_latest" + cache_from: + - "glenux/service-nextcloud:${DRONE_BRANCH/\\//-}_latest" repo: glenux/service-nextcloud tags: "${DRONE_COMMIT_SHA:0:8}" purge: false -- 2.45.2 From 6f57be6b229932aeedf0abc1497b2f9ab5f1e226 Mon Sep 17 00:00:00 2001 From: Glenn Date: Tue, 13 Aug 2024 20:07:22 +0200 Subject: [PATCH 6/9] fix: add php config --- Dockerfile | 4 ++++ php-errors.ini | 11 +++++++++++ php-performance.ini | 3 +++ php-uploads.ini | 5 +++++ 4 files changed, 23 insertions(+) create mode 100644 php-errors.ini create mode 100644 php-performance.ini create mode 100644 php-uploads.ini diff --git a/Dockerfile b/Dockerfile index 08630bb..c176375 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,6 +88,10 @@ RUN echo '[opcache]' > /usr/local/etc/php/conf.d/opcache.ini \ && echo '[PHP]' > /usr/local/etc/php/conf.d/memory-limit.ini \ && echo 'memory_limit=1024M' >> /usr/local/etc/php/conf.d/memory-limit.ini +COPY php-uploads.ini /usr/local/etc/php/conf.d/glenux-uploads.ini +COPY php-performance.ini /usr/local/etc/php/conf.d/glenux-performance.ini +COPY php-errors.ini /usr/local/etc/php/conf.d/glenux-errors.ini + ## ## CRON SETUP ## diff --git a/php-errors.ini b/php-errors.ini new file mode 100644 index 0000000..db533d5 --- /dev/null +++ b/php-errors.ini @@ -0,0 +1,11 @@ +error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +log_errors = On + +## For production +# display_errors = Off +# error_log = /dev/stderr + +## For debugging +display_errors = On +error_log = /var/log/php-errors.log + diff --git a/php-performance.ini b/php-performance.ini new file mode 100644 index 0000000..c600a1a --- /dev/null +++ b/php-performance.ini @@ -0,0 +1,3 @@ +; Maximum amount of memory a script may consume (64MB) +memory_limit = 256M +max_input_vars = 3000 diff --git a/php-uploads.ini b/php-uploads.ini new file mode 100644 index 0000000..c60e710 --- /dev/null +++ b/php-uploads.ini @@ -0,0 +1,5 @@ +file_uploads = On +upload_max_filesize = 128M +post_max_size = 128M +max_execution_time = 1200 +max_input_time = 120 -- 2.45.2 From 8b85d4fea0bcbd0abcc283da1a5949062b6111ca Mon Sep 17 00:00:00 2001 From: Glenn Date: Tue, 13 Aug 2024 20:11:07 +0200 Subject: [PATCH 7/9] fix: add fix for apache2 --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index c176375..b8cdc87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -91,6 +91,7 @@ RUN echo '[opcache]' > /usr/local/etc/php/conf.d/opcache.ini \ COPY php-uploads.ini /usr/local/etc/php/conf.d/glenux-uploads.ini COPY php-performance.ini /usr/local/etc/php/conf.d/glenux-performance.ini COPY php-errors.ini /usr/local/etc/php/conf.d/glenux-errors.ini +RUN echo "LimitRequestBody 0" > /etc/apache2/conf-enabled/nextcloud-fix-413-error.conf ## ## CRON SETUP -- 2.45.2 From be75284145e1ca2cd2c06d7976e5c4a593caddb2 Mon Sep 17 00:00:00 2001 From: Glenn Date: Tue, 24 Sep 2024 14:30:27 +0200 Subject: [PATCH 8/9] Bump upstream version to 29.0.7 --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b8cdc87..43030c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,8 @@ # FROM nextcloud:27.1.3-apache # FROM nextcloud:27.1.4-apache # FROM nextcloud:28.0.1-apache -FROM nextcloud:29.0.3-apache +# FROM nextcloud:29.0.3-apache +FROM nextcloud:29.0.7-apache # This is a stupid comment for a demo (remove later) -- 2.45.2 From 627de5f8608cdfeb7154392c4ea436e2430ac926 Mon Sep 17 00:00:00 2001 From: glenux Date: Sun, 12 Jan 2025 13:02:18 +0000 Subject: [PATCH 9/9] Update Dockerfile --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 43030c6..636a59b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,8 @@ # FROM nextcloud:27.1.4-apache # FROM nextcloud:28.0.1-apache # FROM nextcloud:29.0.3-apache -FROM nextcloud:29.0.7-apache +# FROM nextcloud:29.0.7-apache +FROM nextcloud:30.0.4-apache # This is a stupid comment for a demo (remove later) -- 2.45.2