1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

.well-known redirection for access by federation

If not existing, create .well-known redirection for access by federation
This commit is contained in:
Thatoo 2019-07-01 13:16:07 +02:00 committed by GitHub
parent 1b9e45b38e
commit e21060bd5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -240,6 +240,32 @@ then
chmod 640 /etc/ssl/private/dh2048.pem
fi
#=================================================
# MIGRATION 5 : CREATE A .well-known FILE
#=================================================
# Create .well-known redirection for access by federation if it doesn't exist
if [[ $server_name != $domain ]]; then
if [[ ! -e /var/www/.well-known/${domain}/server_name.json ]]; then
cat > /var/www/.well-known/${domain}/server_name.json <<EOF
{
"m.server": "$domain"
}
EOF
fi
if [[ ! -e /etc/nginx/conf.d/${domain}.d/name_server.conf ]]
cat > /etc/nginx/conf.d/${domain}.d/name_server.conf <<EOF
{
location /.well-known/matrix/server {
alias /var/www/.well-known/${domain}/server_name.json;
}
}
EOF
fi
fi
#=================================================
# STANDARD UPGRADE STEPS
#=================================================