From 8bd688664d389021e52e6adf589a42c3c2e0f680 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Wed, 12 Dec 2018 19:21:48 +0100 Subject: [PATCH 01/67] Fix typo in docker-entrypoint.sh Signed-off-by: Richard Steinmetz --- docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 045227e8..07644c04 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -90,7 +90,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi if [ "$install" = true ]; then - echo "starting nexcloud installation" + echo "starting nextcloud installation" max_retries=10 try=0 until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] From 2f90715d31ddfc0983ab6b55918ee8078e506f0b Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Mon, 10 Dec 2018 18:06:21 -0600 Subject: [PATCH 02/67] Add imagick php extension There is a warning issued in Nextcloud 15 about 'imagick' php extension not being present. They highly recommend that it be installed. Fixes #574, fixes #263 Signed-off-by: Robert Dailey --- .examples/README.md | 5 ----- .examples/dockerfiles/full/apache/Dockerfile | 6 +++--- .examples/dockerfiles/full/fpm/Dockerfile | 6 +++--- 13.0/apache/Dockerfile | 3 +++ 13.0/fpm-alpine/Dockerfile | 3 +++ 13.0/fpm/Dockerfile | 3 +++ 14.0/apache/Dockerfile | 3 +++ 14.0/fpm-alpine/Dockerfile | 3 +++ 14.0/fpm/Dockerfile | 3 +++ 15.0/apache/Dockerfile | 3 +++ 15.0/fpm-alpine/Dockerfile | 3 +++ 15.0/fpm/Dockerfile | 3 +++ Dockerfile-alpine.template | 3 +++ Dockerfile-debian.template | 3 +++ update.sh | 2 ++ 15 files changed, 41 insertions(+), 11 deletions(-) diff --git a/.examples/README.md b/.examples/README.md index d2183447..f2842d92 100644 --- a/.examples/README.md +++ b/.examples/README.md @@ -32,11 +32,6 @@ The required steps for each optional/recommended package that is not already in #### PHP Module bz2 `docker-php-ext-install bz2` -#### PHP Module imagick -`apt install libmagickwand-dev` -`pecl install imagick` -`docker-php-ext-enable imagick` - #### PHP Module imap `apt install libc-client-dev libkrb5-dev` `docker-php-ext-configure imap --with-kerberos --with-imap-ssl` diff --git a/.examples/dockerfiles/full/apache/Dockerfile b/.examples/dockerfiles/full/apache/Dockerfile index fc5e848c..178ca844 100644 --- a/.examples/dockerfiles/full/apache/Dockerfile +++ b/.examples/dockerfiles/full/apache/Dockerfile @@ -4,7 +4,7 @@ RUN mkdir -p /usr/share/man/man1 \ && apt-get update && apt-get install -y \ supervisor \ ffmpeg \ - libmagickwand-dev \ + libbz2-dev \ libgmp3-dev \ libc-client-dev \ libkrb5-dev \ @@ -15,8 +15,8 @@ RUN mkdir -p /usr/share/man/man1 \ && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ && ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h \ && docker-php-ext-install bz2 gmp imap \ - && pecl install imagick smbclient \ - && docker-php-ext-enable imagick smbclient \ + && pecl install smbclient \ + && docker-php-ext-enable smbclient \ && mkdir /var/log/supervisord /var/run/supervisord COPY supervisord.conf /etc/supervisor/supervisord.conf diff --git a/.examples/dockerfiles/full/fpm/Dockerfile b/.examples/dockerfiles/full/fpm/Dockerfile index b7311258..b0c61d64 100644 --- a/.examples/dockerfiles/full/fpm/Dockerfile +++ b/.examples/dockerfiles/full/fpm/Dockerfile @@ -4,7 +4,7 @@ RUN mkdir -p /usr/share/man/man1 \ && apt-get update && apt-get install -y \ supervisor \ ffmpeg \ - libmagickwand-dev \ + libbz2-dev \ libgmp3-dev \ libc-client-dev \ libkrb5-dev \ @@ -15,8 +15,8 @@ RUN mkdir -p /usr/share/man/man1 \ && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ && ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h \ && docker-php-ext-install bz2 gmp imap \ - && pecl install imagick smbclient \ - && docker-php-ext-enable imagick smbclient \ + && pecl install smbclient \ + && docker-php-ext-enable smbclient \ && mkdir /var/log/supervisord /var/run/supervisord COPY supervisord.conf /etc/supervisor/supervisord.conf diff --git a/13.0/apache/Dockerfile b/13.0/apache/Dockerfile index 2a3ba93e..5c096bb4 100644 --- a/13.0/apache/Dockerfile +++ b/13.0/apache/Dockerfile @@ -33,6 +33,7 @@ RUN set -ex; \ libpng-dev \ libpq-dev \ libxml2-dev \ + libmagickwand-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -54,11 +55,13 @@ RUN set -ex; \ pecl install APCu-5.1.15; \ pecl install memcached-3.0.4; \ pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index 9f22e0f2..b2cb6b8c 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -28,6 +28,7 @@ RUN set -ex; \ openldap-dev \ pcre-dev \ postgresql-dev \ + imagemagick-dev \ ; \ \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ @@ -48,11 +49,13 @@ RUN set -ex; \ pecl install APCu-5.1.15; \ pecl install memcached-3.0.4; \ pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ runDeps="$( \ diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile index 8ec966da..ad42be59 100644 --- a/13.0/fpm/Dockerfile +++ b/13.0/fpm/Dockerfile @@ -33,6 +33,7 @@ RUN set -ex; \ libpng-dev \ libpq-dev \ libxml2-dev \ + libmagickwand-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -54,11 +55,13 @@ RUN set -ex; \ pecl install APCu-5.1.15; \ pecl install memcached-3.0.4; \ pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies diff --git a/14.0/apache/Dockerfile b/14.0/apache/Dockerfile index 9ac1e34a..5db06fee 100644 --- a/14.0/apache/Dockerfile +++ b/14.0/apache/Dockerfile @@ -33,6 +33,7 @@ RUN set -ex; \ libpng-dev \ libpq-dev \ libxml2-dev \ + libmagickwand-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -54,11 +55,13 @@ RUN set -ex; \ pecl install APCu-5.1.15; \ pecl install memcached-3.0.4; \ pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies diff --git a/14.0/fpm-alpine/Dockerfile b/14.0/fpm-alpine/Dockerfile index 87dd98ce..d21cf51f 100644 --- a/14.0/fpm-alpine/Dockerfile +++ b/14.0/fpm-alpine/Dockerfile @@ -28,6 +28,7 @@ RUN set -ex; \ openldap-dev \ pcre-dev \ postgresql-dev \ + imagemagick-dev \ ; \ \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ @@ -48,11 +49,13 @@ RUN set -ex; \ pecl install APCu-5.1.15; \ pecl install memcached-3.0.4; \ pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ runDeps="$( \ diff --git a/14.0/fpm/Dockerfile b/14.0/fpm/Dockerfile index 966c4be3..7b388db1 100644 --- a/14.0/fpm/Dockerfile +++ b/14.0/fpm/Dockerfile @@ -33,6 +33,7 @@ RUN set -ex; \ libpng-dev \ libpq-dev \ libxml2-dev \ + libmagickwand-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -54,11 +55,13 @@ RUN set -ex; \ pecl install APCu-5.1.15; \ pecl install memcached-3.0.4; \ pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 48f1195b..454842aa 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -33,6 +33,7 @@ RUN set -ex; \ libpng-dev \ libpq-dev \ libxml2-dev \ + libmagickwand-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -54,11 +55,13 @@ RUN set -ex; \ pecl install APCu-5.1.15; \ pecl install memcached-3.0.4; \ pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index d015b235..d6ac2a2e 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -28,6 +28,7 @@ RUN set -ex; \ openldap-dev \ pcre-dev \ postgresql-dev \ + imagemagick-dev \ ; \ \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ @@ -48,11 +49,13 @@ RUN set -ex; \ pecl install APCu-5.1.15; \ pecl install memcached-3.0.4; \ pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ runDeps="$( \ diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index 6b2c696a..8cc1df2a 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -33,6 +33,7 @@ RUN set -ex; \ libpng-dev \ libpq-dev \ libxml2-dev \ + libmagickwand-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -54,11 +55,13 @@ RUN set -ex; \ pecl install APCu-5.1.15; \ pecl install memcached-3.0.4; \ pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 6683f2b1..4d282f54 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -27,6 +27,7 @@ RUN set -ex; \ openldap-dev \ pcre-dev \ postgresql-dev \ + imagemagick-dev \ ; \ \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ @@ -47,11 +48,13 @@ RUN set -ex; \ pecl install APCu-%%APCU_VERSION%%; \ pecl install memcached-%%MEMCACHED_VERSION%%; \ pecl install redis-%%REDIS_VERSION%%; \ + pecl install imagick-%%IMAGICK_VERSION%%; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ runDeps="$( \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 7f451512..d10ae367 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -32,6 +32,7 @@ RUN set -ex; \ libpng-dev \ libpq-dev \ libxml2-dev \ + libmagickwand-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -53,11 +54,13 @@ RUN set -ex; \ pecl install APCu-%%APCU_VERSION%%; \ pecl install memcached-%%MEMCACHED_VERSION%%; \ pecl install redis-%%REDIS_VERSION%%; \ + pecl install imagick-%%IMAGICK_VERSION%%; \ \ docker-php-ext-enable \ apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies diff --git a/update.sh b/update.sh index 641ba587..8a323635 100755 --- a/update.sh +++ b/update.sh @@ -28,6 +28,7 @@ declare -A pecl_versions=( [APCu]='5.1.15' [memcached]='3.0.4' [redis]='4.2.0' + [imagick]='3.4.3' ) variants=( @@ -78,6 +79,7 @@ function create_variant() { s/%%APCU_VERSION%%/'"${pecl_versions[APCu]}"'/g; s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g; s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g; + s/%%IMAGICK_VERSION%%/'"${pecl_versions[imagick]}"'/g; ' "$dir/Dockerfile" # Copy the shell scripts From a37b6752b9ac77cee7d5fc1942182437419383ed Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Thu, 13 Dec 2018 12:07:24 +0100 Subject: [PATCH 03/67] Run update.sh Signed-off-by: Richard Steinmetz --- 13.0/apache/entrypoint.sh | 2 +- 13.0/fpm-alpine/entrypoint.sh | 2 +- 13.0/fpm/entrypoint.sh | 2 +- 14.0/apache/entrypoint.sh | 2 +- 14.0/fpm-alpine/entrypoint.sh | 2 +- 14.0/fpm/entrypoint.sh | 2 +- 15.0/apache/entrypoint.sh | 2 +- 15.0/fpm-alpine/entrypoint.sh | 2 +- 15.0/fpm/entrypoint.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/13.0/apache/entrypoint.sh b/13.0/apache/entrypoint.sh index 045227e8..07644c04 100755 --- a/13.0/apache/entrypoint.sh +++ b/13.0/apache/entrypoint.sh @@ -90,7 +90,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi if [ "$install" = true ]; then - echo "starting nexcloud installation" + echo "starting nextcloud installation" max_retries=10 try=0 until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] diff --git a/13.0/fpm-alpine/entrypoint.sh b/13.0/fpm-alpine/entrypoint.sh index 045227e8..07644c04 100755 --- a/13.0/fpm-alpine/entrypoint.sh +++ b/13.0/fpm-alpine/entrypoint.sh @@ -90,7 +90,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi if [ "$install" = true ]; then - echo "starting nexcloud installation" + echo "starting nextcloud installation" max_retries=10 try=0 until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] diff --git a/13.0/fpm/entrypoint.sh b/13.0/fpm/entrypoint.sh index 045227e8..07644c04 100755 --- a/13.0/fpm/entrypoint.sh +++ b/13.0/fpm/entrypoint.sh @@ -90,7 +90,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi if [ "$install" = true ]; then - echo "starting nexcloud installation" + echo "starting nextcloud installation" max_retries=10 try=0 until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] diff --git a/14.0/apache/entrypoint.sh b/14.0/apache/entrypoint.sh index 045227e8..07644c04 100755 --- a/14.0/apache/entrypoint.sh +++ b/14.0/apache/entrypoint.sh @@ -90,7 +90,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi if [ "$install" = true ]; then - echo "starting nexcloud installation" + echo "starting nextcloud installation" max_retries=10 try=0 until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] diff --git a/14.0/fpm-alpine/entrypoint.sh b/14.0/fpm-alpine/entrypoint.sh index 045227e8..07644c04 100755 --- a/14.0/fpm-alpine/entrypoint.sh +++ b/14.0/fpm-alpine/entrypoint.sh @@ -90,7 +90,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi if [ "$install" = true ]; then - echo "starting nexcloud installation" + echo "starting nextcloud installation" max_retries=10 try=0 until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] diff --git a/14.0/fpm/entrypoint.sh b/14.0/fpm/entrypoint.sh index 045227e8..07644c04 100755 --- a/14.0/fpm/entrypoint.sh +++ b/14.0/fpm/entrypoint.sh @@ -90,7 +90,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi if [ "$install" = true ]; then - echo "starting nexcloud installation" + echo "starting nextcloud installation" max_retries=10 try=0 until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] diff --git a/15.0/apache/entrypoint.sh b/15.0/apache/entrypoint.sh index 045227e8..07644c04 100755 --- a/15.0/apache/entrypoint.sh +++ b/15.0/apache/entrypoint.sh @@ -90,7 +90,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi if [ "$install" = true ]; then - echo "starting nexcloud installation" + echo "starting nextcloud installation" max_retries=10 try=0 until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] diff --git a/15.0/fpm-alpine/entrypoint.sh b/15.0/fpm-alpine/entrypoint.sh index 045227e8..07644c04 100755 --- a/15.0/fpm-alpine/entrypoint.sh +++ b/15.0/fpm-alpine/entrypoint.sh @@ -90,7 +90,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi if [ "$install" = true ]; then - echo "starting nexcloud installation" + echo "starting nextcloud installation" max_retries=10 try=0 until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] diff --git a/15.0/fpm/entrypoint.sh b/15.0/fpm/entrypoint.sh index 045227e8..07644c04 100755 --- a/15.0/fpm/entrypoint.sh +++ b/15.0/fpm/entrypoint.sh @@ -90,7 +90,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi if [ "$install" = true ]; then - echo "starting nexcloud installation" + echo "starting nextcloud installation" max_retries=10 try=0 until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] From bd2e1b410752d0ed32cf2fce35a8e45a81a0b205 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Thu, 13 Dec 2018 17:08:50 +0100 Subject: [PATCH 04/67] Add db command to docker-compose example in readme Signed-off-by: Richard Steinmetz --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0d712c01..8e4c168d 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ volumes: services: db: image: mariadb + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW restart: always volumes: - db:/var/lib/mysql @@ -192,6 +193,7 @@ volumes: services: db: image: mariadb + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW restart: always volumes: - db:/var/lib/mysql From 030a743b397af22366598c2b9ca010a95120cc29 Mon Sep 17 00:00:00 2001 From: J0WI Date: Sat, 5 Jan 2019 18:36:52 +0100 Subject: [PATCH 05/67] Add Alpine variant to Dockerfile examples Signed-off-by: J0WI --- .../dockerfiles/cron/fpm-alpine/Dockerfile | 10 ++++ .../cron/fpm-alpine/supervisord.conf | 22 ++++++++ .../dockerfiles/full/fpm-alpine/Dockerfile | 52 +++++++++++++++++++ .../full/fpm-alpine/supervisord.conf | 22 ++++++++ .../dockerfiles/imap/fpm-alpine/Dockerfile | 22 ++++++++ .../dockerfiles/smb/fpm-alpine/Dockerfile | 3 ++ 6 files changed, 131 insertions(+) create mode 100644 .examples/dockerfiles/cron/fpm-alpine/Dockerfile create mode 100644 .examples/dockerfiles/cron/fpm-alpine/supervisord.conf create mode 100644 .examples/dockerfiles/full/fpm-alpine/Dockerfile create mode 100644 .examples/dockerfiles/full/fpm-alpine/supervisord.conf create mode 100644 .examples/dockerfiles/imap/fpm-alpine/Dockerfile create mode 100644 .examples/dockerfiles/smb/fpm-alpine/Dockerfile diff --git a/.examples/dockerfiles/cron/fpm-alpine/Dockerfile b/.examples/dockerfiles/cron/fpm-alpine/Dockerfile new file mode 100644 index 00000000..820b3f9a --- /dev/null +++ b/.examples/dockerfiles/cron/fpm-alpine/Dockerfile @@ -0,0 +1,10 @@ +FROM nextcloud:fpm-alpine + +RUN apk add --no-cache supervisor \ + && mkdir /var/log/supervisord /var/run/supervisord + +COPY supervisord.conf /etc/supervisor/supervisord.conf + +ENV NEXTCLOUD_UPDATE=1 + +CMD ["/usr/bin/supervisord"] diff --git a/.examples/dockerfiles/cron/fpm-alpine/supervisord.conf b/.examples/dockerfiles/cron/fpm-alpine/supervisord.conf new file mode 100644 index 00000000..4f762592 --- /dev/null +++ b/.examples/dockerfiles/cron/fpm-alpine/supervisord.conf @@ -0,0 +1,22 @@ +[supervisord] +nodaemon=true +logfile=/var/log/supervisord/supervisord.log +pidfile=/var/run/supervisord/supervisord.pid +childlogdir=/var/log/supervisord/ +logfile_maxbytes=50MB ; maximum size of logfile before rotation +logfile_backups=10 ; number of backed up logfiles +loglevel=error + +[program:php-fpm] +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +command=php-fpm + +[program:cron] +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +command=/cron.sh diff --git a/.examples/dockerfiles/full/fpm-alpine/Dockerfile b/.examples/dockerfiles/full/fpm-alpine/Dockerfile new file mode 100644 index 00000000..bfcb263a --- /dev/null +++ b/.examples/dockerfiles/full/fpm-alpine/Dockerfile @@ -0,0 +1,52 @@ +FROM nextcloud:fpm-alpine + +RUN set -ex; \ + \ + apk add --no-cache \ + ffmpeg \ + samba-client \ + supervisor \ +# libreoffice \ + ; + +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + imap-dev \ + krb5-dev \ + libressl-dev \ + samba-dev \ + bzip2-dev \ + gmp-dev \ + ; \ + \ + docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ + docker-php-ext-install \ + bz2 \ + gmp \ + imap \ + ; \ + pecl install smbclient; \ + docker-php-ext-enable smbclient; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +RUN mkdir -p \ + /usr/share/man/man1 \ + /var/log/supervisord \ + /var/run/supervisord \ +; + +COPY supervisord.conf /etc/supervisor/supervisord.conf + +ENV NEXTCLOUD_UPDATE=1 + +CMD ["/usr/bin/supervisord"] diff --git a/.examples/dockerfiles/full/fpm-alpine/supervisord.conf b/.examples/dockerfiles/full/fpm-alpine/supervisord.conf new file mode 100644 index 00000000..4f762592 --- /dev/null +++ b/.examples/dockerfiles/full/fpm-alpine/supervisord.conf @@ -0,0 +1,22 @@ +[supervisord] +nodaemon=true +logfile=/var/log/supervisord/supervisord.log +pidfile=/var/run/supervisord/supervisord.pid +childlogdir=/var/log/supervisord/ +logfile_maxbytes=50MB ; maximum size of logfile before rotation +logfile_backups=10 ; number of backed up logfiles +loglevel=error + +[program:php-fpm] +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +command=php-fpm + +[program:cron] +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +command=/cron.sh diff --git a/.examples/dockerfiles/imap/fpm-alpine/Dockerfile b/.examples/dockerfiles/imap/fpm-alpine/Dockerfile new file mode 100644 index 00000000..289c2a99 --- /dev/null +++ b/.examples/dockerfiles/imap/fpm-alpine/Dockerfile @@ -0,0 +1,22 @@ +FROM nextcloud:fpm-alpine + +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + imap-dev \ + krb5-dev \ + libressl-dev \ + ; \ + \ + docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ + docker-php-ext-install imap; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps diff --git a/.examples/dockerfiles/smb/fpm-alpine/Dockerfile b/.examples/dockerfiles/smb/fpm-alpine/Dockerfile new file mode 100644 index 00000000..a66cd93a --- /dev/null +++ b/.examples/dockerfiles/smb/fpm-alpine/Dockerfile @@ -0,0 +1,3 @@ +FROM nextcloud:fpm-alpine + +RUN apk add --no-cache samba-client From 0e941215b1b79929581cbbecdd79a544b50e4b9b Mon Sep 17 00:00:00 2001 From: J0WI Date: Sat, 5 Jan 2019 18:43:27 +0100 Subject: [PATCH 06/67] Refactor install process and remove build deps Signed-off-by: J0WI --- .examples/dockerfiles/full/apache/Dockerfile | 65 +++++++++++++++----- .examples/dockerfiles/full/fpm/Dockerfile | 65 +++++++++++++++----- .examples/dockerfiles/imap/apache/Dockerfile | 31 ++++++++-- .examples/dockerfiles/imap/fpm/Dockerfile | 31 ++++++++-- 4 files changed, 152 insertions(+), 40 deletions(-) diff --git a/.examples/dockerfiles/full/apache/Dockerfile b/.examples/dockerfiles/full/apache/Dockerfile index 178ca844..fe82de23 100644 --- a/.examples/dockerfiles/full/apache/Dockerfile +++ b/.examples/dockerfiles/full/apache/Dockerfile @@ -1,23 +1,58 @@ FROM nextcloud:apache -RUN mkdir -p /usr/share/man/man1 \ - && apt-get update && apt-get install -y \ - supervisor \ +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ ffmpeg \ - libbz2-dev \ - libgmp3-dev \ - libc-client-dev \ - libkrb5-dev \ smbclient \ - libsmbclient-dev \ + supervisor \ # libreoffice \ - && rm -rf /var/lib/apt/lists/* \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h \ - && docker-php-ext-install bz2 gmp imap \ - && pecl install smbclient \ - && docker-php-ext-enable smbclient \ - && mkdir /var/log/supervisord /var/run/supervisord + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libbz2-dev \ + libc-client-dev \ + libgmp3-dev \ + libkrb5-dev \ + libsmbclient-dev \ + ; \ + \ + docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ + ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h; \ + docker-php-ext-install \ + bz2 \ + gmp \ + imap \ + ; \ + pecl install smbclient; \ + docker-php-ext-enable smbclient; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +RUN mkdir -p \ + /usr/share/man/man1 \ + /var/log/supervisord \ + /var/run/supervisord \ +; COPY supervisord.conf /etc/supervisor/supervisord.conf diff --git a/.examples/dockerfiles/full/fpm/Dockerfile b/.examples/dockerfiles/full/fpm/Dockerfile index b0c61d64..3e53e597 100644 --- a/.examples/dockerfiles/full/fpm/Dockerfile +++ b/.examples/dockerfiles/full/fpm/Dockerfile @@ -1,23 +1,58 @@ FROM nextcloud:fpm -RUN mkdir -p /usr/share/man/man1 \ - && apt-get update && apt-get install -y \ - supervisor \ +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ ffmpeg \ - libbz2-dev \ - libgmp3-dev \ - libc-client-dev \ - libkrb5-dev \ smbclient \ - libsmbclient-dev \ + supervisor \ # libreoffice \ - && rm -rf /var/lib/apt/lists/* \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h \ - && docker-php-ext-install bz2 gmp imap \ - && pecl install smbclient \ - && docker-php-ext-enable smbclient \ - && mkdir /var/log/supervisord /var/run/supervisord + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libbz2-dev \ + libc-client-dev \ + libgmp3-dev \ + libkrb5-dev \ + libsmbclient-dev \ + ; \ + \ + docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ + ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h; \ + docker-php-ext-install \ + bz2 \ + gmp \ + imap \ + ; \ + pecl install smbclient; \ + docker-php-ext-enable smbclient; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +RUN mkdir -p \ + /usr/share/man/man1 \ + /var/log/supervisord \ + /var/run/supervisord \ +; COPY supervisord.conf /etc/supervisor/supervisord.conf diff --git a/.examples/dockerfiles/imap/apache/Dockerfile b/.examples/dockerfiles/imap/apache/Dockerfile index f7958c08..5f24c756 100644 --- a/.examples/dockerfiles/imap/apache/Dockerfile +++ b/.examples/dockerfiles/imap/apache/Dockerfile @@ -1,7 +1,28 @@ FROM nextcloud:apache -RUN apt-get update \ - && apt-get install -y libc-client-dev libkrb5-dev \ - && rm -rf /var/lib/apt/lists/* \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libc-client-dev \ + libkrb5-dev \ + ; \ + \ + docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ + docker-php-ext-install imap; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* diff --git a/.examples/dockerfiles/imap/fpm/Dockerfile b/.examples/dockerfiles/imap/fpm/Dockerfile index b403de66..f692fd7a 100644 --- a/.examples/dockerfiles/imap/fpm/Dockerfile +++ b/.examples/dockerfiles/imap/fpm/Dockerfile @@ -1,7 +1,28 @@ FROM nextcloud:fpm -RUN apt-get update \ - && apt-get install -y libc-client-dev libkrb5-dev \ - && rm -rf /var/lib/apt/lists/* \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libc-client-dev \ + libkrb5-dev \ + ; \ + \ + docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ + docker-php-ext-install imap; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* From e7d2df22ad03a800a76f85b15eea471663d92ebe Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Sat, 5 Jan 2019 22:51:19 +0000 Subject: [PATCH 07/67] Update to 15.0.1RC1 --- 15.0-rc/apache/Dockerfile | 145 ++++++++++++++++++ .../config/apache-pretty-urls.config.php | 4 + 15.0-rc/apache/config/apcu.config.php | 4 + 15.0-rc/apache/config/apps.config.php | 15 ++ 15.0-rc/apache/config/autoconfig.php | 29 ++++ 15.0-rc/apache/cron.sh | 4 + 15.0-rc/apache/entrypoint.sh | 132 ++++++++++++++++ 15.0-rc/apache/upgrade.exclude | 4 + 15.0-rc/fpm-alpine/Dockerfile | 122 +++++++++++++++ 15.0-rc/fpm-alpine/config/apcu.config.php | 4 + 15.0-rc/fpm-alpine/config/apps.config.php | 15 ++ 15.0-rc/fpm-alpine/config/autoconfig.php | 29 ++++ 15.0-rc/fpm-alpine/cron.sh | 4 + 15.0-rc/fpm-alpine/entrypoint.sh | 132 ++++++++++++++++ 15.0-rc/fpm-alpine/upgrade.exclude | 4 + 15.0-rc/fpm/Dockerfile | 137 +++++++++++++++++ 15.0-rc/fpm/config/apcu.config.php | 4 + 15.0-rc/fpm/config/apps.config.php | 15 ++ 15.0-rc/fpm/config/autoconfig.php | 29 ++++ 15.0-rc/fpm/cron.sh | 4 + 15.0-rc/fpm/entrypoint.sh | 132 ++++++++++++++++ 15.0-rc/fpm/upgrade.exclude | 4 + 22 files changed, 972 insertions(+) create mode 100644 15.0-rc/apache/Dockerfile create mode 100644 15.0-rc/apache/config/apache-pretty-urls.config.php create mode 100644 15.0-rc/apache/config/apcu.config.php create mode 100644 15.0-rc/apache/config/apps.config.php create mode 100644 15.0-rc/apache/config/autoconfig.php create mode 100755 15.0-rc/apache/cron.sh create mode 100755 15.0-rc/apache/entrypoint.sh create mode 100644 15.0-rc/apache/upgrade.exclude create mode 100644 15.0-rc/fpm-alpine/Dockerfile create mode 100644 15.0-rc/fpm-alpine/config/apcu.config.php create mode 100644 15.0-rc/fpm-alpine/config/apps.config.php create mode 100644 15.0-rc/fpm-alpine/config/autoconfig.php create mode 100755 15.0-rc/fpm-alpine/cron.sh create mode 100755 15.0-rc/fpm-alpine/entrypoint.sh create mode 100644 15.0-rc/fpm-alpine/upgrade.exclude create mode 100644 15.0-rc/fpm/Dockerfile create mode 100644 15.0-rc/fpm/config/apcu.config.php create mode 100644 15.0-rc/fpm/config/apps.config.php create mode 100644 15.0-rc/fpm/config/autoconfig.php create mode 100755 15.0-rc/fpm/cron.sh create mode 100755 15.0-rc/fpm/entrypoint.sh create mode 100644 15.0-rc/fpm/upgrade.exclude diff --git a/15.0-rc/apache/Dockerfile b/15.0-rc/apache/Dockerfile new file mode 100644 index 00000000..bcadc21f --- /dev/null +++ b/15.0-rc/apache/Dockerfile @@ -0,0 +1,145 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-apache-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.15; \ + pecl install memcached-3.0.4; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod rewrite remoteip ;\ + {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + } > /etc/apache2/conf-available/remoteip.conf;\ + a2enconf remoteip + +ENV NEXTCLOUD_VERSION 15.0.1RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/15.0-rc/apache/config/apache-pretty-urls.config.php b/15.0-rc/apache/config/apache-pretty-urls.config.php new file mode 100644 index 00000000..72da1d8c --- /dev/null +++ b/15.0-rc/apache/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/15.0-rc/apache/config/apcu.config.php b/15.0-rc/apache/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-rc/apache/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-rc/apache/config/apps.config.php b/15.0-rc/apache/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-rc/apache/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-rc/apache/config/autoconfig.php b/15.0-rc/apache/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-rc/apache/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-rc/apache/upgrade.exclude b/15.0-rc/apache/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-rc/apache/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/15.0-rc/fpm-alpine/Dockerfile b/15.0-rc/fpm-alpine/Dockerfile new file mode 100644 index 00000000..479ebfbe --- /dev/null +++ b/15.0-rc/fpm-alpine/Dockerfile @@ -0,0 +1,122 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template +FROM php:7.2-fpm-alpine3.8 + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + rsync \ + ; \ + \ + rm /var/spool/cron/crontabs/root; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + pcre-dev \ + postgresql-dev \ + imagemagick-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.15; \ + pecl install memcached-3.0.4; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 15.0.1RC1 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/15.0-rc/fpm-alpine/config/apcu.config.php b/15.0-rc/fpm-alpine/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-rc/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-rc/fpm-alpine/config/apps.config.php b/15.0-rc/fpm-alpine/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-rc/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-rc/fpm-alpine/config/autoconfig.php b/15.0-rc/fpm-alpine/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-rc/fpm-alpine/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-rc/fpm-alpine/upgrade.exclude b/15.0-rc/fpm-alpine/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-rc/fpm-alpine/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/15.0-rc/fpm/Dockerfile b/15.0-rc/fpm/Dockerfile new file mode 100644 index 00000000..8f532b9e --- /dev/null +++ b/15.0-rc/fpm/Dockerfile @@ -0,0 +1,137 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-fpm-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.15; \ + pecl install memcached-3.0.4; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 15.0.1RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/15.0-rc/fpm/config/apcu.config.php b/15.0-rc/fpm/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-rc/fpm/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-rc/fpm/config/apps.config.php b/15.0-rc/fpm/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-rc/fpm/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-rc/fpm/config/autoconfig.php b/15.0-rc/fpm/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-rc/fpm/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-rc/fpm/upgrade.exclude b/15.0-rc/fpm/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-rc/fpm/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ From 49085a33e6926f7412f1d0b4774e7058b09153a9 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Sat, 5 Jan 2019 22:51:19 +0000 Subject: [PATCH 08/67] Update to 13.0.9RC1 --- 13.0-rc/apache/Dockerfile | 145 ++++++++++++++++++ .../config/apache-pretty-urls.config.php | 4 + 13.0-rc/apache/config/apcu.config.php | 4 + 13.0-rc/apache/config/apps.config.php | 15 ++ 13.0-rc/apache/config/autoconfig.php | 29 ++++ 13.0-rc/apache/cron.sh | 4 + 13.0-rc/apache/entrypoint.sh | 132 ++++++++++++++++ 13.0-rc/apache/upgrade.exclude | 4 + 13.0-rc/fpm-alpine/Dockerfile | 122 +++++++++++++++ 13.0-rc/fpm-alpine/config/apcu.config.php | 4 + 13.0-rc/fpm-alpine/config/apps.config.php | 15 ++ 13.0-rc/fpm-alpine/config/autoconfig.php | 29 ++++ 13.0-rc/fpm-alpine/cron.sh | 4 + 13.0-rc/fpm-alpine/entrypoint.sh | 132 ++++++++++++++++ 13.0-rc/fpm-alpine/upgrade.exclude | 4 + 13.0-rc/fpm/Dockerfile | 137 +++++++++++++++++ 13.0-rc/fpm/config/apcu.config.php | 4 + 13.0-rc/fpm/config/apps.config.php | 15 ++ 13.0-rc/fpm/config/autoconfig.php | 29 ++++ 13.0-rc/fpm/cron.sh | 4 + 13.0-rc/fpm/entrypoint.sh | 132 ++++++++++++++++ 13.0-rc/fpm/upgrade.exclude | 4 + 22 files changed, 972 insertions(+) create mode 100644 13.0-rc/apache/Dockerfile create mode 100644 13.0-rc/apache/config/apache-pretty-urls.config.php create mode 100644 13.0-rc/apache/config/apcu.config.php create mode 100644 13.0-rc/apache/config/apps.config.php create mode 100644 13.0-rc/apache/config/autoconfig.php create mode 100755 13.0-rc/apache/cron.sh create mode 100755 13.0-rc/apache/entrypoint.sh create mode 100644 13.0-rc/apache/upgrade.exclude create mode 100644 13.0-rc/fpm-alpine/Dockerfile create mode 100644 13.0-rc/fpm-alpine/config/apcu.config.php create mode 100644 13.0-rc/fpm-alpine/config/apps.config.php create mode 100644 13.0-rc/fpm-alpine/config/autoconfig.php create mode 100755 13.0-rc/fpm-alpine/cron.sh create mode 100755 13.0-rc/fpm-alpine/entrypoint.sh create mode 100644 13.0-rc/fpm-alpine/upgrade.exclude create mode 100644 13.0-rc/fpm/Dockerfile create mode 100644 13.0-rc/fpm/config/apcu.config.php create mode 100644 13.0-rc/fpm/config/apps.config.php create mode 100644 13.0-rc/fpm/config/autoconfig.php create mode 100755 13.0-rc/fpm/cron.sh create mode 100755 13.0-rc/fpm/entrypoint.sh create mode 100644 13.0-rc/fpm/upgrade.exclude diff --git a/13.0-rc/apache/Dockerfile b/13.0-rc/apache/Dockerfile new file mode 100644 index 00000000..56a76b74 --- /dev/null +++ b/13.0-rc/apache/Dockerfile @@ -0,0 +1,145 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-apache-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.15; \ + pecl install memcached-3.0.4; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod rewrite remoteip ;\ + {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + } > /etc/apache2/conf-available/remoteip.conf;\ + a2enconf remoteip + +ENV NEXTCLOUD_VERSION 13.0.9RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/13.0-rc/apache/config/apache-pretty-urls.config.php b/13.0-rc/apache/config/apache-pretty-urls.config.php new file mode 100644 index 00000000..72da1d8c --- /dev/null +++ b/13.0-rc/apache/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/13.0-rc/apache/config/apcu.config.php b/13.0-rc/apache/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/13.0-rc/apache/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/13.0-rc/apache/config/apps.config.php b/13.0-rc/apache/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/13.0-rc/apache/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/13.0-rc/apache/config/autoconfig.php b/13.0-rc/apache/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/13.0-rc/apache/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/13.0-rc/apache/upgrade.exclude b/13.0-rc/apache/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/13.0-rc/apache/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/13.0-rc/fpm-alpine/Dockerfile b/13.0-rc/fpm-alpine/Dockerfile new file mode 100644 index 00000000..e2de1cdb --- /dev/null +++ b/13.0-rc/fpm-alpine/Dockerfile @@ -0,0 +1,122 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template +FROM php:7.2-fpm-alpine3.8 + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + rsync \ + ; \ + \ + rm /var/spool/cron/crontabs/root; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + pcre-dev \ + postgresql-dev \ + imagemagick-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.15; \ + pecl install memcached-3.0.4; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 13.0.9RC1 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/13.0-rc/fpm-alpine/config/apcu.config.php b/13.0-rc/fpm-alpine/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/13.0-rc/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/13.0-rc/fpm-alpine/config/apps.config.php b/13.0-rc/fpm-alpine/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/13.0-rc/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/13.0-rc/fpm-alpine/config/autoconfig.php b/13.0-rc/fpm-alpine/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/13.0-rc/fpm-alpine/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/13.0-rc/fpm-alpine/upgrade.exclude b/13.0-rc/fpm-alpine/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/13.0-rc/fpm-alpine/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/13.0-rc/fpm/Dockerfile b/13.0-rc/fpm/Dockerfile new file mode 100644 index 00000000..2daa19b7 --- /dev/null +++ b/13.0-rc/fpm/Dockerfile @@ -0,0 +1,137 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-fpm-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.15; \ + pecl install memcached-3.0.4; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 13.0.9RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/13.0-rc/fpm/config/apcu.config.php b/13.0-rc/fpm/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/13.0-rc/fpm/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/13.0-rc/fpm/config/apps.config.php b/13.0-rc/fpm/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/13.0-rc/fpm/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/13.0-rc/fpm/config/autoconfig.php b/13.0-rc/fpm/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/13.0-rc/fpm/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/13.0-rc/fpm/upgrade.exclude b/13.0-rc/fpm/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/13.0-rc/fpm/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ From 1999ee264bbb4a7143665dba930d2a9cbb777037 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Sat, 5 Jan 2019 22:51:19 +0000 Subject: [PATCH 09/67] Update to 14.0.5RC1 --- 14.0-rc/apache/Dockerfile | 145 ++++++++++++++++++ .../config/apache-pretty-urls.config.php | 4 + 14.0-rc/apache/config/apcu.config.php | 4 + 14.0-rc/apache/config/apps.config.php | 15 ++ 14.0-rc/apache/config/autoconfig.php | 29 ++++ 14.0-rc/apache/cron.sh | 4 + 14.0-rc/apache/entrypoint.sh | 132 ++++++++++++++++ 14.0-rc/apache/upgrade.exclude | 4 + 14.0-rc/fpm-alpine/Dockerfile | 122 +++++++++++++++ 14.0-rc/fpm-alpine/config/apcu.config.php | 4 + 14.0-rc/fpm-alpine/config/apps.config.php | 15 ++ 14.0-rc/fpm-alpine/config/autoconfig.php | 29 ++++ 14.0-rc/fpm-alpine/cron.sh | 4 + 14.0-rc/fpm-alpine/entrypoint.sh | 132 ++++++++++++++++ 14.0-rc/fpm-alpine/upgrade.exclude | 4 + 14.0-rc/fpm/Dockerfile | 137 +++++++++++++++++ 14.0-rc/fpm/config/apcu.config.php | 4 + 14.0-rc/fpm/config/apps.config.php | 15 ++ 14.0-rc/fpm/config/autoconfig.php | 29 ++++ 14.0-rc/fpm/cron.sh | 4 + 14.0-rc/fpm/entrypoint.sh | 132 ++++++++++++++++ 14.0-rc/fpm/upgrade.exclude | 4 + 22 files changed, 972 insertions(+) create mode 100644 14.0-rc/apache/Dockerfile create mode 100644 14.0-rc/apache/config/apache-pretty-urls.config.php create mode 100644 14.0-rc/apache/config/apcu.config.php create mode 100644 14.0-rc/apache/config/apps.config.php create mode 100644 14.0-rc/apache/config/autoconfig.php create mode 100755 14.0-rc/apache/cron.sh create mode 100755 14.0-rc/apache/entrypoint.sh create mode 100644 14.0-rc/apache/upgrade.exclude create mode 100644 14.0-rc/fpm-alpine/Dockerfile create mode 100644 14.0-rc/fpm-alpine/config/apcu.config.php create mode 100644 14.0-rc/fpm-alpine/config/apps.config.php create mode 100644 14.0-rc/fpm-alpine/config/autoconfig.php create mode 100755 14.0-rc/fpm-alpine/cron.sh create mode 100755 14.0-rc/fpm-alpine/entrypoint.sh create mode 100644 14.0-rc/fpm-alpine/upgrade.exclude create mode 100644 14.0-rc/fpm/Dockerfile create mode 100644 14.0-rc/fpm/config/apcu.config.php create mode 100644 14.0-rc/fpm/config/apps.config.php create mode 100644 14.0-rc/fpm/config/autoconfig.php create mode 100755 14.0-rc/fpm/cron.sh create mode 100755 14.0-rc/fpm/entrypoint.sh create mode 100644 14.0-rc/fpm/upgrade.exclude diff --git a/14.0-rc/apache/Dockerfile b/14.0-rc/apache/Dockerfile new file mode 100644 index 00000000..3e9a3434 --- /dev/null +++ b/14.0-rc/apache/Dockerfile @@ -0,0 +1,145 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-apache-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.15; \ + pecl install memcached-3.0.4; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod rewrite remoteip ;\ + {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + } > /etc/apache2/conf-available/remoteip.conf;\ + a2enconf remoteip + +ENV NEXTCLOUD_VERSION 14.0.5RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/14.0-rc/apache/config/apache-pretty-urls.config.php b/14.0-rc/apache/config/apache-pretty-urls.config.php new file mode 100644 index 00000000..72da1d8c --- /dev/null +++ b/14.0-rc/apache/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/14.0-rc/apache/config/apcu.config.php b/14.0-rc/apache/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/14.0-rc/apache/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/14.0-rc/apache/config/apps.config.php b/14.0-rc/apache/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/14.0-rc/apache/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/14.0-rc/apache/config/autoconfig.php b/14.0-rc/apache/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/14.0-rc/apache/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/14.0-rc/apache/upgrade.exclude b/14.0-rc/apache/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/14.0-rc/apache/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/14.0-rc/fpm-alpine/Dockerfile b/14.0-rc/fpm-alpine/Dockerfile new file mode 100644 index 00000000..82dfd0f4 --- /dev/null +++ b/14.0-rc/fpm-alpine/Dockerfile @@ -0,0 +1,122 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template +FROM php:7.2-fpm-alpine3.8 + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + rsync \ + ; \ + \ + rm /var/spool/cron/crontabs/root; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + pcre-dev \ + postgresql-dev \ + imagemagick-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.15; \ + pecl install memcached-3.0.4; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 14.0.5RC1 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/14.0-rc/fpm-alpine/config/apcu.config.php b/14.0-rc/fpm-alpine/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/14.0-rc/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/14.0-rc/fpm-alpine/config/apps.config.php b/14.0-rc/fpm-alpine/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/14.0-rc/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/14.0-rc/fpm-alpine/config/autoconfig.php b/14.0-rc/fpm-alpine/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/14.0-rc/fpm-alpine/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/14.0-rc/fpm-alpine/upgrade.exclude b/14.0-rc/fpm-alpine/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/14.0-rc/fpm-alpine/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/14.0-rc/fpm/Dockerfile b/14.0-rc/fpm/Dockerfile new file mode 100644 index 00000000..c8b495d5 --- /dev/null +++ b/14.0-rc/fpm/Dockerfile @@ -0,0 +1,137 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-fpm-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.15; \ + pecl install memcached-3.0.4; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 14.0.5RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/14.0-rc/fpm/config/apcu.config.php b/14.0-rc/fpm/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/14.0-rc/fpm/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/14.0-rc/fpm/config/apps.config.php b/14.0-rc/fpm/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/14.0-rc/fpm/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/14.0-rc/fpm/config/autoconfig.php b/14.0-rc/fpm/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/14.0-rc/fpm/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/14.0-rc/fpm/upgrade.exclude b/14.0-rc/fpm/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/14.0-rc/fpm/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ From 7d262cbf9737f053f8ad0120a4a1f71fbd8f033a Mon Sep 17 00:00:00 2001 From: J0WI Date: Sun, 6 Jan 2019 23:57:41 +0100 Subject: [PATCH 10/67] Remove reference to line number Signed-off-by: J0WI --- .examples/README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.examples/README.md b/.examples/README.md index f2842d92..015ff53e 100644 --- a/.examples/README.md +++ b/.examples/README.md @@ -21,43 +21,43 @@ Example | Description ### full The `full` Dockerfile example adds dependencies for all optional packages suggested by nextcloud that may be needed for some features (e.g. Video Preview Generation), as stated in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html). -NOTE: The Dockerfile does not install the LibreOffice package (line is commented), because it would increase the generated Image size by approximately 500 MB. In order to install it, simply uncomment the 13th line of the Dockerfile. +NOTE: The Dockerfile does not install the LibreOffice package (line is commented), because it would increase the generated Image size by approximately 500 MB. In order to install it, simply uncomment the appropriate line in the Dockerfile. -NOTE: Per default, only previews for BMP, GIF, JPEG, MarkDown, MP3, PNG, TXT, and XBitmap Files are generated. The configuration of the preview generation can be done in config.php, as explained in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#previews) +NOTE: Per default, only previews for BMP, GIF, JPEG, MarkDown, MP3, PNG, TXT, and XBitmap Files are generated. The configuration of the preview generation can be done in config.php, as explained in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#previews) -NOTE: Nextcloud recommends [disabling preview generation](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html?highlight=enabledpreviewproviders#disable-preview-image-generation) for high security deployments, as preview generation opens your nextcloud instance to new possible attack vectors. +NOTE: Nextcloud recommends [disabling preview generation](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html?highlight=enabledpreviewproviders#disable-preview-image-generation) for high security deployments, as preview generation opens your nextcloud instance to new possible attack vectors. The required steps for each optional/recommended package that is not already in the Nextcloud image are listed here, so that the Dockerfile can easily be modified to only install the needed extra packages. Simply remove the steps for the unwanted packages from the Dockerfile. #### PHP Module bz2 -`docker-php-ext-install bz2` +`docker-php-ext-install bz2` #### PHP Module imap -`apt install libc-client-dev libkrb5-dev` -`docker-php-ext-configure imap --with-kerberos --with-imap-ssl` -`docker-php-ext-install imap` +`apt install libc-client-dev libkrb5-dev` +`docker-php-ext-configure imap --with-kerberos --with-imap-ssl` +`docker-php-ext-install imap` #### PHP Module gmp -`apt install libgmp3-dev` -`docker-php-ext-install gmp` +`apt install libgmp3-dev` +`docker-php-ext-install gmp` #### PHP Module smbclient -`apt install smbclient libsmbclient-dev` -`pecl install smbclient` -`docker-php-ext-enable smbclient` +`apt install smbclient libsmbclient-dev` +`pecl install smbclient` +`docker-php-ext-enable smbclient` #### ffmpeg -`apt install ffmpeg` +`apt install ffmpeg` #### LibreOffice -`apt install libreoffice` +`apt install libreoffice` #### CRON via supervisor -`apt install supervisor` -`mkdir /var/log/supervisord /var/run/supervisord` -The following Dockerfile commands are also necessary for a sucessfull cron installation: -`COPY supervisord.conf /etc/supervisor/supervisord.conf` -`CMD ["/usr/bin/supervisord"]` +`apt install supervisor` +`mkdir /var/log/supervisord /var/run/supervisord` +The following Dockerfile commands are also necessary for a sucessfull cron installation: +`COPY supervisord.conf /etc/supervisor/supervisord.conf` +`CMD ["/usr/bin/supervisord"]` From 89f64fe4482aa53ba7fa0a58f112e72806bdafa0 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Mon, 7 Jan 2019 00:07:59 +0100 Subject: [PATCH 11/67] Run update.sh Signed-off-by: Tilo Spannagel --- .travis.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6e36fdcd..c7bdc606 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,25 @@ jobs: - ./generate-stackbrew-library.sh - stage: test images - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 + env: VERSION=13.0-rc VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=13.0-rc VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=13.0-rc VARIANT=fpm ARCH=amd64 + - env: VERSION=13.0-rc VARIANT=fpm ARCH=i386 + - env: VERSION=13.0-rc VARIANT=apache ARCH=amd64 + - env: VERSION=13.0-rc VARIANT=apache ARCH=i386 + - env: VERSION=14.0-rc VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=14.0-rc VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=14.0-rc VARIANT=fpm ARCH=amd64 + - env: VERSION=14.0-rc VARIANT=fpm ARCH=i386 + - env: VERSION=14.0-rc VARIANT=apache ARCH=amd64 + - env: VERSION=14.0-rc VARIANT=apache ARCH=i386 + - env: VERSION=15.0-rc VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=15.0-rc VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=15.0-rc VARIANT=fpm ARCH=amd64 + - env: VERSION=15.0-rc VARIANT=fpm ARCH=i386 + - env: VERSION=15.0-rc VARIANT=apache ARCH=amd64 + - env: VERSION=15.0-rc VARIANT=apache ARCH=i386 + - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=i386 - env: VERSION=13.0 VARIANT=fpm ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm ARCH=i386 From 4db869636b4c44e331f0d910ae0ed7e734087700 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Wed, 9 Jan 2019 22:51:22 +0000 Subject: [PATCH 12/67] Update to 15.0.1RC2 --- 15.0-rc/apache/Dockerfile | 2 +- 15.0-rc/fpm-alpine/Dockerfile | 2 +- 15.0-rc/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/15.0-rc/apache/Dockerfile b/15.0-rc/apache/Dockerfile index bcadc21f..dc17a254 100644 --- a/15.0-rc/apache/Dockerfile +++ b/15.0-rc/apache/Dockerfile @@ -109,7 +109,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 15.0.1RC1 +ENV NEXTCLOUD_VERSION 15.0.1RC2 RUN set -ex; \ fetchDeps=" \ diff --git a/15.0-rc/fpm-alpine/Dockerfile b/15.0-rc/fpm-alpine/Dockerfile index 479ebfbe..6f88aa6e 100644 --- a/15.0-rc/fpm-alpine/Dockerfile +++ b/15.0-rc/fpm-alpine/Dockerfile @@ -90,7 +90,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.1RC1 +ENV NEXTCLOUD_VERSION 15.0.1RC2 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/15.0-rc/fpm/Dockerfile b/15.0-rc/fpm/Dockerfile index 8f532b9e..bdb400d9 100644 --- a/15.0-rc/fpm/Dockerfile +++ b/15.0-rc/fpm/Dockerfile @@ -101,7 +101,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.1RC1 +ENV NEXTCLOUD_VERSION 15.0.1RC2 RUN set -ex; \ fetchDeps=" \ From d3853330f55561f9026857400be0736c55e74ad6 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Wed, 9 Jan 2019 22:51:23 +0000 Subject: [PATCH 13/67] Update to 13.0.9RC2 --- 13.0-rc/apache/Dockerfile | 2 +- 13.0-rc/fpm-alpine/Dockerfile | 2 +- 13.0-rc/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/13.0-rc/apache/Dockerfile b/13.0-rc/apache/Dockerfile index 56a76b74..b94ab160 100644 --- a/13.0-rc/apache/Dockerfile +++ b/13.0-rc/apache/Dockerfile @@ -109,7 +109,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 13.0.9RC1 +ENV NEXTCLOUD_VERSION 13.0.9RC2 RUN set -ex; \ fetchDeps=" \ diff --git a/13.0-rc/fpm-alpine/Dockerfile b/13.0-rc/fpm-alpine/Dockerfile index e2de1cdb..8eabdcf4 100644 --- a/13.0-rc/fpm-alpine/Dockerfile +++ b/13.0-rc/fpm-alpine/Dockerfile @@ -90,7 +90,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 13.0.9RC1 +ENV NEXTCLOUD_VERSION 13.0.9RC2 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/13.0-rc/fpm/Dockerfile b/13.0-rc/fpm/Dockerfile index 2daa19b7..e5439ce4 100644 --- a/13.0-rc/fpm/Dockerfile +++ b/13.0-rc/fpm/Dockerfile @@ -101,7 +101,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 13.0.9RC1 +ENV NEXTCLOUD_VERSION 13.0.9RC2 RUN set -ex; \ fetchDeps=" \ From ce614ef0d4fbeda849e9d4242769c7d3e36289f4 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Wed, 9 Jan 2019 22:51:23 +0000 Subject: [PATCH 14/67] Update to 14.0.5RC2 --- 14.0-rc/apache/Dockerfile | 2 +- 14.0-rc/fpm-alpine/Dockerfile | 2 +- 14.0-rc/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/14.0-rc/apache/Dockerfile b/14.0-rc/apache/Dockerfile index 3e9a3434..aa62f660 100644 --- a/14.0-rc/apache/Dockerfile +++ b/14.0-rc/apache/Dockerfile @@ -109,7 +109,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 14.0.5RC1 +ENV NEXTCLOUD_VERSION 14.0.5RC2 RUN set -ex; \ fetchDeps=" \ diff --git a/14.0-rc/fpm-alpine/Dockerfile b/14.0-rc/fpm-alpine/Dockerfile index 82dfd0f4..cdca4682 100644 --- a/14.0-rc/fpm-alpine/Dockerfile +++ b/14.0-rc/fpm-alpine/Dockerfile @@ -90,7 +90,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.5RC1 +ENV NEXTCLOUD_VERSION 14.0.5RC2 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/14.0-rc/fpm/Dockerfile b/14.0-rc/fpm/Dockerfile index c8b495d5..a837018c 100644 --- a/14.0-rc/fpm/Dockerfile +++ b/14.0-rc/fpm/Dockerfile @@ -101,7 +101,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.5RC1 +ENV NEXTCLOUD_VERSION 14.0.5RC2 RUN set -ex; \ fetchDeps=" \ From 70cb6ed262e2cac6b9b4f5adbada52e28eb75cd4 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Thu, 10 Jan 2019 16:51:34 +0000 Subject: [PATCH 15/67] Update to 13.0.9 --- 13.0/apache/Dockerfile | 2 +- 13.0/fpm-alpine/Dockerfile | 2 +- 13.0/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/13.0/apache/Dockerfile b/13.0/apache/Dockerfile index 5c096bb4..355af907 100644 --- a/13.0/apache/Dockerfile +++ b/13.0/apache/Dockerfile @@ -109,7 +109,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 13.0.8 +ENV NEXTCLOUD_VERSION 13.0.9 RUN set -ex; \ fetchDeps=" \ diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index b2cb6b8c..58a214df 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -90,7 +90,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 13.0.8 +ENV NEXTCLOUD_VERSION 13.0.9 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile index ad42be59..0e33cd1f 100644 --- a/13.0/fpm/Dockerfile +++ b/13.0/fpm/Dockerfile @@ -101,7 +101,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 13.0.8 +ENV NEXTCLOUD_VERSION 13.0.9 RUN set -ex; \ fetchDeps=" \ From 9ecb0fb6d9912051bb26c1d883d013a5c8173fbf Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Thu, 10 Jan 2019 16:51:34 +0000 Subject: [PATCH 16/67] Update to 14.0.5 --- 14.0/apache/Dockerfile | 2 +- 14.0/fpm-alpine/Dockerfile | 2 +- 14.0/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/14.0/apache/Dockerfile b/14.0/apache/Dockerfile index 5db06fee..d2eb99f8 100644 --- a/14.0/apache/Dockerfile +++ b/14.0/apache/Dockerfile @@ -109,7 +109,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 14.0.4 +ENV NEXTCLOUD_VERSION 14.0.5 RUN set -ex; \ fetchDeps=" \ diff --git a/14.0/fpm-alpine/Dockerfile b/14.0/fpm-alpine/Dockerfile index d21cf51f..2d4b55a1 100644 --- a/14.0/fpm-alpine/Dockerfile +++ b/14.0/fpm-alpine/Dockerfile @@ -90,7 +90,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.4 +ENV NEXTCLOUD_VERSION 14.0.5 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/14.0/fpm/Dockerfile b/14.0/fpm/Dockerfile index 7b388db1..5491e623 100644 --- a/14.0/fpm/Dockerfile +++ b/14.0/fpm/Dockerfile @@ -101,7 +101,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.4 +ENV NEXTCLOUD_VERSION 14.0.5 RUN set -ex; \ fetchDeps=" \ From 5751ebc2a51faed2690aef52a80c490aac09a70d Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Thu, 10 Jan 2019 16:51:34 +0000 Subject: [PATCH 17/67] Update to 15.0.1 --- 15.0/apache/Dockerfile | 2 +- 15.0/fpm-alpine/Dockerfile | 2 +- 15.0/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 454842aa..79aa5c62 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -109,7 +109,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 15.0.0 +ENV NEXTCLOUD_VERSION 15.0.1 RUN set -ex; \ fetchDeps=" \ diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index d6ac2a2e..01de0270 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -90,7 +90,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.0 +ENV NEXTCLOUD_VERSION 15.0.1 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index 8cc1df2a..70e5ed22 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -101,7 +101,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.0 +ENV NEXTCLOUD_VERSION 15.0.1 RUN set -ex; \ fetchDeps=" \ From 2994c70264487f7a485f0a48b7748685196a964c Mon Sep 17 00:00:00 2001 From: J0WI Date: Fri, 11 Jan 2019 01:13:23 +0100 Subject: [PATCH 18/67] Run update.sh Signed-off-by: J0WI --- .travis.yml | 20 +-- 13.0-rc/apache/Dockerfile | 145 ------------------ .../config/apache-pretty-urls.config.php | 4 - 13.0-rc/apache/config/apcu.config.php | 4 - 13.0-rc/apache/config/apps.config.php | 15 -- 13.0-rc/apache/config/autoconfig.php | 29 ---- 13.0-rc/apache/cron.sh | 4 - 13.0-rc/apache/entrypoint.sh | 132 ---------------- 13.0-rc/apache/upgrade.exclude | 4 - 13.0-rc/fpm-alpine/Dockerfile | 122 --------------- 13.0-rc/fpm-alpine/config/apcu.config.php | 4 - 13.0-rc/fpm-alpine/config/apps.config.php | 15 -- 13.0-rc/fpm-alpine/config/autoconfig.php | 29 ---- 13.0-rc/fpm-alpine/cron.sh | 4 - 13.0-rc/fpm-alpine/entrypoint.sh | 132 ---------------- 13.0-rc/fpm-alpine/upgrade.exclude | 4 - 13.0-rc/fpm/Dockerfile | 137 ----------------- 13.0-rc/fpm/config/apcu.config.php | 4 - 13.0-rc/fpm/config/apps.config.php | 15 -- 13.0-rc/fpm/config/autoconfig.php | 29 ---- 13.0-rc/fpm/cron.sh | 4 - 13.0-rc/fpm/entrypoint.sh | 132 ---------------- 13.0-rc/fpm/upgrade.exclude | 4 - 14.0-rc/apache/Dockerfile | 145 ------------------ .../config/apache-pretty-urls.config.php | 4 - 14.0-rc/apache/config/apcu.config.php | 4 - 14.0-rc/apache/config/apps.config.php | 15 -- 14.0-rc/apache/config/autoconfig.php | 29 ---- 14.0-rc/apache/cron.sh | 4 - 14.0-rc/apache/entrypoint.sh | 132 ---------------- 14.0-rc/apache/upgrade.exclude | 4 - 14.0-rc/fpm-alpine/Dockerfile | 122 --------------- 14.0-rc/fpm-alpine/config/apcu.config.php | 4 - 14.0-rc/fpm-alpine/config/apps.config.php | 15 -- 14.0-rc/fpm-alpine/config/autoconfig.php | 29 ---- 14.0-rc/fpm-alpine/cron.sh | 4 - 14.0-rc/fpm-alpine/entrypoint.sh | 132 ---------------- 14.0-rc/fpm-alpine/upgrade.exclude | 4 - 14.0-rc/fpm/Dockerfile | 137 ----------------- 14.0-rc/fpm/config/apcu.config.php | 4 - 14.0-rc/fpm/config/apps.config.php | 15 -- 14.0-rc/fpm/config/autoconfig.php | 29 ---- 14.0-rc/fpm/cron.sh | 4 - 14.0-rc/fpm/entrypoint.sh | 132 ---------------- 14.0-rc/fpm/upgrade.exclude | 4 - 15.0-rc/apache/Dockerfile | 145 ------------------ .../config/apache-pretty-urls.config.php | 4 - 15.0-rc/apache/config/apcu.config.php | 4 - 15.0-rc/apache/config/apps.config.php | 15 -- 15.0-rc/apache/config/autoconfig.php | 29 ---- 15.0-rc/apache/cron.sh | 4 - 15.0-rc/apache/entrypoint.sh | 132 ---------------- 15.0-rc/apache/upgrade.exclude | 4 - 15.0-rc/fpm-alpine/Dockerfile | 122 --------------- 15.0-rc/fpm-alpine/config/apcu.config.php | 4 - 15.0-rc/fpm-alpine/config/apps.config.php | 15 -- 15.0-rc/fpm-alpine/config/autoconfig.php | 29 ---- 15.0-rc/fpm-alpine/cron.sh | 4 - 15.0-rc/fpm-alpine/entrypoint.sh | 132 ---------------- 15.0-rc/fpm-alpine/upgrade.exclude | 4 - 15.0-rc/fpm/Dockerfile | 137 ----------------- 15.0-rc/fpm/config/apcu.config.php | 4 - 15.0-rc/fpm/config/apps.config.php | 15 -- 15.0-rc/fpm/config/autoconfig.php | 29 ---- 15.0-rc/fpm/cron.sh | 4 - 15.0-rc/fpm/entrypoint.sh | 132 ---------------- 15.0-rc/fpm/upgrade.exclude | 4 - 67 files changed, 1 insertion(+), 2935 deletions(-) delete mode 100644 13.0-rc/apache/Dockerfile delete mode 100644 13.0-rc/apache/config/apache-pretty-urls.config.php delete mode 100644 13.0-rc/apache/config/apcu.config.php delete mode 100644 13.0-rc/apache/config/apps.config.php delete mode 100644 13.0-rc/apache/config/autoconfig.php delete mode 100755 13.0-rc/apache/cron.sh delete mode 100755 13.0-rc/apache/entrypoint.sh delete mode 100644 13.0-rc/apache/upgrade.exclude delete mode 100644 13.0-rc/fpm-alpine/Dockerfile delete mode 100644 13.0-rc/fpm-alpine/config/apcu.config.php delete mode 100644 13.0-rc/fpm-alpine/config/apps.config.php delete mode 100644 13.0-rc/fpm-alpine/config/autoconfig.php delete mode 100755 13.0-rc/fpm-alpine/cron.sh delete mode 100755 13.0-rc/fpm-alpine/entrypoint.sh delete mode 100644 13.0-rc/fpm-alpine/upgrade.exclude delete mode 100644 13.0-rc/fpm/Dockerfile delete mode 100644 13.0-rc/fpm/config/apcu.config.php delete mode 100644 13.0-rc/fpm/config/apps.config.php delete mode 100644 13.0-rc/fpm/config/autoconfig.php delete mode 100755 13.0-rc/fpm/cron.sh delete mode 100755 13.0-rc/fpm/entrypoint.sh delete mode 100644 13.0-rc/fpm/upgrade.exclude delete mode 100644 14.0-rc/apache/Dockerfile delete mode 100644 14.0-rc/apache/config/apache-pretty-urls.config.php delete mode 100644 14.0-rc/apache/config/apcu.config.php delete mode 100644 14.0-rc/apache/config/apps.config.php delete mode 100644 14.0-rc/apache/config/autoconfig.php delete mode 100755 14.0-rc/apache/cron.sh delete mode 100755 14.0-rc/apache/entrypoint.sh delete mode 100644 14.0-rc/apache/upgrade.exclude delete mode 100644 14.0-rc/fpm-alpine/Dockerfile delete mode 100644 14.0-rc/fpm-alpine/config/apcu.config.php delete mode 100644 14.0-rc/fpm-alpine/config/apps.config.php delete mode 100644 14.0-rc/fpm-alpine/config/autoconfig.php delete mode 100755 14.0-rc/fpm-alpine/cron.sh delete mode 100755 14.0-rc/fpm-alpine/entrypoint.sh delete mode 100644 14.0-rc/fpm-alpine/upgrade.exclude delete mode 100644 14.0-rc/fpm/Dockerfile delete mode 100644 14.0-rc/fpm/config/apcu.config.php delete mode 100644 14.0-rc/fpm/config/apps.config.php delete mode 100644 14.0-rc/fpm/config/autoconfig.php delete mode 100755 14.0-rc/fpm/cron.sh delete mode 100755 14.0-rc/fpm/entrypoint.sh delete mode 100644 14.0-rc/fpm/upgrade.exclude delete mode 100644 15.0-rc/apache/Dockerfile delete mode 100644 15.0-rc/apache/config/apache-pretty-urls.config.php delete mode 100644 15.0-rc/apache/config/apcu.config.php delete mode 100644 15.0-rc/apache/config/apps.config.php delete mode 100644 15.0-rc/apache/config/autoconfig.php delete mode 100755 15.0-rc/apache/cron.sh delete mode 100755 15.0-rc/apache/entrypoint.sh delete mode 100644 15.0-rc/apache/upgrade.exclude delete mode 100644 15.0-rc/fpm-alpine/Dockerfile delete mode 100644 15.0-rc/fpm-alpine/config/apcu.config.php delete mode 100644 15.0-rc/fpm-alpine/config/apps.config.php delete mode 100644 15.0-rc/fpm-alpine/config/autoconfig.php delete mode 100755 15.0-rc/fpm-alpine/cron.sh delete mode 100755 15.0-rc/fpm-alpine/entrypoint.sh delete mode 100644 15.0-rc/fpm-alpine/upgrade.exclude delete mode 100644 15.0-rc/fpm/Dockerfile delete mode 100644 15.0-rc/fpm/config/apcu.config.php delete mode 100644 15.0-rc/fpm/config/apps.config.php delete mode 100644 15.0-rc/fpm/config/autoconfig.php delete mode 100755 15.0-rc/fpm/cron.sh delete mode 100755 15.0-rc/fpm/entrypoint.sh delete mode 100644 15.0-rc/fpm/upgrade.exclude diff --git a/.travis.yml b/.travis.yml index c7bdc606..6e36fdcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,25 +50,7 @@ jobs: - ./generate-stackbrew-library.sh - stage: test images - env: VERSION=13.0-rc VARIANT=fpm-alpine ARCH=amd64 - - env: VERSION=13.0-rc VARIANT=fpm-alpine ARCH=i386 - - env: VERSION=13.0-rc VARIANT=fpm ARCH=amd64 - - env: VERSION=13.0-rc VARIANT=fpm ARCH=i386 - - env: VERSION=13.0-rc VARIANT=apache ARCH=amd64 - - env: VERSION=13.0-rc VARIANT=apache ARCH=i386 - - env: VERSION=14.0-rc VARIANT=fpm-alpine ARCH=amd64 - - env: VERSION=14.0-rc VARIANT=fpm-alpine ARCH=i386 - - env: VERSION=14.0-rc VARIANT=fpm ARCH=amd64 - - env: VERSION=14.0-rc VARIANT=fpm ARCH=i386 - - env: VERSION=14.0-rc VARIANT=apache ARCH=amd64 - - env: VERSION=14.0-rc VARIANT=apache ARCH=i386 - - env: VERSION=15.0-rc VARIANT=fpm-alpine ARCH=amd64 - - env: VERSION=15.0-rc VARIANT=fpm-alpine ARCH=i386 - - env: VERSION=15.0-rc VARIANT=fpm ARCH=amd64 - - env: VERSION=15.0-rc VARIANT=fpm ARCH=i386 - - env: VERSION=15.0-rc VARIANT=apache ARCH=amd64 - - env: VERSION=15.0-rc VARIANT=apache ARCH=i386 - - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 + env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=i386 - env: VERSION=13.0 VARIANT=fpm ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm ARCH=i386 diff --git a/13.0-rc/apache/Dockerfile b/13.0-rc/apache/Dockerfile deleted file mode 100644 index b94ab160..00000000 --- a/13.0-rc/apache/Dockerfile +++ /dev/null @@ -1,145 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-apache-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - -RUN a2enmod rewrite remoteip ;\ - {\ - echo RemoteIPHeader X-Real-IP ;\ - echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ - echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ - echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ - } > /etc/apache2/conf-available/remoteip.conf;\ - a2enconf remoteip - -ENV NEXTCLOUD_VERSION 13.0.9RC2 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] diff --git a/13.0-rc/apache/config/apache-pretty-urls.config.php b/13.0-rc/apache/config/apache-pretty-urls.config.php deleted file mode 100644 index 72da1d8c..00000000 --- a/13.0-rc/apache/config/apache-pretty-urls.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '/', -); diff --git a/13.0-rc/apache/config/apcu.config.php b/13.0-rc/apache/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/13.0-rc/apache/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/13.0-rc/apache/config/apps.config.php b/13.0-rc/apache/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/13.0-rc/apache/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/13.0-rc/apache/config/autoconfig.php b/13.0-rc/apache/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/13.0-rc/apache/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/13.0-rc/apache/upgrade.exclude b/13.0-rc/apache/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/13.0-rc/apache/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/13.0-rc/fpm-alpine/Dockerfile b/13.0-rc/fpm-alpine/Dockerfile deleted file mode 100644 index 8eabdcf4..00000000 --- a/13.0-rc/fpm-alpine/Dockerfile +++ /dev/null @@ -1,122 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apk add --no-cache \ - rsync \ - ; \ - \ - rm /var/spool/cron/crontabs/root; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - freetype-dev \ - icu-dev \ - libjpeg-turbo-dev \ - libmcrypt-dev \ - libpng-dev \ - libmemcached-dev \ - libxml2-dev \ - openldap-dev \ - pcre-dev \ - postgresql-dev \ - imagemagick-dev \ - ; \ - \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ - apk del .build-deps - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 13.0.9RC2 - -RUN set -ex; \ - apk add --no-cache --virtual .fetch-deps \ - bzip2 \ - gnupg \ - ; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - apk del .fetch-deps - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/13.0-rc/fpm-alpine/config/apcu.config.php b/13.0-rc/fpm-alpine/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/13.0-rc/fpm-alpine/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/13.0-rc/fpm-alpine/config/apps.config.php b/13.0-rc/fpm-alpine/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/13.0-rc/fpm-alpine/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/13.0-rc/fpm-alpine/config/autoconfig.php b/13.0-rc/fpm-alpine/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/13.0-rc/fpm-alpine/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/13.0-rc/fpm-alpine/upgrade.exclude b/13.0-rc/fpm-alpine/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/13.0-rc/fpm-alpine/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/13.0-rc/fpm/Dockerfile b/13.0-rc/fpm/Dockerfile deleted file mode 100644 index e5439ce4..00000000 --- a/13.0-rc/fpm/Dockerfile +++ /dev/null @@ -1,137 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-fpm-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 13.0.9RC2 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/13.0-rc/fpm/config/apcu.config.php b/13.0-rc/fpm/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/13.0-rc/fpm/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/13.0-rc/fpm/config/apps.config.php b/13.0-rc/fpm/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/13.0-rc/fpm/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/13.0-rc/fpm/config/autoconfig.php b/13.0-rc/fpm/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/13.0-rc/fpm/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/13.0-rc/fpm/upgrade.exclude b/13.0-rc/fpm/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/13.0-rc/fpm/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/14.0-rc/apache/Dockerfile b/14.0-rc/apache/Dockerfile deleted file mode 100644 index aa62f660..00000000 --- a/14.0-rc/apache/Dockerfile +++ /dev/null @@ -1,145 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-apache-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - -RUN a2enmod rewrite remoteip ;\ - {\ - echo RemoteIPHeader X-Real-IP ;\ - echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ - echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ - echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ - } > /etc/apache2/conf-available/remoteip.conf;\ - a2enconf remoteip - -ENV NEXTCLOUD_VERSION 14.0.5RC2 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] diff --git a/14.0-rc/apache/config/apache-pretty-urls.config.php b/14.0-rc/apache/config/apache-pretty-urls.config.php deleted file mode 100644 index 72da1d8c..00000000 --- a/14.0-rc/apache/config/apache-pretty-urls.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '/', -); diff --git a/14.0-rc/apache/config/apcu.config.php b/14.0-rc/apache/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/14.0-rc/apache/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/14.0-rc/apache/config/apps.config.php b/14.0-rc/apache/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/14.0-rc/apache/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/14.0-rc/apache/config/autoconfig.php b/14.0-rc/apache/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/14.0-rc/apache/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/14.0-rc/apache/upgrade.exclude b/14.0-rc/apache/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/14.0-rc/apache/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/14.0-rc/fpm-alpine/Dockerfile b/14.0-rc/fpm-alpine/Dockerfile deleted file mode 100644 index cdca4682..00000000 --- a/14.0-rc/fpm-alpine/Dockerfile +++ /dev/null @@ -1,122 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apk add --no-cache \ - rsync \ - ; \ - \ - rm /var/spool/cron/crontabs/root; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - freetype-dev \ - icu-dev \ - libjpeg-turbo-dev \ - libmcrypt-dev \ - libpng-dev \ - libmemcached-dev \ - libxml2-dev \ - openldap-dev \ - pcre-dev \ - postgresql-dev \ - imagemagick-dev \ - ; \ - \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ - apk del .build-deps - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 14.0.5RC2 - -RUN set -ex; \ - apk add --no-cache --virtual .fetch-deps \ - bzip2 \ - gnupg \ - ; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - apk del .fetch-deps - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/14.0-rc/fpm-alpine/config/apcu.config.php b/14.0-rc/fpm-alpine/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/14.0-rc/fpm-alpine/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/14.0-rc/fpm-alpine/config/apps.config.php b/14.0-rc/fpm-alpine/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/14.0-rc/fpm-alpine/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/14.0-rc/fpm-alpine/config/autoconfig.php b/14.0-rc/fpm-alpine/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/14.0-rc/fpm-alpine/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/14.0-rc/fpm-alpine/upgrade.exclude b/14.0-rc/fpm-alpine/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/14.0-rc/fpm-alpine/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/14.0-rc/fpm/Dockerfile b/14.0-rc/fpm/Dockerfile deleted file mode 100644 index a837018c..00000000 --- a/14.0-rc/fpm/Dockerfile +++ /dev/null @@ -1,137 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-fpm-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 14.0.5RC2 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/14.0-rc/fpm/config/apcu.config.php b/14.0-rc/fpm/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/14.0-rc/fpm/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/14.0-rc/fpm/config/apps.config.php b/14.0-rc/fpm/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/14.0-rc/fpm/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/14.0-rc/fpm/config/autoconfig.php b/14.0-rc/fpm/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/14.0-rc/fpm/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/14.0-rc/fpm/upgrade.exclude b/14.0-rc/fpm/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/14.0-rc/fpm/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/15.0-rc/apache/Dockerfile b/15.0-rc/apache/Dockerfile deleted file mode 100644 index dc17a254..00000000 --- a/15.0-rc/apache/Dockerfile +++ /dev/null @@ -1,145 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-apache-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - -RUN a2enmod rewrite remoteip ;\ - {\ - echo RemoteIPHeader X-Real-IP ;\ - echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ - echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ - echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ - } > /etc/apache2/conf-available/remoteip.conf;\ - a2enconf remoteip - -ENV NEXTCLOUD_VERSION 15.0.1RC2 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] diff --git a/15.0-rc/apache/config/apache-pretty-urls.config.php b/15.0-rc/apache/config/apache-pretty-urls.config.php deleted file mode 100644 index 72da1d8c..00000000 --- a/15.0-rc/apache/config/apache-pretty-urls.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '/', -); diff --git a/15.0-rc/apache/config/apcu.config.php b/15.0-rc/apache/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/15.0-rc/apache/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/15.0-rc/apache/config/apps.config.php b/15.0-rc/apache/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/15.0-rc/apache/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/15.0-rc/apache/config/autoconfig.php b/15.0-rc/apache/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/15.0-rc/apache/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/15.0-rc/apache/upgrade.exclude b/15.0-rc/apache/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/15.0-rc/apache/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/15.0-rc/fpm-alpine/Dockerfile b/15.0-rc/fpm-alpine/Dockerfile deleted file mode 100644 index 6f88aa6e..00000000 --- a/15.0-rc/fpm-alpine/Dockerfile +++ /dev/null @@ -1,122 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apk add --no-cache \ - rsync \ - ; \ - \ - rm /var/spool/cron/crontabs/root; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - freetype-dev \ - icu-dev \ - libjpeg-turbo-dev \ - libmcrypt-dev \ - libpng-dev \ - libmemcached-dev \ - libxml2-dev \ - openldap-dev \ - pcre-dev \ - postgresql-dev \ - imagemagick-dev \ - ; \ - \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ - apk del .build-deps - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 15.0.1RC2 - -RUN set -ex; \ - apk add --no-cache --virtual .fetch-deps \ - bzip2 \ - gnupg \ - ; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - apk del .fetch-deps - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/15.0-rc/fpm-alpine/config/apcu.config.php b/15.0-rc/fpm-alpine/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/15.0-rc/fpm-alpine/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/15.0-rc/fpm-alpine/config/apps.config.php b/15.0-rc/fpm-alpine/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/15.0-rc/fpm-alpine/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/15.0-rc/fpm-alpine/config/autoconfig.php b/15.0-rc/fpm-alpine/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/15.0-rc/fpm-alpine/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/15.0-rc/fpm-alpine/upgrade.exclude b/15.0-rc/fpm-alpine/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/15.0-rc/fpm-alpine/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/15.0-rc/fpm/Dockerfile b/15.0-rc/fpm/Dockerfile deleted file mode 100644 index bdb400d9..00000000 --- a/15.0-rc/fpm/Dockerfile +++ /dev/null @@ -1,137 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-fpm-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 15.0.1RC2 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/15.0-rc/fpm/config/apcu.config.php b/15.0-rc/fpm/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/15.0-rc/fpm/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/15.0-rc/fpm/config/apps.config.php b/15.0-rc/fpm/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/15.0-rc/fpm/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/15.0-rc/fpm/config/autoconfig.php b/15.0-rc/fpm/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/15.0-rc/fpm/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/15.0-rc/fpm/upgrade.exclude b/15.0-rc/fpm/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/15.0-rc/fpm/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ From 9ecaf51c4f34a53c2a2f82b55af50777b1900366 Mon Sep 17 00:00:00 2001 From: J0WI Date: Tue, 11 Dec 2018 00:07:49 +0100 Subject: [PATCH 19/67] Use PHP 7.3 for NC 15 Signed-off-by: J0WI --- 15.0/apache/Dockerfile | 3 ++- 15.0/fpm-alpine/Dockerfile | 3 ++- 15.0/fpm/Dockerfile | 3 ++- Dockerfile-alpine.template | 1 + Dockerfile-debian.template | 1 + update.sh | 11 +++++++++-- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 79aa5c62..57ae0a21 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-apache-stretch +FROM php:7.3-apache-stretch # entrypoint.sh and cron.sh dependencies RUN set -ex; \ @@ -34,6 +34,7 @@ RUN set -ex; \ libpq-dev \ libxml2-dev \ libmagickwand-dev \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index 01de0270..70355541 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 +FROM php:7.3-fpm-alpine3.8 # entrypoint.sh and cron.sh dependencies RUN set -ex; \ @@ -25,6 +25,7 @@ RUN set -ex; \ libpng-dev \ libmemcached-dev \ libxml2-dev \ + libzip-dev \ openldap-dev \ pcre-dev \ postgresql-dev \ diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index 70e5ed22..ee5e7ac6 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-fpm-stretch +FROM php:7.3-fpm-stretch # entrypoint.sh and cron.sh dependencies RUN set -ex; \ @@ -34,6 +34,7 @@ RUN set -ex; \ libpq-dev \ libxml2-dev \ libmagickwand-dev \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 4d282f54..af584b5e 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -24,6 +24,7 @@ RUN set -ex; \ libpng-dev \ libmemcached-dev \ libxml2-dev \ + libzip-dev \ openldap-dev \ pcre-dev \ postgresql-dev \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index d10ae367..1b264823 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -33,6 +33,7 @@ RUN set -ex; \ libpq-dev \ libxml2-dev \ libmagickwand-dev \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ diff --git a/update.sh b/update.sh index 8a323635..26e54424 100755 --- a/update.sh +++ b/update.sh @@ -3,7 +3,7 @@ set -eo pipefail declare -A php_version=( [default]='7.2' - [12.0]='7.1' + [15.0]='7.3' ) declare -A cmd=( @@ -58,6 +58,7 @@ travisEnv= function create_variant() { dir="$1/$variant" + phpVersion=${php_version[$version]-${php_version[default]}} # Create the version+variant directory with a Dockerfile. mkdir -p "$dir" @@ -70,7 +71,7 @@ function create_variant() { # Replace the variables. sed -ri -e ' - s/%%PHP_VERSION%%/'"${php_version[$version]-${php_version[default]}}"'/g; + s/%%PHP_VERSION%%/'"$phpVersion"'/g; s/%%VARIANT%%/'"$variant"'/g; s/%%VERSION%%/'"$fullversion"'/g; s/%%BASE_DOWNLOAD_URL%%/'"$2"'/g; @@ -82,6 +83,12 @@ function create_variant() { s/%%IMAGICK_VERSION%%/'"${pecl_versions[imagick]}"'/g; ' "$dir/Dockerfile" + if [[ "$phpVersion" != 7.3 ]]; then + sed -ri \ + -e '/libzip-dev/d' \ + "$dir/Dockerfile" + fi + # Copy the shell scripts for name in entrypoint cron; do cp "docker-$name.sh" "$dir/$name.sh" From 5bd47f81594091fb61a74f8c07eaf2d1331f01f7 Mon Sep 17 00:00:00 2001 From: J0WI Date: Sat, 22 Dec 2018 17:14:05 +0100 Subject: [PATCH 20/67] Update php-memcached to 3.1.2 and APCu to 5.1.16 Signed-off-by: J0WI --- 13.0/apache/Dockerfile | 5 +++-- 13.0/fpm-alpine/Dockerfile | 5 +++-- 13.0/fpm/Dockerfile | 5 +++-- 14.0/apache/Dockerfile | 5 +++-- 14.0/fpm-alpine/Dockerfile | 5 +++-- 14.0/fpm/Dockerfile | 5 +++-- 15.0/apache/Dockerfile | 5 +++-- 15.0/fpm-alpine/Dockerfile | 5 +++-- 15.0/fpm/Dockerfile | 5 +++-- Dockerfile-alpine.template | 1 + Dockerfile-debian.template | 1 + update.sh | 4 ++-- 12 files changed, 31 insertions(+), 20 deletions(-) diff --git a/13.0/apache/Dockerfile b/13.0/apache/Dockerfile index 355af907..bde3ca46 100644 --- a/13.0/apache/Dockerfile +++ b/13.0/apache/Dockerfile @@ -24,6 +24,7 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ + libevent-dev \ libfreetype6-dev \ libicu-dev \ libjpeg-dev \ @@ -52,8 +53,8 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.2; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index 58a214df..6eb98241 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -20,6 +20,7 @@ RUN set -ex; \ autoconf \ freetype-dev \ icu-dev \ + libevent-dev \ libjpeg-turbo-dev \ libmcrypt-dev \ libpng-dev \ @@ -46,8 +47,8 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.2; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile index 0e33cd1f..080eb7d3 100644 --- a/13.0/fpm/Dockerfile +++ b/13.0/fpm/Dockerfile @@ -24,6 +24,7 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ + libevent-dev \ libfreetype6-dev \ libicu-dev \ libjpeg-dev \ @@ -52,8 +53,8 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.2; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/14.0/apache/Dockerfile b/14.0/apache/Dockerfile index d2eb99f8..64ed7f0c 100644 --- a/14.0/apache/Dockerfile +++ b/14.0/apache/Dockerfile @@ -24,6 +24,7 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ + libevent-dev \ libfreetype6-dev \ libicu-dev \ libjpeg-dev \ @@ -52,8 +53,8 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.2; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/14.0/fpm-alpine/Dockerfile b/14.0/fpm-alpine/Dockerfile index 2d4b55a1..5c3d8040 100644 --- a/14.0/fpm-alpine/Dockerfile +++ b/14.0/fpm-alpine/Dockerfile @@ -20,6 +20,7 @@ RUN set -ex; \ autoconf \ freetype-dev \ icu-dev \ + libevent-dev \ libjpeg-turbo-dev \ libmcrypt-dev \ libpng-dev \ @@ -46,8 +47,8 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.2; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/14.0/fpm/Dockerfile b/14.0/fpm/Dockerfile index 5491e623..a547b05f 100644 --- a/14.0/fpm/Dockerfile +++ b/14.0/fpm/Dockerfile @@ -24,6 +24,7 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ + libevent-dev \ libfreetype6-dev \ libicu-dev \ libjpeg-dev \ @@ -52,8 +53,8 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.2; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 57ae0a21..0f4ed34c 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -24,6 +24,7 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ + libevent-dev \ libfreetype6-dev \ libicu-dev \ libjpeg-dev \ @@ -53,8 +54,8 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.2; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index 70355541..40183188 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -20,6 +20,7 @@ RUN set -ex; \ autoconf \ freetype-dev \ icu-dev \ + libevent-dev \ libjpeg-turbo-dev \ libmcrypt-dev \ libpng-dev \ @@ -47,8 +48,8 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.2; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index ee5e7ac6..b2d17da1 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -24,6 +24,7 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ + libevent-dev \ libfreetype6-dev \ libicu-dev \ libjpeg-dev \ @@ -53,8 +54,8 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.15; \ - pecl install memcached-3.0.4; \ + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.2; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index af584b5e..6b92d863 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -19,6 +19,7 @@ RUN set -ex; \ autoconf \ freetype-dev \ icu-dev \ + libevent-dev \ libjpeg-turbo-dev \ libmcrypt-dev \ libpng-dev \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 1b264823..c4c01814 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -23,6 +23,7 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ + libevent-dev \ libfreetype6-dev \ libicu-dev \ libjpeg-dev \ diff --git a/update.sh b/update.sh index 26e54424..16cea76c 100755 --- a/update.sh +++ b/update.sh @@ -25,8 +25,8 @@ declare -A extras=( ) declare -A pecl_versions=( - [APCu]='5.1.15' - [memcached]='3.0.4' + [APCu]='5.1.16' + [memcached]='3.1.2' [redis]='4.2.0' [imagick]='3.4.3' ) From 06c299ce5b584f6af531d35e55ef9c1e2e2490b9 Mon Sep 17 00:00:00 2001 From: J0WI Date: Sat, 5 Jan 2019 17:43:42 +0100 Subject: [PATCH 21/67] Update memcached to 3.1.3 Signed-off-by: J0WI --- 13.0/apache/Dockerfile | 2 +- 13.0/fpm-alpine/Dockerfile | 2 +- 13.0/fpm/Dockerfile | 2 +- 14.0/apache/Dockerfile | 2 +- 14.0/fpm-alpine/Dockerfile | 2 +- 14.0/fpm/Dockerfile | 2 +- 15.0/apache/Dockerfile | 2 +- 15.0/fpm-alpine/Dockerfile | 2 +- 15.0/fpm/Dockerfile | 2 +- update.sh | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/13.0/apache/Dockerfile b/13.0/apache/Dockerfile index bde3ca46..17a42dc4 100644 --- a/13.0/apache/Dockerfile +++ b/13.0/apache/Dockerfile @@ -54,7 +54,7 @@ RUN set -ex; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.16; \ - pecl install memcached-3.1.2; \ + pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index 6eb98241..d5ddd23f 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -48,7 +48,7 @@ RUN set -ex; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.16; \ - pecl install memcached-3.1.2; \ + pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile index 080eb7d3..2199ad5b 100644 --- a/13.0/fpm/Dockerfile +++ b/13.0/fpm/Dockerfile @@ -54,7 +54,7 @@ RUN set -ex; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.16; \ - pecl install memcached-3.1.2; \ + pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/14.0/apache/Dockerfile b/14.0/apache/Dockerfile index 64ed7f0c..d049dd7d 100644 --- a/14.0/apache/Dockerfile +++ b/14.0/apache/Dockerfile @@ -54,7 +54,7 @@ RUN set -ex; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.16; \ - pecl install memcached-3.1.2; \ + pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/14.0/fpm-alpine/Dockerfile b/14.0/fpm-alpine/Dockerfile index 5c3d8040..29fc9671 100644 --- a/14.0/fpm-alpine/Dockerfile +++ b/14.0/fpm-alpine/Dockerfile @@ -48,7 +48,7 @@ RUN set -ex; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.16; \ - pecl install memcached-3.1.2; \ + pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/14.0/fpm/Dockerfile b/14.0/fpm/Dockerfile index a547b05f..81f13f36 100644 --- a/14.0/fpm/Dockerfile +++ b/14.0/fpm/Dockerfile @@ -54,7 +54,7 @@ RUN set -ex; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.16; \ - pecl install memcached-3.1.2; \ + pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 0f4ed34c..f007010e 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -55,7 +55,7 @@ RUN set -ex; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.16; \ - pecl install memcached-3.1.2; \ + pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index 40183188..7a66f38a 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -49,7 +49,7 @@ RUN set -ex; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.16; \ - pecl install memcached-3.1.2; \ + pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index b2d17da1..3eea2541 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -55,7 +55,7 @@ RUN set -ex; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.16; \ - pecl install memcached-3.1.2; \ + pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ \ diff --git a/update.sh b/update.sh index 16cea76c..9b6149d7 100755 --- a/update.sh +++ b/update.sh @@ -26,7 +26,7 @@ declare -A extras=( declare -A pecl_versions=( [APCu]='5.1.16' - [memcached]='3.1.2' + [memcached]='3.1.3' [redis]='4.2.0' [imagick]='3.4.3' ) From 442510be73733cc65b0dd3b7552e4b7b1c1e125c Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Fri, 11 Jan 2019 16:51:27 +0000 Subject: [PATCH 22/67] Update to 13.0.10 --- 13.0/apache/Dockerfile | 2 +- 13.0/fpm-alpine/Dockerfile | 2 +- 13.0/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/13.0/apache/Dockerfile b/13.0/apache/Dockerfile index 355af907..3b3ef9e9 100644 --- a/13.0/apache/Dockerfile +++ b/13.0/apache/Dockerfile @@ -109,7 +109,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 13.0.9 +ENV NEXTCLOUD_VERSION 13.0.10 RUN set -ex; \ fetchDeps=" \ diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index 58a214df..7461ea09 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -90,7 +90,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 13.0.9 +ENV NEXTCLOUD_VERSION 13.0.10 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile index 0e33cd1f..3ea4481e 100644 --- a/13.0/fpm/Dockerfile +++ b/13.0/fpm/Dockerfile @@ -101,7 +101,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 13.0.9 +ENV NEXTCLOUD_VERSION 13.0.10 RUN set -ex; \ fetchDeps=" \ From 48f9b58e6f8b6fb0473a244718f8a9623b5be80e Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Fri, 11 Jan 2019 16:51:27 +0000 Subject: [PATCH 23/67] Update to 14.0.6 --- 14.0/apache/Dockerfile | 2 +- 14.0/fpm-alpine/Dockerfile | 2 +- 14.0/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/14.0/apache/Dockerfile b/14.0/apache/Dockerfile index d2eb99f8..5533e2f6 100644 --- a/14.0/apache/Dockerfile +++ b/14.0/apache/Dockerfile @@ -109,7 +109,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 14.0.5 +ENV NEXTCLOUD_VERSION 14.0.6 RUN set -ex; \ fetchDeps=" \ diff --git a/14.0/fpm-alpine/Dockerfile b/14.0/fpm-alpine/Dockerfile index 2d4b55a1..66aec993 100644 --- a/14.0/fpm-alpine/Dockerfile +++ b/14.0/fpm-alpine/Dockerfile @@ -90,7 +90,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.5 +ENV NEXTCLOUD_VERSION 14.0.6 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/14.0/fpm/Dockerfile b/14.0/fpm/Dockerfile index 5491e623..d7b0edb2 100644 --- a/14.0/fpm/Dockerfile +++ b/14.0/fpm/Dockerfile @@ -101,7 +101,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.5 +ENV NEXTCLOUD_VERSION 14.0.6 RUN set -ex; \ fetchDeps=" \ From 11a6e693713815014c5683ca5006697a69650fb1 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Fri, 11 Jan 2019 16:51:27 +0000 Subject: [PATCH 24/67] Update to 15.0.2 --- 15.0/apache/Dockerfile | 2 +- 15.0/fpm-alpine/Dockerfile | 2 +- 15.0/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 79aa5c62..7c50375d 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -109,7 +109,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 15.0.1 +ENV NEXTCLOUD_VERSION 15.0.2 RUN set -ex; \ fetchDeps=" \ diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index 01de0270..f71d5f9e 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -90,7 +90,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.1 +ENV NEXTCLOUD_VERSION 15.0.2 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index 70e5ed22..c8dc904f 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -101,7 +101,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.1 +ENV NEXTCLOUD_VERSION 15.0.2 RUN set -ex; \ fetchDeps=" \ From 57b9193096b8404e7982928c977e1f0bf32f3d51 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Fri, 11 Jan 2019 18:20:38 +0100 Subject: [PATCH 25/67] Update stable tag to 14.0.6 Signed-off-by: Tilo Spannagel --- generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 3e72a0c8..d3c86b28 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -3,7 +3,7 @@ set -Eeuo pipefail declare -A release_channel=( [production]='13.0.8' - [stable]='14.0.4' + [stable]='14.0.6' ) self="$(basename "$BASH_SOURCE")" From 46c774cd8ccc83602116519a19526e479b3cf2a6 Mon Sep 17 00:00:00 2001 From: J0WI Date: Mon, 14 Jan 2019 17:10:19 +0100 Subject: [PATCH 26/67] Set default PHP version to 7.3 Signed-off-by: J0WI --- update.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/update.sh b/update.sh index 9b6149d7..31dd6182 100755 --- a/update.sh +++ b/update.sh @@ -2,8 +2,9 @@ set -eo pipefail declare -A php_version=( - [default]='7.2' - [15.0]='7.3' + [default]='7.3' + [14.0]='7.2' + [13.0]='7.2' ) declare -A cmd=( From 5f8fa19f04cb550993c5e470581d074aa8d05c63 Mon Sep 17 00:00:00 2001 From: J0WI Date: Mon, 14 Jan 2019 19:06:00 +0100 Subject: [PATCH 27/67] Remove man dir from examples Signed-off-by: J0WI --- .examples/dockerfiles/full/apache/Dockerfile | 1 - .examples/dockerfiles/full/fpm-alpine/Dockerfile | 1 - .examples/dockerfiles/full/fpm/Dockerfile | 1 - 3 files changed, 3 deletions(-) diff --git a/.examples/dockerfiles/full/apache/Dockerfile b/.examples/dockerfiles/full/apache/Dockerfile index fe82de23..4ddcea8e 100644 --- a/.examples/dockerfiles/full/apache/Dockerfile +++ b/.examples/dockerfiles/full/apache/Dockerfile @@ -49,7 +49,6 @@ RUN set -ex; \ rm -rf /var/lib/apt/lists/* RUN mkdir -p \ - /usr/share/man/man1 \ /var/log/supervisord \ /var/run/supervisord \ ; diff --git a/.examples/dockerfiles/full/fpm-alpine/Dockerfile b/.examples/dockerfiles/full/fpm-alpine/Dockerfile index bfcb263a..716b32ff 100644 --- a/.examples/dockerfiles/full/fpm-alpine/Dockerfile +++ b/.examples/dockerfiles/full/fpm-alpine/Dockerfile @@ -40,7 +40,6 @@ RUN set -ex; \ apk del .build-deps RUN mkdir -p \ - /usr/share/man/man1 \ /var/log/supervisord \ /var/run/supervisord \ ; diff --git a/.examples/dockerfiles/full/fpm/Dockerfile b/.examples/dockerfiles/full/fpm/Dockerfile index 3e53e597..deab8d8b 100644 --- a/.examples/dockerfiles/full/fpm/Dockerfile +++ b/.examples/dockerfiles/full/fpm/Dockerfile @@ -49,7 +49,6 @@ RUN set -ex; \ rm -rf /var/lib/apt/lists/* RUN mkdir -p \ - /usr/share/man/man1 \ /var/log/supervisord \ /var/run/supervisord \ ; From d06375a333380d97db61ef4816334cebf634b214 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Thu, 17 Jan 2019 13:42:00 +0100 Subject: [PATCH 28/67] Switch back to php 7.2 Signed-off-by: Tilo Spannagel --- update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.sh b/update.sh index 31dd6182..12db63dd 100755 --- a/update.sh +++ b/update.sh @@ -2,7 +2,7 @@ set -eo pipefail declare -A php_version=( - [default]='7.3' + [default]='7.2' [14.0]='7.2' [13.0]='7.2' ) From d8d9a17be25ea0b3acd34914065cb1f085d36ec6 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Thu, 17 Jan 2019 13:43:13 +0100 Subject: [PATCH 29/67] Run update.sh Signed-off-by: Tilo Spannagel --- 15.0/apache/Dockerfile | 3 +-- 15.0/fpm-alpine/Dockerfile | 3 +-- 15.0/fpm/Dockerfile | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 5fad6022..09e87842 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.3-apache-stretch +FROM php:7.2-apache-stretch # entrypoint.sh and cron.sh dependencies RUN set -ex; \ @@ -35,7 +35,6 @@ RUN set -ex; \ libpq-dev \ libxml2-dev \ libmagickwand-dev \ - libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index cdc04ec2..1e5b23fa 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.3-fpm-alpine3.8 +FROM php:7.2-fpm-alpine3.8 # entrypoint.sh and cron.sh dependencies RUN set -ex; \ @@ -26,7 +26,6 @@ RUN set -ex; \ libpng-dev \ libmemcached-dev \ libxml2-dev \ - libzip-dev \ openldap-dev \ pcre-dev \ postgresql-dev \ diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index 59877ab2..0e6ffcd1 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.3-fpm-stretch +FROM php:7.2-fpm-stretch # entrypoint.sh and cron.sh dependencies RUN set -ex; \ @@ -35,7 +35,6 @@ RUN set -ex; \ libpq-dev \ libxml2-dev \ libmagickwand-dev \ - libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ From b3d324f986764ec68184e9deb039f28db73e6c2f Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Mon, 21 Jan 2019 15:44:12 +0100 Subject: [PATCH 30/67] Ship 14.0.6 on production channel See: https://github.com/nextcloud/updater_server/pull/182 Signed-off-by: Tilo Spannagel --- generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index d3c86b28..ef9e7599 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -2,7 +2,7 @@ set -Eeuo pipefail declare -A release_channel=( - [production]='13.0.8' + [production]='14.0.6' [stable]='14.0.6' ) From f3524791d9b8082fe244e5d5d9e2b744f187937e Mon Sep 17 00:00:00 2001 From: Nico Kaiser Date: Wed, 19 Dec 2018 12:39:06 +0100 Subject: [PATCH 31/67] Fix woff2 files in nginx examples Since some versions of Nextcloud, fonts are served as woff2, which is not forwarded to index.php by the supplied nginx.conf. This leads to nginx returning the dynamic index page instead of the static fonts. Signed-off-by: Nico Kaiser --- .../with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/nginx.conf | 2 +- .../with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf | 2 +- .../docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf | 2 +- .../docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/nginx.conf index 26660646..eca9db99 100644 --- a/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/nginx.conf @@ -125,7 +125,7 @@ http { # Adding the cache control header for js and css files # Make sure it is BELOW the PHP block - location ~ \.(?:css|js|woff|svg|gif)$ { + location ~ \.(?:css|js|woff2?|svg|gif)$ { try_files $uri /index.php$request_uri; add_header Cache-Control "public, max-age=15778463"; # Add headers to serve security related headers (It is intended to diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf index 26660646..eca9db99 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf @@ -125,7 +125,7 @@ http { # Adding the cache control header for js and css files # Make sure it is BELOW the PHP block - location ~ \.(?:css|js|woff|svg|gif)$ { + location ~ \.(?:css|js|woff2?|svg|gif)$ { try_files $uri /index.php$request_uri; add_header Cache-Control "public, max-age=15778463"; # Add headers to serve security related headers (It is intended to diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf index 26660646..eca9db99 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf @@ -125,7 +125,7 @@ http { # Adding the cache control header for js and css files # Make sure it is BELOW the PHP block - location ~ \.(?:css|js|woff|svg|gif)$ { + location ~ \.(?:css|js|woff2?|svg|gif)$ { try_files $uri /index.php$request_uri; add_header Cache-Control "public, max-age=15778463"; # Add headers to serve security related headers (It is intended to diff --git a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf index 26660646..eca9db99 100644 --- a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf @@ -125,7 +125,7 @@ http { # Adding the cache control header for js and css files # Make sure it is BELOW the PHP block - location ~ \.(?:css|js|woff|svg|gif)$ { + location ~ \.(?:css|js|woff2?|svg|gif)$ { try_files $uri /index.php$request_uri; add_header Cache-Control "public, max-age=15778463"; # Add headers to serve security related headers (It is intended to From f081d3864d7b0acd0558dceacc173a3b48100246 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Mon, 21 Jan 2019 17:00:22 +0100 Subject: [PATCH 32/67] Ship 15.0.2 on stable channel (#615) See: https://github.com/nextcloud/updater_server/pull/183 Signed-off-by: Tilo Spannagel --- generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index ef9e7599..461f6cb1 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -2,8 +2,8 @@ set -Eeuo pipefail declare -A release_channel=( + [stable]='15.0.2' [production]='14.0.6' - [stable]='14.0.6' ) self="$(basename "$BASH_SOURCE")" From ba4c1359b96a34f9945e5541232223a7ab1a6ce0 Mon Sep 17 00:00:00 2001 From: marceljd Date: Fri, 11 Jan 2019 08:56:57 +0000 Subject: [PATCH 33/67] set redis environment variables Signed-off-by: marceljd --- .config/redis.config.php | 12 ++++++++++++ README.md | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 .config/redis.config.php diff --git a/.config/redis.config.php b/.config/redis.config.php new file mode 100644 index 00000000..d300dd0a --- /dev/null +++ b/.config/redis.config.php @@ -0,0 +1,12 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT') ?: 6379, + ), + ); +} + diff --git a/README.md b/README.md index 8e4c168d..06189890 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,10 @@ The install and update script is only triggered when a default command is used ( - `NEXTCLOUD_UPDATE` (default: _0_) +If you want to use Redis you have to create a seperate [Redis](https://hub.docker.com/_/redis/) container in your setup / in your docker-compose file. To inform Nextcloud about the Redis container add: + +- 'REDIS_HOST' (not set by default) Name of Redis container +- 'REDIS_PORT' (optional, default:_6379_) Port number of Redis container. Use only if you use a non-standard port. # Running this image with docker-compose From f2ee88d352f945d773e3b76ffceb2d33d9d1973f Mon Sep 17 00:00:00 2001 From: marceljd Date: Fri, 11 Jan 2019 08:59:08 +0000 Subject: [PATCH 34/67] set redis environment variables Signed-off-by: marceljd --- 13.0/apache/config/redis.config.php | 12 ++++++++++++ 13.0/fpm-alpine/config/redis.config.php | 12 ++++++++++++ 13.0/fpm/config/redis.config.php | 12 ++++++++++++ 14.0/apache/config/redis.config.php | 12 ++++++++++++ 14.0/fpm-alpine/config/redis.config.php | 12 ++++++++++++ 14.0/fpm/config/redis.config.php | 12 ++++++++++++ 15.0/apache/config/redis.config.php | 12 ++++++++++++ 15.0/fpm-alpine/config/redis.config.php | 12 ++++++++++++ 15.0/fpm/config/redis.config.php | 12 ++++++++++++ 9 files changed, 108 insertions(+) create mode 100644 13.0/apache/config/redis.config.php create mode 100644 13.0/fpm-alpine/config/redis.config.php create mode 100644 13.0/fpm/config/redis.config.php create mode 100644 14.0/apache/config/redis.config.php create mode 100644 14.0/fpm-alpine/config/redis.config.php create mode 100644 14.0/fpm/config/redis.config.php create mode 100644 15.0/apache/config/redis.config.php create mode 100644 15.0/fpm-alpine/config/redis.config.php create mode 100644 15.0/fpm/config/redis.config.php diff --git a/13.0/apache/config/redis.config.php b/13.0/apache/config/redis.config.php new file mode 100644 index 00000000..d300dd0a --- /dev/null +++ b/13.0/apache/config/redis.config.php @@ -0,0 +1,12 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT') ?: 6379, + ), + ); +} + diff --git a/13.0/fpm-alpine/config/redis.config.php b/13.0/fpm-alpine/config/redis.config.php new file mode 100644 index 00000000..d300dd0a --- /dev/null +++ b/13.0/fpm-alpine/config/redis.config.php @@ -0,0 +1,12 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT') ?: 6379, + ), + ); +} + diff --git a/13.0/fpm/config/redis.config.php b/13.0/fpm/config/redis.config.php new file mode 100644 index 00000000..d300dd0a --- /dev/null +++ b/13.0/fpm/config/redis.config.php @@ -0,0 +1,12 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT') ?: 6379, + ), + ); +} + diff --git a/14.0/apache/config/redis.config.php b/14.0/apache/config/redis.config.php new file mode 100644 index 00000000..d300dd0a --- /dev/null +++ b/14.0/apache/config/redis.config.php @@ -0,0 +1,12 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT') ?: 6379, + ), + ); +} + diff --git a/14.0/fpm-alpine/config/redis.config.php b/14.0/fpm-alpine/config/redis.config.php new file mode 100644 index 00000000..d300dd0a --- /dev/null +++ b/14.0/fpm-alpine/config/redis.config.php @@ -0,0 +1,12 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT') ?: 6379, + ), + ); +} + diff --git a/14.0/fpm/config/redis.config.php b/14.0/fpm/config/redis.config.php new file mode 100644 index 00000000..d300dd0a --- /dev/null +++ b/14.0/fpm/config/redis.config.php @@ -0,0 +1,12 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT') ?: 6379, + ), + ); +} + diff --git a/15.0/apache/config/redis.config.php b/15.0/apache/config/redis.config.php new file mode 100644 index 00000000..d300dd0a --- /dev/null +++ b/15.0/apache/config/redis.config.php @@ -0,0 +1,12 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT') ?: 6379, + ), + ); +} + diff --git a/15.0/fpm-alpine/config/redis.config.php b/15.0/fpm-alpine/config/redis.config.php new file mode 100644 index 00000000..d300dd0a --- /dev/null +++ b/15.0/fpm-alpine/config/redis.config.php @@ -0,0 +1,12 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT') ?: 6379, + ), + ); +} + diff --git a/15.0/fpm/config/redis.config.php b/15.0/fpm/config/redis.config.php new file mode 100644 index 00000000..d300dd0a --- /dev/null +++ b/15.0/fpm/config/redis.config.php @@ -0,0 +1,12 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT') ?: 6379, + ), + ); +} + From 536fb662127c9dbc05bf10fb0714feef7cdd4bf9 Mon Sep 17 00:00:00 2001 From: marceljd Date: Tue, 15 Jan 2019 19:29:07 +0100 Subject: [PATCH 35/67] Only redis_host without port Signed-off-by: marceljd --- .config/redis.config.php | 1 - 1 file changed, 1 deletion(-) diff --git a/.config/redis.config.php b/.config/redis.config.php index d300dd0a..8f4b7ec7 100644 --- a/.config/redis.config.php +++ b/.config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT') ?: 6379, ), ); } From d1db681058525acfff49f84c72050b04e0d2ccf5 Mon Sep 17 00:00:00 2001 From: marceljd Date: Tue, 15 Jan 2019 19:40:35 +0100 Subject: [PATCH 36/67] Update redis.config.php Signed-off-by: marceljd --- .config/redis.config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/redis.config.php b/.config/redis.config.php index 8f4b7ec7..e9c7c733 100644 --- a/.config/redis.config.php +++ b/.config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_PORT')?: 6379, ), ); } From a9f458ce9f74867457da125d6591cbf7469bad21 Mon Sep 17 00:00:00 2001 From: marceljd Date: Tue, 22 Jan 2019 05:14:36 +0000 Subject: [PATCH 37/67] Changes to be committed: modified: .config/redis.config.php modified: .examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml modified: .examples/docker-compose/insecure/mariadb-cron-redis/fpm/docker-compose.yml modified: .examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/docker-compose.yml modified: .examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/docker-compose.yml modified: 13.0/apache/Dockerfile modified: 13.0/apache/config/redis.config.php modified: 13.0/fpm-alpine/Dockerfile modified: 13.0/fpm-alpine/config/redis.config.php modified: 13.0/fpm/Dockerfile modified: 13.0/fpm/config/redis.config.php modified: 14.0/apache/Dockerfile modified: 14.0/apache/config/redis.config.php modified: 14.0/fpm-alpine/Dockerfile modified: 14.0/fpm-alpine/config/redis.config.php modified: 14.0/fpm/Dockerfile modified: 14.0/fpm/config/redis.config.php modified: 15.0/apache/Dockerfile modified: 15.0/apache/config/redis.config.php modified: 15.0/fpm-alpine/Dockerfile modified: 15.0/fpm-alpine/config/redis.config.php modified: 15.0/fpm/Dockerfile modified: 15.0/fpm/config/redis.config.php modified: README.md Signed-off-by: marceljd --- .config/redis.config.php | 1 - .../insecure/mariadb-cron-redis/apache/docker-compose.yml | 1 + .../insecure/mariadb-cron-redis/fpm/docker-compose.yml | 1 + .../mariadb-cron-redis/apache/docker-compose.yml | 1 + .../with-nginx-proxy/mariadb-cron-redis/fpm/docker-compose.yml | 1 + 13.0/apache/config/redis.config.php | 1 - 13.0/fpm-alpine/config/redis.config.php | 1 - 13.0/fpm/config/redis.config.php | 1 - 14.0/apache/config/redis.config.php | 1 - 14.0/fpm-alpine/config/redis.config.php | 1 - 14.0/fpm/config/redis.config.php | 1 - 15.0/apache/config/redis.config.php | 1 - 15.0/fpm-alpine/config/redis.config.php | 1 - 15.0/fpm/config/redis.config.php | 1 - README.md | 2 +- 15 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.config/redis.config.php b/.config/redis.config.php index e9c7c733..8f4b7ec7 100644 --- a/.config/redis.config.php +++ b/.config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT')?: 6379, ), ); } diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml b/.examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml index 64c0570f..97c69299 100644 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml +++ b/.examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml @@ -25,6 +25,7 @@ services: - nextcloud:/var/www/html environment: - MYSQL_HOST=db + - REDIS_HOST=redis env_file: - db.env depends_on: diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/docker-compose.yml b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/docker-compose.yml index 424ef057..b48e54f1 100644 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/docker-compose.yml +++ b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/docker-compose.yml @@ -23,6 +23,7 @@ services: - nextcloud:/var/www/html environment: - MYSQL_HOST=db + - REDIS_HOST=redis env_file: - db.env depends_on: diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/docker-compose.yml index aaec5a2e..2c3f125e 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/docker-compose.yml +++ b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/docker-compose.yml @@ -26,6 +26,7 @@ services: - LETSENCRYPT_HOST= - LETSENCRYPT_EMAIL= - MYSQL_HOST=db + - REDIS_HOST=redis env_file: - db.env depends_on: diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/docker-compose.yml index 30aee4d9..fd2e5fc1 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/docker-compose.yml +++ b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/docker-compose.yml @@ -23,6 +23,7 @@ services: - nextcloud:/var/www/html environment: - MYSQL_HOST=db + - REDIS_HOST=redis env_file: - db.env depends_on: diff --git a/13.0/apache/config/redis.config.php b/13.0/apache/config/redis.config.php index d300dd0a..8f4b7ec7 100644 --- a/13.0/apache/config/redis.config.php +++ b/13.0/apache/config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT') ?: 6379, ), ); } diff --git a/13.0/fpm-alpine/config/redis.config.php b/13.0/fpm-alpine/config/redis.config.php index d300dd0a..8f4b7ec7 100644 --- a/13.0/fpm-alpine/config/redis.config.php +++ b/13.0/fpm-alpine/config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT') ?: 6379, ), ); } diff --git a/13.0/fpm/config/redis.config.php b/13.0/fpm/config/redis.config.php index d300dd0a..8f4b7ec7 100644 --- a/13.0/fpm/config/redis.config.php +++ b/13.0/fpm/config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT') ?: 6379, ), ); } diff --git a/14.0/apache/config/redis.config.php b/14.0/apache/config/redis.config.php index d300dd0a..8f4b7ec7 100644 --- a/14.0/apache/config/redis.config.php +++ b/14.0/apache/config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT') ?: 6379, ), ); } diff --git a/14.0/fpm-alpine/config/redis.config.php b/14.0/fpm-alpine/config/redis.config.php index d300dd0a..8f4b7ec7 100644 --- a/14.0/fpm-alpine/config/redis.config.php +++ b/14.0/fpm-alpine/config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT') ?: 6379, ), ); } diff --git a/14.0/fpm/config/redis.config.php b/14.0/fpm/config/redis.config.php index d300dd0a..8f4b7ec7 100644 --- a/14.0/fpm/config/redis.config.php +++ b/14.0/fpm/config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT') ?: 6379, ), ); } diff --git a/15.0/apache/config/redis.config.php b/15.0/apache/config/redis.config.php index d300dd0a..8f4b7ec7 100644 --- a/15.0/apache/config/redis.config.php +++ b/15.0/apache/config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT') ?: 6379, ), ); } diff --git a/15.0/fpm-alpine/config/redis.config.php b/15.0/fpm-alpine/config/redis.config.php index d300dd0a..8f4b7ec7 100644 --- a/15.0/fpm-alpine/config/redis.config.php +++ b/15.0/fpm-alpine/config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT') ?: 6379, ), ); } diff --git a/15.0/fpm/config/redis.config.php b/15.0/fpm/config/redis.config.php index d300dd0a..8f4b7ec7 100644 --- a/15.0/fpm/config/redis.config.php +++ b/15.0/fpm/config/redis.config.php @@ -5,7 +5,6 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_PORT') ?: 6379, ), ); } diff --git a/README.md b/README.md index 06189890..740db13f 100644 --- a/README.md +++ b/README.md @@ -133,8 +133,8 @@ The install and update script is only triggered when a default command is used ( If you want to use Redis you have to create a seperate [Redis](https://hub.docker.com/_/redis/) container in your setup / in your docker-compose file. To inform Nextcloud about the Redis container add: - 'REDIS_HOST' (not set by default) Name of Redis container -- 'REDIS_PORT' (optional, default:_6379_) Port number of Redis container. Use only if you use a non-standard port. +The use of Redis is recommended to prevent file locking problems. See the examples for further instructions. # Running this image with docker-compose The easiest way to get a fully featured and functional setup is using a `docker-compose` file. There are too many different possibilities to setup your system, so here are only some examples what you have to look for. From 2e481a86eed7dcac7f5076a9ee90f4f63764677f Mon Sep 17 00:00:00 2001 From: marceljd Date: Tue, 22 Jan 2019 11:14:03 +0100 Subject: [PATCH 38/67] Updated ' to ` for better formatting Signed-off-by: marceljd --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 740db13f..72b42f11 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ The install and update script is only triggered when a default command is used ( If you want to use Redis you have to create a seperate [Redis](https://hub.docker.com/_/redis/) container in your setup / in your docker-compose file. To inform Nextcloud about the Redis container add: -- 'REDIS_HOST' (not set by default) Name of Redis container +- `REDIS_HOST` (not set by default) Name of Redis container The use of Redis is recommended to prevent file locking problems. See the examples for further instructions. From b3b6def923dfd2288f2b42aba382bbf78e5ca607 Mon Sep 17 00:00:00 2001 From: marceljd Date: Sun, 27 Jan 2019 07:28:38 +0000 Subject: [PATCH 39/67] On branch redis-env-vars added REDIS_HOST_PORT Changes to be committed: modified: .config/redis.config.php modified: README.md Signed-off-by: marceljd --- .config/redis.config.php | 1 + README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.config/redis.config.php b/.config/redis.config.php index 8f4b7ec7..5df799f2 100644 --- a/.config/redis.config.php +++ b/.config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, ), ); } diff --git a/README.md b/README.md index 72b42f11..23e2fa65 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ The install and update script is only triggered when a default command is used ( If you want to use Redis you have to create a seperate [Redis](https://hub.docker.com/_/redis/) container in your setup / in your docker-compose file. To inform Nextcloud about the Redis container add: - `REDIS_HOST` (not set by default) Name of Redis container +- `REDIS_HOST_PORT` (default: _6379_) Optional port for Redis, only use for external Redis servers that run on non-standard ports. The use of Redis is recommended to prevent file locking problems. See the examples for further instructions. From d3cd3b812fc75ffaa314c6d56f5343830e747774 Mon Sep 17 00:00:00 2001 From: marceljd Date: Sun, 27 Jan 2019 07:31:30 +0000 Subject: [PATCH 40/67] On branch redis-env-vars run update.sh Changes to be committed: modified: 13.0/apache/config/redis.config.php modified: 13.0/fpm-alpine/config/redis.config.php modified: 13.0/fpm/config/redis.config.php modified: 14.0/apache/config/redis.config.php modified: 14.0/fpm-alpine/config/redis.config.php modified: 14.0/fpm/config/redis.config.php modified: 15.0/apache/config/redis.config.php modified: 15.0/fpm-alpine/config/redis.config.php modified: 15.0/fpm/config/redis.config.php Signed-off-by: marceljd --- 13.0/apache/config/redis.config.php | 1 + 13.0/fpm-alpine/config/redis.config.php | 1 + 13.0/fpm/config/redis.config.php | 1 + 14.0/apache/config/redis.config.php | 1 + 14.0/fpm-alpine/config/redis.config.php | 1 + 14.0/fpm/config/redis.config.php | 1 + 15.0/apache/config/redis.config.php | 1 + 15.0/fpm-alpine/config/redis.config.php | 1 + 15.0/fpm/config/redis.config.php | 1 + 9 files changed, 9 insertions(+) diff --git a/13.0/apache/config/redis.config.php b/13.0/apache/config/redis.config.php index 8f4b7ec7..5df799f2 100644 --- a/13.0/apache/config/redis.config.php +++ b/13.0/apache/config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, ), ); } diff --git a/13.0/fpm-alpine/config/redis.config.php b/13.0/fpm-alpine/config/redis.config.php index 8f4b7ec7..5df799f2 100644 --- a/13.0/fpm-alpine/config/redis.config.php +++ b/13.0/fpm-alpine/config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, ), ); } diff --git a/13.0/fpm/config/redis.config.php b/13.0/fpm/config/redis.config.php index 8f4b7ec7..5df799f2 100644 --- a/13.0/fpm/config/redis.config.php +++ b/13.0/fpm/config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, ), ); } diff --git a/14.0/apache/config/redis.config.php b/14.0/apache/config/redis.config.php index 8f4b7ec7..5df799f2 100644 --- a/14.0/apache/config/redis.config.php +++ b/14.0/apache/config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, ), ); } diff --git a/14.0/fpm-alpine/config/redis.config.php b/14.0/fpm-alpine/config/redis.config.php index 8f4b7ec7..5df799f2 100644 --- a/14.0/fpm-alpine/config/redis.config.php +++ b/14.0/fpm-alpine/config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, ), ); } diff --git a/14.0/fpm/config/redis.config.php b/14.0/fpm/config/redis.config.php index 8f4b7ec7..5df799f2 100644 --- a/14.0/fpm/config/redis.config.php +++ b/14.0/fpm/config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, ), ); } diff --git a/15.0/apache/config/redis.config.php b/15.0/apache/config/redis.config.php index 8f4b7ec7..5df799f2 100644 --- a/15.0/apache/config/redis.config.php +++ b/15.0/apache/config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, ), ); } diff --git a/15.0/fpm-alpine/config/redis.config.php b/15.0/fpm-alpine/config/redis.config.php index 8f4b7ec7..5df799f2 100644 --- a/15.0/fpm-alpine/config/redis.config.php +++ b/15.0/fpm-alpine/config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, ), ); } diff --git a/15.0/fpm/config/redis.config.php b/15.0/fpm/config/redis.config.php index 8f4b7ec7..5df799f2 100644 --- a/15.0/fpm/config/redis.config.php +++ b/15.0/fpm/config/redis.config.php @@ -5,6 +5,7 @@ if (getenv('REDIS_HOST')) { 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, ), ); } From e0de4ab28516a09423e5bb8630bfa93cf1de1bba Mon Sep 17 00:00:00 2001 From: marceljd Date: Sun, 27 Jan 2019 15:05:57 +0000 Subject: [PATCH 41/67] removed old redis.config.php files On branch redis-env-vars Changes to be committed: deleted: ../../apache/app/redis.config.php deleted: redis.config.php deleted: ../../../../with-nginx-proxy/mariadb-cron-redis/apache/app/redis.config.php deleted: ../../../../with-nginx-proxy/mariadb-cron-redis/fpm/app/redis.config.php Signed-off-by: marceljd --- .../mariadb-cron-redis/apache/app/redis.config.php | 8 -------- .../insecure/mariadb-cron-redis/fpm/app/redis.config.php | 8 -------- .../mariadb-cron-redis/apache/app/redis.config.php | 8 -------- .../mariadb-cron-redis/fpm/app/redis.config.php | 8 -------- 4 files changed, 32 deletions(-) delete mode 100644 .examples/docker-compose/insecure/mariadb-cron-redis/apache/app/redis.config.php delete mode 100644 .examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/redis.config.php delete mode 100644 .examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/app/redis.config.php delete mode 100644 .examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/app/redis.config.php diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/app/redis.config.php b/.examples/docker-compose/insecure/mariadb-cron-redis/apache/app/redis.config.php deleted file mode 100644 index b0cebe31..00000000 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/app/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/redis.config.php b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/redis.config.php deleted file mode 100644 index b0cebe31..00000000 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/app/redis.config.php b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/app/redis.config.php deleted file mode 100644 index b0cebe31..00000000 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/app/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/app/redis.config.php b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/app/redis.config.php deleted file mode 100644 index b0cebe31..00000000 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/app/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); From f0f22d3ddfbb1dd2893f7b6cbacb4fc4e4ed24db Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Thu, 31 Jan 2019 10:51:39 +0000 Subject: [PATCH 42/67] Update to 14.0.7RC1 --- 14.0-rc/apache/Dockerfile | 146 ++++++++++++++++++ .../config/apache-pretty-urls.config.php | 4 + 14.0-rc/apache/config/apcu.config.php | 4 + 14.0-rc/apache/config/apps.config.php | 15 ++ 14.0-rc/apache/config/autoconfig.php | 29 ++++ 14.0-rc/apache/cron.sh | 4 + 14.0-rc/apache/entrypoint.sh | 132 ++++++++++++++++ 14.0-rc/apache/upgrade.exclude | 4 + 14.0-rc/fpm-alpine/Dockerfile | 123 +++++++++++++++ 14.0-rc/fpm-alpine/config/apcu.config.php | 4 + 14.0-rc/fpm-alpine/config/apps.config.php | 15 ++ 14.0-rc/fpm-alpine/config/autoconfig.php | 29 ++++ 14.0-rc/fpm-alpine/cron.sh | 4 + 14.0-rc/fpm-alpine/entrypoint.sh | 132 ++++++++++++++++ 14.0-rc/fpm-alpine/upgrade.exclude | 4 + 14.0-rc/fpm/Dockerfile | 138 +++++++++++++++++ 14.0-rc/fpm/config/apcu.config.php | 4 + 14.0-rc/fpm/config/apps.config.php | 15 ++ 14.0-rc/fpm/config/autoconfig.php | 29 ++++ 14.0-rc/fpm/cron.sh | 4 + 14.0-rc/fpm/entrypoint.sh | 132 ++++++++++++++++ 14.0-rc/fpm/upgrade.exclude | 4 + 22 files changed, 975 insertions(+) create mode 100644 14.0-rc/apache/Dockerfile create mode 100644 14.0-rc/apache/config/apache-pretty-urls.config.php create mode 100644 14.0-rc/apache/config/apcu.config.php create mode 100644 14.0-rc/apache/config/apps.config.php create mode 100644 14.0-rc/apache/config/autoconfig.php create mode 100755 14.0-rc/apache/cron.sh create mode 100755 14.0-rc/apache/entrypoint.sh create mode 100644 14.0-rc/apache/upgrade.exclude create mode 100644 14.0-rc/fpm-alpine/Dockerfile create mode 100644 14.0-rc/fpm-alpine/config/apcu.config.php create mode 100644 14.0-rc/fpm-alpine/config/apps.config.php create mode 100644 14.0-rc/fpm-alpine/config/autoconfig.php create mode 100755 14.0-rc/fpm-alpine/cron.sh create mode 100755 14.0-rc/fpm-alpine/entrypoint.sh create mode 100644 14.0-rc/fpm-alpine/upgrade.exclude create mode 100644 14.0-rc/fpm/Dockerfile create mode 100644 14.0-rc/fpm/config/apcu.config.php create mode 100644 14.0-rc/fpm/config/apps.config.php create mode 100644 14.0-rc/fpm/config/autoconfig.php create mode 100755 14.0-rc/fpm/cron.sh create mode 100755 14.0-rc/fpm/entrypoint.sh create mode 100644 14.0-rc/fpm/upgrade.exclude diff --git a/14.0-rc/apache/Dockerfile b/14.0-rc/apache/Dockerfile new file mode 100644 index 00000000..6f6beb3e --- /dev/null +++ b/14.0-rc/apache/Dockerfile @@ -0,0 +1,146 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-apache-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod rewrite remoteip ;\ + {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + } > /etc/apache2/conf-available/remoteip.conf;\ + a2enconf remoteip + +ENV NEXTCLOUD_VERSION 14.0.7RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/14.0-rc/apache/config/apache-pretty-urls.config.php b/14.0-rc/apache/config/apache-pretty-urls.config.php new file mode 100644 index 00000000..72da1d8c --- /dev/null +++ b/14.0-rc/apache/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/14.0-rc/apache/config/apcu.config.php b/14.0-rc/apache/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/14.0-rc/apache/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/14.0-rc/apache/config/apps.config.php b/14.0-rc/apache/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/14.0-rc/apache/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/14.0-rc/apache/config/autoconfig.php b/14.0-rc/apache/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/14.0-rc/apache/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/14.0-rc/apache/upgrade.exclude b/14.0-rc/apache/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/14.0-rc/apache/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/14.0-rc/fpm-alpine/Dockerfile b/14.0-rc/fpm-alpine/Dockerfile new file mode 100644 index 00000000..8549f704 --- /dev/null +++ b/14.0-rc/fpm-alpine/Dockerfile @@ -0,0 +1,123 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template +FROM php:7.2-fpm-alpine3.8 + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + rsync \ + ; \ + \ + rm /var/spool/cron/crontabs/root; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + freetype-dev \ + icu-dev \ + libevent-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + pcre-dev \ + postgresql-dev \ + imagemagick-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 14.0.7RC1 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/14.0-rc/fpm-alpine/config/apcu.config.php b/14.0-rc/fpm-alpine/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/14.0-rc/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/14.0-rc/fpm-alpine/config/apps.config.php b/14.0-rc/fpm-alpine/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/14.0-rc/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/14.0-rc/fpm-alpine/config/autoconfig.php b/14.0-rc/fpm-alpine/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/14.0-rc/fpm-alpine/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/14.0-rc/fpm-alpine/upgrade.exclude b/14.0-rc/fpm-alpine/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/14.0-rc/fpm-alpine/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/14.0-rc/fpm/Dockerfile b/14.0-rc/fpm/Dockerfile new file mode 100644 index 00000000..584daee1 --- /dev/null +++ b/14.0-rc/fpm/Dockerfile @@ -0,0 +1,138 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-fpm-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 14.0.7RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/14.0-rc/fpm/config/apcu.config.php b/14.0-rc/fpm/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/14.0-rc/fpm/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/14.0-rc/fpm/config/apps.config.php b/14.0-rc/fpm/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/14.0-rc/fpm/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/14.0-rc/fpm/config/autoconfig.php b/14.0-rc/fpm/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/14.0-rc/fpm/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/14.0-rc/fpm/upgrade.exclude b/14.0-rc/fpm/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/14.0-rc/fpm/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ From a8a7cb95712d394b4d7c5f0af23c791d1f89cb47 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Thu, 31 Jan 2019 10:51:39 +0000 Subject: [PATCH 43/67] Update to 15.0.3RC1 --- 15.0-rc/apache/Dockerfile | 146 ++++++++++++++++++ .../config/apache-pretty-urls.config.php | 4 + 15.0-rc/apache/config/apcu.config.php | 4 + 15.0-rc/apache/config/apps.config.php | 15 ++ 15.0-rc/apache/config/autoconfig.php | 29 ++++ 15.0-rc/apache/cron.sh | 4 + 15.0-rc/apache/entrypoint.sh | 132 ++++++++++++++++ 15.0-rc/apache/upgrade.exclude | 4 + 15.0-rc/fpm-alpine/Dockerfile | 123 +++++++++++++++ 15.0-rc/fpm-alpine/config/apcu.config.php | 4 + 15.0-rc/fpm-alpine/config/apps.config.php | 15 ++ 15.0-rc/fpm-alpine/config/autoconfig.php | 29 ++++ 15.0-rc/fpm-alpine/cron.sh | 4 + 15.0-rc/fpm-alpine/entrypoint.sh | 132 ++++++++++++++++ 15.0-rc/fpm-alpine/upgrade.exclude | 4 + 15.0-rc/fpm/Dockerfile | 138 +++++++++++++++++ 15.0-rc/fpm/config/apcu.config.php | 4 + 15.0-rc/fpm/config/apps.config.php | 15 ++ 15.0-rc/fpm/config/autoconfig.php | 29 ++++ 15.0-rc/fpm/cron.sh | 4 + 15.0-rc/fpm/entrypoint.sh | 132 ++++++++++++++++ 15.0-rc/fpm/upgrade.exclude | 4 + 22 files changed, 975 insertions(+) create mode 100644 15.0-rc/apache/Dockerfile create mode 100644 15.0-rc/apache/config/apache-pretty-urls.config.php create mode 100644 15.0-rc/apache/config/apcu.config.php create mode 100644 15.0-rc/apache/config/apps.config.php create mode 100644 15.0-rc/apache/config/autoconfig.php create mode 100755 15.0-rc/apache/cron.sh create mode 100755 15.0-rc/apache/entrypoint.sh create mode 100644 15.0-rc/apache/upgrade.exclude create mode 100644 15.0-rc/fpm-alpine/Dockerfile create mode 100644 15.0-rc/fpm-alpine/config/apcu.config.php create mode 100644 15.0-rc/fpm-alpine/config/apps.config.php create mode 100644 15.0-rc/fpm-alpine/config/autoconfig.php create mode 100755 15.0-rc/fpm-alpine/cron.sh create mode 100755 15.0-rc/fpm-alpine/entrypoint.sh create mode 100644 15.0-rc/fpm-alpine/upgrade.exclude create mode 100644 15.0-rc/fpm/Dockerfile create mode 100644 15.0-rc/fpm/config/apcu.config.php create mode 100644 15.0-rc/fpm/config/apps.config.php create mode 100644 15.0-rc/fpm/config/autoconfig.php create mode 100755 15.0-rc/fpm/cron.sh create mode 100755 15.0-rc/fpm/entrypoint.sh create mode 100644 15.0-rc/fpm/upgrade.exclude diff --git a/15.0-rc/apache/Dockerfile b/15.0-rc/apache/Dockerfile new file mode 100644 index 00000000..a3b99bd2 --- /dev/null +++ b/15.0-rc/apache/Dockerfile @@ -0,0 +1,146 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-apache-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod rewrite remoteip ;\ + {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + } > /etc/apache2/conf-available/remoteip.conf;\ + a2enconf remoteip + +ENV NEXTCLOUD_VERSION 15.0.3RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/15.0-rc/apache/config/apache-pretty-urls.config.php b/15.0-rc/apache/config/apache-pretty-urls.config.php new file mode 100644 index 00000000..72da1d8c --- /dev/null +++ b/15.0-rc/apache/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/15.0-rc/apache/config/apcu.config.php b/15.0-rc/apache/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-rc/apache/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-rc/apache/config/apps.config.php b/15.0-rc/apache/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-rc/apache/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-rc/apache/config/autoconfig.php b/15.0-rc/apache/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-rc/apache/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-rc/apache/upgrade.exclude b/15.0-rc/apache/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-rc/apache/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/15.0-rc/fpm-alpine/Dockerfile b/15.0-rc/fpm-alpine/Dockerfile new file mode 100644 index 00000000..675020b5 --- /dev/null +++ b/15.0-rc/fpm-alpine/Dockerfile @@ -0,0 +1,123 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template +FROM php:7.2-fpm-alpine3.8 + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + rsync \ + ; \ + \ + rm /var/spool/cron/crontabs/root; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + freetype-dev \ + icu-dev \ + libevent-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + pcre-dev \ + postgresql-dev \ + imagemagick-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 15.0.3RC1 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/15.0-rc/fpm-alpine/config/apcu.config.php b/15.0-rc/fpm-alpine/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-rc/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-rc/fpm-alpine/config/apps.config.php b/15.0-rc/fpm-alpine/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-rc/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-rc/fpm-alpine/config/autoconfig.php b/15.0-rc/fpm-alpine/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-rc/fpm-alpine/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-rc/fpm-alpine/upgrade.exclude b/15.0-rc/fpm-alpine/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-rc/fpm-alpine/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/15.0-rc/fpm/Dockerfile b/15.0-rc/fpm/Dockerfile new file mode 100644 index 00000000..da13bf04 --- /dev/null +++ b/15.0-rc/fpm/Dockerfile @@ -0,0 +1,138 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-fpm-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 15.0.3RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/15.0-rc/fpm/config/apcu.config.php b/15.0-rc/fpm/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-rc/fpm/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-rc/fpm/config/apps.config.php b/15.0-rc/fpm/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-rc/fpm/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-rc/fpm/config/autoconfig.php b/15.0-rc/fpm/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-rc/fpm/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-rc/fpm/upgrade.exclude b/15.0-rc/fpm/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-rc/fpm/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ From e298a56eaa4fc928fcdbfbe2fd8df9a907ff7b41 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Thu, 31 Jan 2019 10:51:39 +0000 Subject: [PATCH 44/67] Update to 13.0.11RC1 --- 13.0-rc/apache/Dockerfile | 146 ++++++++++++++++++ .../config/apache-pretty-urls.config.php | 4 + 13.0-rc/apache/config/apcu.config.php | 4 + 13.0-rc/apache/config/apps.config.php | 15 ++ 13.0-rc/apache/config/autoconfig.php | 29 ++++ 13.0-rc/apache/cron.sh | 4 + 13.0-rc/apache/entrypoint.sh | 132 ++++++++++++++++ 13.0-rc/apache/upgrade.exclude | 4 + 13.0-rc/fpm-alpine/Dockerfile | 123 +++++++++++++++ 13.0-rc/fpm-alpine/config/apcu.config.php | 4 + 13.0-rc/fpm-alpine/config/apps.config.php | 15 ++ 13.0-rc/fpm-alpine/config/autoconfig.php | 29 ++++ 13.0-rc/fpm-alpine/cron.sh | 4 + 13.0-rc/fpm-alpine/entrypoint.sh | 132 ++++++++++++++++ 13.0-rc/fpm-alpine/upgrade.exclude | 4 + 13.0-rc/fpm/Dockerfile | 138 +++++++++++++++++ 13.0-rc/fpm/config/apcu.config.php | 4 + 13.0-rc/fpm/config/apps.config.php | 15 ++ 13.0-rc/fpm/config/autoconfig.php | 29 ++++ 13.0-rc/fpm/cron.sh | 4 + 13.0-rc/fpm/entrypoint.sh | 132 ++++++++++++++++ 13.0-rc/fpm/upgrade.exclude | 4 + 22 files changed, 975 insertions(+) create mode 100644 13.0-rc/apache/Dockerfile create mode 100644 13.0-rc/apache/config/apache-pretty-urls.config.php create mode 100644 13.0-rc/apache/config/apcu.config.php create mode 100644 13.0-rc/apache/config/apps.config.php create mode 100644 13.0-rc/apache/config/autoconfig.php create mode 100755 13.0-rc/apache/cron.sh create mode 100755 13.0-rc/apache/entrypoint.sh create mode 100644 13.0-rc/apache/upgrade.exclude create mode 100644 13.0-rc/fpm-alpine/Dockerfile create mode 100644 13.0-rc/fpm-alpine/config/apcu.config.php create mode 100644 13.0-rc/fpm-alpine/config/apps.config.php create mode 100644 13.0-rc/fpm-alpine/config/autoconfig.php create mode 100755 13.0-rc/fpm-alpine/cron.sh create mode 100755 13.0-rc/fpm-alpine/entrypoint.sh create mode 100644 13.0-rc/fpm-alpine/upgrade.exclude create mode 100644 13.0-rc/fpm/Dockerfile create mode 100644 13.0-rc/fpm/config/apcu.config.php create mode 100644 13.0-rc/fpm/config/apps.config.php create mode 100644 13.0-rc/fpm/config/autoconfig.php create mode 100755 13.0-rc/fpm/cron.sh create mode 100755 13.0-rc/fpm/entrypoint.sh create mode 100644 13.0-rc/fpm/upgrade.exclude diff --git a/13.0-rc/apache/Dockerfile b/13.0-rc/apache/Dockerfile new file mode 100644 index 00000000..f9ba0648 --- /dev/null +++ b/13.0-rc/apache/Dockerfile @@ -0,0 +1,146 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-apache-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod rewrite remoteip ;\ + {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + } > /etc/apache2/conf-available/remoteip.conf;\ + a2enconf remoteip + +ENV NEXTCLOUD_VERSION 13.0.11RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/13.0-rc/apache/config/apache-pretty-urls.config.php b/13.0-rc/apache/config/apache-pretty-urls.config.php new file mode 100644 index 00000000..72da1d8c --- /dev/null +++ b/13.0-rc/apache/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/13.0-rc/apache/config/apcu.config.php b/13.0-rc/apache/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/13.0-rc/apache/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/13.0-rc/apache/config/apps.config.php b/13.0-rc/apache/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/13.0-rc/apache/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/13.0-rc/apache/config/autoconfig.php b/13.0-rc/apache/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/13.0-rc/apache/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/13.0-rc/apache/upgrade.exclude b/13.0-rc/apache/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/13.0-rc/apache/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/13.0-rc/fpm-alpine/Dockerfile b/13.0-rc/fpm-alpine/Dockerfile new file mode 100644 index 00000000..e604e324 --- /dev/null +++ b/13.0-rc/fpm-alpine/Dockerfile @@ -0,0 +1,123 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template +FROM php:7.2-fpm-alpine3.8 + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + rsync \ + ; \ + \ + rm /var/spool/cron/crontabs/root; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + freetype-dev \ + icu-dev \ + libevent-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + pcre-dev \ + postgresql-dev \ + imagemagick-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 13.0.11RC1 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/13.0-rc/fpm-alpine/config/apcu.config.php b/13.0-rc/fpm-alpine/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/13.0-rc/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/13.0-rc/fpm-alpine/config/apps.config.php b/13.0-rc/fpm-alpine/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/13.0-rc/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/13.0-rc/fpm-alpine/config/autoconfig.php b/13.0-rc/fpm-alpine/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/13.0-rc/fpm-alpine/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/13.0-rc/fpm-alpine/upgrade.exclude b/13.0-rc/fpm-alpine/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/13.0-rc/fpm-alpine/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/13.0-rc/fpm/Dockerfile b/13.0-rc/fpm/Dockerfile new file mode 100644 index 00000000..ef353c9d --- /dev/null +++ b/13.0-rc/fpm/Dockerfile @@ -0,0 +1,138 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-fpm-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 13.0.11RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/13.0-rc/fpm/config/apcu.config.php b/13.0-rc/fpm/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/13.0-rc/fpm/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/13.0-rc/fpm/config/apps.config.php b/13.0-rc/fpm/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/13.0-rc/fpm/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/13.0-rc/fpm/config/autoconfig.php b/13.0-rc/fpm/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/13.0-rc/fpm/config/autoconfig.php @@ -0,0 +1,29 @@ + B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/13.0-rc/fpm/upgrade.exclude b/13.0-rc/fpm/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/13.0-rc/fpm/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ From 184d54a2d666e8397f160db179ae9ab5b5dd5f28 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Thu, 31 Jan 2019 12:54:43 +0100 Subject: [PATCH 45/67] Run update.sh Signed-off-by: Tilo Spannagel --- .travis.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6e36fdcd..c7bdc606 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,25 @@ jobs: - ./generate-stackbrew-library.sh - stage: test images - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 + env: VERSION=13.0-rc VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=13.0-rc VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=13.0-rc VARIANT=fpm ARCH=amd64 + - env: VERSION=13.0-rc VARIANT=fpm ARCH=i386 + - env: VERSION=13.0-rc VARIANT=apache ARCH=amd64 + - env: VERSION=13.0-rc VARIANT=apache ARCH=i386 + - env: VERSION=14.0-rc VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=14.0-rc VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=14.0-rc VARIANT=fpm ARCH=amd64 + - env: VERSION=14.0-rc VARIANT=fpm ARCH=i386 + - env: VERSION=14.0-rc VARIANT=apache ARCH=amd64 + - env: VERSION=14.0-rc VARIANT=apache ARCH=i386 + - env: VERSION=15.0-rc VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=15.0-rc VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=15.0-rc VARIANT=fpm ARCH=amd64 + - env: VERSION=15.0-rc VARIANT=fpm ARCH=i386 + - env: VERSION=15.0-rc VARIANT=apache ARCH=amd64 + - env: VERSION=15.0-rc VARIANT=apache ARCH=i386 + - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=i386 - env: VERSION=13.0 VARIANT=fpm ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm ARCH=i386 From bb105463275881d984e65ce482c141e80f2c5b5d Mon Sep 17 00:00:00 2001 From: J0WI Date: Fri, 1 Feb 2019 21:04:24 +0100 Subject: [PATCH 46/67] Add SVG support in full example Signed-off-by: J0WI --- .examples/README.md | 5 ++++- .examples/dockerfiles/full/apache/Dockerfile | 1 + .examples/dockerfiles/full/fpm-alpine/Dockerfile | 1 + .examples/dockerfiles/full/fpm/Dockerfile | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.examples/README.md b/.examples/README.md index 015ff53e..476832a9 100644 --- a/.examples/README.md +++ b/.examples/README.md @@ -27,7 +27,7 @@ NOTE: Per default, only previews for BMP, GIF, JPEG, MarkDown, MP3, PNG, TXT, an NOTE: Nextcloud recommends [disabling preview generation](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html?highlight=enabledpreviewproviders#disable-preview-image-generation) for high security deployments, as preview generation opens your nextcloud instance to new possible attack vectors. -The required steps for each optional/recommended package that is not already in the Nextcloud image are listed here, so that the Dockerfile can easily be modified to only install the needed extra packages. Simply remove the steps for the unwanted packages from the Dockerfile. +The required steps for each optional/recommended package that is not already in the Nextcloud image are listed here, so that the Dockerfile can easily be modified to only install the needed extra packages. Simply remove the steps for the unwanted packages from the Dockerfile. #### PHP Module bz2 `docker-php-ext-install bz2` @@ -49,6 +49,9 @@ The required steps for each optional/recommended package that is not already in #### ffmpeg `apt install ffmpeg` +#### imagemagick SVG support +`apt install libmagickcore-6.q16-3-extra` + #### LibreOffice `apt install libreoffice` diff --git a/.examples/dockerfiles/full/apache/Dockerfile b/.examples/dockerfiles/full/apache/Dockerfile index 4ddcea8e..9e600e76 100644 --- a/.examples/dockerfiles/full/apache/Dockerfile +++ b/.examples/dockerfiles/full/apache/Dockerfile @@ -5,6 +5,7 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends \ ffmpeg \ + libmagickcore-6.q16-3-extra \ smbclient \ supervisor \ # libreoffice \ diff --git a/.examples/dockerfiles/full/fpm-alpine/Dockerfile b/.examples/dockerfiles/full/fpm-alpine/Dockerfile index 716b32ff..37029c8e 100644 --- a/.examples/dockerfiles/full/fpm-alpine/Dockerfile +++ b/.examples/dockerfiles/full/fpm-alpine/Dockerfile @@ -4,6 +4,7 @@ RUN set -ex; \ \ apk add --no-cache \ ffmpeg \ + imagemagick \ samba-client \ supervisor \ # libreoffice \ diff --git a/.examples/dockerfiles/full/fpm/Dockerfile b/.examples/dockerfiles/full/fpm/Dockerfile index deab8d8b..5172e3f2 100644 --- a/.examples/dockerfiles/full/fpm/Dockerfile +++ b/.examples/dockerfiles/full/fpm/Dockerfile @@ -5,6 +5,7 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends \ ffmpeg \ + libmagickcore-6.q16-3-extra \ smbclient \ supervisor \ # libreoffice \ From a726f805e3e0893c73d3e641cc5ba04c039684c4 Mon Sep 17 00:00:00 2001 From: Jay Rogers Date: Mon, 4 Feb 2019 22:17:54 -0600 Subject: [PATCH 47/67] Simple typo fix Signed-off-by: Jay Rogers --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e4c168d..e3270c6e 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Overview of the folders that can be mounted as volumes: - `/var/www/html/custom_apps` installed / modified apps - `/var/www/html/config` local configuration - `/var/www/html/data` the actual data of your Nextcloud -- `/var/www/html/themes/` theming/branding +- `/var/www/html/themes/` theming/branding If you want to use named volumes for all of these it would look like this ```console From da1192ed4ce337bf6b74619f5b30b9527217065d Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Thu, 7 Feb 2019 04:51:23 +0000 Subject: [PATCH 48/67] Update to 14.0.7 --- 14.0/apache/Dockerfile | 2 +- 14.0/fpm-alpine/Dockerfile | 2 +- 14.0/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/14.0/apache/Dockerfile b/14.0/apache/Dockerfile index b0bf50c0..070f3989 100644 --- a/14.0/apache/Dockerfile +++ b/14.0/apache/Dockerfile @@ -110,7 +110,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 14.0.6 +ENV NEXTCLOUD_VERSION 14.0.7 RUN set -ex; \ fetchDeps=" \ diff --git a/14.0/fpm-alpine/Dockerfile b/14.0/fpm-alpine/Dockerfile index 95cae19e..b8a8a25b 100644 --- a/14.0/fpm-alpine/Dockerfile +++ b/14.0/fpm-alpine/Dockerfile @@ -91,7 +91,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.6 +ENV NEXTCLOUD_VERSION 14.0.7 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/14.0/fpm/Dockerfile b/14.0/fpm/Dockerfile index 7e7cff2c..93a12239 100644 --- a/14.0/fpm/Dockerfile +++ b/14.0/fpm/Dockerfile @@ -102,7 +102,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.6 +ENV NEXTCLOUD_VERSION 14.0.7 RUN set -ex; \ fetchDeps=" \ From cd725486518f38f1c81abc3e1f257a97656c861f Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Thu, 7 Feb 2019 04:51:23 +0000 Subject: [PATCH 49/67] Update to 13.0.11 --- 13.0/apache/Dockerfile | 2 +- 13.0/fpm-alpine/Dockerfile | 2 +- 13.0/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/13.0/apache/Dockerfile b/13.0/apache/Dockerfile index d36104af..7cddbb0a 100644 --- a/13.0/apache/Dockerfile +++ b/13.0/apache/Dockerfile @@ -110,7 +110,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 13.0.10 +ENV NEXTCLOUD_VERSION 13.0.11 RUN set -ex; \ fetchDeps=" \ diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index 98bc406b..b546bf7f 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -91,7 +91,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 13.0.10 +ENV NEXTCLOUD_VERSION 13.0.11 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile index 22f343d8..4200fcdb 100644 --- a/13.0/fpm/Dockerfile +++ b/13.0/fpm/Dockerfile @@ -102,7 +102,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 13.0.10 +ENV NEXTCLOUD_VERSION 13.0.11 RUN set -ex; \ fetchDeps=" \ From 6b8820f3f5a9cc5fd9ce480793f5a3fb406df787 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Thu, 7 Feb 2019 04:51:23 +0000 Subject: [PATCH 50/67] Update to 15.0.3 --- 15.0/apache/Dockerfile | 2 +- 15.0/fpm-alpine/Dockerfile | 2 +- 15.0/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 09e87842..4f0aea57 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -110,7 +110,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 15.0.2 +ENV NEXTCLOUD_VERSION 15.0.3 RUN set -ex; \ fetchDeps=" \ diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index 1e5b23fa..fca9dddb 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -91,7 +91,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.2 +ENV NEXTCLOUD_VERSION 15.0.3 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index 0e6ffcd1..915237d7 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -102,7 +102,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.2 +ENV NEXTCLOUD_VERSION 15.0.3 RUN set -ex; \ fetchDeps=" \ From 2695fd9ba247cc82ee03681773eaa859ee23a41c Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Thu, 7 Feb 2019 12:09:11 +0100 Subject: [PATCH 51/67] Run update.sh Signed-off-by: Tilo Spannagel --- .travis.yml | 20 +-- 13.0-rc/apache/Dockerfile | 146 ------------------ .../config/apache-pretty-urls.config.php | 4 - 13.0-rc/apache/config/apcu.config.php | 4 - 13.0-rc/apache/config/apps.config.php | 15 -- 13.0-rc/apache/config/autoconfig.php | 29 ---- 13.0-rc/apache/cron.sh | 4 - 13.0-rc/apache/entrypoint.sh | 132 ---------------- 13.0-rc/apache/upgrade.exclude | 4 - 13.0-rc/fpm-alpine/Dockerfile | 123 --------------- 13.0-rc/fpm-alpine/config/apcu.config.php | 4 - 13.0-rc/fpm-alpine/config/apps.config.php | 15 -- 13.0-rc/fpm-alpine/config/autoconfig.php | 29 ---- 13.0-rc/fpm-alpine/cron.sh | 4 - 13.0-rc/fpm-alpine/entrypoint.sh | 132 ---------------- 13.0-rc/fpm-alpine/upgrade.exclude | 4 - 13.0-rc/fpm/Dockerfile | 138 ----------------- 13.0-rc/fpm/config/apcu.config.php | 4 - 13.0-rc/fpm/config/apps.config.php | 15 -- 13.0-rc/fpm/config/autoconfig.php | 29 ---- 13.0-rc/fpm/cron.sh | 4 - 13.0-rc/fpm/entrypoint.sh | 132 ---------------- 13.0-rc/fpm/upgrade.exclude | 4 - 14.0-rc/apache/Dockerfile | 146 ------------------ .../config/apache-pretty-urls.config.php | 4 - 14.0-rc/apache/config/apcu.config.php | 4 - 14.0-rc/apache/config/apps.config.php | 15 -- 14.0-rc/apache/config/autoconfig.php | 29 ---- 14.0-rc/apache/cron.sh | 4 - 14.0-rc/apache/entrypoint.sh | 132 ---------------- 14.0-rc/apache/upgrade.exclude | 4 - 14.0-rc/fpm-alpine/Dockerfile | 123 --------------- 14.0-rc/fpm-alpine/config/apcu.config.php | 4 - 14.0-rc/fpm-alpine/config/apps.config.php | 15 -- 14.0-rc/fpm-alpine/config/autoconfig.php | 29 ---- 14.0-rc/fpm-alpine/cron.sh | 4 - 14.0-rc/fpm-alpine/entrypoint.sh | 132 ---------------- 14.0-rc/fpm-alpine/upgrade.exclude | 4 - 14.0-rc/fpm/Dockerfile | 138 ----------------- 14.0-rc/fpm/config/apcu.config.php | 4 - 14.0-rc/fpm/config/apps.config.php | 15 -- 14.0-rc/fpm/config/autoconfig.php | 29 ---- 14.0-rc/fpm/cron.sh | 4 - 14.0-rc/fpm/entrypoint.sh | 132 ---------------- 14.0-rc/fpm/upgrade.exclude | 4 - 15.0-rc/apache/Dockerfile | 146 ------------------ .../config/apache-pretty-urls.config.php | 4 - 15.0-rc/apache/config/apcu.config.php | 4 - 15.0-rc/apache/config/apps.config.php | 15 -- 15.0-rc/apache/config/autoconfig.php | 29 ---- 15.0-rc/apache/cron.sh | 4 - 15.0-rc/apache/entrypoint.sh | 132 ---------------- 15.0-rc/apache/upgrade.exclude | 4 - 15.0-rc/fpm-alpine/Dockerfile | 123 --------------- 15.0-rc/fpm-alpine/config/apcu.config.php | 4 - 15.0-rc/fpm-alpine/config/apps.config.php | 15 -- 15.0-rc/fpm-alpine/config/autoconfig.php | 29 ---- 15.0-rc/fpm-alpine/cron.sh | 4 - 15.0-rc/fpm-alpine/entrypoint.sh | 132 ---------------- 15.0-rc/fpm-alpine/upgrade.exclude | 4 - 15.0-rc/fpm/Dockerfile | 138 ----------------- 15.0-rc/fpm/config/apcu.config.php | 4 - 15.0-rc/fpm/config/apps.config.php | 15 -- 15.0-rc/fpm/config/autoconfig.php | 29 ---- 15.0-rc/fpm/cron.sh | 4 - 15.0-rc/fpm/entrypoint.sh | 132 ---------------- 15.0-rc/fpm/upgrade.exclude | 4 - 67 files changed, 1 insertion(+), 2944 deletions(-) delete mode 100644 13.0-rc/apache/Dockerfile delete mode 100644 13.0-rc/apache/config/apache-pretty-urls.config.php delete mode 100644 13.0-rc/apache/config/apcu.config.php delete mode 100644 13.0-rc/apache/config/apps.config.php delete mode 100644 13.0-rc/apache/config/autoconfig.php delete mode 100755 13.0-rc/apache/cron.sh delete mode 100755 13.0-rc/apache/entrypoint.sh delete mode 100644 13.0-rc/apache/upgrade.exclude delete mode 100644 13.0-rc/fpm-alpine/Dockerfile delete mode 100644 13.0-rc/fpm-alpine/config/apcu.config.php delete mode 100644 13.0-rc/fpm-alpine/config/apps.config.php delete mode 100644 13.0-rc/fpm-alpine/config/autoconfig.php delete mode 100755 13.0-rc/fpm-alpine/cron.sh delete mode 100755 13.0-rc/fpm-alpine/entrypoint.sh delete mode 100644 13.0-rc/fpm-alpine/upgrade.exclude delete mode 100644 13.0-rc/fpm/Dockerfile delete mode 100644 13.0-rc/fpm/config/apcu.config.php delete mode 100644 13.0-rc/fpm/config/apps.config.php delete mode 100644 13.0-rc/fpm/config/autoconfig.php delete mode 100755 13.0-rc/fpm/cron.sh delete mode 100755 13.0-rc/fpm/entrypoint.sh delete mode 100644 13.0-rc/fpm/upgrade.exclude delete mode 100644 14.0-rc/apache/Dockerfile delete mode 100644 14.0-rc/apache/config/apache-pretty-urls.config.php delete mode 100644 14.0-rc/apache/config/apcu.config.php delete mode 100644 14.0-rc/apache/config/apps.config.php delete mode 100644 14.0-rc/apache/config/autoconfig.php delete mode 100755 14.0-rc/apache/cron.sh delete mode 100755 14.0-rc/apache/entrypoint.sh delete mode 100644 14.0-rc/apache/upgrade.exclude delete mode 100644 14.0-rc/fpm-alpine/Dockerfile delete mode 100644 14.0-rc/fpm-alpine/config/apcu.config.php delete mode 100644 14.0-rc/fpm-alpine/config/apps.config.php delete mode 100644 14.0-rc/fpm-alpine/config/autoconfig.php delete mode 100755 14.0-rc/fpm-alpine/cron.sh delete mode 100755 14.0-rc/fpm-alpine/entrypoint.sh delete mode 100644 14.0-rc/fpm-alpine/upgrade.exclude delete mode 100644 14.0-rc/fpm/Dockerfile delete mode 100644 14.0-rc/fpm/config/apcu.config.php delete mode 100644 14.0-rc/fpm/config/apps.config.php delete mode 100644 14.0-rc/fpm/config/autoconfig.php delete mode 100755 14.0-rc/fpm/cron.sh delete mode 100755 14.0-rc/fpm/entrypoint.sh delete mode 100644 14.0-rc/fpm/upgrade.exclude delete mode 100644 15.0-rc/apache/Dockerfile delete mode 100644 15.0-rc/apache/config/apache-pretty-urls.config.php delete mode 100644 15.0-rc/apache/config/apcu.config.php delete mode 100644 15.0-rc/apache/config/apps.config.php delete mode 100644 15.0-rc/apache/config/autoconfig.php delete mode 100755 15.0-rc/apache/cron.sh delete mode 100755 15.0-rc/apache/entrypoint.sh delete mode 100644 15.0-rc/apache/upgrade.exclude delete mode 100644 15.0-rc/fpm-alpine/Dockerfile delete mode 100644 15.0-rc/fpm-alpine/config/apcu.config.php delete mode 100644 15.0-rc/fpm-alpine/config/apps.config.php delete mode 100644 15.0-rc/fpm-alpine/config/autoconfig.php delete mode 100755 15.0-rc/fpm-alpine/cron.sh delete mode 100755 15.0-rc/fpm-alpine/entrypoint.sh delete mode 100644 15.0-rc/fpm-alpine/upgrade.exclude delete mode 100644 15.0-rc/fpm/Dockerfile delete mode 100644 15.0-rc/fpm/config/apcu.config.php delete mode 100644 15.0-rc/fpm/config/apps.config.php delete mode 100644 15.0-rc/fpm/config/autoconfig.php delete mode 100755 15.0-rc/fpm/cron.sh delete mode 100755 15.0-rc/fpm/entrypoint.sh delete mode 100644 15.0-rc/fpm/upgrade.exclude diff --git a/.travis.yml b/.travis.yml index c7bdc606..6e36fdcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,25 +50,7 @@ jobs: - ./generate-stackbrew-library.sh - stage: test images - env: VERSION=13.0-rc VARIANT=fpm-alpine ARCH=amd64 - - env: VERSION=13.0-rc VARIANT=fpm-alpine ARCH=i386 - - env: VERSION=13.0-rc VARIANT=fpm ARCH=amd64 - - env: VERSION=13.0-rc VARIANT=fpm ARCH=i386 - - env: VERSION=13.0-rc VARIANT=apache ARCH=amd64 - - env: VERSION=13.0-rc VARIANT=apache ARCH=i386 - - env: VERSION=14.0-rc VARIANT=fpm-alpine ARCH=amd64 - - env: VERSION=14.0-rc VARIANT=fpm-alpine ARCH=i386 - - env: VERSION=14.0-rc VARIANT=fpm ARCH=amd64 - - env: VERSION=14.0-rc VARIANT=fpm ARCH=i386 - - env: VERSION=14.0-rc VARIANT=apache ARCH=amd64 - - env: VERSION=14.0-rc VARIANT=apache ARCH=i386 - - env: VERSION=15.0-rc VARIANT=fpm-alpine ARCH=amd64 - - env: VERSION=15.0-rc VARIANT=fpm-alpine ARCH=i386 - - env: VERSION=15.0-rc VARIANT=fpm ARCH=amd64 - - env: VERSION=15.0-rc VARIANT=fpm ARCH=i386 - - env: VERSION=15.0-rc VARIANT=apache ARCH=amd64 - - env: VERSION=15.0-rc VARIANT=apache ARCH=i386 - - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 + env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=i386 - env: VERSION=13.0 VARIANT=fpm ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm ARCH=i386 diff --git a/13.0-rc/apache/Dockerfile b/13.0-rc/apache/Dockerfile deleted file mode 100644 index f9ba0648..00000000 --- a/13.0-rc/apache/Dockerfile +++ /dev/null @@ -1,146 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-apache-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libevent-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - -RUN a2enmod rewrite remoteip ;\ - {\ - echo RemoteIPHeader X-Real-IP ;\ - echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ - echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ - echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ - } > /etc/apache2/conf-available/remoteip.conf;\ - a2enconf remoteip - -ENV NEXTCLOUD_VERSION 13.0.11RC1 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] diff --git a/13.0-rc/apache/config/apache-pretty-urls.config.php b/13.0-rc/apache/config/apache-pretty-urls.config.php deleted file mode 100644 index 72da1d8c..00000000 --- a/13.0-rc/apache/config/apache-pretty-urls.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '/', -); diff --git a/13.0-rc/apache/config/apcu.config.php b/13.0-rc/apache/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/13.0-rc/apache/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/13.0-rc/apache/config/apps.config.php b/13.0-rc/apache/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/13.0-rc/apache/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/13.0-rc/apache/config/autoconfig.php b/13.0-rc/apache/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/13.0-rc/apache/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/13.0-rc/apache/upgrade.exclude b/13.0-rc/apache/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/13.0-rc/apache/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/13.0-rc/fpm-alpine/Dockerfile b/13.0-rc/fpm-alpine/Dockerfile deleted file mode 100644 index e604e324..00000000 --- a/13.0-rc/fpm-alpine/Dockerfile +++ /dev/null @@ -1,123 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apk add --no-cache \ - rsync \ - ; \ - \ - rm /var/spool/cron/crontabs/root; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - freetype-dev \ - icu-dev \ - libevent-dev \ - libjpeg-turbo-dev \ - libmcrypt-dev \ - libpng-dev \ - libmemcached-dev \ - libxml2-dev \ - openldap-dev \ - pcre-dev \ - postgresql-dev \ - imagemagick-dev \ - ; \ - \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ - apk del .build-deps - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 13.0.11RC1 - -RUN set -ex; \ - apk add --no-cache --virtual .fetch-deps \ - bzip2 \ - gnupg \ - ; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - apk del .fetch-deps - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/13.0-rc/fpm-alpine/config/apcu.config.php b/13.0-rc/fpm-alpine/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/13.0-rc/fpm-alpine/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/13.0-rc/fpm-alpine/config/apps.config.php b/13.0-rc/fpm-alpine/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/13.0-rc/fpm-alpine/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/13.0-rc/fpm-alpine/config/autoconfig.php b/13.0-rc/fpm-alpine/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/13.0-rc/fpm-alpine/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/13.0-rc/fpm-alpine/upgrade.exclude b/13.0-rc/fpm-alpine/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/13.0-rc/fpm-alpine/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/13.0-rc/fpm/Dockerfile b/13.0-rc/fpm/Dockerfile deleted file mode 100644 index ef353c9d..00000000 --- a/13.0-rc/fpm/Dockerfile +++ /dev/null @@ -1,138 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-fpm-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libevent-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 13.0.11RC1 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/13.0-rc/fpm/config/apcu.config.php b/13.0-rc/fpm/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/13.0-rc/fpm/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/13.0-rc/fpm/config/apps.config.php b/13.0-rc/fpm/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/13.0-rc/fpm/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/13.0-rc/fpm/config/autoconfig.php b/13.0-rc/fpm/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/13.0-rc/fpm/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/13.0-rc/fpm/upgrade.exclude b/13.0-rc/fpm/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/13.0-rc/fpm/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/14.0-rc/apache/Dockerfile b/14.0-rc/apache/Dockerfile deleted file mode 100644 index 6f6beb3e..00000000 --- a/14.0-rc/apache/Dockerfile +++ /dev/null @@ -1,146 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-apache-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libevent-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - -RUN a2enmod rewrite remoteip ;\ - {\ - echo RemoteIPHeader X-Real-IP ;\ - echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ - echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ - echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ - } > /etc/apache2/conf-available/remoteip.conf;\ - a2enconf remoteip - -ENV NEXTCLOUD_VERSION 14.0.7RC1 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] diff --git a/14.0-rc/apache/config/apache-pretty-urls.config.php b/14.0-rc/apache/config/apache-pretty-urls.config.php deleted file mode 100644 index 72da1d8c..00000000 --- a/14.0-rc/apache/config/apache-pretty-urls.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '/', -); diff --git a/14.0-rc/apache/config/apcu.config.php b/14.0-rc/apache/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/14.0-rc/apache/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/14.0-rc/apache/config/apps.config.php b/14.0-rc/apache/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/14.0-rc/apache/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/14.0-rc/apache/config/autoconfig.php b/14.0-rc/apache/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/14.0-rc/apache/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/14.0-rc/apache/upgrade.exclude b/14.0-rc/apache/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/14.0-rc/apache/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/14.0-rc/fpm-alpine/Dockerfile b/14.0-rc/fpm-alpine/Dockerfile deleted file mode 100644 index 8549f704..00000000 --- a/14.0-rc/fpm-alpine/Dockerfile +++ /dev/null @@ -1,123 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apk add --no-cache \ - rsync \ - ; \ - \ - rm /var/spool/cron/crontabs/root; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - freetype-dev \ - icu-dev \ - libevent-dev \ - libjpeg-turbo-dev \ - libmcrypt-dev \ - libpng-dev \ - libmemcached-dev \ - libxml2-dev \ - openldap-dev \ - pcre-dev \ - postgresql-dev \ - imagemagick-dev \ - ; \ - \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ - apk del .build-deps - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 14.0.7RC1 - -RUN set -ex; \ - apk add --no-cache --virtual .fetch-deps \ - bzip2 \ - gnupg \ - ; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - apk del .fetch-deps - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/14.0-rc/fpm-alpine/config/apcu.config.php b/14.0-rc/fpm-alpine/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/14.0-rc/fpm-alpine/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/14.0-rc/fpm-alpine/config/apps.config.php b/14.0-rc/fpm-alpine/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/14.0-rc/fpm-alpine/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/14.0-rc/fpm-alpine/config/autoconfig.php b/14.0-rc/fpm-alpine/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/14.0-rc/fpm-alpine/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/14.0-rc/fpm-alpine/upgrade.exclude b/14.0-rc/fpm-alpine/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/14.0-rc/fpm-alpine/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/14.0-rc/fpm/Dockerfile b/14.0-rc/fpm/Dockerfile deleted file mode 100644 index 584daee1..00000000 --- a/14.0-rc/fpm/Dockerfile +++ /dev/null @@ -1,138 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-fpm-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libevent-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 14.0.7RC1 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/14.0-rc/fpm/config/apcu.config.php b/14.0-rc/fpm/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/14.0-rc/fpm/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/14.0-rc/fpm/config/apps.config.php b/14.0-rc/fpm/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/14.0-rc/fpm/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/14.0-rc/fpm/config/autoconfig.php b/14.0-rc/fpm/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/14.0-rc/fpm/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/14.0-rc/fpm/upgrade.exclude b/14.0-rc/fpm/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/14.0-rc/fpm/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/15.0-rc/apache/Dockerfile b/15.0-rc/apache/Dockerfile deleted file mode 100644 index a3b99bd2..00000000 --- a/15.0-rc/apache/Dockerfile +++ /dev/null @@ -1,146 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-apache-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libevent-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - -RUN a2enmod rewrite remoteip ;\ - {\ - echo RemoteIPHeader X-Real-IP ;\ - echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ - echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ - echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ - } > /etc/apache2/conf-available/remoteip.conf;\ - a2enconf remoteip - -ENV NEXTCLOUD_VERSION 15.0.3RC1 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] diff --git a/15.0-rc/apache/config/apache-pretty-urls.config.php b/15.0-rc/apache/config/apache-pretty-urls.config.php deleted file mode 100644 index 72da1d8c..00000000 --- a/15.0-rc/apache/config/apache-pretty-urls.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '/', -); diff --git a/15.0-rc/apache/config/apcu.config.php b/15.0-rc/apache/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/15.0-rc/apache/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/15.0-rc/apache/config/apps.config.php b/15.0-rc/apache/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/15.0-rc/apache/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/15.0-rc/apache/config/autoconfig.php b/15.0-rc/apache/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/15.0-rc/apache/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/15.0-rc/apache/upgrade.exclude b/15.0-rc/apache/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/15.0-rc/apache/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/15.0-rc/fpm-alpine/Dockerfile b/15.0-rc/fpm-alpine/Dockerfile deleted file mode 100644 index 675020b5..00000000 --- a/15.0-rc/fpm-alpine/Dockerfile +++ /dev/null @@ -1,123 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apk add --no-cache \ - rsync \ - ; \ - \ - rm /var/spool/cron/crontabs/root; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - freetype-dev \ - icu-dev \ - libevent-dev \ - libjpeg-turbo-dev \ - libmcrypt-dev \ - libpng-dev \ - libmemcached-dev \ - libxml2-dev \ - openldap-dev \ - pcre-dev \ - postgresql-dev \ - imagemagick-dev \ - ; \ - \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ - apk del .build-deps - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 15.0.3RC1 - -RUN set -ex; \ - apk add --no-cache --virtual .fetch-deps \ - bzip2 \ - gnupg \ - ; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - apk del .fetch-deps - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/15.0-rc/fpm-alpine/config/apcu.config.php b/15.0-rc/fpm-alpine/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/15.0-rc/fpm-alpine/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/15.0-rc/fpm-alpine/config/apps.config.php b/15.0-rc/fpm-alpine/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/15.0-rc/fpm-alpine/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/15.0-rc/fpm-alpine/config/autoconfig.php b/15.0-rc/fpm-alpine/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/15.0-rc/fpm-alpine/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/15.0-rc/fpm-alpine/upgrade.exclude b/15.0-rc/fpm-alpine/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/15.0-rc/fpm-alpine/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/15.0-rc/fpm/Dockerfile b/15.0-rc/fpm/Dockerfile deleted file mode 100644 index da13bf04..00000000 --- a/15.0-rc/fpm/Dockerfile +++ /dev/null @@ -1,138 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-fpm-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libevent-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 15.0.3RC1 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/15.0-rc/fpm/config/apcu.config.php b/15.0-rc/fpm/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/15.0-rc/fpm/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/15.0-rc/fpm/config/apps.config.php b/15.0-rc/fpm/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/15.0-rc/fpm/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/15.0-rc/fpm/config/autoconfig.php b/15.0-rc/fpm/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/15.0-rc/fpm/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/15.0-rc/fpm/upgrade.exclude b/15.0-rc/fpm/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/15.0-rc/fpm/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ From 6d7be410e0a09a1a08e49762c7a7901e8bda49f3 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Thu, 7 Feb 2019 12:17:57 +0100 Subject: [PATCH 52/67] Update to 15.0.4 Signed-off-by: Tilo Spannagel --- 15.0/apache/Dockerfile | 2 +- 15.0/fpm-alpine/Dockerfile | 2 +- 15.0/fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 4f0aea57..409b8035 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -110,7 +110,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 15.0.3 +ENV NEXTCLOUD_VERSION 15.0.4 RUN set -ex; \ fetchDeps=" \ diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index fca9dddb..10f4ff11 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -91,7 +91,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.3 +ENV NEXTCLOUD_VERSION 15.0.4 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index 915237d7..62544154 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -102,7 +102,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.3 +ENV NEXTCLOUD_VERSION 15.0.4 RUN set -ex; \ fetchDeps=" \ From 0a3d4aef87ccb46611ed18dc43f0355fa2decb5f Mon Sep 17 00:00:00 2001 From: J0WI Date: Thu, 7 Feb 2019 12:44:38 +0100 Subject: [PATCH 53/67] Update to Alpine 3.9 Signed-off-by: J0WI --- 13.0/fpm-alpine/Dockerfile | 2 +- 14.0/fpm-alpine/Dockerfile | 2 +- 15.0/fpm-alpine/Dockerfile | 2 +- Dockerfile-alpine.template | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index b546bf7f..aa21060b 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 +FROM php:7.2-fpm-alpine3.9 # entrypoint.sh and cron.sh dependencies RUN set -ex; \ diff --git a/14.0/fpm-alpine/Dockerfile b/14.0/fpm-alpine/Dockerfile index b8a8a25b..8c62f7c4 100644 --- a/14.0/fpm-alpine/Dockerfile +++ b/14.0/fpm-alpine/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 +FROM php:7.2-fpm-alpine3.9 # entrypoint.sh and cron.sh dependencies RUN set -ex; \ diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index 10f4ff11..0fe035f8 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 +FROM php:7.2-fpm-alpine3.9 # entrypoint.sh and cron.sh dependencies RUN set -ex; \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 6b92d863..a92701c0 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -1,4 +1,4 @@ -FROM php:%%PHP_VERSION%%-%%VARIANT%%3.8 +FROM php:%%PHP_VERSION%%-%%VARIANT%%3.9 # entrypoint.sh and cron.sh dependencies RUN set -ex; \ From cc0564ed40b14ea26886acc1e49cc9f706a8fe3a Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Thu, 7 Feb 2019 12:33:13 +0100 Subject: [PATCH 54/67] Remove app dockerfile Signed-off-by: Tilo Spannagel --- .../insecure/mariadb-cron-redis/apache/app/Dockerfile | 3 --- .../insecure/mariadb-cron-redis/apache/docker-compose.yml | 4 ++-- .../insecure/mariadb-cron-redis/fpm/app/Dockerfile | 3 --- .../insecure/mariadb-cron-redis/fpm/docker-compose.yml | 4 ++-- .../mariadb-cron-redis/apache/app/Dockerfile | 3 --- .../mariadb-cron-redis/apache/docker-compose.yml | 4 ++-- .../with-nginx-proxy/mariadb-cron-redis/fpm/app/Dockerfile | 3 --- .../mariadb-cron-redis/fpm/docker-compose.yml | 6 +++--- 8 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 .examples/docker-compose/insecure/mariadb-cron-redis/apache/app/Dockerfile delete mode 100644 .examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/Dockerfile delete mode 100644 .examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/app/Dockerfile delete mode 100644 .examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/app/Dockerfile diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/app/Dockerfile b/.examples/docker-compose/insecure/mariadb-cron-redis/apache/app/Dockerfile deleted file mode 100644 index b55fb524..00000000 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/app/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM nextcloud:apache - -COPY redis.config.php /usr/src/nextcloud/config/redis.config.php diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml b/.examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml index 97c69299..600c609f 100644 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml +++ b/.examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml @@ -17,7 +17,7 @@ services: restart: always app: - build: ./app + image: nextcloud:apache restart: always ports: - 8080:80 @@ -33,7 +33,7 @@ services: - redis cron: - build: ./app + image: nextcloud:apache restart: always volumes: - nextcloud:/var/www/html diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/Dockerfile b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/Dockerfile deleted file mode 100644 index 0436d37d..00000000 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM nextcloud:fpm-alpine - -COPY redis.config.php /usr/src/nextcloud/config/redis.config.php diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/docker-compose.yml b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/docker-compose.yml index b48e54f1..5ac5b3b1 100644 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/docker-compose.yml +++ b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/docker-compose.yml @@ -17,7 +17,7 @@ services: restart: always app: - build: ./app + image: nextcloud:fpm-alpine restart: always volumes: - nextcloud:/var/www/html @@ -41,7 +41,7 @@ services: - app cron: - build: ./app + image: nextcloud:fpm-alpine restart: always volumes: - nextcloud:/var/www/html diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/app/Dockerfile b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/app/Dockerfile deleted file mode 100644 index b55fb524..00000000 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/app/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM nextcloud:apache - -COPY redis.config.php /usr/src/nextcloud/config/redis.config.php diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/docker-compose.yml index 2c3f125e..39ab2bef 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/docker-compose.yml +++ b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/docker-compose.yml @@ -17,7 +17,7 @@ services: restart: always app: - build: ./app + image: nextcloud:apache restart: always volumes: - nextcloud:/var/www/html @@ -37,7 +37,7 @@ services: - default cron: - build: ./app + image: nextcloud:apache restart: always volumes: - nextcloud:/var/www/html diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/app/Dockerfile b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/app/Dockerfile deleted file mode 100644 index 0436d37d..00000000 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/app/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM nextcloud:fpm-alpine - -COPY redis.config.php /usr/src/nextcloud/config/redis.config.php diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/docker-compose.yml index fd2e5fc1..d5763620 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/docker-compose.yml +++ b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/docker-compose.yml @@ -17,13 +17,13 @@ services: restart: always app: - build: ./app + image: nextcloud:fpm-alpine restart: always volumes: - nextcloud:/var/www/html environment: - MYSQL_HOST=db - - REDIS_HOST=redis + - REDIS_HOST=redis env_file: - db.env depends_on: @@ -46,7 +46,7 @@ services: - default cron: - build: ./app + image: nextcloud:fpm-alpine restart: always volumes: - nextcloud:/var/www/html From f4929e6067a5b1002ce89735da6bbf1b77add944 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Thu, 7 Feb 2019 13:19:54 +0100 Subject: [PATCH 55/67] Ship 14.0.7 on production channel Signed-off-by: Tilo Spannagel --- generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 461f6cb1..4b0165cc 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -3,7 +3,7 @@ set -Eeuo pipefail declare -A release_channel=( [stable]='15.0.2' - [production]='14.0.6' + [production]='14.0.7' ) self="$(basename "$BASH_SOURCE")" From be19f23e61abbdac03e66fa58ec85a3822cb1c54 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Thu, 7 Feb 2019 13:21:16 +0100 Subject: [PATCH 56/67] Ship 15.0.4 on stable channel Signed-off-by: Tilo Spannagel --- generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 4b0165cc..abe47cfd 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -2,7 +2,7 @@ set -Eeuo pipefail declare -A release_channel=( - [stable]='15.0.2' + [stable]='15.0.4' [production]='14.0.7' ) From 2e8205eef408c231ef572a8c19d97bbb1fd0b4d0 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Fri, 8 Feb 2019 10:53:12 +0000 Subject: [PATCH 57/67] Update to 15.0.0beta2 --- 15.0-beta/apache/Dockerfile | 146 ++++++++++++++++++ .../config/apache-pretty-urls.config.php | 4 + 15.0-beta/apache/config/apcu.config.php | 4 + 15.0-beta/apache/config/apps.config.php | 15 ++ 15.0-beta/apache/config/autoconfig.php | 29 ++++ 15.0-beta/apache/config/redis.config.php | 12 ++ 15.0-beta/apache/cron.sh | 4 + 15.0-beta/apache/entrypoint.sh | 132 ++++++++++++++++ 15.0-beta/apache/upgrade.exclude | 4 + 15.0-beta/fpm-alpine/Dockerfile | 123 +++++++++++++++ 15.0-beta/fpm-alpine/config/apcu.config.php | 4 + 15.0-beta/fpm-alpine/config/apps.config.php | 15 ++ 15.0-beta/fpm-alpine/config/autoconfig.php | 29 ++++ 15.0-beta/fpm-alpine/config/redis.config.php | 12 ++ 15.0-beta/fpm-alpine/cron.sh | 4 + 15.0-beta/fpm-alpine/entrypoint.sh | 132 ++++++++++++++++ 15.0-beta/fpm-alpine/upgrade.exclude | 4 + 15.0-beta/fpm/Dockerfile | 138 +++++++++++++++++ 15.0-beta/fpm/config/apcu.config.php | 4 + 15.0-beta/fpm/config/apps.config.php | 15 ++ 15.0-beta/fpm/config/autoconfig.php | 29 ++++ 15.0-beta/fpm/config/redis.config.php | 12 ++ 15.0-beta/fpm/cron.sh | 4 + 15.0-beta/fpm/entrypoint.sh | 132 ++++++++++++++++ 15.0-beta/fpm/upgrade.exclude | 4 + 25 files changed, 1011 insertions(+) create mode 100644 15.0-beta/apache/Dockerfile create mode 100644 15.0-beta/apache/config/apache-pretty-urls.config.php create mode 100644 15.0-beta/apache/config/apcu.config.php create mode 100644 15.0-beta/apache/config/apps.config.php create mode 100644 15.0-beta/apache/config/autoconfig.php create mode 100644 15.0-beta/apache/config/redis.config.php create mode 100755 15.0-beta/apache/cron.sh create mode 100755 15.0-beta/apache/entrypoint.sh create mode 100644 15.0-beta/apache/upgrade.exclude create mode 100644 15.0-beta/fpm-alpine/Dockerfile create mode 100644 15.0-beta/fpm-alpine/config/apcu.config.php create mode 100644 15.0-beta/fpm-alpine/config/apps.config.php create mode 100644 15.0-beta/fpm-alpine/config/autoconfig.php create mode 100644 15.0-beta/fpm-alpine/config/redis.config.php create mode 100755 15.0-beta/fpm-alpine/cron.sh create mode 100755 15.0-beta/fpm-alpine/entrypoint.sh create mode 100644 15.0-beta/fpm-alpine/upgrade.exclude create mode 100644 15.0-beta/fpm/Dockerfile create mode 100644 15.0-beta/fpm/config/apcu.config.php create mode 100644 15.0-beta/fpm/config/apps.config.php create mode 100644 15.0-beta/fpm/config/autoconfig.php create mode 100644 15.0-beta/fpm/config/redis.config.php create mode 100755 15.0-beta/fpm/cron.sh create mode 100755 15.0-beta/fpm/entrypoint.sh create mode 100644 15.0-beta/fpm/upgrade.exclude diff --git a/15.0-beta/apache/Dockerfile b/15.0-beta/apache/Dockerfile new file mode 100644 index 00000000..a28d7070 --- /dev/null +++ b/15.0-beta/apache/Dockerfile @@ -0,0 +1,146 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-apache-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod rewrite remoteip ;\ + {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + } > /etc/apache2/conf-available/remoteip.conf;\ + a2enconf remoteip + +ENV NEXTCLOUD_VERSION 15.0.0beta2 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/15.0-beta/apache/config/apache-pretty-urls.config.php b/15.0-beta/apache/config/apache-pretty-urls.config.php new file mode 100644 index 00000000..72da1d8c --- /dev/null +++ b/15.0-beta/apache/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/15.0-beta/apache/config/apcu.config.php b/15.0-beta/apache/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-beta/apache/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-beta/apache/config/apps.config.php b/15.0-beta/apache/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-beta/apache/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-beta/apache/config/autoconfig.php b/15.0-beta/apache/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-beta/apache/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/15.0-beta/apache/cron.sh b/15.0-beta/apache/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/15.0-beta/apache/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/15.0-beta/apache/entrypoint.sh b/15.0-beta/apache/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/15.0-beta/apache/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-beta/apache/upgrade.exclude b/15.0-beta/apache/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-beta/apache/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/15.0-beta/fpm-alpine/Dockerfile b/15.0-beta/fpm-alpine/Dockerfile new file mode 100644 index 00000000..251c4bd0 --- /dev/null +++ b/15.0-beta/fpm-alpine/Dockerfile @@ -0,0 +1,123 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template +FROM php:7.2-fpm-alpine3.8 + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + rsync \ + ; \ + \ + rm /var/spool/cron/crontabs/root; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + freetype-dev \ + icu-dev \ + libevent-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + pcre-dev \ + postgresql-dev \ + imagemagick-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 15.0.0beta2 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/15.0-beta/fpm-alpine/config/apcu.config.php b/15.0-beta/fpm-alpine/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-beta/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-beta/fpm-alpine/config/apps.config.php b/15.0-beta/fpm-alpine/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-beta/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-beta/fpm-alpine/config/autoconfig.php b/15.0-beta/fpm-alpine/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-beta/fpm-alpine/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/15.0-beta/fpm-alpine/cron.sh b/15.0-beta/fpm-alpine/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/15.0-beta/fpm-alpine/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/15.0-beta/fpm-alpine/entrypoint.sh b/15.0-beta/fpm-alpine/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/15.0-beta/fpm-alpine/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-beta/fpm-alpine/upgrade.exclude b/15.0-beta/fpm-alpine/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-beta/fpm-alpine/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/15.0-beta/fpm/Dockerfile b/15.0-beta/fpm/Dockerfile new file mode 100644 index 00000000..be63ff1b --- /dev/null +++ b/15.0-beta/fpm/Dockerfile @@ -0,0 +1,138 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-fpm-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.16; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 15.0.0beta2 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/15.0-beta/fpm/config/apcu.config.php b/15.0-beta/fpm/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-beta/fpm/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-beta/fpm/config/apps.config.php b/15.0-beta/fpm/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-beta/fpm/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-beta/fpm/config/autoconfig.php b/15.0-beta/fpm/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-beta/fpm/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/15.0-beta/fpm/cron.sh b/15.0-beta/fpm/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/15.0-beta/fpm/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/15.0-beta/fpm/entrypoint.sh b/15.0-beta/fpm/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/15.0-beta/fpm/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-beta/fpm/upgrade.exclude b/15.0-beta/fpm/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-beta/fpm/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ From 4c0d269740704b19b11dcb5522cbc3c23fec2906 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Fri, 8 Feb 2019 22:29:34 +0100 Subject: [PATCH 58/67] Revert "Update to 15.0.0beta2" This reverts commit 2e8205eef408c231ef572a8c19d97bbb1fd0b4d0. --- 15.0-beta/apache/Dockerfile | 146 ------------------ .../config/apache-pretty-urls.config.php | 4 - 15.0-beta/apache/config/apcu.config.php | 4 - 15.0-beta/apache/config/apps.config.php | 15 -- 15.0-beta/apache/config/autoconfig.php | 29 ---- 15.0-beta/apache/config/redis.config.php | 12 -- 15.0-beta/apache/cron.sh | 4 - 15.0-beta/apache/entrypoint.sh | 132 ---------------- 15.0-beta/apache/upgrade.exclude | 4 - 15.0-beta/fpm-alpine/Dockerfile | 123 --------------- 15.0-beta/fpm-alpine/config/apcu.config.php | 4 - 15.0-beta/fpm-alpine/config/apps.config.php | 15 -- 15.0-beta/fpm-alpine/config/autoconfig.php | 29 ---- 15.0-beta/fpm-alpine/config/redis.config.php | 12 -- 15.0-beta/fpm-alpine/cron.sh | 4 - 15.0-beta/fpm-alpine/entrypoint.sh | 132 ---------------- 15.0-beta/fpm-alpine/upgrade.exclude | 4 - 15.0-beta/fpm/Dockerfile | 138 ----------------- 15.0-beta/fpm/config/apcu.config.php | 4 - 15.0-beta/fpm/config/apps.config.php | 15 -- 15.0-beta/fpm/config/autoconfig.php | 29 ---- 15.0-beta/fpm/config/redis.config.php | 12 -- 15.0-beta/fpm/cron.sh | 4 - 15.0-beta/fpm/entrypoint.sh | 132 ---------------- 15.0-beta/fpm/upgrade.exclude | 4 - 25 files changed, 1011 deletions(-) delete mode 100644 15.0-beta/apache/Dockerfile delete mode 100644 15.0-beta/apache/config/apache-pretty-urls.config.php delete mode 100644 15.0-beta/apache/config/apcu.config.php delete mode 100644 15.0-beta/apache/config/apps.config.php delete mode 100644 15.0-beta/apache/config/autoconfig.php delete mode 100644 15.0-beta/apache/config/redis.config.php delete mode 100755 15.0-beta/apache/cron.sh delete mode 100755 15.0-beta/apache/entrypoint.sh delete mode 100644 15.0-beta/apache/upgrade.exclude delete mode 100644 15.0-beta/fpm-alpine/Dockerfile delete mode 100644 15.0-beta/fpm-alpine/config/apcu.config.php delete mode 100644 15.0-beta/fpm-alpine/config/apps.config.php delete mode 100644 15.0-beta/fpm-alpine/config/autoconfig.php delete mode 100644 15.0-beta/fpm-alpine/config/redis.config.php delete mode 100755 15.0-beta/fpm-alpine/cron.sh delete mode 100755 15.0-beta/fpm-alpine/entrypoint.sh delete mode 100644 15.0-beta/fpm-alpine/upgrade.exclude delete mode 100644 15.0-beta/fpm/Dockerfile delete mode 100644 15.0-beta/fpm/config/apcu.config.php delete mode 100644 15.0-beta/fpm/config/apps.config.php delete mode 100644 15.0-beta/fpm/config/autoconfig.php delete mode 100644 15.0-beta/fpm/config/redis.config.php delete mode 100755 15.0-beta/fpm/cron.sh delete mode 100755 15.0-beta/fpm/entrypoint.sh delete mode 100644 15.0-beta/fpm/upgrade.exclude diff --git a/15.0-beta/apache/Dockerfile b/15.0-beta/apache/Dockerfile deleted file mode 100644 index a28d7070..00000000 --- a/15.0-beta/apache/Dockerfile +++ /dev/null @@ -1,146 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-apache-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libevent-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - -RUN a2enmod rewrite remoteip ;\ - {\ - echo RemoteIPHeader X-Real-IP ;\ - echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ - echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ - echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ - } > /etc/apache2/conf-available/remoteip.conf;\ - a2enconf remoteip - -ENV NEXTCLOUD_VERSION 15.0.0beta2 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] diff --git a/15.0-beta/apache/config/apache-pretty-urls.config.php b/15.0-beta/apache/config/apache-pretty-urls.config.php deleted file mode 100644 index 72da1d8c..00000000 --- a/15.0-beta/apache/config/apache-pretty-urls.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '/', -); diff --git a/15.0-beta/apache/config/apcu.config.php b/15.0-beta/apache/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/15.0-beta/apache/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/15.0-beta/apache/config/apps.config.php b/15.0-beta/apache/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/15.0-beta/apache/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/15.0-beta/apache/config/autoconfig.php b/15.0-beta/apache/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/15.0-beta/apache/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - '\OC\Memcache\Redis', - 'memcache.locking' => '\OC\Memcache\Redis', - 'redis' => array( - 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_HOST_PORT') ?: 6379, - ), - ); -} - diff --git a/15.0-beta/apache/cron.sh b/15.0-beta/apache/cron.sh deleted file mode 100755 index 4dfa4118..00000000 --- a/15.0-beta/apache/cron.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -set -eu - -exec busybox crond -f -l 0 -L /dev/stdout diff --git a/15.0-beta/apache/entrypoint.sh b/15.0-beta/apache/entrypoint.sh deleted file mode 100755 index 07644c04..00000000 --- a/15.0-beta/apache/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/sh -set -eu - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/15.0-beta/apache/upgrade.exclude b/15.0-beta/apache/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/15.0-beta/apache/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/15.0-beta/fpm-alpine/Dockerfile b/15.0-beta/fpm-alpine/Dockerfile deleted file mode 100644 index 251c4bd0..00000000 --- a/15.0-beta/fpm-alpine/Dockerfile +++ /dev/null @@ -1,123 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.2-fpm-alpine3.8 - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apk add --no-cache \ - rsync \ - ; \ - \ - rm /var/spool/cron/crontabs/root; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - freetype-dev \ - icu-dev \ - libevent-dev \ - libjpeg-turbo-dev \ - libmcrypt-dev \ - libpng-dev \ - libmemcached-dev \ - libxml2-dev \ - openldap-dev \ - pcre-dev \ - postgresql-dev \ - imagemagick-dev \ - ; \ - \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ - apk del .build-deps - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 15.0.0beta2 - -RUN set -ex; \ - apk add --no-cache --virtual .fetch-deps \ - bzip2 \ - gnupg \ - ; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - apk del .fetch-deps - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/15.0-beta/fpm-alpine/config/apcu.config.php b/15.0-beta/fpm-alpine/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/15.0-beta/fpm-alpine/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/15.0-beta/fpm-alpine/config/apps.config.php b/15.0-beta/fpm-alpine/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/15.0-beta/fpm-alpine/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/15.0-beta/fpm-alpine/config/autoconfig.php b/15.0-beta/fpm-alpine/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/15.0-beta/fpm-alpine/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - '\OC\Memcache\Redis', - 'memcache.locking' => '\OC\Memcache\Redis', - 'redis' => array( - 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_HOST_PORT') ?: 6379, - ), - ); -} - diff --git a/15.0-beta/fpm-alpine/cron.sh b/15.0-beta/fpm-alpine/cron.sh deleted file mode 100755 index 4dfa4118..00000000 --- a/15.0-beta/fpm-alpine/cron.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -set -eu - -exec busybox crond -f -l 0 -L /dev/stdout diff --git a/15.0-beta/fpm-alpine/entrypoint.sh b/15.0-beta/fpm-alpine/entrypoint.sh deleted file mode 100755 index 07644c04..00000000 --- a/15.0-beta/fpm-alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/sh -set -eu - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/15.0-beta/fpm-alpine/upgrade.exclude b/15.0-beta/fpm-alpine/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/15.0-beta/fpm-alpine/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ diff --git a/15.0-beta/fpm/Dockerfile b/15.0-beta/fpm/Dockerfile deleted file mode 100644 index be63ff1b..00000000 --- a/15.0-beta/fpm/Dockerfile +++ /dev/null @@ -1,138 +0,0 @@ -# DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.2-fpm-stretch - -# entrypoint.sh and cron.sh dependencies -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - rsync \ - bzip2 \ - busybox-static \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data - -# install the PHP extensions we need -# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html -RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libevent-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libmagickwand-dev \ - ; \ - \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - ; \ - \ -# pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ - pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ - pecl install imagick-3.4.3; \ - \ - docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - imagick \ - ; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -# set recommended PHP.ini settings -# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache -RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ - \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ - \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ - \ - mkdir /var/www/data; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html - - -ENV NEXTCLOUD_VERSION 15.0.0beta2 - -RUN set -ex; \ - fetchDeps=" \ - gnupg \ - dirmngr \ - "; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - \ - curl -fsSL -o nextcloud.tar.bz2 \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ - curl -fsSL -o nextcloud.tar.bz2.asc \ - "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ -# gpg key from https://nextcloud.com/nextcloud.asc - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ - gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ - gpgconf --kill all; \ - rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ - rm -rf /usr/src/nextcloud/updater; \ - mkdir -p /usr/src/nextcloud/data; \ - mkdir -p /usr/src/nextcloud/custom_apps; \ - chmod +x /usr/src/nextcloud/occ; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ - rm -rf /var/lib/apt/lists/* - -COPY *.sh upgrade.exclude / -COPY config/* /usr/src/nextcloud/config/ - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/15.0-beta/fpm/config/apcu.config.php b/15.0-beta/fpm/config/apcu.config.php deleted file mode 100644 index 69fed876..00000000 --- a/15.0-beta/fpm/config/apcu.config.php +++ /dev/null @@ -1,4 +0,0 @@ - '\OC\Memcache\APCu', -); diff --git a/15.0-beta/fpm/config/apps.config.php b/15.0-beta/fpm/config/apps.config.php deleted file mode 100644 index a4bed833..00000000 --- a/15.0-beta/fpm/config/apps.config.php +++ /dev/null @@ -1,15 +0,0 @@ - array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/custom_apps", - "url" => "/custom_apps", - "writable" => true, - ), - ), -); diff --git a/15.0-beta/fpm/config/autoconfig.php b/15.0-beta/fpm/config/autoconfig.php deleted file mode 100644 index 85e02212..00000000 --- a/15.0-beta/fpm/config/autoconfig.php +++ /dev/null @@ -1,29 +0,0 @@ - '\OC\Memcache\Redis', - 'memcache.locking' => '\OC\Memcache\Redis', - 'redis' => array( - 'host' => getenv('REDIS_HOST'), - 'port' => getenv('REDIS_HOST_PORT') ?: 6379, - ), - ); -} - diff --git a/15.0-beta/fpm/cron.sh b/15.0-beta/fpm/cron.sh deleted file mode 100755 index 4dfa4118..00000000 --- a/15.0-beta/fpm/cron.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -set -eu - -exec busybox crond -f -l 0 -L /dev/stdout diff --git a/15.0-beta/fpm/entrypoint.sh b/15.0-beta/fpm/entrypoint.sh deleted file mode 100755 index 07644c04..00000000 --- a/15.0-beta/fpm/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/sh -set -eu - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - -if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then - installed_version="0.0.0.0" - if [ -f /var/www/html/version.php ]; then - # shellcheck disable=SC2016 - installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" - fi - # shellcheck disable=SC2016 - image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" - - if version_greater "$installed_version" "$image_version"; then - echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" - exit 1 - fi - - if version_greater "$image_version" "$installed_version"; then - echo "Initializing nextcloud $image_version ..." - if [ "$installed_version" != "0.0.0.0" ]; then - echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before - fi - if [ "$(id -u)" = 0 ]; then - rsync_options="-rlDog --chown www-data:root" - else - rsync_options="-rlD" - fi - rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ - - for dir in config data custom_apps themes; do - if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then - rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ - fi - done - echo "Initializing finished" - - #install - if [ "$installed_version" = "0.0.0.0" ]; then - echo "New nextcloud instance" - - if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then - # shellcheck disable=SC2016 - install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' - if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' - else - install_options=$install_options' --database-table-prefix ""' - fi - if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then - # shellcheck disable=SC2016 - install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' - fi - - install=false - if [ -n "${SQLITE_DATABASE+x}" ]; then - echo "Installing with SQLite database" - # shellcheck disable=SC2016 - install_options=$install_options' --database-name "$SQLITE_DATABASE"' - install=true - elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then - echo "Installing with MySQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' - install=true - elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then - echo "Installing with PostgreSQL database" - # shellcheck disable=SC2016 - install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' - install=true - fi - - if [ "$install" = true ]; then - echo "starting nextcloud installation" - max_retries=10 - try=0 - until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] - do - echo "retrying install..." - try=$((try+1)) - sleep 3s - done - if [ "$try" -gt "$max_retries" ]; then - echo "installing of nextcloud failed!" - exit 1 - fi - if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then - echo "setting trusted domains…" - NC_TRUSTED_DOMAIN_IDX=1 - for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do - DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') - run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" - NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) - done - fi - else - echo "running web-based installer on first connect!" - fi - fi - #upgrade - else - run_as 'php /var/www/html/occ upgrade' - - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 - rm -f /tmp/list_before /tmp/list_after - - fi - fi -fi - -exec "$@" diff --git a/15.0-beta/fpm/upgrade.exclude b/15.0-beta/fpm/upgrade.exclude deleted file mode 100644 index a1f2de95..00000000 --- a/15.0-beta/fpm/upgrade.exclude +++ /dev/null @@ -1,4 +0,0 @@ -/config/ -/data/ -/custom_apps/ -/themes/ From 891feeaf9485b9dba320aeac61504a81bfaeb462 Mon Sep 17 00:00:00 2001 From: J0WI Date: Sun, 10 Feb 2019 20:54:46 +0100 Subject: [PATCH 59/67] Update APCu to 5.1.17 Signed-off-by: J0WI --- 13.0/apache/Dockerfile | 2 +- 13.0/fpm-alpine/Dockerfile | 2 +- 13.0/fpm/Dockerfile | 2 +- 14.0/apache/Dockerfile | 2 +- 14.0/fpm-alpine/Dockerfile | 2 +- 14.0/fpm/Dockerfile | 2 +- 15.0/apache/Dockerfile | 2 +- 15.0/fpm-alpine/Dockerfile | 2 +- 15.0/fpm/Dockerfile | 2 +- update.sh | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/13.0/apache/Dockerfile b/13.0/apache/Dockerfile index 7cddbb0a..5f189daf 100644 --- a/13.0/apache/Dockerfile +++ b/13.0/apache/Dockerfile @@ -53,7 +53,7 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ + pecl install APCu-5.1.17; \ pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index aa21060b..05ec096a 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -47,7 +47,7 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ + pecl install APCu-5.1.17; \ pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile index 4200fcdb..70623522 100644 --- a/13.0/fpm/Dockerfile +++ b/13.0/fpm/Dockerfile @@ -53,7 +53,7 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ + pecl install APCu-5.1.17; \ pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ diff --git a/14.0/apache/Dockerfile b/14.0/apache/Dockerfile index 070f3989..3775aa72 100644 --- a/14.0/apache/Dockerfile +++ b/14.0/apache/Dockerfile @@ -53,7 +53,7 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ + pecl install APCu-5.1.17; \ pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ diff --git a/14.0/fpm-alpine/Dockerfile b/14.0/fpm-alpine/Dockerfile index 8c62f7c4..b0a4f24b 100644 --- a/14.0/fpm-alpine/Dockerfile +++ b/14.0/fpm-alpine/Dockerfile @@ -47,7 +47,7 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ + pecl install APCu-5.1.17; \ pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ diff --git a/14.0/fpm/Dockerfile b/14.0/fpm/Dockerfile index 93a12239..c7d608fa 100644 --- a/14.0/fpm/Dockerfile +++ b/14.0/fpm/Dockerfile @@ -53,7 +53,7 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ + pecl install APCu-5.1.17; \ pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 409b8035..35420f32 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -53,7 +53,7 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ + pecl install APCu-5.1.17; \ pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index 0fe035f8..946e2ebd 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -47,7 +47,7 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ + pecl install APCu-5.1.17; \ pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index 62544154..c292d513 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -53,7 +53,7 @@ RUN set -ex; \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install APCu-5.1.16; \ + pecl install APCu-5.1.17; \ pecl install memcached-3.1.3; \ pecl install redis-4.2.0; \ pecl install imagick-3.4.3; \ diff --git a/update.sh b/update.sh index 12db63dd..8dc4c81f 100755 --- a/update.sh +++ b/update.sh @@ -26,7 +26,7 @@ declare -A extras=( ) declare -A pecl_versions=( - [APCu]='5.1.16' + [APCu]='5.1.17' [memcached]='3.1.3' [redis]='4.2.0' [imagick]='3.4.3' From f9e1ef8537f66be5a5b7cf3da86af46ae502897d Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Wed, 20 Feb 2019 16:51:29 +0000 Subject: [PATCH 60/67] Update to 13.0.12RC1 --- 13.0-rc/apache/Dockerfile | 146 ++++++++++++++++++ .../config/apache-pretty-urls.config.php | 4 + 13.0-rc/apache/config/apcu.config.php | 4 + 13.0-rc/apache/config/apps.config.php | 15 ++ 13.0-rc/apache/config/autoconfig.php | 29 ++++ 13.0-rc/apache/config/redis.config.php | 12 ++ 13.0-rc/apache/cron.sh | 4 + 13.0-rc/apache/entrypoint.sh | 132 ++++++++++++++++ 13.0-rc/apache/upgrade.exclude | 4 + 13.0-rc/fpm-alpine/Dockerfile | 123 +++++++++++++++ 13.0-rc/fpm-alpine/config/apcu.config.php | 4 + 13.0-rc/fpm-alpine/config/apps.config.php | 15 ++ 13.0-rc/fpm-alpine/config/autoconfig.php | 29 ++++ 13.0-rc/fpm-alpine/config/redis.config.php | 12 ++ 13.0-rc/fpm-alpine/cron.sh | 4 + 13.0-rc/fpm-alpine/entrypoint.sh | 132 ++++++++++++++++ 13.0-rc/fpm-alpine/upgrade.exclude | 4 + 13.0-rc/fpm/Dockerfile | 138 +++++++++++++++++ 13.0-rc/fpm/config/apcu.config.php | 4 + 13.0-rc/fpm/config/apps.config.php | 15 ++ 13.0-rc/fpm/config/autoconfig.php | 29 ++++ 13.0-rc/fpm/config/redis.config.php | 12 ++ 13.0-rc/fpm/cron.sh | 4 + 13.0-rc/fpm/entrypoint.sh | 132 ++++++++++++++++ 13.0-rc/fpm/upgrade.exclude | 4 + 25 files changed, 1011 insertions(+) create mode 100644 13.0-rc/apache/Dockerfile create mode 100644 13.0-rc/apache/config/apache-pretty-urls.config.php create mode 100644 13.0-rc/apache/config/apcu.config.php create mode 100644 13.0-rc/apache/config/apps.config.php create mode 100644 13.0-rc/apache/config/autoconfig.php create mode 100644 13.0-rc/apache/config/redis.config.php create mode 100755 13.0-rc/apache/cron.sh create mode 100755 13.0-rc/apache/entrypoint.sh create mode 100644 13.0-rc/apache/upgrade.exclude create mode 100644 13.0-rc/fpm-alpine/Dockerfile create mode 100644 13.0-rc/fpm-alpine/config/apcu.config.php create mode 100644 13.0-rc/fpm-alpine/config/apps.config.php create mode 100644 13.0-rc/fpm-alpine/config/autoconfig.php create mode 100644 13.0-rc/fpm-alpine/config/redis.config.php create mode 100755 13.0-rc/fpm-alpine/cron.sh create mode 100755 13.0-rc/fpm-alpine/entrypoint.sh create mode 100644 13.0-rc/fpm-alpine/upgrade.exclude create mode 100644 13.0-rc/fpm/Dockerfile create mode 100644 13.0-rc/fpm/config/apcu.config.php create mode 100644 13.0-rc/fpm/config/apps.config.php create mode 100644 13.0-rc/fpm/config/autoconfig.php create mode 100644 13.0-rc/fpm/config/redis.config.php create mode 100755 13.0-rc/fpm/cron.sh create mode 100755 13.0-rc/fpm/entrypoint.sh create mode 100644 13.0-rc/fpm/upgrade.exclude diff --git a/13.0-rc/apache/Dockerfile b/13.0-rc/apache/Dockerfile new file mode 100644 index 00000000..dd602c64 --- /dev/null +++ b/13.0-rc/apache/Dockerfile @@ -0,0 +1,146 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-apache-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod rewrite remoteip ;\ + {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + } > /etc/apache2/conf-available/remoteip.conf;\ + a2enconf remoteip + +ENV NEXTCLOUD_VERSION 13.0.12RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/13.0-rc/apache/config/apache-pretty-urls.config.php b/13.0-rc/apache/config/apache-pretty-urls.config.php new file mode 100644 index 00000000..72da1d8c --- /dev/null +++ b/13.0-rc/apache/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/13.0-rc/apache/config/apcu.config.php b/13.0-rc/apache/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/13.0-rc/apache/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/13.0-rc/apache/config/apps.config.php b/13.0-rc/apache/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/13.0-rc/apache/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/13.0-rc/apache/config/autoconfig.php b/13.0-rc/apache/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/13.0-rc/apache/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/13.0-rc/apache/cron.sh b/13.0-rc/apache/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/13.0-rc/apache/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/13.0-rc/apache/entrypoint.sh b/13.0-rc/apache/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/13.0-rc/apache/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/13.0-rc/apache/upgrade.exclude b/13.0-rc/apache/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/13.0-rc/apache/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/13.0-rc/fpm-alpine/Dockerfile b/13.0-rc/fpm-alpine/Dockerfile new file mode 100644 index 00000000..989f7fb9 --- /dev/null +++ b/13.0-rc/fpm-alpine/Dockerfile @@ -0,0 +1,123 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template +FROM php:7.2-fpm-alpine3.9 + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + rsync \ + ; \ + \ + rm /var/spool/cron/crontabs/root; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + freetype-dev \ + icu-dev \ + libevent-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + pcre-dev \ + postgresql-dev \ + imagemagick-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 13.0.12RC1 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/13.0-rc/fpm-alpine/config/apcu.config.php b/13.0-rc/fpm-alpine/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/13.0-rc/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/13.0-rc/fpm-alpine/config/apps.config.php b/13.0-rc/fpm-alpine/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/13.0-rc/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/13.0-rc/fpm-alpine/config/autoconfig.php b/13.0-rc/fpm-alpine/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/13.0-rc/fpm-alpine/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/13.0-rc/fpm-alpine/cron.sh b/13.0-rc/fpm-alpine/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/13.0-rc/fpm-alpine/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/13.0-rc/fpm-alpine/entrypoint.sh b/13.0-rc/fpm-alpine/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/13.0-rc/fpm-alpine/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/13.0-rc/fpm-alpine/upgrade.exclude b/13.0-rc/fpm-alpine/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/13.0-rc/fpm-alpine/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/13.0-rc/fpm/Dockerfile b/13.0-rc/fpm/Dockerfile new file mode 100644 index 00000000..17d93c4d --- /dev/null +++ b/13.0-rc/fpm/Dockerfile @@ -0,0 +1,138 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-fpm-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 13.0.12RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/13.0-rc/fpm/config/apcu.config.php b/13.0-rc/fpm/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/13.0-rc/fpm/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/13.0-rc/fpm/config/apps.config.php b/13.0-rc/fpm/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/13.0-rc/fpm/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/13.0-rc/fpm/config/autoconfig.php b/13.0-rc/fpm/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/13.0-rc/fpm/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/13.0-rc/fpm/cron.sh b/13.0-rc/fpm/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/13.0-rc/fpm/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/13.0-rc/fpm/entrypoint.sh b/13.0-rc/fpm/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/13.0-rc/fpm/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/13.0-rc/fpm/upgrade.exclude b/13.0-rc/fpm/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/13.0-rc/fpm/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ From 643a35d6fb33bdb02c56b76579266d2bec003425 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Wed, 20 Feb 2019 16:51:29 +0000 Subject: [PATCH 61/67] Update to 14.0.8RC1 --- 14.0-rc/apache/Dockerfile | 146 ++++++++++++++++++ .../config/apache-pretty-urls.config.php | 4 + 14.0-rc/apache/config/apcu.config.php | 4 + 14.0-rc/apache/config/apps.config.php | 15 ++ 14.0-rc/apache/config/autoconfig.php | 29 ++++ 14.0-rc/apache/config/redis.config.php | 12 ++ 14.0-rc/apache/cron.sh | 4 + 14.0-rc/apache/entrypoint.sh | 132 ++++++++++++++++ 14.0-rc/apache/upgrade.exclude | 4 + 14.0-rc/fpm-alpine/Dockerfile | 123 +++++++++++++++ 14.0-rc/fpm-alpine/config/apcu.config.php | 4 + 14.0-rc/fpm-alpine/config/apps.config.php | 15 ++ 14.0-rc/fpm-alpine/config/autoconfig.php | 29 ++++ 14.0-rc/fpm-alpine/config/redis.config.php | 12 ++ 14.0-rc/fpm-alpine/cron.sh | 4 + 14.0-rc/fpm-alpine/entrypoint.sh | 132 ++++++++++++++++ 14.0-rc/fpm-alpine/upgrade.exclude | 4 + 14.0-rc/fpm/Dockerfile | 138 +++++++++++++++++ 14.0-rc/fpm/config/apcu.config.php | 4 + 14.0-rc/fpm/config/apps.config.php | 15 ++ 14.0-rc/fpm/config/autoconfig.php | 29 ++++ 14.0-rc/fpm/config/redis.config.php | 12 ++ 14.0-rc/fpm/cron.sh | 4 + 14.0-rc/fpm/entrypoint.sh | 132 ++++++++++++++++ 14.0-rc/fpm/upgrade.exclude | 4 + 25 files changed, 1011 insertions(+) create mode 100644 14.0-rc/apache/Dockerfile create mode 100644 14.0-rc/apache/config/apache-pretty-urls.config.php create mode 100644 14.0-rc/apache/config/apcu.config.php create mode 100644 14.0-rc/apache/config/apps.config.php create mode 100644 14.0-rc/apache/config/autoconfig.php create mode 100644 14.0-rc/apache/config/redis.config.php create mode 100755 14.0-rc/apache/cron.sh create mode 100755 14.0-rc/apache/entrypoint.sh create mode 100644 14.0-rc/apache/upgrade.exclude create mode 100644 14.0-rc/fpm-alpine/Dockerfile create mode 100644 14.0-rc/fpm-alpine/config/apcu.config.php create mode 100644 14.0-rc/fpm-alpine/config/apps.config.php create mode 100644 14.0-rc/fpm-alpine/config/autoconfig.php create mode 100644 14.0-rc/fpm-alpine/config/redis.config.php create mode 100755 14.0-rc/fpm-alpine/cron.sh create mode 100755 14.0-rc/fpm-alpine/entrypoint.sh create mode 100644 14.0-rc/fpm-alpine/upgrade.exclude create mode 100644 14.0-rc/fpm/Dockerfile create mode 100644 14.0-rc/fpm/config/apcu.config.php create mode 100644 14.0-rc/fpm/config/apps.config.php create mode 100644 14.0-rc/fpm/config/autoconfig.php create mode 100644 14.0-rc/fpm/config/redis.config.php create mode 100755 14.0-rc/fpm/cron.sh create mode 100755 14.0-rc/fpm/entrypoint.sh create mode 100644 14.0-rc/fpm/upgrade.exclude diff --git a/14.0-rc/apache/Dockerfile b/14.0-rc/apache/Dockerfile new file mode 100644 index 00000000..08489335 --- /dev/null +++ b/14.0-rc/apache/Dockerfile @@ -0,0 +1,146 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-apache-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod rewrite remoteip ;\ + {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + } > /etc/apache2/conf-available/remoteip.conf;\ + a2enconf remoteip + +ENV NEXTCLOUD_VERSION 14.0.8RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/14.0-rc/apache/config/apache-pretty-urls.config.php b/14.0-rc/apache/config/apache-pretty-urls.config.php new file mode 100644 index 00000000..72da1d8c --- /dev/null +++ b/14.0-rc/apache/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/14.0-rc/apache/config/apcu.config.php b/14.0-rc/apache/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/14.0-rc/apache/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/14.0-rc/apache/config/apps.config.php b/14.0-rc/apache/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/14.0-rc/apache/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/14.0-rc/apache/config/autoconfig.php b/14.0-rc/apache/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/14.0-rc/apache/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/14.0-rc/apache/cron.sh b/14.0-rc/apache/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/14.0-rc/apache/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/14.0-rc/apache/entrypoint.sh b/14.0-rc/apache/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/14.0-rc/apache/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/14.0-rc/apache/upgrade.exclude b/14.0-rc/apache/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/14.0-rc/apache/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/14.0-rc/fpm-alpine/Dockerfile b/14.0-rc/fpm-alpine/Dockerfile new file mode 100644 index 00000000..30ca9ad2 --- /dev/null +++ b/14.0-rc/fpm-alpine/Dockerfile @@ -0,0 +1,123 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template +FROM php:7.2-fpm-alpine3.9 + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + rsync \ + ; \ + \ + rm /var/spool/cron/crontabs/root; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + freetype-dev \ + icu-dev \ + libevent-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + pcre-dev \ + postgresql-dev \ + imagemagick-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 14.0.8RC1 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/14.0-rc/fpm-alpine/config/apcu.config.php b/14.0-rc/fpm-alpine/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/14.0-rc/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/14.0-rc/fpm-alpine/config/apps.config.php b/14.0-rc/fpm-alpine/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/14.0-rc/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/14.0-rc/fpm-alpine/config/autoconfig.php b/14.0-rc/fpm-alpine/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/14.0-rc/fpm-alpine/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/14.0-rc/fpm-alpine/cron.sh b/14.0-rc/fpm-alpine/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/14.0-rc/fpm-alpine/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/14.0-rc/fpm-alpine/entrypoint.sh b/14.0-rc/fpm-alpine/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/14.0-rc/fpm-alpine/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/14.0-rc/fpm-alpine/upgrade.exclude b/14.0-rc/fpm-alpine/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/14.0-rc/fpm-alpine/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/14.0-rc/fpm/Dockerfile b/14.0-rc/fpm/Dockerfile new file mode 100644 index 00000000..bfe693fe --- /dev/null +++ b/14.0-rc/fpm/Dockerfile @@ -0,0 +1,138 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-fpm-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 14.0.8RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/14.0-rc/fpm/config/apcu.config.php b/14.0-rc/fpm/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/14.0-rc/fpm/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/14.0-rc/fpm/config/apps.config.php b/14.0-rc/fpm/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/14.0-rc/fpm/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/14.0-rc/fpm/config/autoconfig.php b/14.0-rc/fpm/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/14.0-rc/fpm/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/14.0-rc/fpm/cron.sh b/14.0-rc/fpm/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/14.0-rc/fpm/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/14.0-rc/fpm/entrypoint.sh b/14.0-rc/fpm/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/14.0-rc/fpm/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/14.0-rc/fpm/upgrade.exclude b/14.0-rc/fpm/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/14.0-rc/fpm/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ From 1f3c1cd4e9b47e36fc3c71911ff82dd08227d2e8 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Thu, 21 Feb 2019 04:51:35 +0000 Subject: [PATCH 62/67] Update to 15.0.5RC1 --- 15.0-rc/apache/Dockerfile | 146 ++++++++++++++++++ .../config/apache-pretty-urls.config.php | 4 + 15.0-rc/apache/config/apcu.config.php | 4 + 15.0-rc/apache/config/apps.config.php | 15 ++ 15.0-rc/apache/config/autoconfig.php | 29 ++++ 15.0-rc/apache/config/redis.config.php | 12 ++ 15.0-rc/apache/cron.sh | 4 + 15.0-rc/apache/entrypoint.sh | 132 ++++++++++++++++ 15.0-rc/apache/upgrade.exclude | 4 + 15.0-rc/fpm-alpine/Dockerfile | 123 +++++++++++++++ 15.0-rc/fpm-alpine/config/apcu.config.php | 4 + 15.0-rc/fpm-alpine/config/apps.config.php | 15 ++ 15.0-rc/fpm-alpine/config/autoconfig.php | 29 ++++ 15.0-rc/fpm-alpine/config/redis.config.php | 12 ++ 15.0-rc/fpm-alpine/cron.sh | 4 + 15.0-rc/fpm-alpine/entrypoint.sh | 132 ++++++++++++++++ 15.0-rc/fpm-alpine/upgrade.exclude | 4 + 15.0-rc/fpm/Dockerfile | 138 +++++++++++++++++ 15.0-rc/fpm/config/apcu.config.php | 4 + 15.0-rc/fpm/config/apps.config.php | 15 ++ 15.0-rc/fpm/config/autoconfig.php | 29 ++++ 15.0-rc/fpm/config/redis.config.php | 12 ++ 15.0-rc/fpm/cron.sh | 4 + 15.0-rc/fpm/entrypoint.sh | 132 ++++++++++++++++ 15.0-rc/fpm/upgrade.exclude | 4 + 25 files changed, 1011 insertions(+) create mode 100644 15.0-rc/apache/Dockerfile create mode 100644 15.0-rc/apache/config/apache-pretty-urls.config.php create mode 100644 15.0-rc/apache/config/apcu.config.php create mode 100644 15.0-rc/apache/config/apps.config.php create mode 100644 15.0-rc/apache/config/autoconfig.php create mode 100644 15.0-rc/apache/config/redis.config.php create mode 100755 15.0-rc/apache/cron.sh create mode 100755 15.0-rc/apache/entrypoint.sh create mode 100644 15.0-rc/apache/upgrade.exclude create mode 100644 15.0-rc/fpm-alpine/Dockerfile create mode 100644 15.0-rc/fpm-alpine/config/apcu.config.php create mode 100644 15.0-rc/fpm-alpine/config/apps.config.php create mode 100644 15.0-rc/fpm-alpine/config/autoconfig.php create mode 100644 15.0-rc/fpm-alpine/config/redis.config.php create mode 100755 15.0-rc/fpm-alpine/cron.sh create mode 100755 15.0-rc/fpm-alpine/entrypoint.sh create mode 100644 15.0-rc/fpm-alpine/upgrade.exclude create mode 100644 15.0-rc/fpm/Dockerfile create mode 100644 15.0-rc/fpm/config/apcu.config.php create mode 100644 15.0-rc/fpm/config/apps.config.php create mode 100644 15.0-rc/fpm/config/autoconfig.php create mode 100644 15.0-rc/fpm/config/redis.config.php create mode 100755 15.0-rc/fpm/cron.sh create mode 100755 15.0-rc/fpm/entrypoint.sh create mode 100644 15.0-rc/fpm/upgrade.exclude diff --git a/15.0-rc/apache/Dockerfile b/15.0-rc/apache/Dockerfile new file mode 100644 index 00000000..bd3b94cf --- /dev/null +++ b/15.0-rc/apache/Dockerfile @@ -0,0 +1,146 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-apache-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod rewrite remoteip ;\ + {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + } > /etc/apache2/conf-available/remoteip.conf;\ + a2enconf remoteip + +ENV NEXTCLOUD_VERSION 15.0.5RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/15.0-rc/apache/config/apache-pretty-urls.config.php b/15.0-rc/apache/config/apache-pretty-urls.config.php new file mode 100644 index 00000000..72da1d8c --- /dev/null +++ b/15.0-rc/apache/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/15.0-rc/apache/config/apcu.config.php b/15.0-rc/apache/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-rc/apache/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-rc/apache/config/apps.config.php b/15.0-rc/apache/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-rc/apache/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-rc/apache/config/autoconfig.php b/15.0-rc/apache/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-rc/apache/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/15.0-rc/apache/cron.sh b/15.0-rc/apache/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/15.0-rc/apache/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/15.0-rc/apache/entrypoint.sh b/15.0-rc/apache/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/15.0-rc/apache/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-rc/apache/upgrade.exclude b/15.0-rc/apache/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-rc/apache/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/15.0-rc/fpm-alpine/Dockerfile b/15.0-rc/fpm-alpine/Dockerfile new file mode 100644 index 00000000..4ed2ac72 --- /dev/null +++ b/15.0-rc/fpm-alpine/Dockerfile @@ -0,0 +1,123 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template +FROM php:7.2-fpm-alpine3.9 + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + rsync \ + ; \ + \ + rm /var/spool/cron/crontabs/root; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + freetype-dev \ + icu-dev \ + libevent-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + pcre-dev \ + postgresql-dev \ + imagemagick-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 15.0.5RC1 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/15.0-rc/fpm-alpine/config/apcu.config.php b/15.0-rc/fpm-alpine/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-rc/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-rc/fpm-alpine/config/apps.config.php b/15.0-rc/fpm-alpine/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-rc/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-rc/fpm-alpine/config/autoconfig.php b/15.0-rc/fpm-alpine/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-rc/fpm-alpine/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/15.0-rc/fpm-alpine/cron.sh b/15.0-rc/fpm-alpine/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/15.0-rc/fpm-alpine/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/15.0-rc/fpm-alpine/entrypoint.sh b/15.0-rc/fpm-alpine/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/15.0-rc/fpm-alpine/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-rc/fpm-alpine/upgrade.exclude b/15.0-rc/fpm-alpine/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-rc/fpm-alpine/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ diff --git a/15.0-rc/fpm/Dockerfile b/15.0-rc/fpm/Dockerfile new file mode 100644 index 00000000..d8530406 --- /dev/null +++ b/15.0-rc/fpm/Dockerfile @@ -0,0 +1,138 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +FROM php:7.2-fpm-stretch + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + rsync \ + bzip2 \ + busybox-static \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libmagickwand-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.2.0; \ + pecl install imagick-3.4.3; \ + \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + imagick \ + ; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 15.0.5RC1 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/15.0-rc/fpm/config/apcu.config.php b/15.0-rc/fpm/config/apcu.config.php new file mode 100644 index 00000000..69fed876 --- /dev/null +++ b/15.0-rc/fpm/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/15.0-rc/fpm/config/apps.config.php b/15.0-rc/fpm/config/apps.config.php new file mode 100644 index 00000000..a4bed833 --- /dev/null +++ b/15.0-rc/fpm/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/15.0-rc/fpm/config/autoconfig.php b/15.0-rc/fpm/config/autoconfig.php new file mode 100644 index 00000000..85e02212 --- /dev/null +++ b/15.0-rc/fpm/config/autoconfig.php @@ -0,0 +1,29 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + ), + ); +} + diff --git a/15.0-rc/fpm/cron.sh b/15.0-rc/fpm/cron.sh new file mode 100755 index 00000000..4dfa4118 --- /dev/null +++ b/15.0-rc/fpm/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -l 0 -L /dev/stdout diff --git a/15.0-rc/fpm/entrypoint.sh b/15.0-rc/fpm/entrypoint.sh new file mode 100755 index 00000000..07644c04 --- /dev/null +++ b/15.0-rc/fpm/entrypoint.sh @@ -0,0 +1,132 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + echo "Initializing finished" + + #install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' + else + install_options=$install_options' --database-table-prefix ""' + fi + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + install=false + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + echo "starting nextcloud installation" + max_retries=10 + try=0 + until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] + do + echo "retrying install..." + try=$((try+1)) + sleep 3s + done + if [ "$try" -gt "$max_retries" ]; then + echo "installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + else + echo "running web-based installer on first connect!" + fi + fi + #upgrade + else + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + fi + fi +fi + +exec "$@" diff --git a/15.0-rc/fpm/upgrade.exclude b/15.0-rc/fpm/upgrade.exclude new file mode 100644 index 00000000..a1f2de95 --- /dev/null +++ b/15.0-rc/fpm/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/ From 1091814e9b06c8a66d0e3583bb12c591434aeccb Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Thu, 21 Feb 2019 12:51:33 +0100 Subject: [PATCH 63/67] Run update.sh Signed-off-by: Tilo Spannagel --- .travis.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6e36fdcd..c7bdc606 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,25 @@ jobs: - ./generate-stackbrew-library.sh - stage: test images - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 + env: VERSION=13.0-rc VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=13.0-rc VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=13.0-rc VARIANT=fpm ARCH=amd64 + - env: VERSION=13.0-rc VARIANT=fpm ARCH=i386 + - env: VERSION=13.0-rc VARIANT=apache ARCH=amd64 + - env: VERSION=13.0-rc VARIANT=apache ARCH=i386 + - env: VERSION=14.0-rc VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=14.0-rc VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=14.0-rc VARIANT=fpm ARCH=amd64 + - env: VERSION=14.0-rc VARIANT=fpm ARCH=i386 + - env: VERSION=14.0-rc VARIANT=apache ARCH=amd64 + - env: VERSION=14.0-rc VARIANT=apache ARCH=i386 + - env: VERSION=15.0-rc VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=15.0-rc VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=15.0-rc VARIANT=fpm ARCH=amd64 + - env: VERSION=15.0-rc VARIANT=fpm ARCH=i386 + - env: VERSION=15.0-rc VARIANT=apache ARCH=amd64 + - env: VERSION=15.0-rc VARIANT=apache ARCH=i386 + - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=i386 - env: VERSION=13.0 VARIANT=fpm ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm ARCH=i386 From d9ca9e4b08e416ae8a72db0a8b3dc847dcdbf490 Mon Sep 17 00:00:00 2001 From: Jonas Thelemann Date: Wed, 20 Feb 2019 01:51:46 +0100 Subject: [PATCH 64/67] Rephrase README's "Named Volumes" Paragraph Signed-off-by: Jonas Thelemann --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6c0876c..84b5bfbe 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ By default this container uses SQLite for data storage, but the Nextcloud setup ## Persistent data The Nextcloud installation and all data beyond what lives in the database (file uploads, etc) is stored in the [unnamed docker volume](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume) volume `/var/www/html`. The docker daemon will store that data within the docker directory `/var/lib/docker/volumes/...`. That means your data is saved even if the container crashes, is stopped or deleted. -To make your data persistent to upgrading and get access for backups is using named docker volume or mount a host folder. To achieve this you need one volume for your database container and Nextcloud. +A named Docker volume or a mounted host directory should be used for upgrades and backups. To achieve this you need one volume for your database container and one for Nextcloud. Nextcloud: - `/var/www/html/` folder where all nextcloud data lives From e21fac2471d9ebdd7329a0f4345840b0b8d5b928 Mon Sep 17 00:00:00 2001 From: tilosp-bot Date: Mon, 25 Feb 2019 19:44:03 +0000 Subject: [PATCH 65/67] Run update.sh Signed-off-by: tilosp-bot --- 14.0-rc/apache/Dockerfile | 2 +- 14.0-rc/fpm-alpine/Dockerfile | 2 +- 14.0-rc/fpm/Dockerfile | 2 +- 15.0-rc/apache/Dockerfile | 2 +- 15.0-rc/fpm-alpine/Dockerfile | 2 +- 15.0-rc/fpm/Dockerfile | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/14.0-rc/apache/Dockerfile b/14.0-rc/apache/Dockerfile index 08489335..41ea6879 100644 --- a/14.0-rc/apache/Dockerfile +++ b/14.0-rc/apache/Dockerfile @@ -110,7 +110,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 14.0.8RC1 +ENV NEXTCLOUD_VERSION 14.0.8RC2 RUN set -ex; \ fetchDeps=" \ diff --git a/14.0-rc/fpm-alpine/Dockerfile b/14.0-rc/fpm-alpine/Dockerfile index 30ca9ad2..c1e88632 100644 --- a/14.0-rc/fpm-alpine/Dockerfile +++ b/14.0-rc/fpm-alpine/Dockerfile @@ -91,7 +91,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.8RC1 +ENV NEXTCLOUD_VERSION 14.0.8RC2 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/14.0-rc/fpm/Dockerfile b/14.0-rc/fpm/Dockerfile index bfe693fe..fc12146b 100644 --- a/14.0-rc/fpm/Dockerfile +++ b/14.0-rc/fpm/Dockerfile @@ -102,7 +102,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.8RC1 +ENV NEXTCLOUD_VERSION 14.0.8RC2 RUN set -ex; \ fetchDeps=" \ diff --git a/15.0-rc/apache/Dockerfile b/15.0-rc/apache/Dockerfile index bd3b94cf..e22fc96c 100644 --- a/15.0-rc/apache/Dockerfile +++ b/15.0-rc/apache/Dockerfile @@ -110,7 +110,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 15.0.5RC1 +ENV NEXTCLOUD_VERSION 15.0.5RC2 RUN set -ex; \ fetchDeps=" \ diff --git a/15.0-rc/fpm-alpine/Dockerfile b/15.0-rc/fpm-alpine/Dockerfile index 4ed2ac72..d1970f7e 100644 --- a/15.0-rc/fpm-alpine/Dockerfile +++ b/15.0-rc/fpm-alpine/Dockerfile @@ -91,7 +91,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.5RC1 +ENV NEXTCLOUD_VERSION 15.0.5RC2 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/15.0-rc/fpm/Dockerfile b/15.0-rc/fpm/Dockerfile index d8530406..48f094fc 100644 --- a/15.0-rc/fpm/Dockerfile +++ b/15.0-rc/fpm/Dockerfile @@ -102,7 +102,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.5RC1 +ENV NEXTCLOUD_VERSION 15.0.5RC2 RUN set -ex; \ fetchDeps=" \ From 5d607a706c691e978ca0de5d7a054133788ef90b Mon Sep 17 00:00:00 2001 From: ykcab Date: Sun, 24 Feb 2019 18:54:12 -0500 Subject: [PATCH 66/67] Changed you host to 'your host' in line 32 Signed-off-by: ykcab --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6c0876c..ca9b378e 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Now you can access Nextcloud at http://localhost:8080/ from your host system. ## Using the fpm image To use the fpm image you need an additional web server that can proxy http-request to the fpm-port of the container. For fpm connection this container exposes port 9000. In most cases you might want use another container or your host as proxy. If you use your host you can address your Nextcloud container directly on port 9000. If you use another container, make sure that you add them to the same docker network (via `docker run --network ...` or a `docker-compose` file). -In both cases you don't want to map the fpm port to you host. +In both cases you don't want to map the fpm port to your host. ```console $ docker run -d nextcloud:fpm From 7ac27988789ff8ba07ea284639cbfbc972a9d487 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Wed, 27 Feb 2019 00:19:34 +0100 Subject: [PATCH 67/67] Ship 15.0.4 on production channel See: nextcloud/updater_server#188 [skip travis] Signed-off-by: Tilo Spannagel --- generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index abe47cfd..25e26a88 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -3,7 +3,7 @@ set -Eeuo pipefail declare -A release_channel=( [stable]='15.0.4' - [production]='14.0.7' + [production]='15.0.4' ) self="$(basename "$BASH_SOURCE")"