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

DATABASE_NAME configuration is not used in MongoDB initialization #257

Open
antonatos opened this issue Nov 18, 2024 · 0 comments
Open

DATABASE_NAME configuration is not used in MongoDB initialization #257

antonatos opened this issue Nov 18, 2024 · 0 comments

Comments

@antonatos
Copy link

If I configure DATABASE_NAME: "test" in my .env, the Mongo client still connects to "admin" database

The setupDatabase in https://github.com/COSSAS/SOARCA/blob/development/internal/controller/controller.go does not use the DATABASE_NAME so Mongo will use the defaults

this is verified by the mongoDB log:
{"t":{"$date":"2024-11-18T18:38:52.249+02:00"},"s":"I", "c":"ACCESS", "id":5286306, "ctx":"conn82","msg":"Successfully authenticated","attr":{"client":"127.0.0.1:54324","isSpeculative":true,"isClusterMember":false,"mechanism":"SCRAM-SHA-256","user":"root","db":"admin","result":0,"metrics":{"conversation_duration":{"micros":4601,"summary":{"0":{"step":1,"step_total":2,"duration_micros":173},"1":{"step":2,"step_total":2,"duration_micros":72}}}},"extraInfo":{}}}

Even with MONGODB_URI="mongodb://127.0.0.1:27017/soarca" , still the client will connect to "admin" database

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

No branches or pull requests

1 participant