diff --git a/.config/autoconfig.php b/.config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/.config/autoconfig.php
+++ b/.config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/.examples/README.md b/.examples/README.md
index d2450318..d2183447 100644
--- a/.examples/README.md
+++ b/.examples/README.md
@@ -1,7 +1,7 @@
# Examples section
In this subfolders are some examples how to use the docker image. There are two sections:
-
+
* [`dockerfiles`](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles)
* [`docker-compose`](https://github.com/nextcloud/docker/tree/master/.examples/docker-compose)
@@ -13,7 +13,7 @@ The Dockerfiles use the default images as base image and build on top of it.
Example | Description
------- | -------
-[cron](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/cron) | uses supervisor to run the cron job inside the container (so no extra container is needed).
+[cron](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/cron) | uses supervisor to run the cron job inside the container (so no extra container is needed). This image runs `supervisord` to start nextcloud and cron as two seperate processes inside the container.
[imap](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/imap) | adds dependencies required to authenticate users via imap
[smb](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/smb) | adds dependencies required to use smb shares
[full](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/full) | adds dependencies for ALL optional packages and cron functionality via supervisor (as in the `cron` example Dockerfile).
@@ -21,49 +21,48 @@ 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 13th line of 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 imagick
-`apt install libmagickwand-dev`
-`pecl install imagick`
-`docker-php-ext-enable 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`
-`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
-`echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list`
-`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"]`
@@ -92,9 +91,12 @@ If you want to update your installation to a newer version of nextcloud, repeat
### with-nginx-proxy
The nginx proxy adds a proxy layer between nextcloud and the internet. The proxy is designed to serve multiple sites on the same host machine.
+
The advantage in adding this layer is the ability to add a container for [Let's Encrypt](https://letsencrypt.org/) certificate handling.
This combination of the [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) and [jrcs/docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) containers creates a fully automated https encryption of the nextcloud installation without worrying about certificate generation, validation or renewal.
+**This setup only works with a valid domain name on a server that is reachable from the internet.**
+
To use this example complete the following steps:
1. open `docker-compose.yml`
diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/db/Dockerfile b/.examples/docker-compose/insecure/mariadb-cron-redis/apache/db/Dockerfile
deleted file mode 100644
index d9a5cfb4..00000000
--- a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/db/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM mariadb
-#FROM mysql
-
-COPY transaction-isolation.conf /etc/mysql/conf.d/transaction-isolation.conf
diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/db/transaction-isolation.conf b/.examples/docker-compose/insecure/mariadb-cron-redis/apache/db/transaction-isolation.conf
deleted file mode 100644
index 527a3f0e..00000000
--- a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/db/transaction-isolation.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[mysqld]
-# Set Transaction isolation Level to READ-COMMITED (Required by nextcloud)
-# ================================================
-# https://docs.nextcloud.com/server/13/admin_manual/configuration_database/linux_database_configuration.html#database-read-commited-transaction-isolation-level
-transaction-isolation = READ-COMMITTED
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 a08fc9fb..2dc06e15 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
@@ -2,7 +2,8 @@ version: '3'
services:
db:
- build: ./db
+ image: mariadb
+ command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
@@ -15,7 +16,7 @@ services:
image: redis
restart: always
- app:
+ app:
build: ./app
restart: always
ports:
diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/db/Dockerfile b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/db/Dockerfile
deleted file mode 100644
index d9a5cfb4..00000000
--- a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/db/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM mariadb
-#FROM mysql
-
-COPY transaction-isolation.conf /etc/mysql/conf.d/transaction-isolation.conf
diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/db/transaction-isolation.conf b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/db/transaction-isolation.conf
deleted file mode 100644
index 527a3f0e..00000000
--- a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/db/transaction-isolation.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[mysqld]
-# Set Transaction isolation Level to READ-COMMITED (Required by nextcloud)
-# ================================================
-# https://docs.nextcloud.com/server/13/admin_manual/configuration_database/linux_database_configuration.html#database-read-commited-transaction-isolation-level
-transaction-isolation = READ-COMMITTED
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 76f7863a..49fafabc 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
@@ -2,7 +2,8 @@ version: '3'
services:
db:
- build: ./db
+ image: mariadb
+ command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
@@ -15,7 +16,7 @@ services:
image: redis
restart: always
- app:
+ app:
build: ./app
restart: always
volumes:
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 0b6fb89b..2d14e230 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
@@ -50,6 +50,7 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
root /var/www/html;
@@ -89,7 +90,7 @@ http {
#pagespeed off;
location / {
- rewrite ^ /index.php$uri;
+ rewrite ^ /index.php$request_uri;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
@@ -121,7 +122,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)$ {
- try_files $uri /index.php$uri$is_args$args;
+ 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
# have those duplicated to the ones above)
@@ -140,12 +141,14 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
+
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
- try_files $uri /index.php$uri$is_args$args;
+ try_files $uri /index.php$request_uri;
# Optional: Don't log access to other assets
access_log off;
}
diff --git a/.examples/docker-compose/insecure/mariadb/apache/db/Dockerfile b/.examples/docker-compose/insecure/mariadb/apache/db/Dockerfile
deleted file mode 100644
index d9a5cfb4..00000000
--- a/.examples/docker-compose/insecure/mariadb/apache/db/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM mariadb
-#FROM mysql
-
-COPY transaction-isolation.conf /etc/mysql/conf.d/transaction-isolation.conf
diff --git a/.examples/docker-compose/insecure/mariadb/apache/db/transaction-isolation.conf b/.examples/docker-compose/insecure/mariadb/apache/db/transaction-isolation.conf
deleted file mode 100644
index 527a3f0e..00000000
--- a/.examples/docker-compose/insecure/mariadb/apache/db/transaction-isolation.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[mysqld]
-# Set Transaction isolation Level to READ-COMMITED (Required by nextcloud)
-# ================================================
-# https://docs.nextcloud.com/server/13/admin_manual/configuration_database/linux_database_configuration.html#database-read-commited-transaction-isolation-level
-transaction-isolation = READ-COMMITTED
diff --git a/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml b/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml
index d5612444..defa0bdb 100644
--- a/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml
+++ b/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml
@@ -2,7 +2,8 @@ version: '3'
services:
db:
- build: ./db
+ image: mariadb
+ command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
@@ -11,7 +12,7 @@ services:
env_file:
- db.env
- app:
+ app:
image: nextcloud:apache
restart: always
ports:
diff --git a/.examples/docker-compose/insecure/mariadb/fpm/db/Dockerfile b/.examples/docker-compose/insecure/mariadb/fpm/db/Dockerfile
deleted file mode 100644
index d9a5cfb4..00000000
--- a/.examples/docker-compose/insecure/mariadb/fpm/db/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM mariadb
-#FROM mysql
-
-COPY transaction-isolation.conf /etc/mysql/conf.d/transaction-isolation.conf
diff --git a/.examples/docker-compose/insecure/mariadb/fpm/db/transaction-isolation.conf b/.examples/docker-compose/insecure/mariadb/fpm/db/transaction-isolation.conf
deleted file mode 100644
index 527a3f0e..00000000
--- a/.examples/docker-compose/insecure/mariadb/fpm/db/transaction-isolation.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[mysqld]
-# Set Transaction isolation Level to READ-COMMITED (Required by nextcloud)
-# ================================================
-# https://docs.nextcloud.com/server/13/admin_manual/configuration_database/linux_database_configuration.html#database-read-commited-transaction-isolation-level
-transaction-isolation = READ-COMMITTED
diff --git a/.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml b/.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml
index 7b9cd4b6..3596e989 100644
--- a/.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml
+++ b/.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml
@@ -2,7 +2,8 @@ version: '3'
services:
db:
- build: ./db
+ image: mariadb
+ command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
@@ -11,7 +12,7 @@ services:
env_file:
- db.env
- app:
+ app:
image: nextcloud:fpm
restart: always
volumes:
diff --git a/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf b/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf
index 0b6fb89b..2d14e230 100644
--- a/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf
+++ b/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf
@@ -50,6 +50,7 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
root /var/www/html;
@@ -89,7 +90,7 @@ http {
#pagespeed off;
location / {
- rewrite ^ /index.php$uri;
+ rewrite ^ /index.php$request_uri;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
@@ -121,7 +122,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)$ {
- try_files $uri /index.php$uri$is_args$args;
+ 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
# have those duplicated to the ones above)
@@ -140,12 +141,14 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
+
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
- try_files $uri /index.php$uri$is_args$args;
+ try_files $uri /index.php$request_uri;
# Optional: Don't log access to other assets
access_log off;
}
diff --git a/.examples/docker-compose/insecure/postgres/apache/docker-compose.yml b/.examples/docker-compose/insecure/postgres/apache/docker-compose.yml
index 8c4e8f4d..f69bb72e 100644
--- a/.examples/docker-compose/insecure/postgres/apache/docker-compose.yml
+++ b/.examples/docker-compose/insecure/postgres/apache/docker-compose.yml
@@ -9,7 +9,7 @@ services:
env_file:
- db.env
- app:
+ app:
image: nextcloud:apache
restart: always
ports:
diff --git a/.examples/docker-compose/insecure/postgres/fpm/docker-compose.yml b/.examples/docker-compose/insecure/postgres/fpm/docker-compose.yml
index a64bfd5f..7a1fab7d 100644
--- a/.examples/docker-compose/insecure/postgres/fpm/docker-compose.yml
+++ b/.examples/docker-compose/insecure/postgres/fpm/docker-compose.yml
@@ -9,7 +9,7 @@ services:
env_file:
- db.env
- app:
+ app:
image: nextcloud:fpm
restart: always
volumes:
diff --git a/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf b/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf
index 0b6fb89b..2d14e230 100644
--- a/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf
+++ b/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf
@@ -50,6 +50,7 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
root /var/www/html;
@@ -89,7 +90,7 @@ http {
#pagespeed off;
location / {
- rewrite ^ /index.php$uri;
+ rewrite ^ /index.php$request_uri;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
@@ -121,7 +122,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)$ {
- try_files $uri /index.php$uri$is_args$args;
+ 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
# have those duplicated to the ones above)
@@ -140,12 +141,14 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
+
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
- try_files $uri /index.php$uri$is_args$args;
+ try_files $uri /index.php$request_uri;
# Optional: Don't log access to other assets
access_log off;
}
diff --git a/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/db.env b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/db.env
new file mode 100644
index 00000000..a4366057
--- /dev/null
+++ b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/db.env
@@ -0,0 +1,3 @@
+MYSQL_PASSWORD=
+MYSQL_DATABASE=nextcloud
+MYSQL_USER=nextcloud
diff --git a/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/docker-compose.yml
new file mode 100644
index 00000000..6d1e70a9
--- /dev/null
+++ b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/docker-compose.yml
@@ -0,0 +1,78 @@
+version: '3'
+
+services:
+ db:
+ image: mariadb
+ command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
+ restart: always
+ volumes:
+ - db:/var/lib/mysql
+ environment:
+ - MYSQL_ROOT_PASSWORD=
+ env_file:
+ - db.env
+
+ app:
+ image: nextcloud:fpm
+ restart: always
+ volumes:
+ - nextcloud:/var/www/html
+ environment:
+ - MYSQL_HOST=db
+ env_file:
+ - db.env
+ depends_on:
+ - db
+
+ web:
+ build: ./web
+ restart: always
+ volumes:
+ - nextcloud:/var/www/html:ro
+ environment:
+ - VIRTUAL_HOST=
+ depends_on:
+ - app
+ networks:
+ - proxy-tier
+ - default
+
+ proxy:
+ build: ./proxy
+ restart: always
+ ports:
+ - 80:80
+ - 443:443
+ volumes:
+ - certs:/etc/nginx/certs:ro
+ - vhost.d:/etc/nginx/vhost.d
+ - html:/usr/share/nginx/html
+ - /var/run/docker.sock:/tmp/docker.sock:ro
+ networks:
+ - proxy-tier
+ depends_on:
+ - omgwtfssl
+
+ omgwtfssl:
+ image: paulczar/omgwtfssl
+ restart: "no"
+ volumes:
+ - certs:/certs
+ environment:
+ - SSL_SUBJECT=servhostname.local
+ - CA_SUBJECT=my@example.com
+ - SSL_KEY=/certs/servhostname.local.key
+ - SSL_CSR=/certs/servhostname.local.csr
+ - SSL_CERT=/certs/servhostname.local.crt
+ networks:
+ - proxy-tier
+
+volumes:
+ db:
+ nextcloud:
+ certs:
+ vhost.d:
+ html:
+
+networks:
+ proxy-tier:
diff --git a/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/proxy/Dockerfile b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/proxy/Dockerfile
new file mode 100644
index 00000000..242c84e1
--- /dev/null
+++ b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/proxy/Dockerfile
@@ -0,0 +1,3 @@
+FROM jwilder/nginx-proxy:alpine
+
+COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf
diff --git a/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/proxy/uploadsize.conf b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/proxy/uploadsize.conf
new file mode 100644
index 00000000..c636de7d
--- /dev/null
+++ b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/proxy/uploadsize.conf
@@ -0,0 +1 @@
+client_max_body_size 10G;
diff --git a/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/Dockerfile b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/Dockerfile
new file mode 100644
index 00000000..d6eac3e8
--- /dev/null
+++ b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/Dockerfile
@@ -0,0 +1,3 @@
+FROM nginx
+
+COPY nginx.conf /etc/nginx/nginx.conf
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
new file mode 100644
index 00000000..518f104d
--- /dev/null
+++ b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/nginx.conf
@@ -0,0 +1,162 @@
+user www-data;
+worker_processes 1;
+
+error_log /var/log/nginx/error.log warn;
+pid /var/run/nginx.pid;
+
+
+events {
+ worker_connections 1024;
+}
+
+
+http {
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ '$status $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+
+ access_log /var/log/nginx/access.log main;
+
+ sendfile on;
+ #tcp_nopush on;
+
+ keepalive_timeout 65;
+
+ set_real_ip_from 10.0.0.0/8;
+ set_real_ip_from 172.16.0.0/12;
+ set_real_ip_from 192.168.0.0/16;
+ real_ip_header X-Real-IP;
+
+ #gzip on;
+
+ upstream php-handler {
+ server app:9000;
+ }
+
+ server {
+ listen 80;
+
+ # Add headers to serve security related headers
+ # Before enabling Strict-Transport-Security headers please read into this
+ # topic first.
+ # add_header Strict-Transport-Security "max-age=15768000;
+ # includeSubDomains; preload;";
+ #
+ # WARNING: Only add the preload option once you read about
+ # the consequences in https://hstspreload.org/. This option
+ # will add the domain to a hardcoded list that is shipped
+ # in all major browsers and getting removed from this list
+ # could take several months.
+ add_header X-Content-Type-Options nosniff;
+ add_header X-XSS-Protection "1; mode=block";
+ add_header X-Robots-Tag none;
+ add_header X-Download-Options noopen;
+ add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
+
+ root /var/www/html;
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # The following 2 rules are only needed for the user_webfinger app.
+ # Uncomment it if you're planning to use this app.
+ #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
+ # last;
+
+ location = /.well-known/carddav {
+ return 301 $scheme://$host/remote.php/dav;
+ }
+ location = /.well-known/caldav {
+ return 301 $scheme://$host/remote.php/dav;
+ }
+
+ # set max upload size
+ client_max_body_size 10G;
+ fastcgi_buffers 64 4K;
+
+ # Enable gzip but do not remove ETag headers
+ gzip on;
+ gzip_vary on;
+ gzip_comp_level 4;
+ gzip_min_length 256;
+ gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
+ gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
+
+ # Uncomment if your server is build with the ngx_pagespeed module
+ # This module is currently not supported.
+ #pagespeed off;
+
+ location / {
+ rewrite ^ /index.php$request_uri;
+ }
+
+ location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
+ deny all;
+ }
+ location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
+ deny all;
+ }
+
+ location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ # fastcgi_param HTTPS on;
+ #Avoid sending the security headers twice
+ fastcgi_param modHeadersAvailable true;
+ fastcgi_param front_controller_active true;
+ fastcgi_pass php-handler;
+ fastcgi_intercept_errors on;
+ fastcgi_request_buffering off;
+ }
+
+ location ~ ^/(?:updater|ocs-provider)(?:$|/) {
+ try_files $uri/ =404;
+ index index.php;
+ }
+
+ # Adding the cache control header for js and css files
+ # Make sure it is BELOW the PHP block
+ location ~ \.(?:css|js|woff|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
+ # have those duplicated to the ones above)
+ # Before enabling Strict-Transport-Security headers please read into
+ # this topic first.
+ # add_header Strict-Transport-Security "max-age=15768000;
+ # includeSubDomains; preload;";
+ #
+ # WARNING: Only add the preload option once you read about
+ # the consequences in https://hstspreload.org/. This option
+ # will add the domain to a hardcoded list that is shipped
+ # in all major browsers and getting removed from this list
+ # could take several months.
+ add_header X-Content-Type-Options nosniff;
+ add_header X-XSS-Protection "1; mode=block";
+ add_header X-Robots-Tag none;
+ add_header X-Download-Options noopen;
+ add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
+
+ # Optional: Don't log access to assets
+ access_log off;
+ }
+
+ location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
+ try_files $uri /index.php$request_uri;
+ # Optional: Don't log access to other assets
+ access_log off;
+ }
+ }
+
+}
diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/db/Dockerfile b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/db/Dockerfile
deleted file mode 100644
index d9a5cfb4..00000000
--- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/db/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM mariadb
-#FROM mysql
-
-COPY transaction-isolation.conf /etc/mysql/conf.d/transaction-isolation.conf
diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/db/transaction-isolation.conf b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/db/transaction-isolation.conf
deleted file mode 100644
index 527a3f0e..00000000
--- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/apache/db/transaction-isolation.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[mysqld]
-# Set Transaction isolation Level to READ-COMMITED (Required by nextcloud)
-# ================================================
-# https://docs.nextcloud.com/server/13/admin_manual/configuration_database/linux_database_configuration.html#database-read-commited-transaction-isolation-level
-transaction-isolation = READ-COMMITTED
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 80a03675..b6ca391f 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
@@ -2,7 +2,8 @@ version: '3'
services:
db:
- build: ./db
+ image: mariadb
+ command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
@@ -15,7 +16,7 @@ services:
image: redis
restart: always
- app:
+ app:
build: ./app
restart: always
volumes:
diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/db/Dockerfile b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/db/Dockerfile
deleted file mode 100644
index d9a5cfb4..00000000
--- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/db/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM mariadb
-#FROM mysql
-
-COPY transaction-isolation.conf /etc/mysql/conf.d/transaction-isolation.conf
diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/db/transaction-isolation.conf b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/db/transaction-isolation.conf
deleted file mode 100644
index 527a3f0e..00000000
--- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/db/transaction-isolation.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[mysqld]
-# Set Transaction isolation Level to READ-COMMITED (Required by nextcloud)
-# ================================================
-# https://docs.nextcloud.com/server/13/admin_manual/configuration_database/linux_database_configuration.html#database-read-commited-transaction-isolation-level
-transaction-isolation = READ-COMMITTED
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 8c29b9fe..dd98915e 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
@@ -2,7 +2,8 @@ version: '3'
services:
db:
- build: ./db
+ image: mariadb
+ command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
@@ -15,7 +16,7 @@ services:
image: redis
restart: always
- app:
+ app:
build: ./app
restart: always
volumes:
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 eb67c0f5..518f104d 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
@@ -55,6 +55,7 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
root /var/www/html;
@@ -94,7 +95,7 @@ http {
#pagespeed off;
location / {
- rewrite ^ /index.php$uri;
+ rewrite ^ /index.php$request_uri;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
@@ -126,7 +127,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)$ {
- try_files $uri /index.php$uri$is_args$args;
+ 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
# have those duplicated to the ones above)
@@ -145,12 +146,14 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
+
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
- try_files $uri /index.php$uri$is_args$args;
+ try_files $uri /index.php$request_uri;
# Optional: Don't log access to other assets
access_log off;
}
diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/apache/db/Dockerfile b/.examples/docker-compose/with-nginx-proxy/mariadb/apache/db/Dockerfile
deleted file mode 100644
index d9a5cfb4..00000000
--- a/.examples/docker-compose/with-nginx-proxy/mariadb/apache/db/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM mariadb
-#FROM mysql
-
-COPY transaction-isolation.conf /etc/mysql/conf.d/transaction-isolation.conf
diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/apache/db/transaction-isolation.conf b/.examples/docker-compose/with-nginx-proxy/mariadb/apache/db/transaction-isolation.conf
deleted file mode 100644
index 527a3f0e..00000000
--- a/.examples/docker-compose/with-nginx-proxy/mariadb/apache/db/transaction-isolation.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[mysqld]
-# Set Transaction isolation Level to READ-COMMITED (Required by nextcloud)
-# ================================================
-# https://docs.nextcloud.com/server/13/admin_manual/configuration_database/linux_database_configuration.html#database-read-commited-transaction-isolation-level
-transaction-isolation = READ-COMMITTED
diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/apache/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy/mariadb/apache/docker-compose.yml
index 004a0b86..3b5121a6 100644
--- a/.examples/docker-compose/with-nginx-proxy/mariadb/apache/docker-compose.yml
+++ b/.examples/docker-compose/with-nginx-proxy/mariadb/apache/docker-compose.yml
@@ -2,7 +2,8 @@ version: '3'
services:
db:
- build: ./db
+ image: mariadb
+ command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
@@ -11,7 +12,7 @@ services:
env_file:
- db.env
- app:
+ app:
image: nextcloud:apache
restart: always
volumes:
diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/db/Dockerfile b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/db/Dockerfile
deleted file mode 100644
index d9a5cfb4..00000000
--- a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/db/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM mariadb
-#FROM mysql
-
-COPY transaction-isolation.conf /etc/mysql/conf.d/transaction-isolation.conf
diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/db/transaction-isolation.conf b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/db/transaction-isolation.conf
deleted file mode 100644
index 527a3f0e..00000000
--- a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/db/transaction-isolation.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[mysqld]
-# Set Transaction isolation Level to READ-COMMITED (Required by nextcloud)
-# ================================================
-# https://docs.nextcloud.com/server/13/admin_manual/configuration_database/linux_database_configuration.html#database-read-commited-transaction-isolation-level
-transaction-isolation = READ-COMMITTED
diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/docker-compose.yml
index 3db0ac13..17a656de 100644
--- a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/docker-compose.yml
+++ b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/docker-compose.yml
@@ -2,7 +2,8 @@ version: '3'
services:
db:
- build: ./db
+ image: mariadb
+ command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
@@ -11,7 +12,7 @@ services:
env_file:
- db.env
- app:
+ app:
image: nextcloud:fpm
restart: always
volumes:
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 eb67c0f5..518f104d 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
@@ -55,6 +55,7 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
root /var/www/html;
@@ -94,7 +95,7 @@ http {
#pagespeed off;
location / {
- rewrite ^ /index.php$uri;
+ rewrite ^ /index.php$request_uri;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
@@ -126,7 +127,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)$ {
- try_files $uri /index.php$uri$is_args$args;
+ 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
# have those duplicated to the ones above)
@@ -145,12 +146,14 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
+
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
- try_files $uri /index.php$uri$is_args$args;
+ try_files $uri /index.php$request_uri;
# Optional: Don't log access to other assets
access_log off;
}
diff --git a/.examples/docker-compose/with-nginx-proxy/postgres/apache/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy/postgres/apache/docker-compose.yml
index febd7402..a2bda83b 100644
--- a/.examples/docker-compose/with-nginx-proxy/postgres/apache/docker-compose.yml
+++ b/.examples/docker-compose/with-nginx-proxy/postgres/apache/docker-compose.yml
@@ -9,7 +9,7 @@ services:
env_file:
- db.env
- app:
+ app:
image: nextcloud:apache
restart: always
volumes:
diff --git a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy/postgres/fpm/docker-compose.yml
index 7403a29c..9bed1218 100644
--- a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/docker-compose.yml
+++ b/.examples/docker-compose/with-nginx-proxy/postgres/fpm/docker-compose.yml
@@ -9,7 +9,7 @@ services:
env_file:
- db.env
- app:
+ app:
image: nextcloud:fpm
restart: always
volumes:
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 eb67c0f5..518f104d 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
@@ -55,6 +55,7 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
root /var/www/html;
@@ -94,7 +95,7 @@ http {
#pagespeed off;
location / {
- rewrite ^ /index.php$uri;
+ rewrite ^ /index.php$request_uri;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
@@ -126,7 +127,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)$ {
- try_files $uri /index.php$uri$is_args$args;
+ 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
# have those duplicated to the ones above)
@@ -145,12 +146,14 @@ http {
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
+ add_header Referrer-Policy no-referrer;
+
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
- try_files $uri /index.php$uri$is_args$args;
+ try_files $uri /index.php$request_uri;
# Optional: Don't log access to other assets
access_log off;
}
diff --git a/.examples/dockerfiles/cron/apache/Dockerfile b/.examples/dockerfiles/cron/apache/Dockerfile
index 2a6f3e73..85445b54 100644
--- a/.examples/dockerfiles/cron/apache/Dockerfile
+++ b/.examples/dockerfiles/cron/apache/Dockerfile
@@ -7,4 +7,6 @@ RUN apt-get update && apt-get install -y \
COPY supervisord.conf /etc/supervisor/supervisord.conf
+ENV NEXTCLOUD_UPDATE=1
+
CMD ["/usr/bin/supervisord"]
diff --git a/.examples/dockerfiles/cron/fpm/Dockerfile b/.examples/dockerfiles/cron/fpm/Dockerfile
index 1e4b4025..5bf88ffd 100644
--- a/.examples/dockerfiles/cron/fpm/Dockerfile
+++ b/.examples/dockerfiles/cron/fpm/Dockerfile
@@ -7,4 +7,6 @@ RUN apt-get update && apt-get install -y \
COPY supervisord.conf /etc/supervisor/supervisord.conf
+ENV NEXTCLOUD_UPDATE=1
+
CMD ["/usr/bin/supervisord"]
diff --git a/.examples/dockerfiles/full/apache/Dockerfile b/.examples/dockerfiles/full/apache/Dockerfile
index e2520fff..23d796c3 100644
--- a/.examples/dockerfiles/full/apache/Dockerfile
+++ b/.examples/dockerfiles/full/apache/Dockerfile
@@ -1,6 +1,6 @@
FROM nextcloud:apache
-RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \
+RUN mkdir -p /usr/share/man/man1 \
&& apt-get update && apt-get install -y \
supervisor \
ffmpeg \
@@ -11,7 +11,7 @@ RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/so
libkrb5-dev \
smbclient \
libsmbclient-dev \
-# LibreOffice \
+# 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 \
@@ -30,4 +30,6 @@ RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/so
COPY supervisord.conf /etc/supervisor/supervisord.conf
+ENV NEXTCLOUD_UPDATE=1
+
CMD ["/usr/bin/supervisord"]
diff --git a/.examples/dockerfiles/full/fpm/Dockerfile b/.examples/dockerfiles/full/fpm/Dockerfile
index 4798db42..b7311258 100644
--- a/.examples/dockerfiles/full/fpm/Dockerfile
+++ b/.examples/dockerfiles/full/fpm/Dockerfile
@@ -1,6 +1,6 @@
FROM nextcloud:fpm
-RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \
+RUN mkdir -p /usr/share/man/man1 \
&& apt-get update && apt-get install -y \
supervisor \
ffmpeg \
@@ -10,7 +10,7 @@ RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/so
libkrb5-dev \
smbclient \
libsmbclient-dev \
-# LibreOffice \
+# 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 \
@@ -21,4 +21,6 @@ RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/so
COPY supervisord.conf /etc/supervisor/supervisord.conf
+ENV NEXTCLOUD_UPDATE=1
+
CMD ["/usr/bin/supervisord"]
diff --git a/.travis.yml b/.travis.yml
index b7f16d9a..3e2ccebf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,9 +1,5 @@
-dist: trusty
-sudo: required
-
-services: docker
-
language: bash
+services: docker
branches:
only:
@@ -14,13 +10,19 @@ install:
before_script:
- env | sort
+ - wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash
- image="nextcloud:${VERSION}${VARIANT:+-$VARIANT}"
- if [[ "$ARCH" == 'i386' ]]; then sed -i -e 's/FROM php/FROM i386\/php/g' "${VERSION}/${VARIANT}/Dockerfile"; fi
script:
- - travis_retry docker build -t "$image" "${VERSION}/${VARIANT}"
- - ~/official-images/test/run.sh "$image"
- - .travis/test-example-dockerfiles.sh "$image"
+ - |
+ (
+ set -Eeuo pipefail
+ set -x
+ docker build -t "$image" "${VERSION}/${VARIANT}"
+ ~/official-images/test/run.sh "$image"
+ .travis/test-example-dockerfiles.sh "$image"
+ )
after_script:
- docker images
@@ -30,7 +32,6 @@ jobs:
- &test-scripts
stage: test scripts
env: SCRIPT=update.sh
- sudo: false
services: []
install: skip
before_script: skip
@@ -49,18 +50,12 @@ jobs:
- ./generate-stackbrew-library.sh
- stage: test images
- env: VERSION=12.0-rc VARIANT=fpm-alpine ARCH=amd64
- - env: VERSION=12.0-rc VARIANT=fpm-alpine ARCH=i386
- - env: VERSION=12.0-rc VARIANT=fpm ARCH=amd64
- - env: VERSION=12.0-rc VARIANT=fpm ARCH=i386
- - env: VERSION=12.0-rc VARIANT=apache ARCH=amd64
- - env: VERSION=12.0-rc VARIANT=apache ARCH=i386
- - 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=15.0-beta VARIANT=fpm-alpine ARCH=amd64
+ - env: VERSION=15.0-beta VARIANT=fpm-alpine ARCH=i386
+ - env: VERSION=15.0-beta VARIANT=fpm ARCH=amd64
+ - env: VERSION=15.0-beta VARIANT=fpm ARCH=i386
+ - env: VERSION=15.0-beta VARIANT=apache ARCH=amd64
+ - env: VERSION=15.0-beta VARIANT=apache ARCH=i386
- env: VERSION=12.0 VARIANT=fpm-alpine ARCH=amd64
- env: VERSION=12.0 VARIANT=fpm-alpine ARCH=i386
- env: VERSION=12.0 VARIANT=fpm ARCH=amd64
@@ -73,3 +68,9 @@ jobs:
- 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=i386
+ - env: VERSION=14.0 VARIANT=fpm ARCH=amd64
+ - env: VERSION=14.0 VARIANT=fpm ARCH=i386
+ - env: VERSION=14.0 VARIANT=apache ARCH=amd64
+ - env: VERSION=14.0 VARIANT=apache ARCH=i386
diff --git a/.travis/test-example-dockerfiles.sh b/.travis/test-example-dockerfiles.sh
index e86ed162..2598ed6d 100755
--- a/.travis/test-example-dockerfiles.sh
+++ b/.travis/test-example-dockerfiles.sh
@@ -10,10 +10,9 @@ dirs=( "${dirs[@]%/}" )
for dir in "${dirs[@]}"; do
if [ -d "$dir/$VARIANT" ]; then
(
- cd "$dir/$VARIANT"
+ cd "$dir/$VARIANT"
sed -ri -e 's/^FROM .*/FROM '"$image"'/g' 'Dockerfile'
docker build -t "$image-$dir" .
- ~/official-images/test/run.sh "$image-$dir"
)
fi
done
diff --git a/12.0-rc/apache/entrypoint.sh b/12.0-rc/apache/entrypoint.sh
deleted file mode 100755
index 8f3ac087..00000000
--- a/12.0-rc/apache/entrypoint.sh
+++ /dev/null
@@ -1,62 +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 - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
-}
-
-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
- if [ "$installed_version" != "0.0.0.0" ]; then
- 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 /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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
-
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
-
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed 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
-
-exec "$@"
diff --git a/12.0-rc/fpm-alpine/entrypoint.sh b/12.0-rc/fpm-alpine/entrypoint.sh
deleted file mode 100755
index 8f3ac087..00000000
--- a/12.0-rc/fpm-alpine/entrypoint.sh
+++ /dev/null
@@ -1,62 +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 - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
-}
-
-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
- if [ "$installed_version" != "0.0.0.0" ]; then
- 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 /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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
-
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
-
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed 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
-
-exec "$@"
diff --git a/12.0-rc/fpm/entrypoint.sh b/12.0-rc/fpm/entrypoint.sh
deleted file mode 100755
index 8f3ac087..00000000
--- a/12.0-rc/fpm/entrypoint.sh
+++ /dev/null
@@ -1,62 +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 - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
-}
-
-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
- if [ "$installed_version" != "0.0.0.0" ]; then
- 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 /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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
-
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
-
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed 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
-
-exec "$@"
diff --git a/12.0/apache/Dockerfile b/12.0/apache/Dockerfile
index 1e9fa6f9..c49048f0 100644
--- a/12.0/apache/Dockerfile
+++ b/12.0/apache/Dockerfile
@@ -1,5 +1,5 @@
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:7.1-apache
+FROM php:7.1-apache-stretch
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -30,7 +30,7 @@ RUN set -ex; \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
- libpng12-dev \
+ libpng-dev \
libpq-dev \
libxml2-dev \
; \
@@ -43,21 +43,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -90,6 +87,10 @@ RUN { \
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
@@ -105,9 +106,16 @@ RUN a2enmod rewrite remoteip ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip
-ENV NEXTCLOUD_VERSION 12.0.6
+ENV NEXTCLOUD_VERSION 12.0.12
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/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
curl -fsSL -o nextcloud.tar.bz2.asc \
@@ -116,15 +124,18 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/12.0/apache/config/autoconfig.php b/12.0/apache/config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/12.0/apache/config/autoconfig.php
+++ b/12.0/apache/config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/12.0/apache/entrypoint.sh b/12.0/apache/entrypoint.sh
index 8f3ac087..045227e8 100755
--- a/12.0/apache/entrypoint.sh
+++ b/12.0/apache/entrypoint.sh
@@ -3,7 +3,7 @@ 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" ]
+ [ "$(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
@@ -12,50 +12,120 @@ directory_empty() {
}
run_as() {
- if [ "$(id -u)" = 0 ]; then
- su - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
+ if [ "$(id -u)" = 0 ]; then
+ su -p www-data -s /bin/sh -c "$1"
+ else
+ sh -c "$1"
+ fi
}
-installed_version="0.0.0.0"
-if [ -f /var/www/html/version.php ]; then
+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
- 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);')"
+ 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
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
+ 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 [ "$(id -u)" = 0 ]; then
- rsync_options="-rlDog --chown www-data:root"
- else
- rsync_options="-rlD"
- fi
- rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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/
+ 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
- done
+ 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/
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
+ 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"
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed disabled:"
- diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
- rm -f /tmp/list_before /tmp/list_after
+ #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 nexcloud 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
diff --git a/12.0/apache/upgrade.exclude b/12.0/apache/upgrade.exclude
new file mode 100644
index 00000000..a1f2de95
--- /dev/null
+++ b/12.0/apache/upgrade.exclude
@@ -0,0 +1,4 @@
+/config/
+/data/
+/custom_apps/
+/themes/
diff --git a/12.0/fpm-alpine/Dockerfile b/12.0/fpm-alpine/Dockerfile
index 713453f5..00ce909c 100644
--- a/12.0/fpm-alpine/Dockerfile
+++ b/12.0/fpm-alpine/Dockerfile
@@ -1,5 +1,5 @@
# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
-FROM php:7.1-fpm-alpine
+FROM php:7.1-fpm-alpine3.8
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -16,7 +16,7 @@ RUN set -ex; \
RUN set -ex; \
\
apk add --no-cache --virtual .build-deps \
- alpine-sdk \
+ $PHPIZE_DEPS \
autoconf \
freetype-dev \
icu-dev \
@@ -37,21 +37,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -79,6 +76,10 @@ RUN { \
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
@@ -86,7 +87,7 @@ RUN { \
VOLUME /var/www/html
-ENV NEXTCLOUD_VERSION 12.0.6
+ENV NEXTCLOUD_VERSION 12.0.12
RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \
@@ -102,16 +103,16 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/12.0/fpm-alpine/config/autoconfig.php b/12.0/fpm-alpine/config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/12.0/fpm-alpine/config/autoconfig.php
+++ b/12.0/fpm-alpine/config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/12.0/fpm-alpine/entrypoint.sh b/12.0/fpm-alpine/entrypoint.sh
index 8f3ac087..045227e8 100755
--- a/12.0/fpm-alpine/entrypoint.sh
+++ b/12.0/fpm-alpine/entrypoint.sh
@@ -3,7 +3,7 @@ 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" ]
+ [ "$(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
@@ -12,50 +12,120 @@ directory_empty() {
}
run_as() {
- if [ "$(id -u)" = 0 ]; then
- su - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
+ if [ "$(id -u)" = 0 ]; then
+ su -p www-data -s /bin/sh -c "$1"
+ else
+ sh -c "$1"
+ fi
}
-installed_version="0.0.0.0"
-if [ -f /var/www/html/version.php ]; then
+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
- 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);')"
+ 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
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
+ 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 [ "$(id -u)" = 0 ]; then
- rsync_options="-rlDog --chown www-data:root"
- else
- rsync_options="-rlD"
- fi
- rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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/
+ 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
- done
+ 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/
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
+ 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"
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed disabled:"
- diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
- rm -f /tmp/list_before /tmp/list_after
+ #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 nexcloud 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
diff --git a/12.0/fpm-alpine/upgrade.exclude b/12.0/fpm-alpine/upgrade.exclude
new file mode 100644
index 00000000..a1f2de95
--- /dev/null
+++ b/12.0/fpm-alpine/upgrade.exclude
@@ -0,0 +1,4 @@
+/config/
+/data/
+/custom_apps/
+/themes/
diff --git a/12.0/fpm/Dockerfile b/12.0/fpm/Dockerfile
index 09dc0f04..a85c2224 100644
--- a/12.0/fpm/Dockerfile
+++ b/12.0/fpm/Dockerfile
@@ -1,5 +1,5 @@
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:7.1-fpm
+FROM php:7.1-fpm-stretch
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -30,7 +30,7 @@ RUN set -ex; \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
- libpng12-dev \
+ libpng-dev \
libpq-dev \
libxml2-dev \
; \
@@ -43,21 +43,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -90,6 +87,10 @@ RUN { \
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
@@ -97,9 +98,16 @@ RUN { \
VOLUME /var/www/html
-ENV NEXTCLOUD_VERSION 12.0.6
+ENV NEXTCLOUD_VERSION 12.0.12
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/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
curl -fsSL -o nextcloud.tar.bz2.asc \
@@ -108,15 +116,18 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/12.0/fpm/config/autoconfig.php b/12.0/fpm/config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/12.0/fpm/config/autoconfig.php
+++ b/12.0/fpm/config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/12.0/fpm/entrypoint.sh b/12.0/fpm/entrypoint.sh
index 8f3ac087..045227e8 100755
--- a/12.0/fpm/entrypoint.sh
+++ b/12.0/fpm/entrypoint.sh
@@ -3,7 +3,7 @@ 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" ]
+ [ "$(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
@@ -12,50 +12,120 @@ directory_empty() {
}
run_as() {
- if [ "$(id -u)" = 0 ]; then
- su - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
+ if [ "$(id -u)" = 0 ]; then
+ su -p www-data -s /bin/sh -c "$1"
+ else
+ sh -c "$1"
+ fi
}
-installed_version="0.0.0.0"
-if [ -f /var/www/html/version.php ]; then
+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
- 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);')"
+ 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
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
+ 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 [ "$(id -u)" = 0 ]; then
- rsync_options="-rlDog --chown www-data:root"
- else
- rsync_options="-rlD"
- fi
- rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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/
+ 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
- done
+ 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/
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
+ 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"
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed disabled:"
- diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
- rm -f /tmp/list_before /tmp/list_after
+ #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 nexcloud 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
diff --git a/12.0/fpm/upgrade.exclude b/12.0/fpm/upgrade.exclude
new file mode 100644
index 00000000..a1f2de95
--- /dev/null
+++ b/12.0/fpm/upgrade.exclude
@@ -0,0 +1,4 @@
+/config/
+/data/
+/custom_apps/
+/themes/
diff --git a/13.0-rc/apache/entrypoint.sh b/13.0-rc/apache/entrypoint.sh
deleted file mode 100755
index 8f3ac087..00000000
--- a/13.0-rc/apache/entrypoint.sh
+++ /dev/null
@@ -1,62 +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 - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
-}
-
-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
- if [ "$installed_version" != "0.0.0.0" ]; then
- 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 /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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
-
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
-
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed 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
-
-exec "$@"
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 b759f4d1..00000000
--- a/13.0-rc/fpm-alpine/config/autoconfig.php
+++ /dev/null
@@ -1,34 +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 - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
-}
-
-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
- if [ "$installed_version" != "0.0.0.0" ]; then
- 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 /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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
-
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
-
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed 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
-
-exec "$@"
diff --git a/13.0-rc/fpm/config/autoconfig.php b/13.0-rc/fpm/config/autoconfig.php
deleted file mode 100644
index b759f4d1..00000000
--- a/13.0-rc/fpm/config/autoconfig.php
+++ /dev/null
@@ -1,34 +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 - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
-}
-
-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
- if [ "$installed_version" != "0.0.0.0" ]; then
- 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 /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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
-
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
-
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed 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
-
-exec "$@"
diff --git a/13.0/apache/Dockerfile b/13.0/apache/Dockerfile
index 2d32b97f..c9eca58c 100644
--- a/13.0/apache/Dockerfile
+++ b/13.0/apache/Dockerfile
@@ -1,5 +1,5 @@
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:7.1-apache
+FROM php:7.2-apache-stretch
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -30,7 +30,7 @@ RUN set -ex; \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
- libpng12-dev \
+ libpng-dev \
libpq-dev \
libxml2-dev \
; \
@@ -43,21 +43,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -90,6 +87,10 @@ RUN { \
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
@@ -105,9 +106,16 @@ RUN a2enmod rewrite remoteip ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip
-ENV NEXTCLOUD_VERSION 13.0.1
+ENV NEXTCLOUD_VERSION 13.0.7
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/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
curl -fsSL -o nextcloud.tar.bz2.asc \
@@ -116,15 +124,18 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/13.0/apache/config/autoconfig.php b/13.0/apache/config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/13.0/apache/config/autoconfig.php
+++ b/13.0/apache/config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/13.0/apache/entrypoint.sh b/13.0/apache/entrypoint.sh
index 8f3ac087..045227e8 100755
--- a/13.0/apache/entrypoint.sh
+++ b/13.0/apache/entrypoint.sh
@@ -3,7 +3,7 @@ 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" ]
+ [ "$(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
@@ -12,50 +12,120 @@ directory_empty() {
}
run_as() {
- if [ "$(id -u)" = 0 ]; then
- su - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
+ if [ "$(id -u)" = 0 ]; then
+ su -p www-data -s /bin/sh -c "$1"
+ else
+ sh -c "$1"
+ fi
}
-installed_version="0.0.0.0"
-if [ -f /var/www/html/version.php ]; then
+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
- 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);')"
+ 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
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
+ 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 [ "$(id -u)" = 0 ]; then
- rsync_options="-rlDog --chown www-data:root"
- else
- rsync_options="-rlD"
- fi
- rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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/
+ 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
- done
+ 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/
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
+ 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"
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed disabled:"
- diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
- rm -f /tmp/list_before /tmp/list_after
+ #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 nexcloud 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
diff --git a/13.0/apache/upgrade.exclude b/13.0/apache/upgrade.exclude
new file mode 100644
index 00000000..a1f2de95
--- /dev/null
+++ b/13.0/apache/upgrade.exclude
@@ -0,0 +1,4 @@
+/config/
+/data/
+/custom_apps/
+/themes/
diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile
index dd44e271..797a7040 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.1-fpm-alpine
+FROM php:7.2-fpm-alpine3.8
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -16,7 +16,7 @@ RUN set -ex; \
RUN set -ex; \
\
apk add --no-cache --virtual .build-deps \
- alpine-sdk \
+ $PHPIZE_DEPS \
autoconf \
freetype-dev \
icu-dev \
@@ -37,21 +37,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -79,6 +76,10 @@ RUN { \
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
@@ -86,7 +87,7 @@ RUN { \
VOLUME /var/www/html
-ENV NEXTCLOUD_VERSION 13.0.1
+ENV NEXTCLOUD_VERSION 13.0.7
RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \
@@ -102,16 +103,16 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/13.0/fpm-alpine/config/autoconfig.php b/13.0/fpm-alpine/config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/13.0/fpm-alpine/config/autoconfig.php
+++ b/13.0/fpm-alpine/config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/13.0/fpm-alpine/entrypoint.sh b/13.0/fpm-alpine/entrypoint.sh
index 8f3ac087..045227e8 100755
--- a/13.0/fpm-alpine/entrypoint.sh
+++ b/13.0/fpm-alpine/entrypoint.sh
@@ -3,7 +3,7 @@ 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" ]
+ [ "$(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
@@ -12,50 +12,120 @@ directory_empty() {
}
run_as() {
- if [ "$(id -u)" = 0 ]; then
- su - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
+ if [ "$(id -u)" = 0 ]; then
+ su -p www-data -s /bin/sh -c "$1"
+ else
+ sh -c "$1"
+ fi
}
-installed_version="0.0.0.0"
-if [ -f /var/www/html/version.php ]; then
+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
- 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);')"
+ 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
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
+ 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 [ "$(id -u)" = 0 ]; then
- rsync_options="-rlDog --chown www-data:root"
- else
- rsync_options="-rlD"
- fi
- rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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/
+ 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
- done
+ 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/
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
+ 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"
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed disabled:"
- diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
- rm -f /tmp/list_before /tmp/list_after
+ #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 nexcloud 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
diff --git a/13.0/fpm-alpine/upgrade.exclude b/13.0/fpm-alpine/upgrade.exclude
new file mode 100644
index 00000000..a1f2de95
--- /dev/null
+++ b/13.0/fpm-alpine/upgrade.exclude
@@ -0,0 +1,4 @@
+/config/
+/data/
+/custom_apps/
+/themes/
diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile
index 6dab4207..1b2df5ff 100644
--- a/13.0/fpm/Dockerfile
+++ b/13.0/fpm/Dockerfile
@@ -1,5 +1,5 @@
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:7.1-fpm
+FROM php:7.2-fpm-stretch
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -30,7 +30,7 @@ RUN set -ex; \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
- libpng12-dev \
+ libpng-dev \
libpq-dev \
libxml2-dev \
; \
@@ -43,21 +43,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -90,6 +87,10 @@ RUN { \
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
@@ -97,9 +98,16 @@ RUN { \
VOLUME /var/www/html
-ENV NEXTCLOUD_VERSION 13.0.1
+ENV NEXTCLOUD_VERSION 13.0.7
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/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
curl -fsSL -o nextcloud.tar.bz2.asc \
@@ -108,15 +116,18 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/13.0/fpm/config/autoconfig.php b/13.0/fpm/config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/13.0/fpm/config/autoconfig.php
+++ b/13.0/fpm/config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/13.0/fpm/entrypoint.sh b/13.0/fpm/entrypoint.sh
index 8f3ac087..045227e8 100755
--- a/13.0/fpm/entrypoint.sh
+++ b/13.0/fpm/entrypoint.sh
@@ -3,7 +3,7 @@ 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" ]
+ [ "$(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
@@ -12,50 +12,120 @@ directory_empty() {
}
run_as() {
- if [ "$(id -u)" = 0 ]; then
- su - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
+ if [ "$(id -u)" = 0 ]; then
+ su -p www-data -s /bin/sh -c "$1"
+ else
+ sh -c "$1"
+ fi
}
-installed_version="0.0.0.0"
-if [ -f /var/www/html/version.php ]; then
+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
- 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);')"
+ 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
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
+ 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 [ "$(id -u)" = 0 ]; then
- rsync_options="-rlDog --chown www-data:root"
- else
- rsync_options="-rlD"
- fi
- rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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/
+ 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
- done
+ 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/
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
+ 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"
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed disabled:"
- diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
- rm -f /tmp/list_before /tmp/list_after
+ #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 nexcloud 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
diff --git a/13.0/fpm/upgrade.exclude b/13.0/fpm/upgrade.exclude
new file mode 100644
index 00000000..a1f2de95
--- /dev/null
+++ b/13.0/fpm/upgrade.exclude
@@ -0,0 +1,4 @@
+/config/
+/data/
+/custom_apps/
+/themes/
diff --git a/13.0-rc/apache/Dockerfile b/14.0/apache/Dockerfile
similarity index 76%
rename from 13.0-rc/apache/Dockerfile
rename to 14.0/apache/Dockerfile
index d22d4eed..e2b3852e 100644
--- a/13.0-rc/apache/Dockerfile
+++ b/14.0/apache/Dockerfile
@@ -1,5 +1,5 @@
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:7.1-apache
+FROM php:7.2-apache-stretch
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -30,7 +30,7 @@ RUN set -ex; \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
- libpng12-dev \
+ libpng-dev \
libpq-dev \
libxml2-dev \
; \
@@ -43,21 +43,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -90,6 +87,10 @@ RUN { \
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
@@ -105,26 +106,36 @@ RUN a2enmod rewrite remoteip ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip
-ENV NEXTCLOUD_VERSION 13.0.2RC1
+ENV NEXTCLOUD_VERSION 14.0.3
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"; \
+ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
curl -fsSL -o nextcloud.tar.bz2.asc \
- "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \
+ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/12.0-rc/apache/config/apache-pretty-urls.config.php b/14.0/apache/config/apache-pretty-urls.config.php
similarity index 100%
rename from 12.0-rc/apache/config/apache-pretty-urls.config.php
rename to 14.0/apache/config/apache-pretty-urls.config.php
diff --git a/12.0-rc/apache/config/apcu.config.php b/14.0/apache/config/apcu.config.php
similarity index 100%
rename from 12.0-rc/apache/config/apcu.config.php
rename to 14.0/apache/config/apcu.config.php
diff --git a/12.0-rc/apache/config/apps.config.php b/14.0/apache/config/apps.config.php
similarity index 100%
rename from 12.0-rc/apache/config/apps.config.php
rename to 14.0/apache/config/apps.config.php
diff --git a/12.0-rc/apache/config/autoconfig.php b/14.0/apache/config/autoconfig.php
similarity index 83%
rename from 12.0-rc/apache/config/autoconfig.php
rename to 14.0/apache/config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/12.0-rc/apache/config/autoconfig.php
+++ b/14.0/apache/config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/12.0-rc/apache/cron.sh b/14.0/apache/cron.sh
similarity index 100%
rename from 12.0-rc/apache/cron.sh
rename to 14.0/apache/cron.sh
diff --git a/14.0/apache/entrypoint.sh b/14.0/apache/entrypoint.sh
new file mode 100755
index 00000000..045227e8
--- /dev/null
+++ b/14.0/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 nexcloud 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/apache/upgrade.exclude b/14.0/apache/upgrade.exclude
new file mode 100644
index 00000000..a1f2de95
--- /dev/null
+++ b/14.0/apache/upgrade.exclude
@@ -0,0 +1,4 @@
+/config/
+/data/
+/custom_apps/
+/themes/
diff --git a/12.0-rc/fpm-alpine/Dockerfile b/14.0/fpm-alpine/Dockerfile
similarity index 79%
rename from 12.0-rc/fpm-alpine/Dockerfile
rename to 14.0/fpm-alpine/Dockerfile
index 1121edda..4a8c15bf 100644
--- a/12.0-rc/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.1-fpm-alpine
+FROM php:7.2-fpm-alpine3.8
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -16,7 +16,7 @@ RUN set -ex; \
RUN set -ex; \
\
apk add --no-cache --virtual .build-deps \
- alpine-sdk \
+ $PHPIZE_DEPS \
autoconf \
freetype-dev \
icu-dev \
@@ -37,21 +37,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -79,6 +76,10 @@ RUN { \
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
@@ -86,7 +87,7 @@ RUN { \
VOLUME /var/www/html
-ENV NEXTCLOUD_VERSION 12.0.7RC1
+ENV NEXTCLOUD_VERSION 14.0.3
RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \
@@ -95,23 +96,23 @@ RUN set -ex; \
; \
\
curl -fsSL -o nextcloud.tar.bz2 \
- "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
+ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
curl -fsSL -o nextcloud.tar.bz2.asc \
- "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \
+ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/12.0-rc/fpm-alpine/config/apcu.config.php b/14.0/fpm-alpine/config/apcu.config.php
similarity index 100%
rename from 12.0-rc/fpm-alpine/config/apcu.config.php
rename to 14.0/fpm-alpine/config/apcu.config.php
diff --git a/12.0-rc/fpm-alpine/config/apps.config.php b/14.0/fpm-alpine/config/apps.config.php
similarity index 100%
rename from 12.0-rc/fpm-alpine/config/apps.config.php
rename to 14.0/fpm-alpine/config/apps.config.php
diff --git a/12.0-rc/fpm/config/autoconfig.php b/14.0/fpm-alpine/config/autoconfig.php
similarity index 83%
rename from 12.0-rc/fpm/config/autoconfig.php
rename to 14.0/fpm-alpine/config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/12.0-rc/fpm/config/autoconfig.php
+++ b/14.0/fpm-alpine/config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/12.0-rc/fpm-alpine/cron.sh b/14.0/fpm-alpine/cron.sh
similarity index 100%
rename from 12.0-rc/fpm-alpine/cron.sh
rename to 14.0/fpm-alpine/cron.sh
diff --git a/14.0/fpm-alpine/entrypoint.sh b/14.0/fpm-alpine/entrypoint.sh
new file mode 100755
index 00000000..045227e8
--- /dev/null
+++ b/14.0/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 nexcloud 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/fpm-alpine/upgrade.exclude b/14.0/fpm-alpine/upgrade.exclude
new file mode 100644
index 00000000..a1f2de95
--- /dev/null
+++ b/14.0/fpm-alpine/upgrade.exclude
@@ -0,0 +1,4 @@
+/config/
+/data/
+/custom_apps/
+/themes/
diff --git a/13.0-rc/fpm/Dockerfile b/14.0/fpm/Dockerfile
similarity index 74%
rename from 13.0-rc/fpm/Dockerfile
rename to 14.0/fpm/Dockerfile
index f4b4e470..f6a41564 100644
--- a/13.0-rc/fpm/Dockerfile
+++ b/14.0/fpm/Dockerfile
@@ -1,5 +1,5 @@
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:7.1-fpm
+FROM php:7.2-fpm-stretch
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -30,7 +30,7 @@ RUN set -ex; \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
- libpng12-dev \
+ libpng-dev \
libpq-dev \
libxml2-dev \
; \
@@ -43,21 +43,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -90,6 +87,10 @@ RUN { \
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
@@ -97,26 +98,36 @@ RUN { \
VOLUME /var/www/html
-ENV NEXTCLOUD_VERSION 13.0.2RC1
+ENV NEXTCLOUD_VERSION 14.0.3
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"; \
+ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
curl -fsSL -o nextcloud.tar.bz2.asc \
- "https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \
+ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/12.0-rc/fpm/config/apcu.config.php b/14.0/fpm/config/apcu.config.php
similarity index 100%
rename from 12.0-rc/fpm/config/apcu.config.php
rename to 14.0/fpm/config/apcu.config.php
diff --git a/12.0-rc/fpm/config/apps.config.php b/14.0/fpm/config/apps.config.php
similarity index 100%
rename from 12.0-rc/fpm/config/apps.config.php
rename to 14.0/fpm/config/apps.config.php
diff --git a/12.0-rc/fpm-alpine/config/autoconfig.php b/14.0/fpm/config/autoconfig.php
similarity index 83%
rename from 12.0-rc/fpm-alpine/config/autoconfig.php
rename to 14.0/fpm/config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/12.0-rc/fpm-alpine/config/autoconfig.php
+++ b/14.0/fpm/config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/12.0-rc/fpm/cron.sh b/14.0/fpm/cron.sh
similarity index 100%
rename from 12.0-rc/fpm/cron.sh
rename to 14.0/fpm/cron.sh
diff --git a/14.0/fpm/entrypoint.sh b/14.0/fpm/entrypoint.sh
new file mode 100755
index 00000000..045227e8
--- /dev/null
+++ b/14.0/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 nexcloud 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/fpm/upgrade.exclude b/14.0/fpm/upgrade.exclude
new file mode 100644
index 00000000..a1f2de95
--- /dev/null
+++ b/14.0/fpm/upgrade.exclude
@@ -0,0 +1,4 @@
+/config/
+/data/
+/custom_apps/
+/themes/
diff --git a/12.0-rc/apache/Dockerfile b/15.0-beta/apache/Dockerfile
similarity index 80%
rename from 12.0-rc/apache/Dockerfile
rename to 15.0-beta/apache/Dockerfile
index fded6a57..8eb10b85 100644
--- a/12.0-rc/apache/Dockerfile
+++ b/15.0-beta/apache/Dockerfile
@@ -1,5 +1,5 @@
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:7.1-apache
+FROM php:7.2-apache-stretch
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -30,7 +30,7 @@ RUN set -ex; \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
- libpng12-dev \
+ libpng-dev \
libpq-dev \
libxml2-dev \
; \
@@ -43,21 +43,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -90,6 +87,10 @@ RUN { \
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
@@ -105,9 +106,16 @@ RUN a2enmod rewrite remoteip ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip
-ENV NEXTCLOUD_VERSION 12.0.7RC1
+ENV NEXTCLOUD_VERSION 15.0.0beta1
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 \
@@ -116,15 +124,18 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/13.0-rc/apache/config/apache-pretty-urls.config.php b/15.0-beta/apache/config/apache-pretty-urls.config.php
similarity index 100%
rename from 13.0-rc/apache/config/apache-pretty-urls.config.php
rename to 15.0-beta/apache/config/apache-pretty-urls.config.php
diff --git a/13.0-rc/apache/config/apcu.config.php b/15.0-beta/apache/config/apcu.config.php
similarity index 100%
rename from 13.0-rc/apache/config/apcu.config.php
rename to 15.0-beta/apache/config/apcu.config.php
diff --git a/13.0-rc/apache/config/apps.config.php b/15.0-beta/apache/config/apps.config.php
similarity index 100%
rename from 13.0-rc/apache/config/apps.config.php
rename to 15.0-beta/apache/config/apps.config.php
diff --git a/13.0-rc/apache/config/autoconfig.php b/15.0-beta/apache/config/autoconfig.php
similarity index 83%
rename from 13.0-rc/apache/config/autoconfig.php
rename to 15.0-beta/apache/config/autoconfig.php
index b759f4d1..85e02212 100644
--- a/13.0-rc/apache/config/autoconfig.php
+++ b/15.0-beta/apache/config/autoconfig.php
@@ -26,9 +26,4 @@ if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
-
- if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
- $AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
- $AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
- }
}
diff --git a/13.0-rc/apache/cron.sh b/15.0-beta/apache/cron.sh
similarity index 100%
rename from 13.0-rc/apache/cron.sh
rename to 15.0-beta/apache/cron.sh
diff --git a/15.0-beta/apache/entrypoint.sh b/15.0-beta/apache/entrypoint.sh
new file mode 100755
index 00000000..045227e8
--- /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 nexcloud 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/13.0-rc/fpm-alpine/Dockerfile b/15.0-beta/fpm-alpine/Dockerfile
similarity index 84%
rename from 13.0-rc/fpm-alpine/Dockerfile
rename to 15.0-beta/fpm-alpine/Dockerfile
index 617a71df..efffdbe4 100644
--- a/13.0-rc/fpm-alpine/Dockerfile
+++ b/15.0-beta/fpm-alpine/Dockerfile
@@ -1,5 +1,5 @@
# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
-FROM php:7.1-fpm-alpine
+FROM php:7.2-fpm-alpine3.8
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -16,7 +16,7 @@ RUN set -ex; \
RUN set -ex; \
\
apk add --no-cache --virtual .build-deps \
- alpine-sdk \
+ $PHPIZE_DEPS \
autoconf \
freetype-dev \
icu-dev \
@@ -37,21 +37,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -79,6 +76,10 @@ RUN { \
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
@@ -86,7 +87,7 @@ RUN { \
VOLUME /var/www/html
-ENV NEXTCLOUD_VERSION 13.0.2RC1
+ENV NEXTCLOUD_VERSION 15.0.0beta1
RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \
@@ -102,16 +103,16 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/13.0-rc/fpm-alpine/config/apcu.config.php b/15.0-beta/fpm-alpine/config/apcu.config.php
similarity index 100%
rename from 13.0-rc/fpm-alpine/config/apcu.config.php
rename to 15.0-beta/fpm-alpine/config/apcu.config.php
diff --git a/13.0-rc/fpm-alpine/config/apps.config.php b/15.0-beta/fpm-alpine/config/apps.config.php
similarity index 100%
rename from 13.0-rc/fpm-alpine/config/apps.config.php
rename to 15.0-beta/fpm-alpine/config/apps.config.php
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 @@
+ 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 nexcloud 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/12.0-rc/fpm/Dockerfile b/15.0-beta/fpm/Dockerfile
similarity index 79%
rename from 12.0-rc/fpm/Dockerfile
rename to 15.0-beta/fpm/Dockerfile
index 27acdd33..d7363c15 100644
--- a/12.0-rc/fpm/Dockerfile
+++ b/15.0-beta/fpm/Dockerfile
@@ -1,5 +1,5 @@
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:7.1-fpm
+FROM php:7.2-fpm-stretch
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -30,7 +30,7 @@ RUN set -ex; \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
- libpng12-dev \
+ libpng-dev \
libpq-dev \
libxml2-dev \
; \
@@ -43,21 +43,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-5.1.11 \
- memcached-3.0.4 \
- redis-3.1.6 \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-5.1.12; \
+ pecl install memcached-3.0.4; \
+ pecl install redis-4.1.1; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -90,6 +87,10 @@ RUN { \
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
@@ -97,9 +98,16 @@ RUN { \
VOLUME /var/www/html
-ENV NEXTCLOUD_VERSION 12.0.7RC1
+ENV NEXTCLOUD_VERSION 15.0.0beta1
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 \
@@ -108,15 +116,18 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/13.0-rc/fpm/config/apcu.config.php b/15.0-beta/fpm/config/apcu.config.php
similarity index 100%
rename from 13.0-rc/fpm/config/apcu.config.php
rename to 15.0-beta/fpm/config/apcu.config.php
diff --git a/13.0-rc/fpm/config/apps.config.php b/15.0-beta/fpm/config/apps.config.php
similarity index 100%
rename from 13.0-rc/fpm/config/apps.config.php
rename to 15.0-beta/fpm/config/apps.config.php
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 @@
+ 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 nexcloud 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/
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..d9060072
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,9 @@
+In the Nextcloud community, participants from all over the world come together to create Free Software for a free internet. This is made possible by the support, hard work and enthusiasm of thousands of people, including those who create and use Nextcloud software.
+
+Our code of conduct offers some guidance to ensure Nextcloud participants can cooperate effectively in a positive and inspiring atmosphere, and to explain how together we can strengthen and support each other.
+
+The Code of Conduct is shared by all contributors and users who engage with the Nextcloud team and its community services. It presents a summary of the shared values and “common sense” thinking in our community.
+
+You can find our full code of conduct on our website: https://nextcloud.com/code-of-conduct/
+
+Please, keep our CoC in mind when you contribute! That way, everyone can be a part of our community in a productive, positive, creative and fun way.
diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template
index e87a4ed4..9bb6e9eb 100644
--- a/Dockerfile-alpine.template
+++ b/Dockerfile-alpine.template
@@ -1,4 +1,4 @@
-FROM php:%%PHP_VERSION%%-%%VARIANT%%
+FROM php:%%PHP_VERSION%%-%%VARIANT%%3.8
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -15,7 +15,7 @@ RUN set -ex; \
RUN set -ex; \
\
apk add --no-cache --virtual .build-deps \
- alpine-sdk \
+ $PHPIZE_DEPS \
autoconf \
freetype-dev \
icu-dev \
@@ -36,21 +36,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-%%APCU_VERSION%% \
- memcached-%%MEMCACHED_VERSION%% \
- redis-%%REDIS_VERSION%% \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-%%APCU_VERSION%%; \
+ pecl install memcached-%%MEMCACHED_VERSION%%; \
+ pecl install redis-%%REDIS_VERSION%%; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -78,6 +75,10 @@ RUN { \
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
@@ -101,16 +102,16 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template
index 67891508..54c28425 100644
--- a/Dockerfile-debian.template
+++ b/Dockerfile-debian.template
@@ -1,4 +1,4 @@
-FROM php:%%PHP_VERSION%%-%%VARIANT%%
+FROM php:%%PHP_VERSION%%-%%VARIANT%%-stretch
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
@@ -29,7 +29,7 @@ RUN set -ex; \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
- libpng12-dev \
+ libpng-dev \
libpq-dev \
libxml2-dev \
; \
@@ -42,21 +42,18 @@ RUN set -ex; \
gd \
intl \
ldap \
- mbstring \
- mcrypt \
- mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
- pgsql \
zip \
; \
- pecl install \
- APCu-%%APCU_VERSION%% \
- memcached-%%MEMCACHED_VERSION%% \
- redis-%%REDIS_VERSION%% \
- ; \
+ \
+# pecl will claim success even if one install fails, so we need to perform each install separately
+ pecl install APCu-%%APCU_VERSION%%; \
+ pecl install memcached-%%MEMCACHED_VERSION%%; \
+ pecl install redis-%%REDIS_VERSION%%; \
+ \
docker-php-ext-enable \
apcu \
memcached \
@@ -89,6 +86,10 @@ RUN { \
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
@@ -99,6 +100,13 @@ VOLUME /var/www/html
ENV NEXTCLOUD_VERSION %%VERSION%%
RUN set -ex; \
+ fetchDeps=" \
+ gnupg \
+ dirmngr \
+ "; \
+ apt-get update; \
+ apt-get install -y --no-install-recommends $fetchDeps; \
+ \
curl -fsSL -o nextcloud.tar.bz2 \
"%%BASE_DOWNLOAD_URL%%/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
curl -fsSL -o nextcloud.tar.bz2.asc \
@@ -107,15 +115,18 @@ RUN set -ex; \
# gpg key from https://nextcloud.com/nextcloud.asc
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
- rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
- rm nextcloud.tar.bz2; \
+ 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
+ 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 /
+COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 00000000..dbbe3558
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,661 @@
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+.
diff --git a/README.md b/README.md
index aa03b89f..0d712c01 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
A safe home for all your data. Access & share your files, calendars, contacts, mail & more from any device, on your terms.
-
+
# How to use this image
This image is designed to be used in a micro-service environment. There are two versions of the image you can choose from.
@@ -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 you host.
```console
$ docker run -d nextcloud:fpm
@@ -62,7 +62,7 @@ $ docker run -d \
mariadb
```
-If you want to get fine grained access to your individual files, you can mount additional volumes for data, config, your theme and custom apps.
+If you want to get fine grained access to your individual files, you can mount additional volumes for data, config, your theme and custom apps.
The `data`, `config` are stored in respective subfolders inside `/var/www/html/`. The apps are split into core `apps` (which are shipped with Nextcloud and you don't need to take care of) and a `custom_apps` folder. If you use a custom theme it would go into the `themes` subfolder.
Overview of the folders that can be mounted as volumes:
@@ -101,7 +101,7 @@ __SQLITE_DATABASE__:
- `SQLITE_DATABASE` Name of the database using sqlite
__MYSQL/MariaDB__:
-- `MYSQL_DATABASE` Name of the database using mysql / mariadb.
+- `MYSQL_DATABASE` Name of the database using mysql / mariadb.
- `MYSQL_USER` Username for the database using mysql / mariadb.
- `MYSQL_PASSWORD` Password for the database user using mysql / mariadb.
- `MYSQL_HOST` Hostname of the database server using mysql / mariadb.
@@ -122,14 +122,23 @@ 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.
+
+- `NEXTCLOUD_TRUSTED_DOMAINS` (not set by default) Optional space-separated list of domains
+
+The install and update script is only triggered when a default command is used (`apache-foreground` or `php-fpm`). If you use a custom command you have to enable the install / update with
+
+- `NEXTCLOUD_UPDATE` (default: _0_)
+
+
# 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.
+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.
At first make sure you have chosen the right base image (fpm or apache) and added the features you wanted (see below). In every case you want to add a database container and docker volumes to get easy access to your persistent data. When you want to have your server reachable from the internet adding HTTPS-encryption is mandatory! See below for more information.
## Base version - apache
-This version will use the apache image and add a mariaDB container. The volumes are set to keep your data persistent. This setup provides **no ssl encryption** and is intended to run behind a proxy.
+This version will use the apache image and add a mariaDB container. The volumes are set to keep your data persistent. This setup provides **no ssl encryption** and is intended to run behind a proxy.
Make sure to set the variables `MYSQL_ROOT_PASSWORD` and `MYSQL_PASSWORD` before you run this setup.
@@ -152,7 +161,7 @@ services:
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- app:
+ app:
image: nextcloud
ports:
- 8080:80
@@ -169,7 +178,7 @@ Then run `docker-compose up -d`, now you can access Nextcloud at http://localhos
## Base version - FPM
When using the FPM image you need another container that acts as web server on port 80 and proxies the requests to the Nextcloud container. In this example a simple nginx container is combined with the Nextcloud-fpm image and a MariaDB database container. The data is stored in docker volumes. The nginx container also need access to static files from your Nextcloud installation. It gets access to all the volumes mounted to Nextcloud via the `volumes_from` option.The configuration for nginx is stored in the configuration file `nginx.conf`, that is mounted into the container. An example can be found in the examples section [here](https://github.com/nextcloud/docker/tree/master/.examples).
-As this setup does **not include encryption** it should to be run behind a proxy.
+As this setup does **not include encryption** it should to be run behind a proxy.
Make sure to set the variables `MYSQL_ROOT_PASSWORD` and `MYSQL_PASSWORD` before you run this setup.
@@ -219,7 +228,7 @@ Then run `docker-compose up -d`, now you can access Nextcloud at http://localhos
Until here your Nextcloud is just available from you docker host. If you want you Nextcloud available from the internet adding SSL encryption is mandatory.
## HTTPS - SSL encryption
-There are many different possibilities to introduce encryption depending on your setup.
+There are many different possibilities to introduce encryption depending on your setup.
We recommend using a reverse proxy in front of our Nextcloud installation. Your Nextcloud will only be reachable through the proxy, which encrypts all traffic to the clients. You can mount your manually generated certificates to the proxy or use a fully automated solution, which generates and renews the certificates for you.
@@ -229,7 +238,7 @@ 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. 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
@@ -257,7 +266,7 @@ FROM nextcloud:apache
RUN ...
```
-The [examples folder](https://github.com/nextcloud/docker/blob/master/.examples) gives a few examples on how to add certain functionalities, like including the cron job, smb-support or imap-authentication.
+The [examples folder](https://github.com/nextcloud/docker/blob/master/.examples) gives a few examples on how to add certain functionalities, like including the cron job, smb-support or imap-authentication.
If you use your own Dockerfile you need to configure your docker-compose file accordingly. Switch out the `image` option with `build`. You have to specify the path to your Dockerfile. (in the example it's in the same directory next to the docker-compose file)
@@ -273,10 +282,23 @@ If you use your own Dockerfile you need to configure your docker-compose file ac
restart: always
```
+If you intend to use another command to run the image. Make sure that you set `NEXTCLOUD_UPDATE=1` in your Dockerfile. Otherwise the installation and update will not work.
+
+```yaml
+FROM nextcloud:apache
+
+...
+
+ENV NEXTCLOUD_UPDATE=1
+
+CMD ["/usr/bin/supervisord"]
+```
+
+
**Updating** your own derived image is also very simple. When a new version of the Nextcloud image is available run:
```console
-docker build -t your-name --pull .
+docker build -t your-name --pull .
docker run -d your-name
```
@@ -299,10 +321,10 @@ docker-compose exec db sh -c "mysql -u USER -pPASSWORD nextcloud < /dmp"
docker-compose exec db rm /dmp
```
3. Edit your config.php
- 1. Set database connection
+ 1. Set database connection
```php
'dbhost' => 'db:3306',
- ```
+ ```
2. Make sure you have no configuration for the `apps_paths`. Delete lines like these
```diff
- "apps_paths" => array (
@@ -316,7 +338,7 @@ docker-compose exec db rm /dmp
```php
'datadirectory' => '/var/www/html/data',
```
-
+
4. Copy your data (nextcloud_app_1 is the name of your Nextcloud container):
```console
@@ -328,10 +350,10 @@ docker cp ./config/config.php nextcloud_app_1:/var/www/html/config
docker-compose exec app chown -R www-data:www-data /var/www/html/config
```
5. Copy only the custom apps you use (or simply redownload them from the web interface):
-```console
+```console
docker cp ./apps/ nextcloud_data:/var/www/html/custom_apps
docker-compose exec app chown -R www-data:www-data /var/www/html/custom_apps
```
# Questions / Issues
-If you got any questions or problems using the image, please visit our [Github Repository](https://github.com/nextcloud/docker) and write an issue.
+If you got any questions or problems using the image, please visit our [Github Repository](https://github.com/nextcloud/docker) and write an issue.
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 8f3ac087..045227e8 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -3,7 +3,7 @@ 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" ]
+ [ "$(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
@@ -12,50 +12,120 @@ directory_empty() {
}
run_as() {
- if [ "$(id -u)" = 0 ]; then
- su - www-data -s /bin/sh -c "$1"
- else
- sh -c "$1"
- fi
+ if [ "$(id -u)" = 0 ]; then
+ su -p www-data -s /bin/sh -c "$1"
+ else
+ sh -c "$1"
+ fi
}
-installed_version="0.0.0.0"
-if [ -f /var/www/html/version.php ]; then
+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
- 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);')"
+ 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
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
+ 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 [ "$(id -u)" = 0 ]; then
- rsync_options="-rlDog --chown www-data:root"
- else
- rsync_options="-rlD"
- fi
- rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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/
+ 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
- done
+ 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/
- if [ "$installed_version" != "0.0.0.0" ]; then
- run_as 'php /var/www/html/occ upgrade --no-app-disable'
+ 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"
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
- echo "The following apps have beed disabled:"
- diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
- rm -f /tmp/list_before /tmp/list_after
+ #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 nexcloud 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
diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh
index 15e3a8f1..af901b36 100755
--- a/generate-stackbrew-library.sh
+++ b/generate-stackbrew-library.sh
@@ -2,8 +2,8 @@
set -Eeuo pipefail
declare -A release_channel=(
- [production]='12.0.6'
- [stable]='13.0.1'
+ [production]='13.0.7'
+ [stable]='13.0.7'
)
self="$(basename "$BASH_SOURCE")"
@@ -11,7 +11,13 @@ cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
# Get the most recent commit which modified any of "$@".
fileCommit() {
- git log -1 --format='format:%H' HEAD -- "$@"
+ commit="$(git log -1 --format='format:%H' HEAD -- "$@")"
+ if [ -z "$commit" ]; then
+ # return some valid sha1 hash to make bashbrew happy
+ echo '0000000000000000000000000000000000000000'
+ else
+ echo "$commit"
+ fi
}
# Get the most recent commit which modified "$1/Dockerfile" or any file that
@@ -73,6 +79,12 @@ latest_rc=$( curl -fsSL 'https://download.nextcloud.com/server/prereleases/' |ta
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[@]%/}" )
@@ -90,7 +102,7 @@ for version in "${versions[@]}"; do
versionPostfix=""
if [ "$fullversion_with_extension" != "$fullversion" ]; then
versionAliases=( "$fullversion_with_extension" )
- versionPostfix="-rc"
+ versionPostfix="-$( echo "$fullversion_with_extension" | tr '[:upper:]' '[:lower:]' | grep -oE '(beta|rc)')"
fi
versionAliases+=( "$fullversion$versionPostfix" "${fullversion%.*}$versionPostfix" "${fullversion%.*.*}$versionPostfix" )
@@ -100,6 +112,9 @@ for version in "${versions[@]}"; do
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/license.md b/license.md
deleted file mode 100644
index a271da30..00000000
--- a/license.md
+++ /dev/null
@@ -1 +0,0 @@
-View [license information](https://github.com/nextcloud/server/blob/master/COPYING-README) for the software contained in this image.
diff --git a/logo.svg b/logo.svg
index 18acad5a..80d546e7 100644
--- a/logo.svg
+++ b/logo.svg
@@ -1,2 +1,109 @@
-
-
+
+
+
+
\ No newline at end of file
diff --git a/update.sh b/update.sh
index 136f62ac..16c1104c 100755
--- a/update.sh
+++ b/update.sh
@@ -2,7 +2,8 @@
set -eo pipefail
declare -A php_version=(
- [default]='7.1'
+ [default]='7.2'
+ [12.0]='7.1'
)
declare -A cmd=(
@@ -24,9 +25,9 @@ declare -A extras=(
)
declare -A pecl_versions=(
- [APCu]='5.1.11'
+ [APCu]='5.1.12'
[memcached]='3.0.4'
- [redis]='3.1.6'
+ [redis]='4.1.1'
)
variants=(
@@ -47,6 +48,11 @@ function check_released() {
printf '%s\n' "${fullversions[@]}" | grep -qE "^$( echo "$1" | grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' )"
}
+# checks if the the beta has already a rc
+function check_rc_released() {
+ printf '%s\n' "${fullversions_rc[@]}" | grep -qE "^$( echo "$1" | grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' )"
+}
+
travisEnv=
function create_variant() {
@@ -55,8 +61,8 @@ function create_variant() {
# Create the version+variant directory with a Dockerfile.
mkdir -p "$dir"
- template="Dockerfile-${base[$variant]}.template"
- echo "# DO NOT EDIT: created by update.sh from $template" > "$dir/Dockerfile"
+ template="Dockerfile-${base[$variant]}.template"
+ echo "# DO NOT EDIT: created by update.sh from $template" > "$dir/Dockerfile"
cat "$template" >> "$dir/Dockerfile"
echo "updating $fullversion [$1] $variant"
@@ -79,6 +85,9 @@ function create_variant() {
cp "docker-$name.sh" "$dir/$name.sh"
done
+ # Copy the upgrade.exclude
+ cp upgrade.exclude "$dir/"
+
# Copy the config directory
cp -rT .config "$dir/config"
@@ -92,7 +101,7 @@ function create_variant() {
done
}
-find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+\(-rc\)\?' -exec rm -r '{}' \;
+find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+\(-rc\|-beta\)\?' -exec rm -r '{}' \;
fullversions=( $( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \
grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}' | \
@@ -105,7 +114,7 @@ for version in "${versions[@]}"; do
if version_greater_or_equal "$version" "$min_version"; then
for variant in "${variants[@]}"; do
-
+
create_variant "$version" "https:\/\/download.nextcloud.com\/server\/releases"
done
fi
@@ -124,13 +133,33 @@ for version in "${versions_rc[@]}"; do
if ! check_released "$fullversion"; then
for variant in "${variants[@]}"; do
-
+
create_variant "$version-rc" "https:\/\/download.nextcloud.com\/server\/prereleases"
done
fi
fi
done
+fullversions_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 -urV ) )
+versions_beta=( $( printf '%s\n' "${fullversions_beta[@]}" | cut -d. -f1-2 | sort -urV ) )
+for version in "${versions_beta[@]}"; do
+ fullversion="$( printf '%s\n' "${fullversions_beta[@]}" | grep -E "^$version" | head -1 )"
+
+ if version_greater_or_equal "$version" "$min_version"; then
+
+ if ! check_rc_released "$fullversion"; then
+
+ for variant in "${variants[@]}"; do
+
+ create_variant "$version-beta" "https:\/\/download.nextcloud.com\/server\/prereleases"
+ done
+ fi
+ fi
+done
+
# replace the fist '-' with ' '
travisEnv="$(echo "$travisEnv" | sed '0,/-/{s/-/ /}')"
diff --git a/upgrade.exclude b/upgrade.exclude
new file mode 100644
index 00000000..a1f2de95
--- /dev/null
+++ b/upgrade.exclude
@@ -0,0 +1,4 @@
+/config/
+/data/
+/custom_apps/
+/themes/