From 34a0bfd939fe9bb1ed64506d58b6f07d0c5c878c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frantis=CC=8Cek=20Ha=CC=81na?= Date: Thu, 15 Aug 2019 14:54:47 +0200 Subject: [PATCH] setup Mongo authSource by ENV --- adminer/drivers/mongo.inc.php | 3 +++ changes.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/adminer/drivers/mongo.inc.php b/adminer/drivers/mongo.inc.php index 7b83a285..88c8e0db 100644 --- a/adminer/drivers/mongo.inc.php +++ b/adminer/drivers/mongo.inc.php @@ -618,6 +618,9 @@ if (isset($_GET["mongo"])) { if ($db != "") { $options["db"] = $db; } + if (($auth_source = getenv("MONGO_AUTH_SOURCE"))) { + $options["authSource"] = $auth_source; + } try { $connection->_link = $connection->connect("mongodb://$server", $options); if ($password != "") { diff --git a/changes.txt b/changes.txt index 08f369b1..15d4fa42 100644 --- a/changes.txt +++ b/changes.txt @@ -8,6 +8,7 @@ SQLite: Handle error in altering table (bug #697) SQLite: Allow setting auto increment for empty tables SQLite: Preserve auto increment when recreating table MS SQL: Support foreign keys to other DB +MongoDB: Allow setting authSource from environment variable Adminer 4.7.2 (released 2019-07-18): Do not attempt logging in without password (bug #676)