#!/bin/sh
set -eu

/usr/local/bin/php occ config:app:set indie_external chat_url --value "${CHAT_URL}"
/usr/local/bin/php occ config:app:set indie_external visio_url --value "${VISIO_URL}"
if [ -z "$SAML_IDP_URL" ]; then
    /usr/local/bin/php occ config:app:delete indie_external sso_url
else
    /usr/local/bin/php occ config:app:set indie_external sso_url --value "${$SAML_IDP_URL}/auth/realms/${SAML_REALM}"
fi

php occ config:app:set mail app.mail.smtp.timeout --value=10
