-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bitnami/mongodb] add allow remote connection env #73187
Conversation
@@ -25,7 +25,7 @@ net: | |||
enabled: true | |||
pathPrefix: {{MONGODB_TMP_DIR}} | |||
ipv6: {{MONGODB_DEFAULT_ENABLE_IPV6}} | |||
bindIpAll: false | |||
bindIpAll: {{ALLOW_REMOTE_CONNECTION}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a default setting, hence any env. var modifying this behaviour should be prefixed with MONGODB_DEFAULT_
.
That said, please note this won't allow you to edit the value for bindIpAll
dynamically on runtime. This template is only used when building the container image, see:
containers/bitnami/mongodb/8.0/debian-12/rootfs/opt/bitnami/scripts/mongodb/postunpack.sh
Line 25 in 4fe538c
render-template "$MONGODB_MONGOD_TEMPLATES_FILE" >"$MONGODB_CONF_FILE"
In order to customize the configuration file at runtime, we recommend you to follow the instruction below instead:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand what you mean, but in some cases, we really need a quick way to create a MongoDB instance that can be accessed remotely, even though it won't be changed during runtime. It seems that bitnami/postgres follows the same logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's a reason to configure MongoDB to bind by default all IPv4 and IPv6 addresses. I understand it's sth useful for your use case but it's not a secure setting that should be used except for certain development purposes.
That's why, I see to options:
- Adapt this PR so this setting is adapted during the container initialization (instead of doing so at build time).
- Use a custom configuration following the instructions I shared before.
added a environment variable to allow remote connections