From 6c03c4a48979b0ca3ef727a489ea09815c428622 Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 11 Oct 2020 15:47:01 +0300 Subject: [PATCH] Allow let's encrypte sertificates --- run-document-server.sh | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/run-document-server.sh b/run-document-server.sh index 9f57747..5581f63 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -49,6 +49,9 @@ JWT_SECRET=${JWT_SECRET:-secret} JWT_HEADER=${JWT_HEADER:-Authorization} JWT_IN_BODY=${JWT_IN_BODY:-false} +LETS_ENCRYPT_DOMAINS=${LETS_ENCRYPT_DOMAINS:-none} +LETS_ENCRYPT_MAIL=${LETS_ENCRYPT_MAIL:-none} + if [[ ${PRODUCT_NAME} == "documentserver" ]]; then REDIS_ENABLED=false else @@ -418,6 +421,68 @@ update_logrotate_settings(){ sed 's|\(^su\b\).*|\1 root root|' -i /etc/logrotate.conf } +modify_conf_templated(){ + sed -i '$ d' ${NGINX_ONLYOFFICE_PATH}/ds.conf.tmpl + cat >> ${NGINX_ONLYOFFICE_PATH}/ds.conf.tmpl <> ${NGINX_ONLYOFFICE_PATH}/ds-ssl.conf.tmpl < ${DIR}/letsencrypt_cron.sh <> /var/log/le-renew.log + cp ${LETSENCRYPT_ROOT_DIR}/${args[0]}/fullchain.pem ${ROOT_DIR}/onlyoffice.crt + cp ${LETSENCRYPT_ROOT_DIR}/${args[0]}/privkey.pem ${ROOT_DIR}/onlyoffice.key + cp ${LETSENCRYPT_ROOT_DIR}/${args[0]}/chain.pem ${ROOT_DIR}/stapling.trusted.crt + #openssl pkcs12 -export -out ${ROOT_DIR}/onlyoffice.pfx -inkey ${ROOT_DIR}/onlyoffice.key -in ${ROOT_DIR}/onlyoffice.crt -password pass:onlyoffice + #chown onlyoffice:onlyoffice ${ROOT_DIR}/onlyoffice.pfx + service nginx reload +END + + chmod a+x ${DIR}/letsencrypt_cron.sh + + cat > /etc/cron.d/letsencrypt <