0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-03-15 19:05:09 +01:00

Store environment variables in vars in reverse-proxy config

Signed-off-by: András Maróy <andras@maroy.hu>
This commit is contained in:
András Maróy 2020-04-08 20:13:27 +02:00
parent 83255f2385
commit e16056c2e6
10 changed files with 150 additions and 100 deletions

View file

@ -1,30 +1,35 @@
<?php <?php
if (getenv('OVERWRITEHOST')) { $overwritehost = getenv('OVERWRITEHOST');
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST'); if ($overwritehost) {
$CONFIG['overwritehost'] = $overwritehost;
} else { } else {
$CONFIG['overwritehost'] = null; $CONFIG['overwritehost'] = null;
} }
if (getenv('OVERWRITEPROTOCOL')) { $overwriteprotocol = getenv('OVERWRITEPROTOCOL');
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL'); if ($overwriteprotocol) {
$CONFIG['overwriteprotocol'] = $overwriteprotocol;
} else { } else {
$CONFIG['overwriteprotocol'] = null; $CONFIG['overwriteprotocol'] = null;
} }
if (getenv('OVERWRITEWEBROOT')) { $overwritewebroot = getenv('OVERWRITEWEBROOT');
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT'); if ($overwritewebroot) {
$CONFIG['overwritewebroot'] = $overwritewebroot;
} else { } else {
$CONFIG['overwritewebroot'] = null; $CONFIG['overwritewebroot'] = null;
} }
if (getenv('OVERWRITECONDADDR')) { $overwritecondaddr = getenv('OVERWRITECONDADDR');
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR'); if ($overwritecondaddr) {
$CONFIG['overwritecondaddr'] = $overwritecondaddr;
} else { } else {
$CONFIG['overwritecondaddr'] = null; $CONFIG['overwritecondaddr'] = null;
} }
if (getenv('TRUSTED_PROXIES')) { $trusted_proxies = getenv('TRUSTED_PROXIES');
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES')); if ($trusted_proxies) {
$CONFIG['trusted_proxies'] = explode(',', $trusted_proxies);
} else { } else {
$CONFIG['trusted_proxies'] = null; $CONFIG['trusted_proxies'] = null;
} }

View file

@ -1,30 +1,35 @@
<?php <?php
if (getenv('OVERWRITEHOST')) { $overwritehost = getenv('OVERWRITEHOST');
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST'); if ($overwritehost) {
$CONFIG['overwritehost'] = $overwritehost;
} else { } else {
$CONFIG['overwritehost'] = null; $CONFIG['overwritehost'] = null;
} }
if (getenv('OVERWRITEPROTOCOL')) { $overwriteprotocol = getenv('OVERWRITEPROTOCOL');
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL'); if ($overwriteprotocol) {
$CONFIG['overwriteprotocol'] = $overwriteprotocol;
} else { } else {
$CONFIG['overwriteprotocol'] = null; $CONFIG['overwriteprotocol'] = null;
} }
if (getenv('OVERWRITEWEBROOT')) { $overwritewebroot = getenv('OVERWRITEWEBROOT');
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT'); if ($overwritewebroot) {
$CONFIG['overwritewebroot'] = $overwritewebroot;
} else { } else {
$CONFIG['overwritewebroot'] = null; $CONFIG['overwritewebroot'] = null;
} }
if (getenv('OVERWRITECONDADDR')) { $overwritecondaddr = getenv('OVERWRITECONDADDR');
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR'); if ($overwritecondaddr) {
$CONFIG['overwritecondaddr'] = $overwritecondaddr;
} else { } else {
$CONFIG['overwritecondaddr'] = null; $CONFIG['overwritecondaddr'] = null;
} }
if (getenv('TRUSTED_PROXIES')) { $trusted_proxies = getenv('TRUSTED_PROXIES');
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES')); if ($trusted_proxies) {
$CONFIG['trusted_proxies'] = explode(',', $trusted_proxies);
} else { } else {
$CONFIG['trusted_proxies'] = null; $CONFIG['trusted_proxies'] = null;
} }

View file

@ -1,30 +1,35 @@
<?php <?php
if (getenv('OVERWRITEHOST')) { $overwritehost = getenv('OVERWRITEHOST');
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST'); if ($overwritehost) {
$CONFIG['overwritehost'] = $overwritehost;
} else { } else {
$CONFIG['overwritehost'] = null; $CONFIG['overwritehost'] = null;
} }
if (getenv('OVERWRITEPROTOCOL')) { $overwriteprotocol = getenv('OVERWRITEPROTOCOL');
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL'); if ($overwriteprotocol) {
$CONFIG['overwriteprotocol'] = $overwriteprotocol;
} else { } else {
$CONFIG['overwriteprotocol'] = null; $CONFIG['overwriteprotocol'] = null;
} }
if (getenv('OVERWRITEWEBROOT')) { $overwritewebroot = getenv('OVERWRITEWEBROOT');
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT'); if ($overwritewebroot) {
$CONFIG['overwritewebroot'] = $overwritewebroot;
} else { } else {
$CONFIG['overwritewebroot'] = null; $CONFIG['overwritewebroot'] = null;
} }
if (getenv('OVERWRITECONDADDR')) { $overwritecondaddr = getenv('OVERWRITECONDADDR');
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR'); if ($overwritecondaddr) {
$CONFIG['overwritecondaddr'] = $overwritecondaddr;
} else { } else {
$CONFIG['overwritecondaddr'] = null; $CONFIG['overwritecondaddr'] = null;
} }
if (getenv('TRUSTED_PROXIES')) { $trusted_proxies = getenv('TRUSTED_PROXIES');
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES')); if ($trusted_proxies) {
$CONFIG['trusted_proxies'] = explode(',', $trusted_proxies);
} else { } else {
$CONFIG['trusted_proxies'] = null; $CONFIG['trusted_proxies'] = null;
} }

View file

@ -1,30 +1,35 @@
<?php <?php
if (getenv('OVERWRITEHOST')) { $overwritehost = getenv('OVERWRITEHOST');
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST'); if ($overwritehost) {
$CONFIG['overwritehost'] = $overwritehost;
} else { } else {
$CONFIG['overwritehost'] = null; $CONFIG['overwritehost'] = null;
} }
if (getenv('OVERWRITEPROTOCOL')) { $overwriteprotocol = getenv('OVERWRITEPROTOCOL');
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL'); if ($overwriteprotocol) {
$CONFIG['overwriteprotocol'] = $overwriteprotocol;
} else { } else {
$CONFIG['overwriteprotocol'] = null; $CONFIG['overwriteprotocol'] = null;
} }
if (getenv('OVERWRITEWEBROOT')) { $overwritewebroot = getenv('OVERWRITEWEBROOT');
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT'); if ($overwritewebroot) {
$CONFIG['overwritewebroot'] = $overwritewebroot;
} else { } else {
$CONFIG['overwritewebroot'] = null; $CONFIG['overwritewebroot'] = null;
} }
if (getenv('OVERWRITECONDADDR')) { $overwritecondaddr = getenv('OVERWRITECONDADDR');
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR'); if ($overwritecondaddr) {
$CONFIG['overwritecondaddr'] = $overwritecondaddr;
} else { } else {
$CONFIG['overwritecondaddr'] = null; $CONFIG['overwritecondaddr'] = null;
} }
if (getenv('TRUSTED_PROXIES')) { $trusted_proxies = getenv('TRUSTED_PROXIES');
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES')); if ($trusted_proxies) {
$CONFIG['trusted_proxies'] = explode(',', $trusted_proxies);
} else { } else {
$CONFIG['trusted_proxies'] = null; $CONFIG['trusted_proxies'] = null;
} }

View file

@ -1,30 +1,35 @@
<?php <?php
if (getenv('OVERWRITEHOST')) { $overwritehost = getenv('OVERWRITEHOST');
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST'); if ($overwritehost) {
$CONFIG['overwritehost'] = $overwritehost;
} else { } else {
$CONFIG['overwritehost'] = null; $CONFIG['overwritehost'] = null;
} }
if (getenv('OVERWRITEPROTOCOL')) { $overwriteprotocol = getenv('OVERWRITEPROTOCOL');
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL'); if ($overwriteprotocol) {
$CONFIG['overwriteprotocol'] = $overwriteprotocol;
} else { } else {
$CONFIG['overwriteprotocol'] = null; $CONFIG['overwriteprotocol'] = null;
} }
if (getenv('OVERWRITEWEBROOT')) { $overwritewebroot = getenv('OVERWRITEWEBROOT');
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT'); if ($overwritewebroot) {
$CONFIG['overwritewebroot'] = $overwritewebroot;
} else { } else {
$CONFIG['overwritewebroot'] = null; $CONFIG['overwritewebroot'] = null;
} }
if (getenv('OVERWRITECONDADDR')) { $overwritecondaddr = getenv('OVERWRITECONDADDR');
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR'); if ($overwritecondaddr) {
$CONFIG['overwritecondaddr'] = $overwritecondaddr;
} else { } else {
$CONFIG['overwritecondaddr'] = null; $CONFIG['overwritecondaddr'] = null;
} }
if (getenv('TRUSTED_PROXIES')) { $trusted_proxies = getenv('TRUSTED_PROXIES');
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES')); if ($trusted_proxies) {
$CONFIG['trusted_proxies'] = explode(',', $trusted_proxies);
} else { } else {
$CONFIG['trusted_proxies'] = null; $CONFIG['trusted_proxies'] = null;
} }

View file

@ -1,30 +1,35 @@
<?php <?php
if (getenv('OVERWRITEHOST')) { $overwritehost = getenv('OVERWRITEHOST');
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST'); if ($overwritehost) {
$CONFIG['overwritehost'] = $overwritehost;
} else { } else {
$CONFIG['overwritehost'] = null; $CONFIG['overwritehost'] = null;
} }
if (getenv('OVERWRITEPROTOCOL')) { $overwriteprotocol = getenv('OVERWRITEPROTOCOL');
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL'); if ($overwriteprotocol) {
$CONFIG['overwriteprotocol'] = $overwriteprotocol;
} else { } else {
$CONFIG['overwriteprotocol'] = null; $CONFIG['overwriteprotocol'] = null;
} }
if (getenv('OVERWRITEWEBROOT')) { $overwritewebroot = getenv('OVERWRITEWEBROOT');
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT'); if ($overwritewebroot) {
$CONFIG['overwritewebroot'] = $overwritewebroot;
} else { } else {
$CONFIG['overwritewebroot'] = null; $CONFIG['overwritewebroot'] = null;
} }
if (getenv('OVERWRITECONDADDR')) { $overwritecondaddr = getenv('OVERWRITECONDADDR');
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR'); if ($overwritecondaddr) {
$CONFIG['overwritecondaddr'] = $overwritecondaddr;
} else { } else {
$CONFIG['overwritecondaddr'] = null; $CONFIG['overwritecondaddr'] = null;
} }
if (getenv('TRUSTED_PROXIES')) { $trusted_proxies = getenv('TRUSTED_PROXIES');
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES')); if ($trusted_proxies) {
$CONFIG['trusted_proxies'] = explode(',', $trusted_proxies);
} else { } else {
$CONFIG['trusted_proxies'] = null; $CONFIG['trusted_proxies'] = null;
} }

View file

@ -1,30 +1,35 @@
<?php <?php
if (getenv('OVERWRITEHOST')) { $overwritehost = getenv('OVERWRITEHOST');
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST'); if ($overwritehost) {
$CONFIG['overwritehost'] = $overwritehost;
} else { } else {
$CONFIG['overwritehost'] = null; $CONFIG['overwritehost'] = null;
} }
if (getenv('OVERWRITEPROTOCOL')) { $overwriteprotocol = getenv('OVERWRITEPROTOCOL');
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL'); if ($overwriteprotocol) {
$CONFIG['overwriteprotocol'] = $overwriteprotocol;
} else { } else {
$CONFIG['overwriteprotocol'] = null; $CONFIG['overwriteprotocol'] = null;
} }
if (getenv('OVERWRITEWEBROOT')) { $overwritewebroot = getenv('OVERWRITEWEBROOT');
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT'); if ($overwritewebroot) {
$CONFIG['overwritewebroot'] = $overwritewebroot;
} else { } else {
$CONFIG['overwritewebroot'] = null; $CONFIG['overwritewebroot'] = null;
} }
if (getenv('OVERWRITECONDADDR')) { $overwritecondaddr = getenv('OVERWRITECONDADDR');
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR'); if ($overwritecondaddr) {
$CONFIG['overwritecondaddr'] = $overwritecondaddr;
} else { } else {
$CONFIG['overwritecondaddr'] = null; $CONFIG['overwritecondaddr'] = null;
} }
if (getenv('TRUSTED_PROXIES')) { $trusted_proxies = getenv('TRUSTED_PROXIES');
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES')); if ($trusted_proxies) {
$CONFIG['trusted_proxies'] = explode(',', $trusted_proxies);
} else { } else {
$CONFIG['trusted_proxies'] = null; $CONFIG['trusted_proxies'] = null;
} }

View file

@ -1,30 +1,35 @@
<?php <?php
if (getenv('OVERWRITEHOST')) { $overwritehost = getenv('OVERWRITEHOST');
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST'); if ($overwritehost) {
$CONFIG['overwritehost'] = $overwritehost;
} else { } else {
$CONFIG['overwritehost'] = null; $CONFIG['overwritehost'] = null;
} }
if (getenv('OVERWRITEPROTOCOL')) { $overwriteprotocol = getenv('OVERWRITEPROTOCOL');
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL'); if ($overwriteprotocol) {
$CONFIG['overwriteprotocol'] = $overwriteprotocol;
} else { } else {
$CONFIG['overwriteprotocol'] = null; $CONFIG['overwriteprotocol'] = null;
} }
if (getenv('OVERWRITEWEBROOT')) { $overwritewebroot = getenv('OVERWRITEWEBROOT');
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT'); if ($overwritewebroot) {
$CONFIG['overwritewebroot'] = $overwritewebroot;
} else { } else {
$CONFIG['overwritewebroot'] = null; $CONFIG['overwritewebroot'] = null;
} }
if (getenv('OVERWRITECONDADDR')) { $overwritecondaddr = getenv('OVERWRITECONDADDR');
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR'); if ($overwritecondaddr) {
$CONFIG['overwritecondaddr'] = $overwritecondaddr;
} else { } else {
$CONFIG['overwritecondaddr'] = null; $CONFIG['overwritecondaddr'] = null;
} }
if (getenv('TRUSTED_PROXIES')) { $trusted_proxies = getenv('TRUSTED_PROXIES');
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES')); if ($trusted_proxies) {
$CONFIG['trusted_proxies'] = explode(',', $trusted_proxies);
} else { } else {
$CONFIG['trusted_proxies'] = null; $CONFIG['trusted_proxies'] = null;
} }

View file

@ -1,30 +1,35 @@
<?php <?php
if (getenv('OVERWRITEHOST')) { $overwritehost = getenv('OVERWRITEHOST');
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST'); if ($overwritehost) {
$CONFIG['overwritehost'] = $overwritehost;
} else { } else {
$CONFIG['overwritehost'] = null; $CONFIG['overwritehost'] = null;
} }
if (getenv('OVERWRITEPROTOCOL')) { $overwriteprotocol = getenv('OVERWRITEPROTOCOL');
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL'); if ($overwriteprotocol) {
$CONFIG['overwriteprotocol'] = $overwriteprotocol;
} else { } else {
$CONFIG['overwriteprotocol'] = null; $CONFIG['overwriteprotocol'] = null;
} }
if (getenv('OVERWRITEWEBROOT')) { $overwritewebroot = getenv('OVERWRITEWEBROOT');
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT'); if ($overwritewebroot) {
$CONFIG['overwritewebroot'] = $overwritewebroot;
} else { } else {
$CONFIG['overwritewebroot'] = null; $CONFIG['overwritewebroot'] = null;
} }
if (getenv('OVERWRITECONDADDR')) { $overwritecondaddr = getenv('OVERWRITECONDADDR');
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR'); if ($overwritecondaddr) {
$CONFIG['overwritecondaddr'] = $overwritecondaddr;
} else { } else {
$CONFIG['overwritecondaddr'] = null; $CONFIG['overwritecondaddr'] = null;
} }
if (getenv('TRUSTED_PROXIES')) { $trusted_proxies = getenv('TRUSTED_PROXIES');
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES')); if ($trusted_proxies) {
$CONFIG['trusted_proxies'] = explode(',', $trusted_proxies);
} else { } else {
$CONFIG['trusted_proxies'] = null; $CONFIG['trusted_proxies'] = null;
} }

View file

@ -1,30 +1,35 @@
<?php <?php
if (getenv('OVERWRITEHOST')) { $overwritehost = getenv('OVERWRITEHOST');
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST'); if ($overwritehost) {
$CONFIG['overwritehost'] = $overwritehost;
} else { } else {
$CONFIG['overwritehost'] = null; $CONFIG['overwritehost'] = null;
} }
if (getenv('OVERWRITEPROTOCOL')) { $overwriteprotocol = getenv('OVERWRITEPROTOCOL');
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL'); if ($overwriteprotocol) {
$CONFIG['overwriteprotocol'] = $overwriteprotocol;
} else { } else {
$CONFIG['overwriteprotocol'] = null; $CONFIG['overwriteprotocol'] = null;
} }
if (getenv('OVERWRITEWEBROOT')) { $overwritewebroot = getenv('OVERWRITEWEBROOT');
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT'); if ($overwritewebroot) {
$CONFIG['overwritewebroot'] = $overwritewebroot;
} else { } else {
$CONFIG['overwritewebroot'] = null; $CONFIG['overwritewebroot'] = null;
} }
if (getenv('OVERWRITECONDADDR')) { $overwritecondaddr = getenv('OVERWRITECONDADDR');
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR'); if ($overwritecondaddr) {
$CONFIG['overwritecondaddr'] = $overwritecondaddr;
} else { } else {
$CONFIG['overwritecondaddr'] = null; $CONFIG['overwritecondaddr'] = null;
} }
if (getenv('TRUSTED_PROXIES')) { $trusted_proxies = getenv('TRUSTED_PROXIES');
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES')); if ($trusted_proxies) {
$CONFIG['trusted_proxies'] = explode(',', $trusted_proxies);
} else { } else {
$CONFIG['trusted_proxies'] = null; $CONFIG['trusted_proxies'] = null;
} }