Split config into a Debian and local part

* The Debian part will be generated and managed by Debconf and configure
  homeserver name, address and port
* The local part will just be a config file that shows the other
  configuration options

Added the address configuration and moved the config generation
from the config to the postinst script.
This commit is contained in:
Paul van Tilburg 2020-11-13 20:35:22 +01:00
parent 79692db45d
commit f72554de10
No known key found for this signature in database
GPG key ID: C6DE073EDA9EEC4D
7 changed files with 98 additions and 64 deletions

14
debian/config vendored
View file

@ -4,20 +4,14 @@ set -e
# Source debconf library.
. /usr/share/debconf/confmodule
CONDUIT_CONFIG_PATH=/etc/matrix-conduit
CONDUIT_CONFIG_FILE="$CONDUIT_CONFIG_PATH/env"
# Ask for the Matrix homeserver name and port.
# Ask for the Matrix homeserver name, address and port.
db_input high matrix-conduit/hostname || true
db_go
db_input low matrix-conduit/address || true
db_go
db_input medium matrix-conduit/port || true
db_go
# Update the values in the config.
db_get matrix-conduit/hostname
sed -i -e "s/^ROCKET_SERVER_NAME=.*/ROCKET_SERVER_NAME=\"$RET\"/" $CONDUIT_CONFIG_FILE
db_get matrix-conduit/port
sed -i -e "s/^ROCKET_PORT=.*/ROCKET_PORT=\"$RET\"/" $CONDUIT_CONFIG_FILE
exit 0