summaryrefslogtreecommitdiff
path: root/debian/postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/postinst')
-rw-r--r--debian/postinst47
1 files changed, 47 insertions, 0 deletions
diff --git a/debian/postinst b/debian/postinst
index ee684da..bd7fb85 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -1,6 +1,10 @@
#!/bin/sh
set -e
+. /usr/share/debconf/confmodule
+
+CONDUIT_CONFIG_PATH=/etc/matrix-conduit
+CONDUIT_CONFIG_FILE="$CONDUIT_CONFIG_PATH/debian"
CONDUIT_DATABASE_PATH=/var/lib/matrix-conduit
case "$1" in
@@ -20,6 +24,49 @@ case "$1" in
mkdir -p "$CONDUIT_DATABASE_PATH"
chown _matrix-conduit "$CONDUIT_DATABASE_PATH"
fi
+
+ # Write the debconf values in the config.
+ db_get matrix-conduit/hostname
+ ROCKET_SERVER_NAME="$RET"
+ db_get matrix-conduit/address
+ ROCKET_ADDRESS="$RET"
+ db_get matrix-conduit/port
+ ROCKET_PORT="$RET"
+ cat >"$CONDUIT_CONFIG_FILE" << EOF
+# Conduit homeserver Debian configuration
+#
+# Conduit is an application based on the Rocket web framework.
+# Configuration of Conduit happens via Debconf (of which the resulting config
+# is in this file) and optionally by uncommenting and tweaking the variables in
+# /etc/matrix-conduit/local.
+
+# THIS FILE IS GENERATED BY DEBCONF AND WILL BE OVERRIDDEN!
+#
+# Please make changes by running:
+#
+# \$ dpkg-reconfigure matrix-conduit
+#
+# or by providing overriding changes in /etc/matrix-conduit/local.
+
+# The server (host)name of the Matrix homeserver.
+#
+# This is the hostname the homeserver will be reachable at via a client.
+ROCKET_SERVER_NAME="$ROCKET_SERVER_NAME"
+
+# The address the Matrix homeserver listens on.
+#
+# By default the server listens on address 0.0.0.0. Change this to 127.0.0.1 to
+# only listen on the localhost when using a reverse proxy.
+ROCKET_ADDRESS="$ROCKET_ADDRESS"
+
+# The port of the Matrix homeserver.
+#
+# This port is could be any available port if accessed by a reverse proxy.
+# By default the server listens on port 8000.
+ROCKET_PORT="$ROCKET_PORT"
+
+# THIS FILE IS GENERATED BY DEBCONF AND WILL BE OVERRIDDEN!
+EOF
;;
esac