collabora-online-server-nod.../install

72 lines
1.9 KiB
Bash

#!/bin/sh
post_install() {
## From Debian packages ##
# We assume that the LibreOffice to be used is built TDF-style
# and installs in /opt/collaboraoffice6.4, and that /opt/lool is
# on the same file system
mkdir -p opt/lool/child-roots
## From Docker script ##
# Fix domain name resolution from jails
: # no need
# Generate new SSL certificate instead of using the default
#+
# Replace trusted host and set admin username and password
cat <<-THEEND
IMPORTANT!
IMPORTANT! A certificate must be issued if restricted HTTP access is not possible.
IMPORTANT! See /usr/share/doc/loolwsd/example.mkcert.sh for guidance.
IMPORTANT!
IMPORTANT! The username and password must be set in /etc/loolwsd/loolwsd.xml
IMPORTANT! for the admin console.
IMPORTANT!
IMPORTANT! In /etc/loolwsd/loolwsd.xml, the host should be set to a value
IMPORTANT! different than “localhost”.
IMPORTANT!
IMPORTANT! You may also want to force the server_name in /etc/loolwsd/loolwsd.xml.
IMPORTANT!
THEEND
post_upgrade
}
pre_upgrade() {
systemctl stop loolwsd.service
}
post_upgrade() {
## From Debian packages ##
setcap cap_chown,cap_fowner,cap_mknod,cap_sys_chroot=ep usr/bin/loolforkit || true
setcap cap_sys_admin=ep usr/bin/loolmount || true # this line + cap_chown above contributed by celogeek
systemd-sysusers collabora-online-server-nodocker.conf
chown lool:lool etc/loolwsd/loolwsd.xml
chmod 640 etc/loolwsd/loolwsd.xml
chown -R lool:lool opt/lool
fc-cache opt/collaboraoffice6.4/share/fonts/truetype
su lool --shell=/bin/sh -c 'set -x; loolwsd-systemplate-setup /opt/lool/systemplate /opt/collaboraoffice6.4 >/dev/null'
systemctl daemon-reload
if systemctl list-unit-files loolwsd.service | grep -q 'enabled$'; then
systemctl start loolwsd.service
fi
}
pre_remove() {
pre_upgrade
}
post_remove() {
rm -rf /var/cache/loolwsd
rm -rf /opt/lool
}