From d55015ccda70e7a99765899b71e0b1c0f29608da Mon Sep 17 00:00:00 2001 From: strawberry Date: Thu, 25 Apr 2024 00:09:50 -0400 Subject: [PATCH] rename `release_log_level` dev feature to `dev_release_log_level`, some rebranding Signed-off-by: strawberry --- Cargo.toml | 22 +++++++++---------- debian/README.md | 21 ++++++++---------- ...trix-conduit.service => conduwuit.service} | 8 +++---- debian/config | 6 ++--- debian/postinst | 18 +++++++-------- debian/postrm | 12 +++++----- debian/templates | 6 ++--- src/utils/debug.rs | 4 ++-- 8 files changed, 47 insertions(+), 50 deletions(-) rename debian/{matrix-conduit.service => conduwuit.service} (89%) diff --git a/Cargo.toml b/Cargo.toml index eb538402..e76f8a09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ authors = [ "strawberry ", "timokoesters ", ] -homepage = "https://puppygock.gay/conduwuit" +homepage = "https://conduwuit.puppyirl.gay/" repository = "https://github.com/girlbossceo/conduwuit" readme = "README.md" version = "0.3.0" @@ -250,7 +250,7 @@ features = ["std", "derive", "help", "usage", "error-context", "string"] version = "0.3.30" default-features = false -# Used for reading the configuration from conduit.toml & environment variables +# Used for reading the configuration from conduwuit.toml & environment variables [dependencies.figment] version = "0.10.18" features = ["env", "toml"] @@ -388,7 +388,7 @@ release_max_log_level = [ ] # developer feature useful only in debug builds. -release_log_level = [] +dev_release_log_level = [] # client/server interopability hacks # @@ -397,9 +397,9 @@ element_hacks = [] [package.metadata.deb] -name = "matrix-conduit" +name = "conduwuit" maintainer = "strawberry " -copyright = "2024, Timo Kösters " +copyright = "2024, strawberry " license-file = ["LICENSE", "3"] depends = "$auto, ca-certificates" extended-description = """\ @@ -409,28 +409,28 @@ priority = "optional" assets = [ [ "debian/README.md", - "usr/share/doc/matrix-conduit/README.Debian", + "usr/share/doc/conduwuit/README.Debian", "644", ], [ "README.md", - "usr/share/doc/matrix-conduit/", + "usr/share/doc/conduwuit/", "644", ], [ "target/release/conduit", - "usr/sbin/matrix-conduit", + "usr/sbin/conduwuit", "755", ], [ "conduwuit-example.toml", - "etc/matrix-conduit/conduit.toml", + "etc/conduwuit/conduwuit.toml", "640", ], ] -conf-files = ["/etc/matrix-conduit/conduit.toml"] +conf-files = ["/etc/conduwuit/conduwuit.toml"] maintainer-scripts = "debian/" -systemd-units = { unit-name = "matrix-conduit" } +systemd-units = { unit-name = "conduwuit" } [profile.dev] diff --git a/debian/README.md b/debian/README.md index 063982de..95a43cc2 100644 --- a/debian/README.md +++ b/debian/README.md @@ -5,7 +5,7 @@ Installation ------------ Information about downloading, building and deploying the Debian package, see -the "Installing Conduit" section in the Deploying docs. +the "Installing conduwuit" section in the Deploying docs. All following sections until "Setting up the Reverse Proxy" be ignored because this is handled automatically by the packaging. @@ -14,24 +14,21 @@ Configuration When installed, Debconf generates the configuration of the homeserver (host)name, the address and port it listens on. This configuration ends up in -`/etc/matrix-conduit/conduit.toml`. +`/etc/conduwuit/conduwuit.toml`. You can tweak more detailed settings by uncommenting and setting the variables -in `/etc/matrix-conduit/conduit.toml`. This involves settings such as the maximum +in `/etc/conduwuit/conduwuit.toml`. This involves settings such as the maximum file size for download/upload, enabling federation, etc. Running ------- -The package uses the `matrix-conduit.service` systemd unit file to start and -stop Conduit. It loads the configuration file mentioned above to set up the +The package uses the `conduwuit.service` systemd unit file to start and +stop conduwuit. It loads the configuration file mentioned above to set up the environment before running the server. -This package assumes by default that Conduit will be placed behind a reverse -proxy such as Apache or nginx. This default deployment entails just listening +This package assumes by default that conduwuit will be placed behind a reverse +proxy. This default deployment entails just listening on `127.0.0.1` and the free port `6167` and is reachable via a client using the URL -. - -At a later stage this packaging may support also setting up TLS and running -stand-alone. In this case, however, you need to set up some certificates and -renewal, for it to work properly. +. Matrix federation requires TLS, so you will need to set up +some certificates and renewal, for it to work properly. diff --git a/debian/matrix-conduit.service b/debian/conduwuit.service similarity index 89% rename from debian/matrix-conduit.service rename to debian/conduwuit.service index bc1347af..07f7696b 100644 --- a/debian/matrix-conduit.service +++ b/debian/conduwuit.service @@ -4,8 +4,8 @@ After=network-online.target [Service] DynamicUser=yes -User=_matrix-conduit -Group=_matrix-conduit +User=_conduwuit +Group=_conduwuit Type=notify AmbientCapabilities= @@ -44,9 +44,9 @@ StateDirectory=matrix-conduit RuntimeDirectory=conduit RuntimeDirectoryMode=0750 -Environment="CONDUIT_CONFIG=/etc/matrix-conduit/conduit.toml" +Environment="CONDUIT_CONFIG=/etc/conduwuit/conduwuit.toml" -ExecStart=/usr/sbin/matrix-conduit +ExecStart=/usr/sbin/conduwuit Restart=on-failure RestartSec=5 diff --git a/debian/config b/debian/config index 8710ef97..8e605873 100644 --- a/debian/config +++ b/debian/config @@ -5,13 +5,13 @@ set -e . /usr/share/debconf/confmodule # Ask for the Matrix homeserver name, address and port. -db_input high matrix-conduit/hostname || true +db_input high conduwuit/hostname || true db_go -db_input low matrix-conduit/address || true +db_input low conduwuit/address || true db_go -db_input medium matrix-conduit/port || true +db_input medium conduwuit/port || true db_go exit 0 diff --git a/debian/postinst b/debian/postinst index cf73fe1d..a91e136c 100644 --- a/debian/postinst +++ b/debian/postinst @@ -3,26 +3,26 @@ set -e . /usr/share/debconf/confmodule -CONDUIT_DATABASE_PATH=/var/lib/matrix-conduit/ +CONDUWUIT_DATABASE_PATH=/var/lib/conduwuit/ case "$1" in configure) - # Create the `_matrix-conduit` user if it does not exist yet. - if ! getent passwd _matrix-conduit > /dev/null ; then - echo 'Adding system user for the Conduwuit Matrix homeserver' 1>&2 + # 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 adduser --system --group --quiet \ - --home "$CONDUIT_DATABASE_PATH" \ + --home "$CONDUWUIT_DATABASE_PATH" \ --disabled-login \ --shell "/usr/sbin/nologin" \ --force-badname \ - _matrix-conduit + _conduwuit fi # Create the database path if it does not exist yet and fix up ownership # and permissions. - mkdir -p "$CONDUIT_DATABASE_PATH" - chown _matrix-conduit:_matrix-conduit -R "$CONDUIT_DATABASE_PATH" - chmod 700 "$CONDUIT_DATABASE_PATH" + mkdir -p "$CONDUWUIT_DATABASE_PATH" + chown _conduwuit:_conduwuit -R "$CONDUWUIT_DATABASE_PATH" + chmod 700 "$CONDUWUIT_DATABASE_PATH" ;; esac diff --git a/debian/postrm b/debian/postrm index 28949091..1feb6815 100644 --- a/debian/postrm +++ b/debian/postrm @@ -3,8 +3,8 @@ set -e . /usr/share/debconf/confmodule -CONDUIT_CONFIG_PATH=/etc/matrix-conduit -CONDUIT_DATABASE_PATH=/var/lib/matrix-conduit +CONDUWUIT_CONFIG_PATH=/etc/conduwuit +CONDUWUIT_DATABASE_PATH=/var/lib/conduwuit case $1 in purge) @@ -14,12 +14,12 @@ case $1 in # Per https://www.debian.org/doc/debian-policy/ch-files.html#behavior # "configuration files must be preserved when the package is removed, and # only deleted when the package is purged." - if [ -d "$CONDUIT_CONFIG_PATH" ]; then - rm -r "$CONDUIT_CONFIG_PATH" + if [ -d "$CONDUWUIT_CONFIG_PATH" ]; then + rm -r "$CONDUWUIT_CONFIG_PATH" fi - if [ -d "$CONDUIT_DATABASE_PATH" ]; then - rm -r "$CONDUIT_DATABASE_PATH" + if [ -d "$CONDUWUIT_DATABASE_PATH" ]; then + rm -r "$CONDUWUIT_DATABASE_PATH" fi ;; esac diff --git a/debian/templates b/debian/templates index c4281ad3..1aa82674 100644 --- a/debian/templates +++ b/debian/templates @@ -1,4 +1,4 @@ -Template: matrix-conduit/hostname +Template: conduwuit/hostname Type: string Default: localhost Description: The server (host)name of the Matrix homeserver @@ -7,14 +7,14 @@ Description: The server (host)name of the Matrix homeserver If set to "localhost", you can connect with a client locally and clients from other hosts and also other homeservers will not be able to reach you! -Template: matrix-conduit/address +Template: conduwuit/address Type: string Default: 127.0.0.1 Description: The listen address of the Matrix homeserver This is the address the homeserver will listen on. Leave it set to 127.0.0.1 when using a reverse proxy. -Template: matrix-conduit/port +Template: conduwuit/port Type: string Default: 6167 Description: The port of the Matrix homeserver diff --git a/src/utils/debug.rs b/src/utils/debug.rs index 119a92ff..3974ae67 100644 --- a/src/utils/debug.rs +++ b/src/utils/debug.rs @@ -2,11 +2,11 @@ /// In release-mode it becomes DEBUG level, and possibly subject to elision. /// /// Release-mode can be simulated in debug-mode builds by enabling the feature -/// 'release_log_level'. +/// 'dev_release_log_level'. #[macro_export] macro_rules! debug_event { ( $level:expr, $($x:tt)+ ) => { - if cfg!(debug_assertions) && cfg!(not(feature = "release_log_level")) { + if cfg!(debug_assertions) && cfg!(not(feature = "dev_release_log_level")) { tracing::event!( $level, $($x)+ ); } else { tracing::debug!( $($x)+ );