summarylogtreecommitdiffstats
path: root/install
blob: d407e72369fcf6d1934ed5a157376a3f4ead8e45 (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
71
#!/bin/sh

post_install() {

  ## From Debian packages ##

  # We assume that the LibreOffice to be used is built TDF-style
  # and installs in /opt/collaboraoffice5.3, and that /opt/lool is
  # on the same file system
  mkdir -p           opt/lool/child-roots

  ## From Docker script ##

  # Fix lool resolv.conf problem (wizdude)
  [ -d opt/lool/systemplate/etc ] || mkdir -p opt/lool/systemplate/etc
  rm -f opt/lool/systemplate/etc/resolv.conf
  ln -s /etc/resolv.conf opt/lool/systemplate/etc/

  # 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/mkcert_example.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/collaboraoffice5.3/share/fonts/truetype
  su lool --shell=/bin/sh -c "loolwsd-systemplate-setup /opt/lool/systemplate /opt/collaboraoffice5.3 >/dev/null 2>&1"

  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
}