Skip to content
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

nixos/mongodb: fix running initialScript without a set root password #99037

Merged
merged 1 commit into from Dec 21, 2020

Conversation

mohe2015
Copy link
Contributor

@mohe2015 mohe2015 commented Sep 28, 2020

Motivation for this change

Running an initialScript without having set an initialRootPassword failed because mogo tried to login to the server with a nonexistent username (root).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@mohe2015
Copy link
Contributor Author

mohe2015 commented Oct 2, 2020

@bluescreen303 @offlinehacker @cstrahan Could you review this PR please?

@mohe2015
Copy link
Contributor Author

I think this is an obvious one which can't break anything so I would love it if somebody could look over it. https://docs.mongodb.com/manual/reference/program/mongo/#bin.mongo shows that --password <password>, -p <password> only makes sense noninteractively with an argument and "Specifies a username with which to authenticate to a MongoDB database that uses authentication." specifies that the user argument only makes sense if authentication is used. https://github.com/NixOS/nixpkgs/blob/5161708ff571c3ec097b3c5b753f0c5c9eb1a8d0/nixos/modules/services/databases/mongodb.nix#L112 specifies that a password is required if authentication is enabled.

@mohe2015
Copy link
Contributor Author

Could somebody please just check the diff as this removes inserting a null value which should not make things worse. I would really like to get this merged.

Co-authored-by: Timo Kaufmann <timokau@zoho.com>
@mohe2015
Copy link
Contributor Author

mohe2015 commented Dec 19, 2020

@timokau Thanks for that fix! I kept your co-authorship btw.

Copy link
Member

@timokau timokau left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks! OfBorg (our CI) is currently down, I will merge this once its back up and the checks are green. Please remind me if I forget.

I am sorry that this sat around unnoticed for so long. We have a bit of a problem with our PR backlog. Things get missed sometimes. You could give marvin (experimental) a try in your future PRs. You could even try it here, it will automatically remind me about this PR in three days if you post a message containing

/marvin opt-in
/status awaiting_reviewer

@mohe2015
Copy link
Contributor Author

/marvin opt-in
/status awaiting_reviewer

@marvin-mk2 marvin-mk2 bot added the marvin label Dec 19, 2020
@marvin-mk2
Copy link

marvin-mk2 bot commented Dec 19, 2020

Hi! I'm an experimental bot. My goal is to guide this PR through its stages, hopefully ending with a merge. You can read up on the usage here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants