mirror of
https://github.com/phpmyadmin/docker.git
synced 2026-08-28 18:24:11 -05:00
Add support for config auth method
Fixes #8 Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
@@ -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
|
||||
|
||||
+7
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user