2020-05-31 22:49:07 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2020-11-13 20:35:22 +01:00
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
|
2024-04-25 06:09:50 +02:00
|
|
|
CONDUWUIT_DATABASE_PATH=/var/lib/conduwuit/
|
2020-05-31 22:49:07 +02:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
configure)
|
2024-05-09 03:26:05 +02:00
|
|
|
# Create the `conduwuit` user if it does not exist yet.
|
|
|
|
if ! getent passwd conduwuit > /dev/null ; then
|
2024-04-25 06:09:50 +02:00
|
|
|
echo 'Adding system user for the conduwuit Matrix homeserver' 1>&2
|
2020-05-31 22:49:07 +02:00
|
|
|
adduser --system --group --quiet \
|
2024-04-25 06:09:50 +02:00
|
|
|
--home "$CONDUWUIT_DATABASE_PATH" \
|
2020-05-31 22:49:07 +02:00
|
|
|
--disabled-login \
|
2024-03-12 01:15:40 +01:00
|
|
|
--shell "/usr/sbin/nologin" \
|
2020-05-31 22:49:07 +02:00
|
|
|
--force-badname \
|
2024-05-09 03:26:05 +02:00
|
|
|
conduwuit
|
2020-05-31 22:49:07 +02:00
|
|
|
fi
|
|
|
|
|
2023-07-23 12:14:59 +02:00
|
|
|
# Create the database path if it does not exist yet and fix up ownership
|
|
|
|
# and permissions.
|
2024-04-25 06:09:50 +02:00
|
|
|
mkdir -p "$CONDUWUIT_DATABASE_PATH"
|
2024-05-09 03:26:05 +02:00
|
|
|
chown conduwuit:conduwuit -R "$CONDUWUIT_DATABASE_PATH"
|
2024-04-25 06:09:50 +02:00
|
|
|
chmod 700 "$CONDUWUIT_DATABASE_PATH"
|
2020-05-31 22:49:07 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
#DEBHELPER#
|