chg: [mattermost] upd img to 5.30.1 and add DATASOURCE to connect db #45

Open
bgallet wants to merge 1 commits from bgallet/0k-charms:bgallet/mattermost into master
  1. 7
      mattermost/hooks/postgres_database-relation-joined
  2. 3
      mattermost/metadata.yml

7
mattermost/hooks/postgres_database-relation-joined

@ -20,12 +20,15 @@ services:
MM_PASSWORD: $PASSWORD MM_PASSWORD: $PASSWORD
MM_USERNAME: $USER MM_USERNAME: $USER
" "
DATASOURCE="postgres://${USER}:${PASSWORD}@${HOST}:${PORT}/${DBNAME}?sslmode=disable\&connect_timeout=10"
if [ -e "$SERVICE_CONFIGSTORE/mattermost/config/config.json" ]; then 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 fi
[ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0 [ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0

3
mattermost/metadata.yml

@ -1,11 +1,12 @@
description: "Mattermost" description: "Mattermost"
maintainer: "Valentin Lab <valentin.lab@kalysto.org>" maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
## We fix image here to be sure of what we install ## 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 # docker-image: docker.0k.io/mattermost-enterprise
config-resources: config-resources:
- /mattermost/config - /mattermost/config
- /mattermost/plugins - /mattermost/plugins
- /mattermost/client-plugins
data-resources: data-resources:
- /mattermost/data - /mattermost/data
- /mattermost/logs - /mattermost/logs

Loading…
Cancel
Save