From e7f3192a8b50c92c733ec297d914a4f8b1797f43 Mon Sep 17 00:00:00 2001 From: DerFossibaer Date: Sat, 15 Jan 2022 19:38:49 +0100 Subject: [PATCH] fix ssl --- src/onlyoffice/install-service.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/onlyoffice/install-service.sh b/src/onlyoffice/install-service.sh index 6cae315..c623bee 100644 --- a/src/onlyoffice/install-service.sh +++ b/src/onlyoffice/install-service.sh @@ -31,6 +31,13 @@ ONLYOFFICE_DB_USER=$ONLYOFFICE_DB_USER ONLYOFFICE_DB_PASS=$ONLYOFFICE_DB_PASS EOF -/etc/nginx/conf.d/ds.conf +mkdir /etc/nginx/ssl +openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout /etc/nginx/ssl/onlyoffice.key -out /etc/nginx/ssl/onlyoffice.crt -subj "/CN=$LXC_HOSTNAME.$LXC_DOMAIN" -addext "subjectAltName=DNS:$LXC_HOSTNAME.$LXC_DOMAIN" + +rm /etc/nginx/conf.d/ds.conf cp /etc/onlyoffice/documentserver/nginx/ds-ssl.conf.tmpl /etc/onlyoffice/documentserver/nginx/ds-ssl.conf ln -sf /etc/onlyoffice/documentserver/nginx/ds-ssl.conf /etc/nginx/conf.d/ds-ssl.conf + +sed -i "s|ssl_certificate {{SSL_CERTIFICATE_PATH}}|ssl_certificate /etc/nginx/ssl/onlyoffice.crt|" /etc/nginx/conf.d/ds-ssl.conf +sed -i "s|ssl_certificate_key {{SSL_KEY_PATH}}|ssl_certificate_key /etc/nginx/ssl/onlyoffice.key|" /etc/nginx/conf.d/ds-ssl.conf +systemctl restart nginx \ No newline at end of file