From 34b6e9e7727cf36f1ed011b3a26395f5b4ee4d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 3 Feb 2018 15:05:35 +0100 Subject: [PATCH] Fix dh copy while it don't exist --- scripts/upgrade | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5b1c564..38eb005 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -335,8 +335,11 @@ then adduser turnserver ssl-cert fi -# If we don't have the dh file in synapse config dir we copy it -test -e /etc/matrix-$app/dh.pem || cp /etc/yunohost/certs/$domain/dh.pem /etc/matrix-$app/dh.pem +# In the old synapse instance we stored the dh.pem in /etc/yunohost/certs/DOMAIN.TLD/ but it was problematics with lets'encrypt witch made a link to the key. While the letsencrypt key was changed the dh.pem file was lost. So we decided to move to /etc/matrix-synapse/ witch is a directory witch is not managed by any other component. +# Here we check if the dh.pem file is already moved. If not we try to copy the file from the old place. If the file in the old place was already removed (by letsencrypt) we create a new one. +test -e /etc/matrix-$app/dh.pem || \ + cp /etc/yunohost/certs/$domain/dh.pem /etc/matrix-$app/dh.pem || \ + openssl dhparam -out /etc/matrix-$app/dh.pem 2048 > /dev/null #================================================= # STANDARD UPGRADE STEPS