Skip to content

Commit

Permalink
enable server specific ssl
Browse files Browse the repository at this point in the history
Signed-off-by: TasdidurRahman <[email protected]>
  • Loading branch information
TasdidurRahman committed Aug 1, 2024
1 parent e3f29d8 commit 2d6be82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apache/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
'MEMORY_LIMIT',
'PMA_UPLOADDIR',
'PMA_SAVEDIR',
'PMA_SSL',
'PMA_SSLS',
];

foreach ($vars as $var) {
Expand Down Expand Up @@ -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'])) {
Expand All @@ -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];
Expand Down
2 changes: 2 additions & 0 deletions apache/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d6be82

Please sign in to comment.