summarylogtreecommitdiffstats
path: root/synapse.install
diff options
context:
space:
mode:
authorIvan Shapovalov2015-07-07 20:17:49 +0300
committerIvan Shapovalov2015-07-07 20:17:49 +0300
commitb782d9639a1a921c0b15403e873177406ae51f5a (patch)
tree7f110fd602c38c20f329460bbe26a0475369f298 /synapse.install
downloadaur-b782d9639a1a921c0b15403e873177406ae51f5a.tar.gz
Automated: initialized with version 0.9.0.r5.r241.gd70c847-4
Diffstat (limited to 'synapse.install')
-rw-r--r--synapse.install27
1 files changed, 27 insertions, 0 deletions
diff --git a/synapse.install b/synapse.install
new file mode 100644
index 000000000000..3b9cd764e054
--- /dev/null
+++ b/synapse.install
@@ -0,0 +1,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
+}