[libreoffice-online] 03/06: Use the ssl-cert-snakeoil certificate on new installations
Rene Engelhard
rene at moszumanska.debian.org
Mon Nov 27 18:49:32 UTC 2017
This is an automated email from the git hooks/post-receive script.
rene pushed a commit to branch master
in repository libreoffice-online.
commit 809b2ff09eae1c3ceeca3e590bca7f7bba965643
Author: Rene Engelhard <rene at rene-engelhard.de>
Date: Mon Nov 27 18:10:23 2017 +0000
Use the ssl-cert-snakeoil certificate on new installations
---
debian/control | 2 +-
debian/loolwsd.postinst | 22 +++++++++++++++++++---
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/debian/control b/debian/control
index 2ee448b..cd06354 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Package: loolwsd
Section: web
Architecture: any
Pre-Depends: ${misc:Pre-Depends}
-Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, libodbc1, libcups2, cpio, libreoffice, loleaflet
+Depends: ${shlibs:Depends}, ${misc:Depends}, ssl-cert, adduser, libodbc1, libcups2, cpio, libreoffice, loleaflet
Description: LibreOffice On-Line WebSocket Daemon
LOOLWSD is a daemon that talks to web browser clients and provides LibreOffice
services.
diff --git a/debian/loolwsd.postinst b/debian/loolwsd.postinst
index d0aad65..1327b35 100755
--- a/debian/loolwsd.postinst
+++ b/debian/loolwsd.postinst
@@ -22,13 +22,29 @@ case "$1" in
chown lool: /var/lib/lool
chown lool: /var/lib/lool/child-roots
+ # log...
+ touch /var/log/loolwsd.log
+ chown -R lool:lool /var/log/loolwsd.log
+
+ # SSL configuration
+ # Use the ssl-cert-snakeoil certificate on new installations
+ if [ -z "$2" ]; then
+ if [ ! -e /etc/libreoffice-online/key.pem -a \
+ ! -e /etc/libreoffice-online/cert.pem -a \
+ ! -e /etc/libreoffice-online/ca-chain-cert.pem ]; then
+ # copy this as loolwsd starts directly as "lool" and thus cannot
+ # access /etc/ssl/private...
+ cp /etc/ssl/private/ssl-cert-snakeoil.key /etc/libreoffice-online/key.pem
+ chmod 644 /etc/libreoffice-online/key.pem
+ ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/libreoffice-online/cert.pem
+ ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/libreoffice-online/ca-chain.cert.pem
+ fi
+ fi
+
echo -n "Setting up systemplate..."
su lool --shell=/bin/sh -c "loolwsd-systemplate-setup /var/lib/lool/systemplate /usr/lib/libreoffice >/dev/null 2>&1"
echo "done."
- # log...
- touch /var/log/loolwsd.log
- chown -R lool:lool /var/log/loolwsd.log
;;
esac
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/libreoffice-online.git
More information about the Pkg-openoffice-commits
mailing list