-
Notifications
You must be signed in to change notification settings - Fork 48
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
[Feature Request] MongoDB --auth #12
Comments
@jorlugaqui Hey Jorge, thank you for your feature request! Can you please help me understand how you’re injecting the MongoDB authentication credentials into your testing environment? Are you reading the values from environment variables and use them to connect to MongoDB? Or do you have hard-coded values in a configuration file in your app? |
Hi @marcuspoehls. I'm not sure if by Local environment I'm reading the values from environment variables and I use them to connect to the MongoDB server:
With values being injected via docker-compose like:
GitHub actions' environment For now, I'm using hardcoded values, but when the moment comes, I'll switch to secrets.
How I'm imagining the feature It will be our responsibility as developers to handle how the values will get into the workflow file. For instance, I could have a step defined like:
One value hardcoded, one value coming from the secrets. The important thing will be that if these two variables are present, we could start the container with the
And therefore, achieve the "out of the box" authentication mechanism, which should be sufficient for a CI environment. Let me know your thoughts. |
@marcuspoehls Are there still plans to implement this? I'm trying to setup Mongo in GA with auth, and there doesn't seem to be an easy way to do so currently :) |
@kibertoad Hey Igor, thank you for your patience. I’m in for this feature. Do you want to PR it? |
@jorlugaqui @kibertoad @biodrone I’ve tagged a new release version |
Just used it in my project, working like a dream :) |
Awesome! |
Hello,
Firstly, thank you very much for this implementation, I have been using it for learning Github actions on an aside project (https://github.com/jorlugaqui/ahm) and it helped me by a lot.
This request is for you to consider (if it makes sense) to have a variation for which the container will start with --auth enabled, probably achievable by sending the env variables
MONGO_INITDB_ROOT_USERNAME
andMONGO_INITDB_ROOT_PASSWORD
.Some applications may be using this mechanism as a default for connecting to a mongo server. By supporting the --auth, applications won't need to adjust their code, but rather will only need to take care of sending the right values in the env variables. I could try posting a PR if you think it is worth it.
The text was updated successfully, but these errors were encountered: