ansible-roles/roles/jitsi/templates/dehydrated_hook.sh.j2
2021-12-01 19:13:34 +01:00

21 lines
624 B
Django/Jinja

#!/bin/bash -e
{% if jitsi_letsencrypt_cert is defined %}
{% if jitsi_letsencrypt_cert == True %}
{% set cert = jitsi_domain %}
{% elif jitsi_letsencrypt_cert is string %}
{% set cert = jitsi_letsencrypt_cert %}
{% endif %}
if [ $1 == "{{ cert }}" ]; then
cp /var/lib/dehydrated/certificates/certs/{{ cert }}/fullchain.pem /etc/prosody/certs/jitsi.crt
cp /var/lib/dehydrated/certificates/certs/{{ cert }}/privkey.pem /etc/prosody/certs/jitsi.key
chown :prosody /etc/prosody/certs/jitsi.key
chmod 644 /etc/prosody/certs/jitsi.crt
chmod 640 /etc/prosody/certs/jitsi.key
systemctl reload prosody
fi
{% endif %}