Added option to select sslmode when connecting to DB in Grafana #2846
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In teslamate, you can configure an SSL connection with the DB using the
DATABASE_SSL
environment variable.https://docs.teslamate.org/docs/configuration/environment_variables
But grafana doesn't have that option.
I found the
sslmode
option of DB connection in Grafana's documentation. This is in the jsonData entry in datasources.yml.https://grafana.com/docs/grafana/latest/administration/provisioning/#data-sources
Guide documentation
I configured it to receive this as an environment variable. I also added information to the traefik and apache guides documentation.
Dockerfile
By adding the ENV to Dockerfile, users who don't have this option in docker-compose can use it without any problems.
When I ran grafana using the Dockerfile with this option added, it was confirmed that it was connected to PostgreSQL using SSL.
This is also related to #447 from about 2 years ago. It seems that the user who opened the issue had the same problem.
Thank you for your review. have a good day :)