From 71a8f0ef64e2f347c97a7c0ac97d5fd44a5b4137 Mon Sep 17 00:00:00 2001 From: naramski Date: Fri, 14 Dec 2018 09:52:46 +0100 Subject: [PATCH] Rebase --- 13.0/apache/entrypoint.sh | 14 ++++++++++++++ 13.0/fpm-alpine/entrypoint.sh | 14 ++++++++++++++ 13.0/fpm/entrypoint.sh | 14 ++++++++++++++ 14.0/apache/entrypoint.sh | 14 ++++++++++++++ 14.0/fpm-alpine/entrypoint.sh | 14 ++++++++++++++ 14.0/fpm/entrypoint.sh | 14 ++++++++++++++ 15.0/apache/Dockerfile | 4 ++++ 15.0/apache/entrypoint.sh | 14 ++++++++++++++ 15.0/fpm-alpine/Dockerfile | 4 ++++ 15.0/fpm-alpine/entrypoint.sh | 14 ++++++++++++++ 15.0/fpm/Dockerfile | 4 ++++ 15.0/fpm/entrypoint.sh | 14 ++++++++++++++ README.md | 6 ++++++ docker-entrypoint.sh | 14 ++++++++++++++ 14 files changed, 158 insertions(+) diff --git a/13.0/apache/entrypoint.sh b/13.0/apache/entrypoint.sh index 07644c04..db164624 100755 --- a/13.0/apache/entrypoint.sh +++ b/13.0/apache/entrypoint.sh @@ -127,6 +127,20 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi fi + + if [ -n "${NEXTCLOUD_OVERWRITEHOST+x}" ]; then + echo "setting overwritehost…" + run_as "php /var/www/html/occ config:system:set overwritehost --value=$NEXTCLOUD_OVERWRITEHOST" + fi + if [ -n "${NEXTCLOUD_OVERWRITEPROTOCOL+x}" ]; then + echo "setting overwriteprotocol…" + run_as "php /var/www/html/occ config:system:set overwriteprotocol --value=$NEXTCLOUD_OVERWRITEPROTOCOL" + fi + if [ -n "${NEXTCLOUD_OVERWRITEWEBROOT+x}" ]; then + echo "setting overwritewebroot…" + run_as "php /var/www/html/occ config:system:set overwritewebroot --value=$NEXTCLOUD_OVERWRITEWEBROOT" + fi + fi exec "$@" diff --git a/13.0/fpm-alpine/entrypoint.sh b/13.0/fpm-alpine/entrypoint.sh index 07644c04..db164624 100755 --- a/13.0/fpm-alpine/entrypoint.sh +++ b/13.0/fpm-alpine/entrypoint.sh @@ -127,6 +127,20 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi fi + + if [ -n "${NEXTCLOUD_OVERWRITEHOST+x}" ]; then + echo "setting overwritehost…" + run_as "php /var/www/html/occ config:system:set overwritehost --value=$NEXTCLOUD_OVERWRITEHOST" + fi + if [ -n "${NEXTCLOUD_OVERWRITEPROTOCOL+x}" ]; then + echo "setting overwriteprotocol…" + run_as "php /var/www/html/occ config:system:set overwriteprotocol --value=$NEXTCLOUD_OVERWRITEPROTOCOL" + fi + if [ -n "${NEXTCLOUD_OVERWRITEWEBROOT+x}" ]; then + echo "setting overwritewebroot…" + run_as "php /var/www/html/occ config:system:set overwritewebroot --value=$NEXTCLOUD_OVERWRITEWEBROOT" + fi + fi exec "$@" diff --git a/13.0/fpm/entrypoint.sh b/13.0/fpm/entrypoint.sh index 07644c04..db164624 100755 --- a/13.0/fpm/entrypoint.sh +++ b/13.0/fpm/entrypoint.sh @@ -127,6 +127,20 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi fi + + if [ -n "${NEXTCLOUD_OVERWRITEHOST+x}" ]; then + echo "setting overwritehost…" + run_as "php /var/www/html/occ config:system:set overwritehost --value=$NEXTCLOUD_OVERWRITEHOST" + fi + if [ -n "${NEXTCLOUD_OVERWRITEPROTOCOL+x}" ]; then + echo "setting overwriteprotocol…" + run_as "php /var/www/html/occ config:system:set overwriteprotocol --value=$NEXTCLOUD_OVERWRITEPROTOCOL" + fi + if [ -n "${NEXTCLOUD_OVERWRITEWEBROOT+x}" ]; then + echo "setting overwritewebroot…" + run_as "php /var/www/html/occ config:system:set overwritewebroot --value=$NEXTCLOUD_OVERWRITEWEBROOT" + fi + fi exec "$@" diff --git a/14.0/apache/entrypoint.sh b/14.0/apache/entrypoint.sh index 07644c04..db164624 100755 --- a/14.0/apache/entrypoint.sh +++ b/14.0/apache/entrypoint.sh @@ -127,6 +127,20 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi fi + + if [ -n "${NEXTCLOUD_OVERWRITEHOST+x}" ]; then + echo "setting overwritehost…" + run_as "php /var/www/html/occ config:system:set overwritehost --value=$NEXTCLOUD_OVERWRITEHOST" + fi + if [ -n "${NEXTCLOUD_OVERWRITEPROTOCOL+x}" ]; then + echo "setting overwriteprotocol…" + run_as "php /var/www/html/occ config:system:set overwriteprotocol --value=$NEXTCLOUD_OVERWRITEPROTOCOL" + fi + if [ -n "${NEXTCLOUD_OVERWRITEWEBROOT+x}" ]; then + echo "setting overwritewebroot…" + run_as "php /var/www/html/occ config:system:set overwritewebroot --value=$NEXTCLOUD_OVERWRITEWEBROOT" + fi + fi exec "$@" diff --git a/14.0/fpm-alpine/entrypoint.sh b/14.0/fpm-alpine/entrypoint.sh index 07644c04..db164624 100755 --- a/14.0/fpm-alpine/entrypoint.sh +++ b/14.0/fpm-alpine/entrypoint.sh @@ -127,6 +127,20 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi fi + + if [ -n "${NEXTCLOUD_OVERWRITEHOST+x}" ]; then + echo "setting overwritehost…" + run_as "php /var/www/html/occ config:system:set overwritehost --value=$NEXTCLOUD_OVERWRITEHOST" + fi + if [ -n "${NEXTCLOUD_OVERWRITEPROTOCOL+x}" ]; then + echo "setting overwriteprotocol…" + run_as "php /var/www/html/occ config:system:set overwriteprotocol --value=$NEXTCLOUD_OVERWRITEPROTOCOL" + fi + if [ -n "${NEXTCLOUD_OVERWRITEWEBROOT+x}" ]; then + echo "setting overwritewebroot…" + run_as "php /var/www/html/occ config:system:set overwritewebroot --value=$NEXTCLOUD_OVERWRITEWEBROOT" + fi + fi exec "$@" diff --git a/14.0/fpm/entrypoint.sh b/14.0/fpm/entrypoint.sh index 07644c04..db164624 100755 --- a/14.0/fpm/entrypoint.sh +++ b/14.0/fpm/entrypoint.sh @@ -127,6 +127,20 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi fi + + if [ -n "${NEXTCLOUD_OVERWRITEHOST+x}" ]; then + echo "setting overwritehost…" + run_as "php /var/www/html/occ config:system:set overwritehost --value=$NEXTCLOUD_OVERWRITEHOST" + fi + if [ -n "${NEXTCLOUD_OVERWRITEPROTOCOL+x}" ]; then + echo "setting overwriteprotocol…" + run_as "php /var/www/html/occ config:system:set overwriteprotocol --value=$NEXTCLOUD_OVERWRITEPROTOCOL" + fi + if [ -n "${NEXTCLOUD_OVERWRITEWEBROOT+x}" ]; then + echo "setting overwritewebroot…" + run_as "php /var/www/html/occ config:system:set overwritewebroot --value=$NEXTCLOUD_OVERWRITEWEBROOT" + fi + fi exec "$@" diff --git a/15.0/apache/Dockerfile b/15.0/apache/Dockerfile index 454842aa..b1035da5 100644 --- a/15.0/apache/Dockerfile +++ b/15.0/apache/Dockerfile @@ -109,7 +109,11 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip +<<<<<<< HEAD:15.0/apache/Dockerfile ENV NEXTCLOUD_VERSION 15.0.0 +======= +ENV NEXTCLOUD_VERSION 12.0.13 +>>>>>>> Add two parameters when Nextcloud is behind a proxy:12.0/apache/Dockerfile RUN set -ex; \ fetchDeps=" \ diff --git a/15.0/apache/entrypoint.sh b/15.0/apache/entrypoint.sh index 07644c04..db164624 100755 --- a/15.0/apache/entrypoint.sh +++ b/15.0/apache/entrypoint.sh @@ -127,6 +127,20 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi fi + + if [ -n "${NEXTCLOUD_OVERWRITEHOST+x}" ]; then + echo "setting overwritehost…" + run_as "php /var/www/html/occ config:system:set overwritehost --value=$NEXTCLOUD_OVERWRITEHOST" + fi + if [ -n "${NEXTCLOUD_OVERWRITEPROTOCOL+x}" ]; then + echo "setting overwriteprotocol…" + run_as "php /var/www/html/occ config:system:set overwriteprotocol --value=$NEXTCLOUD_OVERWRITEPROTOCOL" + fi + if [ -n "${NEXTCLOUD_OVERWRITEWEBROOT+x}" ]; then + echo "setting overwritewebroot…" + run_as "php /var/www/html/occ config:system:set overwritewebroot --value=$NEXTCLOUD_OVERWRITEWEBROOT" + fi + fi exec "$@" diff --git a/15.0/fpm-alpine/Dockerfile b/15.0/fpm-alpine/Dockerfile index d6ac2a2e..3fbdc0b6 100644 --- a/15.0/fpm-alpine/Dockerfile +++ b/15.0/fpm-alpine/Dockerfile @@ -90,7 +90,11 @@ RUN { \ VOLUME /var/www/html +<<<<<<< HEAD:15.0/fpm-alpine/Dockerfile ENV NEXTCLOUD_VERSION 15.0.0 +======= +ENV NEXTCLOUD_VERSION 12.0.13 +>>>>>>> Add two parameters when Nextcloud is behind a proxy:12.0/fpm-alpine/Dockerfile RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ diff --git a/15.0/fpm-alpine/entrypoint.sh b/15.0/fpm-alpine/entrypoint.sh index 07644c04..db164624 100755 --- a/15.0/fpm-alpine/entrypoint.sh +++ b/15.0/fpm-alpine/entrypoint.sh @@ -127,6 +127,20 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi fi + + if [ -n "${NEXTCLOUD_OVERWRITEHOST+x}" ]; then + echo "setting overwritehost…" + run_as "php /var/www/html/occ config:system:set overwritehost --value=$NEXTCLOUD_OVERWRITEHOST" + fi + if [ -n "${NEXTCLOUD_OVERWRITEPROTOCOL+x}" ]; then + echo "setting overwriteprotocol…" + run_as "php /var/www/html/occ config:system:set overwriteprotocol --value=$NEXTCLOUD_OVERWRITEPROTOCOL" + fi + if [ -n "${NEXTCLOUD_OVERWRITEWEBROOT+x}" ]; then + echo "setting overwritewebroot…" + run_as "php /var/www/html/occ config:system:set overwritewebroot --value=$NEXTCLOUD_OVERWRITEWEBROOT" + fi + fi exec "$@" diff --git a/15.0/fpm/Dockerfile b/15.0/fpm/Dockerfile index 8cc1df2a..9b0b935d 100644 --- a/15.0/fpm/Dockerfile +++ b/15.0/fpm/Dockerfile @@ -101,7 +101,11 @@ RUN { \ VOLUME /var/www/html +<<<<<<< HEAD:15.0/fpm/Dockerfile ENV NEXTCLOUD_VERSION 15.0.0 +======= +ENV NEXTCLOUD_VERSION 12.0.13 +>>>>>>> Add two parameters when Nextcloud is behind a proxy:12.0/fpm/Dockerfile RUN set -ex; \ fetchDeps=" \ diff --git a/15.0/fpm/entrypoint.sh b/15.0/fpm/entrypoint.sh index 07644c04..db164624 100755 --- a/15.0/fpm/entrypoint.sh +++ b/15.0/fpm/entrypoint.sh @@ -127,6 +127,20 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi fi + + if [ -n "${NEXTCLOUD_OVERWRITEHOST+x}" ]; then + echo "setting overwritehost…" + run_as "php /var/www/html/occ config:system:set overwritehost --value=$NEXTCLOUD_OVERWRITEHOST" + fi + if [ -n "${NEXTCLOUD_OVERWRITEPROTOCOL+x}" ]; then + echo "setting overwriteprotocol…" + run_as "php /var/www/html/occ config:system:set overwriteprotocol --value=$NEXTCLOUD_OVERWRITEPROTOCOL" + fi + if [ -n "${NEXTCLOUD_OVERWRITEWEBROOT+x}" ]; then + echo "setting overwritewebroot…" + run_as "php /var/www/html/occ config:system:set overwritewebroot --value=$NEXTCLOUD_OVERWRITEWEBROOT" + fi + fi exec "$@" diff --git a/README.md b/README.md index 0d712c01..66a3555d 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,13 @@ The install and update script is only triggered when a default command is used ( - `NEXTCLOUD_UPDATE` (default: _0_) +If Nextcloud fails to automatically detect the hostname, protocol or webroot you can use the overwrite parameters inside the config/config.php. +- `NEXTCLOUD_OVERWRITEHOST` The overwritehost parameter is used to set the hostname of the proxy. You can also specify a port. +- `NEXTCLOUD_OVERWRITEPROTOCOL` The overwriteprotocol parameter is used to set the protocol of the proxy. You can choose between the two options http and https. +- `NEXTCLOUD_OVERWRITEWEBROOT` The overwritewebroot parameter is used to set the absolute web path of the proxy to the Nextcloud folder. + +These parameters are available in v14.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. diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 07644c04..db164624 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -127,6 +127,20 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP fi fi + + if [ -n "${NEXTCLOUD_OVERWRITEHOST+x}" ]; then + echo "setting overwritehost…" + run_as "php /var/www/html/occ config:system:set overwritehost --value=$NEXTCLOUD_OVERWRITEHOST" + fi + if [ -n "${NEXTCLOUD_OVERWRITEPROTOCOL+x}" ]; then + echo "setting overwriteprotocol…" + run_as "php /var/www/html/occ config:system:set overwriteprotocol --value=$NEXTCLOUD_OVERWRITEPROTOCOL" + fi + if [ -n "${NEXTCLOUD_OVERWRITEWEBROOT+x}" ]; then + echo "setting overwritewebroot…" + run_as "php /var/www/html/occ config:system:set overwritewebroot --value=$NEXTCLOUD_OVERWRITEWEBROOT" + fi + fi exec "$@"