sillsdev / web-languageforge

Language Forge: Online Collaborative Dictionary Building on the Web and Phone.
https://languageforge.org
MIT License
44 stars 29 forks source link

Require username and password for mongodb #1813

Closed rmunn closed 1 month ago

rmunn commented 1 month ago

Fixes #1787

Description

Add env vars MONGODB_USER and MONGODB_PASS to optionally specify authentication when connecting to MongoDB. Some manual setup on the MongoDB server(s) should be done before this is deployed; see https://github.com/sillsdev/web-languageforge/issues/1787#issuecomment-2119674540 for details. Once the appropriate admin user has been created and Kubernetes secrets set, this PR can then be deployed to staging and production.

Note that https://github.com/sillsdev/LfMerge/pull/336 will need to be merged first, and a new LfMerge version built. The version number in lfmerge/Dockerfile can then be bumped as part of this PR.

Screenshots

None

Checklist

Testing

Testers, use the following instructions against our staging environment. Post your findings as a comment and include any meaningful screenshots, etc.

If those all continue to pass, then the necessary setup steps (creating an admin user and giving it a password, and creating Kubernetes secrets for that username and password) were correctly completed.

github-actions[bot] commented 1 month ago

Unit Test Results

362 tests   362 :white_check_mark:  12s :stopwatch:  37 suites    0 :zzz:   1 files      0 :x:

Results for commit 15e532f5.

:recycle: This comment has been updated with latest results.

rmunn commented 1 month ago

Once https://github.com/sillsdev/LfMerge/pull/336 is merged, I'll update this PR with the new version of the LfMerge docker image and then mark it ready for review. I don't expect many changes between now and then, so if you want to give this an early review, @megahirt, go ahead.

rmunn commented 1 month ago

LfMerge has now completed a build with auth built in, so I've pushed a commit bumping the LfMerge version. It's currently just an alpha build of LfMerge so we'll need another version bump later on once LfMerge releases a non-alpha build, but this is enough ot test the PR with. So it's ready for review now.

rmunn commented 1 month ago

Rebased on top of develop to pull in the base-php changes from #1812.

megahirt commented 1 month ago

running the provided script worked for setup. Maybe we should put that script in the dev docs for future reference?

Great! I am hoping that new devs won't need it. It's only required if you have an existing mongo database and don't want to drop the mongo volume. A fresh start should work fine.