incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Feature][devlake] mysql connection config from environment variables

Open pimperator opened this issue 1 year ago • 1 comments

Search before asking

  • [X] I had searched in the issues and found no similar feature requirement.

Use case

running the devlake part (not config-ui, not grafana) we need to ingest the value of DB_URL (either from .env file or as environment variable) in order to set up the mysql connection sadly this contains the full connection string

DB_URL=mysql://username:password@databasehost:3306/database?charset=utf8mb4&parseTime=True&loc=UTC

see https://github.com/apache/incubator-devlake/blob/main/env.example#L26

Usually (like for grafana and opendora) the connection is set up via DB_HOSTNAME, DB_USER, DB_PASSWORD, DB_NAME as environment variables that make us able to put DB_PASSWORD into an encrypted vault. With the given solution above we need to create the connection string and store all data in a vault. Additionally it needs to be recreated on password reset.

Description

I suggest to use DB_HOSTNAME, DB_USER, DB_PASSWORD, DB_NAME for the database connection setup instead of DB_URL. This makes us able to store DB_PASSWORD in an encrypted vault and rotate only that vault/value on password rotation.

Related issues

No response

Are you willing to submit a PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

pimperator avatar Aug 28 '24 10:08 pimperator

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Oct 28 '24 00:10 github-actions[bot]

I started something in this PR #8127 :)

riipeckx avatar Oct 31 '24 13:10 riipeckx

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Jan 01 '25 00:01 github-actions[bot]

This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.

github-actions[bot] avatar Jan 09 '25 00:01 github-actions[bot]