Skip to content

Commit

Permalink
Add support for config auth method
Browse files Browse the repository at this point in the history
Fixes #8

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Dec 14, 2015
1 parent 7d56664 commit b0a8bc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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
8 changes: 7 additions & 1 deletion config.inc.php
Expand Up @@ -10,7 +10,6 @@
/* First server */
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
if (isset($_ENV['PMA_HOST'])) {
$cfg['Servers'][$i]['host'] = $_ENV['PMA_HOST'];
} else {
Expand All @@ -19,6 +18,13 @@
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;
Expand Down

1 comment on commit b0a8bc0

@soullivaneuh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👍

Please sign in to comment.