From 77426c0d7a5d32ed1436eafc35fba37935727cc0 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 2 May 2025 22:23:39 +0000 Subject: [PATCH] Update arch directory. Update debian directory. Signed-off-by: Jason Volk --- arch/{conduwuit.service => tuwunel.service} | 22 +++++++------ debian/README.md | 19 +++++++---- debian/config | 6 ++-- debian/postinst | 31 ++++++++++-------- debian/postrm | 32 ++++++++++++------- debian/{conduwuit.service => tuwunel.service} | 20 ++++++------ 6 files changed, 75 insertions(+), 55 deletions(-) rename arch/{conduwuit.service => tuwunel.service} (71%) rename debian/{conduwuit.service => tuwunel.service} (75%) diff --git a/arch/conduwuit.service b/arch/tuwunel.service similarity index 71% rename from arch/conduwuit.service rename to arch/tuwunel.service index 4f45ddc0..4156fe15 100644 --- a/arch/conduwuit.service +++ b/arch/tuwunel.service @@ -1,10 +1,10 @@ [Unit] -Description=conduwuit Matrix homeserver +Description=Tuwunel Matrix homeserver Wants=network-online.target After=network-online.target -Documentation=https://conduwuit.puppyirl.gay/ -RequiresMountsFor=/var/lib/private/conduwuit -Alias=matrix-conduwuit.service +Documentation=https://tuwunel.chat/ +RequiresMountsFor=/var/lib/private/tuwunel +Alias=matrix-tuwunel.service [Service] DynamicUser=yes @@ -54,16 +54,18 @@ SystemCallArchitectures=native SystemCallFilter=@system-service @resources SystemCallFilter=~@clock @debug @module @mount @reboot @swap @cpu-emulation @obsolete @timer @chown @setuid @privileged @keyring @ipc SystemCallErrorNumber=EPERM -StateDirectory=conduwuit +StateDirectory=tuwunel -RuntimeDirectory=conduwuit +RuntimeDirectory=tuwunel RuntimeDirectoryMode=0750 -Environment="CONDUWUIT_CONFIG=/etc/conduwuit/conduwuit.toml" -BindPaths=/var/lib/private/conduwuit:/var/lib/matrix-conduit -BindPaths=/var/lib/private/conduwuit:/var/lib/private/matrix-conduit +Environment="CONDUWUIT_CONFIG=/etc/tuwunel/tuwunel.toml" +BindPaths=/var/lib/private/tuwunel:/var/lib/conduwuit +BindPaths=/var/lib/private/tuwunel:/var/lib/private/conduwuit +BindPaths=/var/lib/private/tuwunel:/var/lib/matrix-conduit +BindPaths=/var/lib/private/tuwunel:/var/lib/private/matrix-conduit -ExecStart=/usr/bin/conduwuit +ExecStart=/usr/bin/tuwunel Restart=on-failure RestartSec=5 diff --git a/debian/README.md b/debian/README.md index 800a2e09..ac00a4ed 100644 --- a/debian/README.md +++ b/debian/README.md @@ -1,4 +1,4 @@ -# conduwuit for Debian +# Tuwunel for Debian Information about downloading and deploying the Debian package. This may also be referenced for other `apt`-based distros such as Ubuntu. @@ -13,17 +13,24 @@ No `apt` repository is currently offered yet, it is in the works/development. ### Configuration -When installed, the example config is placed at `/etc/conduwuit/conduwuit.toml` +When installed, the example config is placed at `/etc/tuwunel/tuwunel.toml` as the default config. The config mentions things required to be changed before starting. You can tweak more detailed settings by uncommenting and setting the config -options in `/etc/conduwuit/conduwuit.toml`. +options in `/etc/tuwunel/tuwunel.toml`. ### Running -The package uses the [`conduwuit.service`](../configuration/examples.md#example-systemd-unit-file) systemd unit file to start and stop conduwuit. The binary is installed at `/usr/sbin/conduwuit`. +The package uses the [`tuwunel.service`](../configuration/examples.md#example-systemd-unit-file) +systemd unit file to start and stop Tuwunel. The binary is installed at `/usr/sbin/tuwunel`. -This package assumes by default that conduwuit will be placed behind a reverse proxy. The default config options apply (listening on `localhost` and TCP port `6167`). Matrix federation requires a valid domain name and TLS, so you will need to set up TLS certificates and renewal for it to work properly if you intend to federate. +This package assumes by default that Tuwunel will be placed behind a reverse +proxy. The default config options apply (listening on `localhost` and TCP port +`6167`). Matrix federation requires a valid domain name and TLS, so you will +need to set up TLS certificates and renewal for it to work properly if you +intend to federate. -Consult various online documentation and guides on setting up a reverse proxy and TLS. Caddy is documented at the [generic deployment guide](../deploying/generic.md#setting-up-the-reverse-proxy) as it's the easiest and most user friendly. +Consult various online documentation and guides on setting up a reverse proxy +and TLS. Caddy is documented at the [generic deployment guide](../deploying/generic.md#setting-up-the-reverse-proxy) +as it's the easiest and most user friendly. diff --git a/debian/config b/debian/config index ec84aaa1..41c3468d 100644 --- a/debian/config +++ b/debian/config @@ -6,13 +6,13 @@ set -e #. /usr/share/debconf/confmodule # ## Ask for the Matrix homeserver name, address and port. -#db_input high conduwuit/hostname || true +#db_input high tuwunel/hostname || true #db_go # -#db_input low conduwuit/address || true +#db_input low tuwunel/address || true #db_go # -#db_input medium conduwuit/port || true +#db_input medium tuwunel/port || true #db_go exit 0 diff --git a/debian/postinst b/debian/postinst index 4eae4573..b93dfe72 100644 --- a/debian/postinst +++ b/debian/postinst @@ -4,38 +4,41 @@ set -e # TODO: implement debconf support that is maintainable without duplicating the config #. /usr/share/debconf/confmodule -CONDUWUIT_DATABASE_PATH=/var/lib/conduwuit -CONDUWUIT_CONFIG_PATH=/etc/conduwuit +TUWUNEL_DATABASE_PATH=/var/lib/tuwunel +TUWUNEL_CONFIG_PATH=/etc/tuwunel case "$1" in configure) - # Create the `conduwuit` user if it does not exist yet. - if ! getent passwd conduwuit > /dev/null ; then - echo 'Adding system user for the conduwuit Matrix homeserver' 1>&2 + # Create the `tuwunel` user if it does not exist yet. + if ! getent passwd tuwunel > /dev/null ; then + echo 'Adding system user for the tuwunel Matrix homeserver' 1>&2 adduser --system --group --quiet \ - --home "$CONDUWUIT_DATABASE_PATH" \ + --home "$TUWUNEL_DATABASE_PATH" \ --disabled-login \ --shell "/usr/sbin/nologin" \ - conduwuit + tuwunel fi # Create the database path if it does not exist yet and fix up ownership # and permissions for the config. - mkdir -v -p "$CONDUWUIT_DATABASE_PATH" + mkdir -v -p "$TUWUNEL_DATABASE_PATH" # symlink the previous location for compatibility if it does not exist yet. if ! test -L "/var/lib/matrix-conduit" ; then - ln -s -v "$CONDUWUIT_DATABASE_PATH" "/var/lib/matrix-conduit" + ln -s -v "$TUWUNEL_DATABASE_PATH" "/var/lib/matrix-conduit" + fi + if ! test -L "/var/lib/conduwuit" ; then + ln -s -v "$TUWUNEL_DATABASE_PATH" "/var/lib/conduwuit" fi - chown -v conduwuit:conduwuit -R "$CONDUWUIT_DATABASE_PATH" - chown -v conduwuit:conduwuit -R "$CONDUWUIT_CONFIG_PATH" + chown -v tuwunel:tuwunel -R "$TUWUNEL_DATABASE_PATH" + chown -v tuwunel:tuwunel -R "$TUWUNEL_CONFIG_PATH" - chmod -v 740 "$CONDUWUIT_DATABASE_PATH" + chmod -v 740 "$TUWUNEL_DATABASE_PATH" echo '' - echo 'Make sure you edit the example config at /etc/conduwuit/conduwuit.toml before starting!' - echo 'To start the server, run: systemctl start conduwuit.service' + echo 'Make sure you edit the example config at /etc/tuwunel/tuwunel.toml before starting!' + echo 'To start the server, run: systemctl start tuwunel.service' echo '' ;; diff --git a/debian/postrm b/debian/postrm index 3c0b1c09..fe73ff9f 100644 --- a/debian/postrm +++ b/debian/postrm @@ -3,9 +3,10 @@ set -e #. /usr/share/debconf/confmodule -CONDUWUIT_CONFIG_PATH=/etc/conduwuit -CONDUWUIT_DATABASE_PATH=/var/lib/conduwuit -CONDUWUIT_DATABASE_PATH_SYMLINK=/var/lib/matrix-conduit +TUWUNEL_CONFIG_PATH=/etc/tuwunel +TUWUNEL_DATABASE_PATH=/var/lib/tuwunel +CONDUIT_DATABASE_PATH_SYMLINK=/var/lib/matrix-conduit +CONDUWUIT_DATABASE_PATH_SYMLINK=/var/lib/conduwuit case $1 in purge) @@ -18,23 +19,30 @@ case $1 in # - if [ -d "$CONDUWUIT_CONFIG_PATH" ]; then - if test -L "$CONDUWUIT_CONFIG_PATH"; then - echo "Deleting conduwuit configuration files" - rm -v -r "$CONDUWUIT_CONFIG_PATH" + if [ -d "$TUWUNEL_CONFIG_PATH" ]; then + if test -L "$TUWUNEL_CONFIG_PATH"; then + echo "Deleting tuwunel configuration files" + rm -v -r "$TUWUNEL_CONFIG_PATH" fi fi - if [ -d "$CONDUWUIT_DATABASE_PATH" ]; then - if test -L "$CONDUWUIT_DATABASE_PATH"; then - echo "Deleting conduwuit database directory" - rm -r "$CONDUWUIT_DATABASE_PATH" + if [ -d "$TUWUNEL_DATABASE_PATH" ]; then + if test -L "$TUWUNEL_DATABASE_PATH"; then + echo "Deleting tuwunel database directory" + rm -r "$TUWUNEL_DATABASE_PATH" + fi + fi + + if [ -d "$CONDUIT_DATABASE_PATH_SYMLINK" ]; then + if test -L "$CONDUIT_DATABASE_SYMLINK"; then + echo "Removing matrix-conduit symlink" + rm -r "$CONDUIT_DATABASE_PATH_SYMLINK" fi fi if [ -d "$CONDUWUIT_DATABASE_PATH_SYMLINK" ]; then if test -L "$CONDUWUIT_DATABASE_SYMLINK"; then - echo "Removing matrix-conduit symlink" + echo "Removing conduwuit symlink" rm -r "$CONDUWUIT_DATABASE_PATH_SYMLINK" fi fi diff --git a/debian/conduwuit.service b/debian/tuwunel.service similarity index 75% rename from debian/conduwuit.service rename to debian/tuwunel.service index a079499e..479afede 100644 --- a/debian/conduwuit.service +++ b/debian/tuwunel.service @@ -1,21 +1,21 @@ [Unit] -Description=conduwuit Matrix homeserver +Description=Tuwunel Matrix homeserver Wants=network-online.target After=network-online.target -Alias=matrix-conduwuit.service -Documentation=https://conduwuit.puppyirl.gay/ +Alias=matrix-tuwunel.service +Documentation=https://tuwunel.chat/ [Service] DynamicUser=yes -User=conduwuit -Group=conduwuit +User=tuwunel +Group=tuwunel Type=notify -Environment="CONDUWUIT_CONFIG=/etc/conduwuit/conduwuit.toml" +Environment="TUWUNEL_CONFIG=/etc/tuwunel/tuwunel.toml" -ExecStart=/usr/sbin/conduwuit +ExecStart=/usr/sbin/tuwunel -ReadWritePaths=/var/lib/conduwuit /etc/conduwuit +ReadWritePaths=/var/lib/tuwunel /etc/tuwunel AmbientCapabilities= CapabilityBoundingSet= @@ -48,9 +48,9 @@ SystemCallArchitectures=native SystemCallFilter=@system-service @resources SystemCallFilter=~@clock @debug @module @mount @reboot @swap @cpu-emulation @obsolete @timer @chown @setuid @privileged @keyring @ipc SystemCallErrorNumber=EPERM -#StateDirectory=conduwuit +#StateDirectory=tuwunel -RuntimeDirectory=conduwuit +RuntimeDirectory=tuwunel RuntimeDirectoryMode=0750 Restart=on-failure