From 2d6be82ec666064b165414a565bcffc19178c829 Mon Sep 17 00:00:00 2001 From: TasdidurRahman Date: Thu, 1 Aug 2024 18:34:36 +0600 Subject: [PATCH] enable server specific ssl Signed-off-by: TasdidurRahman --- apache/config.inc.php | 8 +++++++- apache/docker-entrypoint.sh | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apache/config.inc.php b/apache/config.inc.php index 5c59d611..9f5d2ac7 100644 --- a/apache/config.inc.php +++ b/apache/config.inc.php @@ -27,6 +27,8 @@ 'MEMORY_LIMIT', 'PMA_UPLOADDIR', 'PMA_SAVEDIR', + 'PMA_SSL', + 'PMA_SSLS', ]; foreach ($vars as $var) { @@ -63,10 +65,12 @@ $hosts = [$_ENV['PMA_HOST']]; $verbose = [$_ENV['PMA_VERBOSE']]; $ports = [$_ENV['PMA_PORT']]; + $ssls = [$_ENV['PMA_SSL']]; } elseif (! empty($_ENV['PMA_HOSTS'])) { $hosts = array_map('trim', explode(',', $_ENV['PMA_HOSTS'])); $verbose = array_map('trim', explode(',', $_ENV['PMA_VERBOSES'])); $ports = array_map('trim', explode(',', $_ENV['PMA_PORTS'])); + $ssls = array_map('trim', explode(',', $_ENV['PMA_SSLS'])); } if (! empty($_ENV['PMA_SOCKET'])) { @@ -77,7 +81,9 @@ /* Server settings */ for ($i = 1; isset($hosts[$i - 1]); $i++) { - $cfg['Servers'][$i]['ssl'] = true; + if (isset($ssls[$i - 1]) && $ssls[$i - 1] === '1') { + $cfg['Servers'][$i]['ssl'] = $ssls[$i - 1]; + } $cfg['Servers'][$i]['host'] = $hosts[$i - 1]; if (isset($verbose[$i - 1])) { $cfg['Servers'][$i]['verbose'] = $verbose[$i - 1]; diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh index 5d748548..ff9e486b 100755 --- a/apache/docker-entrypoint.sh +++ b/apache/docker-entrypoint.sh @@ -55,6 +55,8 @@ get_docker_secret MYSQL_ROOT_PASSWORD get_docker_secret MYSQL_PASSWORD get_docker_secret PMA_HOSTS get_docker_secret PMA_HOST +get_docker_secret PMA_SSL +get_docker_secret PMA_SSLS get_docker_secret PMA_CONTROLHOST get_docker_secret PMA_CONTROLUSER get_docker_secret PMA_CONTROLPASS