File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -107,12 +107,6 @@ services:
107107 SETTING_MEMCACHED_LOCATION : " memcached:11211"
108108 SETTING_RABBITMQ_HOST : " rabbitmq"
109109 SETTING_REDIS_HOST : " redis"
110- SECRETS_postgres_password_FILE : /run/secrets/zulip__postgres_password
111- SECRETS_memcached_password_FILE : /run/secrets/zulip__memcached_password
112- SECRETS_rabbitmq_password_FILE : /run/secrets/zulip__rabbitmq_password
113- SECRETS_redis_password_FILE : /run/secrets/zulip__redis_password
114- SECRETS_secret_key_FILE : /run/secrets/zulip__secret_key
115- SECRETS_email_password_FILE : /run/secrets/zulip__email_password
116110 SETTING_EXTERNAL_HOST : " localhost.localdomain"
117111 SETTING_ZULIP_ADMINISTRATOR : " admin@example.com"
118112 SETTING_EMAIL_HOST : " " # e.g. smtp.example.com
Original file line number Diff line number Diff line change @@ -280,6 +280,20 @@ secretsConfiguration() {
280280 echo " Setting $SECRET_KEY from environment variable $key "
281281 crudini --set " $DATA_DIR /zulip-secrets.conf" " secrets" " ${SECRET_KEY} " " ${SECRET_VAR} "
282282 done
283+ # Secrets detected in /run/secrets/ override those via env vars
284+ for secrets_path in /run/secrets/zulip__* ; do
285+ secrets_filename=" $( basename " $secrets_path " ) "
286+ local SECRET_KEY=" ${secrets_filename# zulip__} "
287+ local SECRET_VAR=" $( cat " $secrets_path " ) "
288+ if [ -z " $SECRET_VAR " ]; then
289+ echo " Empty secret for key \" $SECRET_KEY \" ."
290+ elif [[ " $SECRET_VAR " =~ $' \n ' ]]; then
291+ echo " ERROR: Secret \" $SECRET_KEY \" contains a newline!"
292+ exit 1
293+ fi
294+ echo " Setting $SECRET_KEY from secret in $secrets_path "
295+ crudini --set " $DATA_DIR /zulip-secrets.conf" " secrets" " ${SECRET_KEY} " " ${SECRET_VAR} "
296+ done
283297 echo " Zulip secrets configuration succeeded."
284298}
285299databaseConfiguration () {
You can’t perform that action at this time.
0 commit comments