diff --git a/README.md b/README.md index 6a6924b..55353ec 100644 --- a/README.md +++ b/README.md @@ -50,3 +50,4 @@ docker-compose up -d * ``PMA_ARBITRARY`` - when set to 1 connection to the arbitrary server will be allowed * ``PMA_HOST`` - define address/host name of the MySQL server * ``PMA_PORT`` - define port of the MySQL server +* ``PMA_USER`` and ``PMA_PASSWORD`` - define username to use for config authentication method diff --git a/config.inc.php b/config.inc.php index a855f67..e5bcc40 100644 --- a/config.inc.php +++ b/config.inc.php @@ -10,7 +10,6 @@ if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') { /* First server */ $i = 0; $i++; -$cfg['Servers'][$i]['auth_type'] = 'cookie'; if (isset($_ENV['PMA_HOST'])) { $cfg['Servers'][$i]['host'] = $_ENV['PMA_HOST']; } else { @@ -19,6 +18,13 @@ if (isset($_ENV['PMA_HOST'])) { if (isset($_ENV['PMA_PORT'])) { $cfg['Servers'][$i]['port'] = $_ENV['PMA_PORT']; } +if (isset($_ENV['PMA_USER']) && isset($_ENV['PMA_PASSWORD']) { + $cfg['Servers'][$i]['auth_type'] = 'config'; + $cfg['Servers'][$i]['user'] = $_ENV['PMA_USER']; + $cfg['Servers'][$i]['password'] = $_ENV['PMA_PASSWORD']; +} else { + $cfg['Servers'][$i]['auth_type'] = 'cookie'; +} $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = true;