#!/bin/sh

mkdir -p /var/lib/univention-appcenter/apps/riot
cat <<EOF > /var/lib/univention-appcenter/apps/riot/config.json
{
	"default_server_config": {
		"m.homeserver": {}
	}
}
EOF

# create special apache config
cat <<-EOF >"/etc/apache2/ucs-sites.conf.d/riot.conf"
ProxyPass /element http://127.0.0.1:8009/element
ProxyPassReverse /element http://127.0.0.1:8009/element
EOF
invoke-rc.d apache2 reload

exit 0