From 3171d7af1fd0646a75479bcd737f35b791a39f47 Mon Sep 17 00:00:00 2001 From: Douglas Thomson Date: Wed, 17 May 2023 17:30:04 +0100 Subject: [PATCH] Enabling the configuration of the hostname during initialization. Done via the environment variable MONGODB_LOCALHOST_NAME Signed-off-by: Douglas Thomson --- .../debian-11/rootfs/opt/bitnami/scripts/libmongodb.sh | 8 ++++---- .../debian-11/rootfs/opt/bitnami/scripts/mongodb-env.sh | 2 ++ .../debian-11/rootfs/opt/bitnami/scripts/libmongodb.sh | 8 ++++---- .../debian-11/rootfs/opt/bitnami/scripts/mongodb-env.sh | 2 ++ bitnami/mongodb/README.md | 2 ++ 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/libmongodb.sh b/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/libmongodb.sh index 81a1893a3aaa2..b5b16f0c83218 100644 --- a/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/libmongodb.sh +++ b/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/libmongodb.sh @@ -667,7 +667,7 @@ mongodb_create_user() { [[ -z "$database" ]] && query="db.getSiblingDB(db.stats().db).createUser({ user: '$user', pwd: '$password', roles: [{role: 'readWrite', db: db.getSiblingDB(db.stats().db).stats().db }] })" # Create user, discarding mongo CLI output for clean logs info "Creating user '$user'..." - mongodb_execute "$MONGODB_ROOT_USER" "$MONGODB_ROOT_PASSWORD" "" "127.0.0.1" <<<"$query" + mongodb_execute "$MONGODB_ROOT_USER" "$MONGODB_ROOT_PASSWORD" "" "$MONGODB_LOCALHOST_NAME" <<<"$query" } ######################## @@ -684,7 +684,7 @@ mongodb_create_users() { if [[ -n "$MONGODB_ROOT_PASSWORD" ]] && ! [[ "$MONGODB_REPLICA_SET_MODE" =~ ^(secondary|arbiter|hidden) ]]; then info "Creating $MONGODB_ROOT_USER user..." - mongodb_execute "" "" "" "127.0.0.1" <