Browse Source

chg: [mattermost] update image to ``5.30.1``

mattermost
Boris Gallet 1 month ago
committed by Valentin Lab
parent
commit
4adb59d822
  1. 2
      mattermost/hooks/init
  2. 17
      mattermost/hooks/postgres_database-relation-joined
  3. 12
      mattermost/hooks/web_proxy-relation-joined
  4. 9
      mattermost/metadata.yml

2
mattermost/hooks/init

@ -15,7 +15,7 @@
## checking permission of base directory ## checking permission of base directory
## ##
dirs=("$SERVICE_CONFIGSTORE/mattermost/"{config,plugins} "$SERVICE_DATASTORE/mattermost/"{data,logs})
dirs=("$SERVICE_DATASTORE/mattermost/"{data,logs,config,plugins})
for dir in "${dirs[@]}"; do for dir in "${dirs[@]}"; do
mkdir -p "$dir" mkdir -p "$dir"
find "$dir" \! -uid 2000 -print0 | while read-0 f; do find "$dir" \! -uid 2000 -print0 | while read-0 f; do

17
mattermost/hooks/postgres_database-relation-joined

@ -10,21 +10,16 @@ PORT="$(relation-get port)"
control=$(p0 "$USER" "$DBNAME" "$PASSWORD" "$HOST" "$PORT" | md5_compat) control=$(p0 "$USER" "$DBNAME" "$PASSWORD" "$HOST" "$PORT" | md5_compat)
## Used doc from https://github.com/mattermost/docker/blob/main/env.example
config-add "\ config-add "\
services: services:
$MASTER_BASE_SERVICE_NAME: $MASTER_BASE_SERVICE_NAME:
environment: environment:
DB_HOST: $HOST
DB_PORT_NUMBER: $PORT
MM_DBNAME: $DBNAME
MM_PASSWORD: $PASSWORD
MM_USERNAME: $USER
"
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
fi
MM_SQLSETTINGS_DRIVERNAME: postgres
MM_SQLSETTINGS_DATASOURCE: \"postgres://${USER}:${PASSWORD}@${HOST}:${PORT}/${DBNAME}?sslmode=disable&connect_timeout=10\"
" || exit 17
[ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0 [ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0

12
mattermost/hooks/web_proxy-relation-joined

@ -0,0 +1,12 @@
#!/bin/bash
set -e
URL="$(relation-get url)" || exit 1
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
environment:
MM_SERVICESETTINGS_SITEURL=${URL}
"

9
mattermost/metadata.yml

@ -1,14 +1,13 @@
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:
- /mattermost/config
- /mattermost/plugins
data-resources: data-resources:
- /mattermost/data - /mattermost/data
- /mattermost/logs - /mattermost/logs
- /mattermost/config
- /mattermost/plugins
host-resources: host-resources:
- /etc/localtime:ro - /etc/localtime:ro
@ -38,4 +37,4 @@ uses:
RewriteCond %{REQUEST_URI} /api/v[0-9]+/(users/)?websocket [NC,OR] RewriteCond %{REQUEST_URI} /api/v[0-9]+/(users/)?websocket [NC,OR]
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR] RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC] RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://${MASTER_BASE_SERVICE_NAME}:8000%{REQUEST_URI} [P,QSA,L]
RewriteRule .* ws://${MASTER_BASE_SERVICE_NAME}:8065%{REQUEST_URI} [P,QSA,L]
Loading…
Cancel
Save