|
@ -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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|