From a4d29335478c4d3a4564762e7e8bdc58c91bd137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Mar=C3=B3y?= Date: Sun, 12 Apr 2020 09:04:43 +0200 Subject: [PATCH] Remove default null from reverse proxy config to avoid breaking existing deployments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: András Maróy --- .config/reverse-proxy.config.php | 10 ---------- 16.0/apache/config/reverse-proxy.config.php | 10 ---------- 16.0/fpm-alpine/config/reverse-proxy.config.php | 10 ---------- 16.0/fpm/config/reverse-proxy.config.php | 10 ---------- 17.0/apache/config/reverse-proxy.config.php | 10 ---------- 17.0/fpm-alpine/config/reverse-proxy.config.php | 10 ---------- 17.0/fpm/config/reverse-proxy.config.php | 10 ---------- 18.0/apache/config/reverse-proxy.config.php | 10 ---------- 18.0/fpm-alpine/config/reverse-proxy.config.php | 10 ---------- 18.0/fpm/config/reverse-proxy.config.php | 10 ---------- 19.0-beta/apache/config/reverse-proxy.config.php | 10 ---------- 19.0-beta/fpm-alpine/config/reverse-proxy.config.php | 10 ---------- 19.0-beta/fpm/config/reverse-proxy.config.php | 10 ---------- README.md | 2 ++ 14 files changed, 2 insertions(+), 130 deletions(-) diff --git a/.config/reverse-proxy.config.php b/.config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/.config/reverse-proxy.config.php +++ b/.config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/16.0/apache/config/reverse-proxy.config.php b/16.0/apache/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/16.0/apache/config/reverse-proxy.config.php +++ b/16.0/apache/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/16.0/fpm-alpine/config/reverse-proxy.config.php b/16.0/fpm-alpine/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/16.0/fpm-alpine/config/reverse-proxy.config.php +++ b/16.0/fpm-alpine/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/16.0/fpm/config/reverse-proxy.config.php b/16.0/fpm/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/16.0/fpm/config/reverse-proxy.config.php +++ b/16.0/fpm/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/17.0/apache/config/reverse-proxy.config.php b/17.0/apache/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/17.0/apache/config/reverse-proxy.config.php +++ b/17.0/apache/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/17.0/fpm-alpine/config/reverse-proxy.config.php b/17.0/fpm-alpine/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/17.0/fpm-alpine/config/reverse-proxy.config.php +++ b/17.0/fpm-alpine/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/17.0/fpm/config/reverse-proxy.config.php b/17.0/fpm/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/17.0/fpm/config/reverse-proxy.config.php +++ b/17.0/fpm/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/18.0/apache/config/reverse-proxy.config.php b/18.0/apache/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/18.0/apache/config/reverse-proxy.config.php +++ b/18.0/apache/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/18.0/fpm-alpine/config/reverse-proxy.config.php b/18.0/fpm-alpine/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/18.0/fpm-alpine/config/reverse-proxy.config.php +++ b/18.0/fpm-alpine/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/18.0/fpm/config/reverse-proxy.config.php b/18.0/fpm/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/18.0/fpm/config/reverse-proxy.config.php +++ b/18.0/fpm/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/19.0-beta/apache/config/reverse-proxy.config.php b/19.0-beta/apache/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/19.0-beta/apache/config/reverse-proxy.config.php +++ b/19.0-beta/apache/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/19.0-beta/fpm-alpine/config/reverse-proxy.config.php b/19.0-beta/fpm-alpine/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/19.0-beta/fpm-alpine/config/reverse-proxy.config.php +++ b/19.0-beta/fpm-alpine/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/19.0-beta/fpm/config/reverse-proxy.config.php b/19.0-beta/fpm/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/19.0-beta/fpm/config/reverse-proxy.config.php +++ b/19.0-beta/fpm/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/README.md b/README.md index 2b456187..431072aa 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,8 @@ If the `TRUSTED_PROXIES` approach does not work for you, try using fixed values Check the [Nexcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/reverse_proxy_configuration.html) for more details. +Keep in mind that once set, removing these environment variables won't remove these values from the configuration file, due to how Nextcloud merges configuration files together. + # 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 of what you have to look for.