Update matrix certs

This commit is contained in:
Bob Mottram 2016-12-30 20:00:50 +00:00
parent 9ac187f036
commit 6ea77bde31
2 changed files with 19 additions and 0 deletions

View File

@ -81,6 +81,11 @@ function matrix_configure_homeserver_yaml {
}' "${filepath}" > "${ymltemp}" }' "${filepath}" > "${ymltemp}"
mv ${ymltemp} "${filepath}" mv ${ymltemp} "${filepath}"
if [[ $ONION_ONLY != 'no' ]]; then
sed -i 's|no_tls: .*|no_tls: True|g' "${filepath}"
fi
sed -i 's|enable_registration_captcha.*|enable_registration_captcha: False|g' "${filepath}"
} }
function matrix_diff { function matrix_diff {

View File

@ -732,6 +732,20 @@ function update_default_domain {
systemctl reload prosody systemctl reload prosody
fi fi
if [ -d /var/lib/matrix ]; then
if [ -f /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem ]; then
cp /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem /var/lib/matrix/${DEFAULT_DOMAIN_NAME}.tls.crt
cp /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.dhparam /var/lib/matrix/${DEFAULT_DOMAIN_NAME}.tls.dh
cp /etc/ssl/private/${DEFAULT_DOMAIN_NAME}.key /var/lib/matrix/${DEFAULT_DOMAIN_NAME}.tls.key
chown -R matrix:matrix /var/lib/matrix
chmod -R 700 /var/lib/matrix/*.pem
chmod -R 700 /var/lib/matrix/*.key
chmod -R 700 /var/lib/matrix/*.dhparam
systemctl restart turn
systemctl restart matrix
fi
fi
if [ -d /var/lib/mumble-server ]; then if [ -d /var/lib/mumble-server ]; then
if [[ "$(cert_exists ${DEFAULT_DOMAIN_NAME} pem)" == "1" ]]; then if [[ "$(cert_exists ${DEFAULT_DOMAIN_NAME} pem)" == "1" ]]; then
cp /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem /var/lib/mumble-server/mumble.pem cp /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem /var/lib/mumble-server/mumble.pem