70 lines
1.8 KiB
Bash
70 lines
1.8 KiB
Bash
#!/bin/sh
|
|
|
|
post_install() {
|
|
post_upgrade
|
|
|
|
cat <<-THEEND
|
|
IMPORTANT!
|
|
IMPORTANT! A certificate must be issued if restricted HTTP access is not possible.
|
|
IMPORTANT! See /usr/share/doc/coolwsd/example.mkcert.sh for guidance.
|
|
IMPORTANT!
|
|
IMPORTANT! The username and password must be set in /etc/coolwsd/coolwsd.xml
|
|
IMPORTANT! for the admin console.
|
|
IMPORTANT!
|
|
IMPORTANT! In /etc/coolwsd/coolwsd.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/coolwsd/coolwsd.xml.
|
|
IMPORTANT!
|
|
THEEND
|
|
}
|
|
|
|
pre_upgrade() {
|
|
systemctl stop coolwsd.service 2>/dev/null || true
|
|
}
|
|
|
|
post_upgrade() {
|
|
systemd-sysusers collabora-online-server-nodocker.conf
|
|
systemd-tmpfiles --create --clean collabora-online-server-nodocker.conf
|
|
|
|
## From Debian packages ##
|
|
|
|
setcap cap_fowner,cap_chown,cap_mknod,cap_sys_chroot=ep usr/bin/coolforkit || true
|
|
setcap cap_sys_admin=ep /usr/bin/coolmount || true
|
|
|
|
# We assume that the LibreOffice to be used is built TDF-style
|
|
# and installs in /opt/collaboraoffice, and that /opt/cool is
|
|
# on the same file system
|
|
|
|
rm -rf opt/cool
|
|
mkdir -p opt/cool/child-roots
|
|
chown cool: opt/cool
|
|
chown cool: opt/cool/child-roots
|
|
|
|
fc-cache opt/collaboraoffice/share/fonts/truetype
|
|
|
|
coolwsd-systemplate-setup opt/cool/systemplate opt/collaboraoffice >/dev/null 2>&1
|
|
coolwsd-generate-proof-key >/dev/null 2>&1
|
|
|
|
## From Docker script ##
|
|
|
|
cp /etc/resolv.conf /etc/hosts opt/cool/systemplate/etc/
|
|
chown cool:cool opt/cool/systemplate/etc/hosts opt/cool/systemplate/etc/resolv.conf
|
|
|
|
##
|
|
|
|
systemctl daemon-reload
|
|
if systemctl list-unit-files coolwsd.service | grep -q 'enabled$'; then
|
|
systemctl start coolwsd.service
|
|
fi
|
|
}
|
|
|
|
pre_remove() {
|
|
pre_upgrade
|
|
}
|
|
|
|
post_remove() {
|
|
systemctl disable coolwsd.service 2>/dev/null || true
|
|
rm -rf opt/cool
|
|
}
|