From ad17e36ba3f55ee569d8f52a0143e250c2568e82 Mon Sep 17 00:00:00 2001 From: Boris Gallet Date: Tue, 12 Nov 2024 16:04:30 +0100 Subject: [PATCH] chg: [mattermost] upd img to 5.30.1 and add DATASOURCE to connect db --- mattermost/hooks/postgres_database-relation-joined | 7 +++++-- mattermost/metadata.yml | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mattermost/hooks/postgres_database-relation-joined b/mattermost/hooks/postgres_database-relation-joined index de1b7d3..c13b76a 100755 --- a/mattermost/hooks/postgres_database-relation-joined +++ b/mattermost/hooks/postgres_database-relation-joined @@ -20,12 +20,15 @@ services: MM_PASSWORD: $PASSWORD MM_USERNAME: $USER " +DATASOURCE="postgres://${USER}:${PASSWORD}@${HOST}:${PORT}/${DBNAME}?sslmode=disable\&connect_timeout=10" + if [ -e "$SERVICE_CONFIGSTORE/mattermost/config/config.json" ]; then - sed -ri 's/(^\s+"DataSource": "postgres:[^:]+:)([^@]+)@/\1'"$PASSWORD"'@/' \ - "$SERVICE_CONFIGSTORE/mattermost/config/config.json" || exit 1 + sed -ri 's|("DataSource": ")[^"]*(")|\1'"$DATASOURCE"'\2|' \ + "$SERVICE_CONFIGSTORE/mattermost/config/config.json" || exit 1 fi + [ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0 diff --git a/mattermost/metadata.yml b/mattermost/metadata.yml index c0d0f47..1b01502 100644 --- a/mattermost/metadata.yml +++ b/mattermost/metadata.yml @@ -1,11 +1,12 @@ description: "Mattermost" maintainer: "Valentin Lab " ## We fix image here to be sure of what we install -docker-image: docker.0k.io/mattermost-team:5.15.0 +docker-image: docker.0k.io/mattermost-team:5.30.1 # docker-image: docker.0k.io/mattermost-enterprise config-resources: - /mattermost/config - /mattermost/plugins + - /mattermost/client-plugins data-resources: - /mattermost/data - /mattermost/logs -- 2.30.2