diff --git a/.config/smtp.config.php b/.config/smtp.config.php new file mode 100644 index 00000000..59f1eaa1 --- /dev/null +++ b/.config/smtp.config.php @@ -0,0 +1,15 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); +} diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/web/nginx.conf b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/web/nginx.conf index 49a19c35..858674ad 100644 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/web/nginx.conf +++ b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/web/nginx.conf @@ -120,7 +120,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/insecure/mariadb/fpm/web/nginx.conf b/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf index 49a19c35..858674ad 100644 --- a/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf +++ b/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf @@ -120,7 +120,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/insecure/postgres/fpm/web/nginx.conf b/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf index 49a19c35..858674ad 100644 --- a/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf +++ b/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf @@ -120,7 +120,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/.travis.yml b/.travis.yml index 6e36fdcd..84d805c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,13 +50,7 @@ jobs: - ./generate-stackbrew-library.sh - stage: test images - 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 - - env: VERSION=13.0 VARIANT=apache ARCH=amd64 - - env: VERSION=13.0 VARIANT=apache ARCH=i386 - - env: VERSION=14.0 VARIANT=fpm-alpine ARCH=amd64 + env: VERSION=14.0 VARIANT=fpm-alpine ARCH=amd64 - env: VERSION=14.0 VARIANT=fpm-alpine ARCH=i386 - env: VERSION=14.0 VARIANT=fpm ARCH=amd64 - env: VERSION=14.0 VARIANT=fpm ARCH=i386 @@ -68,3 +62,9 @@ jobs: - env: VERSION=15.0 VARIANT=fpm ARCH=i386 - env: VERSION=15.0 VARIANT=apache ARCH=amd64 - env: VERSION=15.0 VARIANT=apache ARCH=i386 + - env: VERSION=16.0 VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=16.0 VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=16.0 VARIANT=fpm ARCH=amd64 + - env: VERSION=16.0 VARIANT=fpm ARCH=i386 + - env: VERSION=16.0 VARIANT=apache ARCH=amd64 + - env: VERSION=16.0 VARIANT=apache ARCH=i386 diff --git a/14.0/apache/Dockerfile b/14.0/apache/Dockerfile index 38ce18e8..7de9415b 100644 --- a/14.0/apache/Dockerfile +++ b/14.0/apache/Dockerfile @@ -16,7 +16,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ @@ -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.17; \ pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ + pecl install redis-4.3.0; \ pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ @@ -110,7 +110,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 14.0.8 +ENV NEXTCLOUD_VERSION 14.0.10 RUN set -ex; \ fetchDeps=" \ diff --git a/14.0/apache/config/smtp.config.php b/14.0/apache/config/smtp.config.php new file mode 100644 index 00000000..59f1eaa1 --- /dev/null +++ b/14.0/apache/config/smtp.config.php @@ -0,0 +1,15 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); +} diff --git a/14.0/apache/entrypoint.sh b/14.0/apache/entrypoint.sh index 07644c04..78bd0a8d 100755 --- a/14.0/apache/entrypoint.sh +++ b/14.0/apache/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 @@ -51,6 +60,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ fi done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ echo "Initializing finished" #install diff --git a/14.0/apache/upgrade.exclude b/14.0/apache/upgrade.exclude index a1f2de95..354864da 100644 --- a/14.0/apache/upgrade.exclude +++ b/14.0/apache/upgrade.exclude @@ -2,3 +2,4 @@ /data/ /custom_apps/ /themes/ +/version.php diff --git a/14.0/fpm-alpine/Dockerfile b/14.0/fpm-alpine/Dockerfile index d1befe22..95765f1e 100644 --- a/14.0/fpm-alpine/Dockerfile +++ b/14.0/fpm-alpine/Dockerfile @@ -12,7 +12,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ apk add --no-cache --virtual .build-deps \ @@ -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.17; \ pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ + pecl install redis-4.3.0; \ pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ @@ -91,7 +91,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.8 +ENV NEXTCLOUD_VERSION 14.0.10 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/14.0/fpm-alpine/config/smtp.config.php b/14.0/fpm-alpine/config/smtp.config.php new file mode 100644 index 00000000..59f1eaa1 --- /dev/null +++ b/14.0/fpm-alpine/config/smtp.config.php @@ -0,0 +1,15 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); +} diff --git a/14.0/fpm-alpine/entrypoint.sh b/14.0/fpm-alpine/entrypoint.sh index 07644c04..78bd0a8d 100755 --- a/14.0/fpm-alpine/entrypoint.sh +++ b/14.0/fpm-alpine/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 @@ -51,6 +60,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ fi done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ echo "Initializing finished" #install diff --git a/14.0/fpm-alpine/upgrade.exclude b/14.0/fpm-alpine/upgrade.exclude index a1f2de95..354864da 100644 --- a/14.0/fpm-alpine/upgrade.exclude +++ b/14.0/fpm-alpine/upgrade.exclude @@ -2,3 +2,4 @@ /data/ /custom_apps/ /themes/ +/version.php diff --git a/14.0/fpm/Dockerfile b/14.0/fpm/Dockerfile index b95255b5..d50f6d6c 100644 --- a/14.0/fpm/Dockerfile +++ b/14.0/fpm/Dockerfile @@ -16,7 +16,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ @@ -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.17; \ pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ + pecl install redis-4.3.0; \ pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ @@ -102,7 +102,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 14.0.8 +ENV NEXTCLOUD_VERSION 14.0.10 RUN set -ex; \ fetchDeps=" \ diff --git a/14.0/fpm/config/smtp.config.php b/14.0/fpm/config/smtp.config.php new file mode 100644 index 00000000..59f1eaa1 --- /dev/null +++ b/14.0/fpm/config/smtp.config.php @@ -0,0 +1,15 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); +} diff --git a/14.0/fpm/entrypoint.sh b/14.0/fpm/entrypoint.sh index 07644c04..78bd0a8d 100755 --- a/14.0/fpm/entrypoint.sh +++ b/14.0/fpm/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 @@ -51,6 +60,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ fi done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ echo "Initializing finished" #install diff --git a/14.0/fpm/upgrade.exclude b/14.0/fpm/upgrade.exclude index a1f2de95..354864da 100644 --- a/14.0/fpm/upgrade.exclude +++ b/14.0/fpm/upgrade.exclude @@ -2,3 +2,4 @@ /data/ /custom_apps/ /themes/ +/version.php diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 86baeb82..bf5237ca 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; \ @@ -16,7 +16,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ @@ -35,6 +35,7 @@ RUN set -ex; \ libpq-dev \ libxml2-dev \ libmagickwand-dev \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -55,7 +56,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.17; \ pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ + pecl install redis-4.3.0; \ pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ @@ -110,7 +111,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 15.0.5 +ENV NEXTCLOUD_VERSION 15.0.7 RUN set -ex; \ fetchDeps=" \ diff --git a/15.0/apache/config/smtp.config.php b/15.0/apache/config/smtp.config.php new file mode 100644 index 00000000..59f1eaa1 --- /dev/null +++ b/15.0/apache/config/smtp.config.php @@ -0,0 +1,15 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); +} diff --git a/15.0/apache/entrypoint.sh b/15.0/apache/entrypoint.sh index 07644c04..78bd0a8d 100755 --- a/15.0/apache/entrypoint.sh +++ b/15.0/apache/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 @@ -51,6 +60,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ fi done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ echo "Initializing finished" #install diff --git a/15.0/apache/upgrade.exclude b/15.0/apache/upgrade.exclude index a1f2de95..354864da 100644 --- a/15.0/apache/upgrade.exclude +++ b/15.0/apache/upgrade.exclude @@ -2,3 +2,4 @@ /data/ /custom_apps/ /themes/ +/version.php diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index 9ce02ba1..effdfe84 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.9 +FROM php:7.3-fpm-alpine3.9 # entrypoint.sh and cron.sh dependencies RUN set -ex; \ @@ -12,7 +12,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ apk add --no-cache --virtual .build-deps \ @@ -26,6 +26,7 @@ RUN set -ex; \ libpng-dev \ libmemcached-dev \ libxml2-dev \ + libzip-dev \ openldap-dev \ pcre-dev \ postgresql-dev \ @@ -49,7 +50,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.17; \ pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ + pecl install redis-4.3.0; \ pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ @@ -91,7 +92,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.5 +ENV NEXTCLOUD_VERSION 15.0.7 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/15.0/fpm-alpine/config/smtp.config.php b/15.0/fpm-alpine/config/smtp.config.php new file mode 100644 index 00000000..59f1eaa1 --- /dev/null +++ b/15.0/fpm-alpine/config/smtp.config.php @@ -0,0 +1,15 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); +} diff --git a/15.0/fpm-alpine/entrypoint.sh b/15.0/fpm-alpine/entrypoint.sh index 07644c04..78bd0a8d 100755 --- a/15.0/fpm-alpine/entrypoint.sh +++ b/15.0/fpm-alpine/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 @@ -51,6 +60,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ fi done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ echo "Initializing finished" #install diff --git a/15.0/fpm-alpine/upgrade.exclude b/15.0/fpm-alpine/upgrade.exclude index a1f2de95..354864da 100644 --- a/15.0/fpm-alpine/upgrade.exclude +++ b/15.0/fpm-alpine/upgrade.exclude @@ -2,3 +2,4 @@ /data/ /custom_apps/ /themes/ +/version.php diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index 70fa5ac7..cf3b1af7 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; \ @@ -16,7 +16,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ @@ -35,6 +35,7 @@ RUN set -ex; \ libpq-dev \ libxml2-dev \ libmagickwand-dev \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -55,7 +56,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.17; \ pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ + pecl install redis-4.3.0; \ pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ @@ -102,7 +103,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 15.0.5 +ENV NEXTCLOUD_VERSION 15.0.7 RUN set -ex; \ fetchDeps=" \ diff --git a/15.0/fpm/config/smtp.config.php b/15.0/fpm/config/smtp.config.php new file mode 100644 index 00000000..59f1eaa1 --- /dev/null +++ b/15.0/fpm/config/smtp.config.php @@ -0,0 +1,15 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); +} diff --git a/15.0/fpm/entrypoint.sh b/15.0/fpm/entrypoint.sh index 07644c04..78bd0a8d 100755 --- a/15.0/fpm/entrypoint.sh +++ b/15.0/fpm/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 @@ -51,6 +60,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ fi done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ echo "Initializing finished" #install diff --git a/15.0/fpm/upgrade.exclude b/15.0/fpm/upgrade.exclude index a1f2de95..354864da 100644 --- a/15.0/fpm/upgrade.exclude +++ b/15.0/fpm/upgrade.exclude @@ -2,3 +2,4 @@ /data/ /custom_apps/ /themes/ +/version.php diff --git a/13.0/apache/Dockerfile b/16.0/apache/Dockerfile similarity index 95% rename from 13.0/apache/Dockerfile rename to 16.0/apache/Dockerfile index ef544a5e..dc5193e7 100644 --- a/13.0/apache/Dockerfile +++ b/16.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; \ @@ -16,7 +16,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ @@ -35,6 +35,7 @@ RUN set -ex; \ libpq-dev \ libxml2-dev \ libmagickwand-dev \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -55,7 +56,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.17; \ pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ + pecl install redis-4.3.0; \ pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ @@ -110,7 +111,7 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -ENV NEXTCLOUD_VERSION 13.0.12 +ENV NEXTCLOUD_VERSION 16.0.0 RUN set -ex; \ fetchDeps=" \ diff --git a/13.0/apache/config/apache-pretty-urls.config.php b/16.0/apache/config/apache-pretty-urls.config.php similarity index 100% rename from 13.0/apache/config/apache-pretty-urls.config.php rename to 16.0/apache/config/apache-pretty-urls.config.php diff --git a/13.0/apache/config/apcu.config.php b/16.0/apache/config/apcu.config.php similarity index 100% rename from 13.0/apache/config/apcu.config.php rename to 16.0/apache/config/apcu.config.php diff --git a/13.0/apache/config/apps.config.php b/16.0/apache/config/apps.config.php similarity index 100% rename from 13.0/apache/config/apps.config.php rename to 16.0/apache/config/apps.config.php diff --git a/13.0/apache/config/autoconfig.php b/16.0/apache/config/autoconfig.php similarity index 100% rename from 13.0/apache/config/autoconfig.php rename to 16.0/apache/config/autoconfig.php diff --git a/13.0/apache/config/redis.config.php b/16.0/apache/config/redis.config.php similarity index 100% rename from 13.0/apache/config/redis.config.php rename to 16.0/apache/config/redis.config.php diff --git a/16.0/apache/config/smtp.config.php b/16.0/apache/config/smtp.config.php new file mode 100644 index 00000000..59f1eaa1 --- /dev/null +++ b/16.0/apache/config/smtp.config.php @@ -0,0 +1,15 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); +} diff --git a/13.0/apache/cron.sh b/16.0/apache/cron.sh similarity index 100% rename from 13.0/apache/cron.sh rename to 16.0/apache/cron.sh diff --git a/13.0/fpm/entrypoint.sh b/16.0/apache/entrypoint.sh similarity index 93% rename from 13.0/fpm/entrypoint.sh rename to 16.0/apache/entrypoint.sh index 07644c04..78bd0a8d 100755 --- a/13.0/fpm/entrypoint.sh +++ b/16.0/apache/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 @@ -51,6 +60,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ fi done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ echo "Initializing finished" #install diff --git a/13.0/fpm-alpine/upgrade.exclude b/16.0/apache/upgrade.exclude similarity index 75% rename from 13.0/fpm-alpine/upgrade.exclude rename to 16.0/apache/upgrade.exclude index a1f2de95..354864da 100644 --- a/13.0/fpm-alpine/upgrade.exclude +++ b/16.0/apache/upgrade.exclude @@ -2,3 +2,4 @@ /data/ /custom_apps/ /themes/ +/version.php diff --git a/13.0/fpm-alpine/Dockerfile b/16.0/fpm-alpine/Dockerfile similarity index 94% rename from 13.0/fpm-alpine/Dockerfile rename to 16.0/fpm-alpine/Dockerfile index 191c0b71..23ba8961 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/16.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.9 +FROM php:7.3-fpm-alpine3.9 # entrypoint.sh and cron.sh dependencies RUN set -ex; \ @@ -12,7 +12,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ apk add --no-cache --virtual .build-deps \ @@ -26,6 +26,7 @@ RUN set -ex; \ libpng-dev \ libmemcached-dev \ libxml2-dev \ + libzip-dev \ openldap-dev \ pcre-dev \ postgresql-dev \ @@ -49,7 +50,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.17; \ pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ + pecl install redis-4.3.0; \ pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ @@ -91,7 +92,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 13.0.12 +ENV NEXTCLOUD_VERSION 16.0.0 RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/13.0/fpm-alpine/config/apcu.config.php b/16.0/fpm-alpine/config/apcu.config.php similarity index 100% rename from 13.0/fpm-alpine/config/apcu.config.php rename to 16.0/fpm-alpine/config/apcu.config.php diff --git a/13.0/fpm-alpine/config/apps.config.php b/16.0/fpm-alpine/config/apps.config.php similarity index 100% rename from 13.0/fpm-alpine/config/apps.config.php rename to 16.0/fpm-alpine/config/apps.config.php diff --git a/13.0/fpm-alpine/config/autoconfig.php b/16.0/fpm-alpine/config/autoconfig.php similarity index 100% rename from 13.0/fpm-alpine/config/autoconfig.php rename to 16.0/fpm-alpine/config/autoconfig.php diff --git a/13.0/fpm-alpine/config/redis.config.php b/16.0/fpm-alpine/config/redis.config.php similarity index 100% rename from 13.0/fpm-alpine/config/redis.config.php rename to 16.0/fpm-alpine/config/redis.config.php diff --git a/16.0/fpm-alpine/config/smtp.config.php b/16.0/fpm-alpine/config/smtp.config.php new file mode 100644 index 00000000..59f1eaa1 --- /dev/null +++ b/16.0/fpm-alpine/config/smtp.config.php @@ -0,0 +1,15 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); +} diff --git a/13.0/fpm-alpine/cron.sh b/16.0/fpm-alpine/cron.sh similarity index 100% rename from 13.0/fpm-alpine/cron.sh rename to 16.0/fpm-alpine/cron.sh diff --git a/13.0/apache/entrypoint.sh b/16.0/fpm-alpine/entrypoint.sh similarity index 93% rename from 13.0/apache/entrypoint.sh rename to 16.0/fpm-alpine/entrypoint.sh index 07644c04..78bd0a8d 100755 --- a/13.0/apache/entrypoint.sh +++ b/16.0/fpm-alpine/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 @@ -51,6 +60,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ fi done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ echo "Initializing finished" #install diff --git a/13.0/fpm/upgrade.exclude b/16.0/fpm-alpine/upgrade.exclude similarity index 75% rename from 13.0/fpm/upgrade.exclude rename to 16.0/fpm-alpine/upgrade.exclude index a1f2de95..354864da 100644 --- a/13.0/fpm/upgrade.exclude +++ b/16.0/fpm-alpine/upgrade.exclude @@ -2,3 +2,4 @@ /data/ /custom_apps/ /themes/ +/version.php diff --git a/13.0/fpm/Dockerfile b/16.0/fpm/Dockerfile similarity index 95% rename from 13.0/fpm/Dockerfile rename to 16.0/fpm/Dockerfile index fa2d98e6..a2bc6156 100644 --- a/13.0/fpm/Dockerfile +++ b/16.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; \ @@ -16,7 +16,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ @@ -35,6 +35,7 @@ RUN set -ex; \ libpq-dev \ libxml2-dev \ libmagickwand-dev \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ @@ -55,7 +56,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.17; \ pecl install memcached-3.1.3; \ - pecl install redis-4.2.0; \ + pecl install redis-4.3.0; \ pecl install imagick-3.4.3; \ \ docker-php-ext-enable \ @@ -102,7 +103,7 @@ RUN { \ VOLUME /var/www/html -ENV NEXTCLOUD_VERSION 13.0.12 +ENV NEXTCLOUD_VERSION 16.0.0 RUN set -ex; \ fetchDeps=" \ diff --git a/13.0/fpm/config/apcu.config.php b/16.0/fpm/config/apcu.config.php similarity index 100% rename from 13.0/fpm/config/apcu.config.php rename to 16.0/fpm/config/apcu.config.php diff --git a/13.0/fpm/config/apps.config.php b/16.0/fpm/config/apps.config.php similarity index 100% rename from 13.0/fpm/config/apps.config.php rename to 16.0/fpm/config/apps.config.php diff --git a/13.0/fpm/config/autoconfig.php b/16.0/fpm/config/autoconfig.php similarity index 100% rename from 13.0/fpm/config/autoconfig.php rename to 16.0/fpm/config/autoconfig.php diff --git a/13.0/fpm/config/redis.config.php b/16.0/fpm/config/redis.config.php similarity index 100% rename from 13.0/fpm/config/redis.config.php rename to 16.0/fpm/config/redis.config.php diff --git a/16.0/fpm/config/smtp.config.php b/16.0/fpm/config/smtp.config.php new file mode 100644 index 00000000..59f1eaa1 --- /dev/null +++ b/16.0/fpm/config/smtp.config.php @@ -0,0 +1,15 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); +} diff --git a/13.0/fpm/cron.sh b/16.0/fpm/cron.sh similarity index 100% rename from 13.0/fpm/cron.sh rename to 16.0/fpm/cron.sh diff --git a/13.0/fpm-alpine/entrypoint.sh b/16.0/fpm/entrypoint.sh similarity index 93% rename from 13.0/fpm-alpine/entrypoint.sh rename to 16.0/fpm/entrypoint.sh index 07644c04..78bd0a8d 100755 --- a/13.0/fpm-alpine/entrypoint.sh +++ b/16.0/fpm/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 @@ -51,6 +60,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ fi done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ echo "Initializing finished" #install diff --git a/13.0/apache/upgrade.exclude b/16.0/fpm/upgrade.exclude similarity index 75% rename from 13.0/apache/upgrade.exclude rename to 16.0/fpm/upgrade.exclude index a1f2de95..354864da 100644 --- a/13.0/apache/upgrade.exclude +++ b/16.0/fpm/upgrade.exclude @@ -2,3 +2,4 @@ /data/ /custom_apps/ /themes/ +/version.php diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index a92701c0..e35d1807 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -11,7 +11,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ apk add --no-cache --virtual .build-deps \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index c4c01814..d7a00264 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -15,7 +15,7 @@ RUN set -ex; \ 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 +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ diff --git a/README.md b/README.md index 175b6143..88c15454 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ If you want you can set the data directory and table prefix, otherwise default v - `NEXTCLOUD_DATA_DIR` (default: _/var/www/html/data_) Configures the data directory where nextcloud stores all files from the users. - `NEXTCLOUD_TABLE_PREFIX` (default: _""_) Optional prefix for the tables. Used to be `oc_` in the past -One or more trusted domains can be set by environemnt variable, too. They will be added to the configuration after install. +One or more trusted domains can be set by environment variable, too. They will be added to the configuration after install. - `NEXTCLOUD_TRUSTED_DOMAINS` (not set by default) Optional space-separated list of domains @@ -130,13 +130,27 @@ 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: +If you want to use Redis you have to create a separate [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. +To use a external SMTP server you have to provide the conection details. To configure Nextcloud to use SMTP add: + +- `SMTP_HOST` (not set by default) hostname of the SMTP server +- `SMTP_SECURE` (empty by default) set to 'ssl' to use SSL on the connection. +- `SMTP_PORT` (default: _465_ for SSL and _25_ for non-secure connection) Optional port for SMTP connection. +- `SMTP_AUTHTYPE` (default: _LOGIN_) The method used for authentication. +- `SMTP_NAME` (empty by default) Username for the authentication. +- `SMTP_PASSWORD` (empty by default) Password for the authentication. +- `MAIL_FROM_ADDRESS` (not set by default) Use this address for the 'from' field in the mail envelopes sent by Nextcloud. +- `MAIL_DOMAIN` (not set by default) Set a different domain for the emails than the domain where Nextcloud is installed. + +Check the [Nextcloud documentation](https://docs.nextcloud.com/server/15/admin_manual/configuration_server/email_configuration.html) for other values to configure SMTP. + + # 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. @@ -245,7 +259,11 @@ In our [examples](https://github.com/nextcloud/docker/tree/master/.examples) sec When you first access your Nextcloud, the setup wizard will appear and ask you to choose an administrator account, password and the database connection. For the database use `db` as host and `nextcloud` as table and user name. Also enter the password you chose in your `docker-compose.yml` file. # Update to a newer version -Updating the Nextcloud container is done by pulling the new image, throwing away the old container and starting the new one. Since all data is stored in volumes, nothing gets lost. The startup script will check for the version in your volume and the installed docker version. If it finds a mismatch, it automatically starts the upgrade process. Don't forget to add all the volumes to your new container, so it works as expected. +Updating the Nextcloud container is done by pulling the new image, throwing away the old container and starting the new one. + +**It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16.** + +Since all data is stored in volumes, nothing gets lost. The startup script will check for the version in your volume and the installed docker version. If it finds a mismatch, it automatically starts the upgrade process. Don't forget to add all the volumes to your new container, so it works as expected. ```console $ docker pull nextcloud diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 07644c04..78bd0a8d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 @@ -51,6 +60,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ fi done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ echo "Initializing finished" #install diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index c36ea33b..73a6cab7 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.5' - [production]='15.0.5' + [stable]='15.0.7' + [production]='15.0.7' ) self="$(basename "$BASH_SOURCE")" @@ -73,18 +73,6 @@ latest=$( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| sort -uV | \ tail -1 ) -latest_rc=$( curl -fsSL 'https://download.nextcloud.com/server/prereleases/' |tac|tac| \ - grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}RC[[:digit:]]+' | \ - grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}RC[[:digit:]]+' | \ - sort -uV | \ - tail -1 ) - -latest_beta=$( curl -fsSL 'https://download.nextcloud.com/server/prereleases/' |tac|tac| \ - grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}beta[[:digit:]]+' | \ - grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}beta[[:digit:]]+' | \ - sort -uV | \ - tail -1 ) - # Generate each of the tags. versions=( */ ) versions=( "${versions[@]%/}" ) @@ -102,19 +90,13 @@ for version in "${versions[@]}"; do versionPostfix="" if [ "$fullversion_with_extension" != "$fullversion" ]; then versionAliases=( "$fullversion_with_extension" ) - versionPostfix="-$( echo "$fullversion_with_extension" | tr '[:upper:]' '[:lower:]' | grep -oE '(beta|rc)')" + versionPostfix="-$( echo "$fullversion_with_extension" | tr '[:upper:]' '[:lower:]' | grep -oE '(beta|rc|alpha)')" fi versionAliases+=( "$fullversion$versionPostfix" "${fullversion%.*}$versionPostfix" "${fullversion%.*.*}$versionPostfix" ) if [ "$fullversion_with_extension" = "$latest" ]; then versionAliases+=( "latest" ) fi - if [ "$fullversion_with_extension" = "$latest_rc" ]; then - versionAliases+=( "rc" ) - fi - if [ "$fullversion_with_extension" = "$latest_beta" ]; then - versionAliases+=( "beta" ) - fi for channel in "${!release_channel[@]}"; do if [ "$fullversion_with_extension" = "${release_channel[$channel]}" ]; then diff --git a/update.sh b/update.sh index 8dc4c81f..d645f4a1 100755 --- a/update.sh +++ b/update.sh @@ -2,9 +2,8 @@ set -eo pipefail declare -A php_version=( - [default]='7.2' + [default]='7.3' [14.0]='7.2' - [13.0]='7.2' ) declare -A cmd=( @@ -25,11 +24,47 @@ declare -A extras=( [fpm-alpine]='' ) +apcu_version="$( + git ls-remote --tags https://github.com/krakjoe/apcu.git \ + | cut -d/ -f3 \ + | grep -vE -- '-rc|-b' \ + | sed -E 's/^v//' \ + | sort -V \ + | tail -1 +)" + +memcached_version="$( + git ls-remote --tags https://github.com/php-memcached-dev/php-memcached.git \ + | cut -d/ -f3 \ + | grep -vE -- '-rc|-b' \ + | sed -E 's/^[rv]//' \ + | sort -V \ + | tail -1 +)" + +redis_version="$( + git ls-remote --tags https://github.com/phpredis/phpredis.git \ + | cut -d/ -f3 \ + | grep -viE '[a-z]' \ + | tr -d '^{}' \ + | sort -V \ + | tail -1 +)" + +imagick_version="$( + git ls-remote --tags https://github.com/mkoppanen/imagick.git \ + | cut -d/ -f3 \ + | grep -viE '[a-z]' \ + | tr -d '^{}' \ + | sort -V \ + | tail -1 +)" + declare -A pecl_versions=( - [APCu]='5.1.17' - [memcached]='3.1.3' - [redis]='4.2.0' - [imagick]='3.4.3' + [APCu]="$apcu_version" + [memcached]="$memcached_version" + [redis]="$redis_version" + [imagick]="$imagick_version" ) variants=( @@ -38,7 +73,7 @@ variants=( fpm-alpine ) -min_version='13.0' +min_version='14.0' # version_greater_or_equal A B returns whether A >= B function version_greater_or_equal() { @@ -55,6 +90,11 @@ function check_rc_released() { printf '%s\n' "${fullversions_rc[@]}" | grep -qE "^$( echo "$1" | grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' )" } +# checks if the the alpha has already a beta +function check_beta_released() { + printf '%s\n' "${fullversions_beta[@]}" | grep -qE "^$( echo "$1" | grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' )" +} + travisEnv= function create_variant() { @@ -111,7 +151,7 @@ function create_variant() { done } -find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+\(-rc\|-beta\)\?' -exec rm -r '{}' \; +find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+\(-rc\|-beta\|-alpha\)\?' -exec rm -r '{}' \; fullversions=( $( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \ grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}' | \ @@ -170,6 +210,26 @@ for version in "${versions_beta[@]}"; do fi done +fullversions_alpha=( $( curl -fsSL 'https://download.nextcloud.com/server/prereleases/' |tac|tac| \ + grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}alpha[[:digit:]]+' | \ + grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}alpha[[:digit:]]+' | \ + sort -urV ) ) +versions_alpha=( $( printf '%s\n' "${fullversions_alpha[@]}" | cut -d. -f1-2 | sort -urV ) ) +for version in "${versions_alpha[@]}"; do + fullversion="$( printf '%s\n' "${fullversions_alpha[@]}" | grep -E "^$version" | head -1 )" + + if version_greater_or_equal "$version" "$min_version"; then + + if ! check_beta_released "$fullversion"; then + + for variant in "${variants[@]}"; do + + create_variant "$version-alpha" "https:\/\/download.nextcloud.com\/server\/prereleases" + done + fi + fi +done + # remove everything after '- stage: test images' travis="$(awk '!p; /- stage: test images/ {p=1}' .travis.yml)" echo "$travis" > .travis.yml diff --git a/upgrade.exclude b/upgrade.exclude index a1f2de95..354864da 100644 --- a/upgrade.exclude +++ b/upgrade.exclude @@ -2,3 +2,4 @@ /data/ /custom_apps/ /themes/ +/version.php