How to use environment variables on config.yml?

There are a few values that I need to setup in the config.yml file that I’d like to read from environment variables, rather than having them saved and committed to our repo.

Does the config.yml support some sort of template that I can use for it?

I don’t think it does but you can read them in file. There are also some environment variables that Sentry automatically reads and honors. Which ones you have in mind?

Basically I need to setup Redis host, the used for Login with Github, and the secret key.

Are you saying that I don’t actually need to use config.yml and I can set all these variables in the

Oh, all those are already supported via environment variables. Just take a look at, especially to the comments at the very beginning that lists all supported env variables.

@BYK do you know anything about the migration to config.yml stated here

The following will be a simple mapping of old ( ) keys to new ( config.yml ). Old settings should be completely removed.

If that’s the case, how would one keep EMAIL_HOST_PASSWORD a secret?


They are already not very secret if you are passing them to Docker via .env file or with environment variables, they are not safer than just baking them into the image by setting them in the config.yml file at image build time.

We may look into using Docker secrets in the future for this. Also, the file is still supported for now if environment variables are your preferred way of transport.