diff --git a/scripts/install b/scripts/install index cd129e5..1a4abda 100755 --- a/scripts/install +++ b/scripts/install @@ -58,6 +58,22 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=group_name --value=$group_name ynh_app_setting_set --app=$app --key=password --value=$password +#================================================= +# CREATE A DH FILE +#================================================= +ynh_script_progression --message="Creating a dh file..." --weight=3 + +# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE +# For any update do it in all files + +# Make dh cert for synapse if it doesn't exist +if [ ! -e /etc/ssl/private/dh2048.pem ] +then + ynh_exec_warn_less openssl dhparam -out /etc/ssl/private/dh2048.pem -outform PEM -2 2048 -dsaparam + chown root:ssl-cert /etc/ssl/private/dh2048.pem + chmod 640 /etc/ssl/private/dh2048.pem +fi + #================================================= # STANDARD MODIFICATIONS #================================================= diff --git a/scripts/restore b/scripts/restore index 64795ee..4a0b859 100755 --- a/scripts/restore +++ b/scripts/restore @@ -123,6 +123,22 @@ yunohost service add coturn-$app --needs_exposed_ports $turnserver_tls_port ynh_restore_file --logfile "/var/log/$app" +#================================================= +# CREATE A DH FILE +#================================================= +ynh_script_progression --message="Creating a dh file..." --weight=3 + +# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE +# For any update do it in all files + +# Make dh cert for synapse if it doesn't exist +if [ ! -e /etc/ssl/private/dh2048.pem ] +then + ynh_exec_warn_less openssl dhparam -out /etc/ssl/private/dh2048.pem -outform PEM -2 2048 -dsaparam + chown root:ssl-cert /etc/ssl/private/dh2048.pem + chmod 640 /etc/ssl/private/dh2048.pem +fi + #================================================= # RECONFIGURE THE TURNSERVER #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 78f0b97..e3cb11f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -138,6 +138,22 @@ then ynh_use_logrotate --logfile /var/log/matrix-$app --nonappend fi +#================================================= +# CREATE A DH FILE +#================================================= +ynh_script_progression --message="Creating a dh file..." --weight=3 + +# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE +# For any update do it in all files + +# Make dh cert for synapse if it doesn't exist +if [ ! -e /etc/ssl/private/dh2048.pem ] +then + ynh_exec_warn_less openssl dhparam -out /etc/ssl/private/dh2048.pem -outform PEM -2 2048 -dsaparam + chown root:ssl-cert /etc/ssl/private/dh2048.pem + chmod 640 /etc/ssl/private/dh2048.pem +fi + #================================================= # SPECIFIC UPGRADE #=================================================