summarylogtreecommitdiffstats
path: root/install
blob: d2686e185101ba540c507ef08e84982675668fe6 (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
#!/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
}