From 3c1fd91a2e1edbd51321e6bbb93eb9996744f5b2 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 2 Jan 2019 10:55:18 +0100 Subject: [PATCH] fix: [mattermost] postgres password is saved in config, so we need also to change it. --- mattermost/hooks/postgres_database-relation-joined | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mattermost/hooks/postgres_database-relation-joined b/mattermost/hooks/postgres_database-relation-joined index a751df5..5122349 100755 --- a/mattermost/hooks/postgres_database-relation-joined +++ b/mattermost/hooks/postgres_database-relation-joined @@ -18,6 +18,9 @@ services: MM_USERNAME: $USER " +sed -ri 's/(^\s+"DataSource": "postgres:[^:]+:)([^@]+)@/\1'"$PASSWORD"'@/' \ + "$SERVICE_CONFIGSTORE/mattermost/config/config.json" || exit 1 + [ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0