rename release_log_level dev feature to dev_release_log_level, some rebranding

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-25 00:09:50 -04:00 committed by June
parent 76ab8ca69b
commit d55015ccda
8 changed files with 47 additions and 50 deletions

View file

@ -6,7 +6,7 @@ authors = [
"strawberry <strawberry@puppygock.gay>", "strawberry <strawberry@puppygock.gay>",
"timokoesters <timo@koesters.xyz>", "timokoesters <timo@koesters.xyz>",
] ]
homepage = "https://puppygock.gay/conduwuit" homepage = "https://conduwuit.puppyirl.gay/"
repository = "https://github.com/girlbossceo/conduwuit" repository = "https://github.com/girlbossceo/conduwuit"
readme = "README.md" readme = "README.md"
version = "0.3.0" version = "0.3.0"
@ -250,7 +250,7 @@ features = ["std", "derive", "help", "usage", "error-context", "string"]
version = "0.3.30" version = "0.3.30"
default-features = false 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] [dependencies.figment]
version = "0.10.18" version = "0.10.18"
features = ["env", "toml"] features = ["env", "toml"]
@ -388,7 +388,7 @@ release_max_log_level = [
] ]
# developer feature useful only in debug builds. # developer feature useful only in debug builds.
release_log_level = [] dev_release_log_level = []
# client/server interopability hacks # client/server interopability hacks
# #
@ -397,9 +397,9 @@ element_hacks = []
[package.metadata.deb] [package.metadata.deb]
name = "matrix-conduit" name = "conduwuit"
maintainer = "strawberry <strawberry@puppygock.gay>" maintainer = "strawberry <strawberry@puppygock.gay>"
copyright = "2024, Timo Kösters <timo@koesters.xyz>" copyright = "2024, strawberry <strawberry@puppygock.gay>"
license-file = ["LICENSE", "3"] license-file = ["LICENSE", "3"]
depends = "$auto, ca-certificates" depends = "$auto, ca-certificates"
extended-description = """\ extended-description = """\
@ -409,28 +409,28 @@ priority = "optional"
assets = [ assets = [
[ [
"debian/README.md", "debian/README.md",
"usr/share/doc/matrix-conduit/README.Debian", "usr/share/doc/conduwuit/README.Debian",
"644", "644",
], ],
[ [
"README.md", "README.md",
"usr/share/doc/matrix-conduit/", "usr/share/doc/conduwuit/",
"644", "644",
], ],
[ [
"target/release/conduit", "target/release/conduit",
"usr/sbin/matrix-conduit", "usr/sbin/conduwuit",
"755", "755",
], ],
[ [
"conduwuit-example.toml", "conduwuit-example.toml",
"etc/matrix-conduit/conduit.toml", "etc/conduwuit/conduwuit.toml",
"640", "640",
], ],
] ]
conf-files = ["/etc/matrix-conduit/conduit.toml"] conf-files = ["/etc/conduwuit/conduwuit.toml"]
maintainer-scripts = "debian/" maintainer-scripts = "debian/"
systemd-units = { unit-name = "matrix-conduit" } systemd-units = { unit-name = "conduwuit" }
[profile.dev] [profile.dev]

21
debian/README.md vendored
View file

@ -5,7 +5,7 @@ Installation
------------ ------------
Information about downloading, building and deploying the Debian package, see 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 All following sections until "Setting up the Reverse Proxy" be ignored because
this is handled automatically by the packaging. this is handled automatically by the packaging.
@ -14,24 +14,21 @@ Configuration
When installed, Debconf generates the configuration of the homeserver When installed, Debconf generates the configuration of the homeserver
(host)name, the address and port it listens on. This configuration ends up in (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 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. file size for download/upload, enabling federation, etc.
Running Running
------- -------
The package uses the `matrix-conduit.service` systemd unit file to start and The package uses the `conduwuit.service` systemd unit file to start and
stop Conduit. It loads the configuration file mentioned above to set up the stop conduwuit. It loads the configuration file mentioned above to set up the
environment before running the server. environment before running the server.
This package assumes by default that Conduit will be placed behind a reverse This package assumes by default that conduwuit will be placed behind a reverse
proxy such as Apache or nginx. This default deployment entails just listening 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 on `127.0.0.1` and the free port `6167` and is reachable via a client using the URL
<http://localhost:6167>. <http://localhost:6167>. Matrix federation requires TLS, so you will need to set up
some certificates and renewal, for it to work properly.
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.

View file

@ -4,8 +4,8 @@ After=network-online.target
[Service] [Service]
DynamicUser=yes DynamicUser=yes
User=_matrix-conduit User=_conduwuit
Group=_matrix-conduit Group=_conduwuit
Type=notify Type=notify
AmbientCapabilities= AmbientCapabilities=
@ -44,9 +44,9 @@ StateDirectory=matrix-conduit
RuntimeDirectory=conduit RuntimeDirectory=conduit
RuntimeDirectoryMode=0750 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 Restart=on-failure
RestartSec=5 RestartSec=5

6
debian/config vendored
View file

@ -5,13 +5,13 @@ set -e
. /usr/share/debconf/confmodule . /usr/share/debconf/confmodule
# Ask for the Matrix homeserver name, address and port. # 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_go
db_input low matrix-conduit/address || true db_input low conduwuit/address || true
db_go db_go
db_input medium matrix-conduit/port || true db_input medium conduwuit/port || true
db_go db_go
exit 0 exit 0

18
debian/postinst vendored
View file

@ -3,26 +3,26 @@ set -e
. /usr/share/debconf/confmodule . /usr/share/debconf/confmodule
CONDUIT_DATABASE_PATH=/var/lib/matrix-conduit/ CONDUWUIT_DATABASE_PATH=/var/lib/conduwuit/
case "$1" in case "$1" in
configure) configure)
# Create the `_matrix-conduit` user if it does not exist yet. # Create the `_conduwuit` user if it does not exist yet.
if ! getent passwd _matrix-conduit > /dev/null ; then if ! getent passwd _conduwuit > /dev/null ; then
echo 'Adding system user for the Conduwuit Matrix homeserver' 1>&2 echo 'Adding system user for the conduwuit Matrix homeserver' 1>&2
adduser --system --group --quiet \ adduser --system --group --quiet \
--home "$CONDUIT_DATABASE_PATH" \ --home "$CONDUWUIT_DATABASE_PATH" \
--disabled-login \ --disabled-login \
--shell "/usr/sbin/nologin" \ --shell "/usr/sbin/nologin" \
--force-badname \ --force-badname \
_matrix-conduit _conduwuit
fi fi
# Create the database path if it does not exist yet and fix up ownership # Create the database path if it does not exist yet and fix up ownership
# and permissions. # and permissions.
mkdir -p "$CONDUIT_DATABASE_PATH" mkdir -p "$CONDUWUIT_DATABASE_PATH"
chown _matrix-conduit:_matrix-conduit -R "$CONDUIT_DATABASE_PATH" chown _conduwuit:_conduwuit -R "$CONDUWUIT_DATABASE_PATH"
chmod 700 "$CONDUIT_DATABASE_PATH" chmod 700 "$CONDUWUIT_DATABASE_PATH"
;; ;;
esac esac

12
debian/postrm vendored
View file

@ -3,8 +3,8 @@ set -e
. /usr/share/debconf/confmodule . /usr/share/debconf/confmodule
CONDUIT_CONFIG_PATH=/etc/matrix-conduit CONDUWUIT_CONFIG_PATH=/etc/conduwuit
CONDUIT_DATABASE_PATH=/var/lib/matrix-conduit CONDUWUIT_DATABASE_PATH=/var/lib/conduwuit
case $1 in case $1 in
purge) purge)
@ -14,12 +14,12 @@ case $1 in
# Per https://www.debian.org/doc/debian-policy/ch-files.html#behavior # Per https://www.debian.org/doc/debian-policy/ch-files.html#behavior
# "configuration files must be preserved when the package is removed, and # "configuration files must be preserved when the package is removed, and
# only deleted when the package is purged." # only deleted when the package is purged."
if [ -d "$CONDUIT_CONFIG_PATH" ]; then if [ -d "$CONDUWUIT_CONFIG_PATH" ]; then
rm -r "$CONDUIT_CONFIG_PATH" rm -r "$CONDUWUIT_CONFIG_PATH"
fi fi
if [ -d "$CONDUIT_DATABASE_PATH" ]; then if [ -d "$CONDUWUIT_DATABASE_PATH" ]; then
rm -r "$CONDUIT_DATABASE_PATH" rm -r "$CONDUWUIT_DATABASE_PATH"
fi fi
;; ;;
esac esac

6
debian/templates vendored
View file

@ -1,4 +1,4 @@
Template: matrix-conduit/hostname Template: conduwuit/hostname
Type: string Type: string
Default: localhost Default: localhost
Description: The server (host)name of the Matrix homeserver 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 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! from other hosts and also other homeservers will not be able to reach you!
Template: matrix-conduit/address Template: conduwuit/address
Type: string Type: string
Default: 127.0.0.1 Default: 127.0.0.1
Description: The listen address of the Matrix homeserver 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 This is the address the homeserver will listen on. Leave it set to 127.0.0.1
when using a reverse proxy. when using a reverse proxy.
Template: matrix-conduit/port Template: conduwuit/port
Type: string Type: string
Default: 6167 Default: 6167
Description: The port of the Matrix homeserver Description: The port of the Matrix homeserver

View file

@ -2,11 +2,11 @@
/// In release-mode it becomes DEBUG level, and possibly subject to elision. /// 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-mode can be simulated in debug-mode builds by enabling the feature
/// 'release_log_level'. /// 'dev_release_log_level'.
#[macro_export] #[macro_export]
macro_rules! debug_event { macro_rules! debug_event {
( $level:expr, $($x:tt)+ ) => { ( $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)+ ); tracing::event!( $level, $($x)+ );
} else { } else {
tracing::debug!( $($x)+ ); tracing::debug!( $($x)+ );