Compare commits

...

1 Commits

  1. 5
      mattermost/hooks/postgres_database-relation-joined
  2. 2
      mattermost/metadata.yml

5
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"'@/' \
sed -ri 's|("DataSource": ")[^"]*(")|\1'"$DATASOURCE"'\2|' \
"$SERVICE_CONFIGSTORE/mattermost/config/config.json" || exit 1 "$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

2
mattermost/metadata.yml

@ -38,4 +38,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