Require username and password for mongodb by rmunn · Pull Request #1813 · sillsdev/web-languageforge

@rmunn added the engineering

Tasks which do not directly relate to a user-facing feature or fix

label

May 20, 2024

@rmunn rmunn marked this pull request as ready for review

May 20, 2024 09:34
If MONGODB_USER and MONGODB_PASS are set, they will be used to
authenticate to the MongoDB server. If they are not set, then a
connection request with no authentication will be sent (as per the
existing behavior). This allows us to deploy this change, then set
MONGODB_USER and MONGODB_PASS later and have those changes picked up
without a redeployment.

Note that a corresponding change to LfMerge will also be needed.
LfMerge env vars won't be used until we deploy a new build of LfMerge
that looks for them, which will be in a PR on the LfMerge repo.
LfMerge now has an alpha build that handles auth. Once we've proved that
it works, we'll release a full build of LfMerge and bump this version
number again.
Now the check for the `MONGODB_USER` and `MONGODB_PASS` env vars works
correctly because it has the right syntax.
Uncommenting these two lines will enable MongoDB auth on local dev. Do
not do so until you have created the `admin` user or you may end up
locked out of your local MongoDB.
This will allow us to change the name of the Mongo database we store our
auth in, if in the future we decide not to go with the default name.
This does not create the actual secrets, which will need to be done at
the Rancher admin UI. This commit simply adds the Kubernetes config to
reference the secrets.

@rmunn rmunn changed the title Chore/require password for mongodb Require username and password for mongodb

May 21, 2024

megahirt

@megahirt

hahn-kev

@rmunn rmunn deleted the chore/require-password-for-mongodb branch

May 23, 2024 09:06

@rmunn rmunn mentioned this pull request

Jun 27, 2024