papercups-io / papercups

Open-source live customer chat
https://app.papercups.io/demo
MIT License
5.76k stars 525 forks source link

Allow to store sensitive configs in files #905

Closed paescuj closed 3 years ago

paescuj commented 3 years ago

Description

This allows to store sensitive configs (namely the secret key base and the database password) in a file (e.g. via Docker secrets).

The database can now be configured via DATABASE_USER, DATABASE_PASSWORD/DATABASE_PASSWORD_FILE, DATABASE_HOST and DATABASE variable as an alternative to the DATABASE_URL variable (which still has priority).

The database password is encoded to prevent errors, like https://elixirforum.com/t/problems-with-url-in-a-configuration-for-ecto/4057.

Since I'm not very familiar with Elixir this might require some tweaking. However, it's working for me.

Issue

None

Screenshots

Not relevant

Checklist