summarylogtreecommitdiffstats
path: root/install
blob: c2b014769b6bc31b75972a08677332c27dd4c63d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh

post_install() {

  ## From Debian packages ##

  # We assume that the LibreOffice to be used is built TDF-style
  # and installs in /opt/collaboraoffice6.2, 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_fowner,cap_mknod,cap_sys_chroot=ep usr/bin/loolforkit || true

  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.2/share/fonts/truetype
  su lool --shell=/bin/sh -c 'set -x; loolwsd-systemplate-setup /opt/lool/systemplate /opt/collaboraoffice6.2 >/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
}