summarylogtreecommitdiffstats
path: root/synapse.install
blob: 3b9cd764e0540d9999655c165eef560515186db0 (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
#!/bin/bash

DATA_DIR="/var/lib/synapse"

## arg 1:  the new package version
post_install() {
	systemd-sysusers /usr/lib/sysusers.d/synapse.conf

	if [[ ! -e /etc/synapse/homeserver.yaml ]]; then
		cat <<-EOF
		:: A sample configuration file will be created in /etc/synapse/homeserver.yaml,
		   using /var/lib/synapse as the data directory and localhost:8448 as server name
		   and port. Customize it as necessary or regenerate with the following command:
		   python2.7 -m synapse.app.homeserver --config-path <...> --generate-config
		   (pass --help to see other options).
		EOF

		install -dm700 -o synapse -g synapse "$DATA_DIR"
		cd "$DATA_DIR"
		python2.7 \
			-m synapse.app.homeserver \
			--config-path /etc/synapse/homeserver.yaml \
			--generate-config \
			--server-name localhost \
			--bind-port 8448
	fi
}