diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0cc2bfef..b5fa56e4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,29 +1,46 @@ # Contributing guide -This page is for about contributing to conduwuit. The [development](development.md) page may be of interest for you as well. +This page is for about contributing to conduwuit. The +[development](development.md) page may be of interest for you as well. -If you would like to work on an [issue][issues] that is not assigned, preferably ask in the Matrix room first at [#conduwuit:puppygock.gay][conduwuit-matrix], and comment on it. +If you would like to work on an [issue][issues] that is not assigned, preferably +ask in the Matrix room first at [#conduwuit:puppygock.gay][conduwuit-matrix], +and comment on it. ### Linting and Formatting -It is mandatory all your changes satisfy the lints (clippy, rustc, rustdoc, etc) and your code is formatted via the **nightly** `cargo fmt`. A lot of the `rustfmt.toml` features depend on nightly toolchain. It would be ideal if they weren't nightly-exclusive features, but they currently still are. CI's rustfmt uses nightly. +It is mandatory all your changes satisfy the lints (clippy, rustc, rustdoc, etc) +and your code is formatted via the **nightly** `cargo fmt`. A lot of the +`rustfmt.toml` features depend on nightly toolchain. It would be ideal if they +weren't nightly-exclusive features, but they currently still are. CI's rustfmt +uses nightly. -If you need to allow a lint, please make sure it's either obvious as to why (e.g. clippy saying redundant clone but it's actually required) or it has a comment saying why. Do not write inefficient code for the sake of satisfying lints. If a lint is wrong and provides a more inefficient solution or suggestion, allow the lint and mention that in a comment. +If you need to allow a lint, please make sure it's either obvious as to why +(e.g. clippy saying redundant clone but it's actually required) or it has a +comment saying why. Do not write inefficient code for the sake of satisfying +lints. If a lint is wrong and provides a more inefficient solution or +suggestion, allow the lint and mention that in a comment. ### Running CI tests locally -conduwuit's CI for tests, linting, formatting, audit, etc use [`engage`][engage]. engage can be installed from nixpkgs or `cargo install engage`. conduwuit's Nix flake devshell has the nixpkgs engage with `direnv`. Use `engage --help` for more usage details. +conduwuit's CI for tests, linting, formatting, audit, etc use +[`engage`][engage]. engage can be installed from nixpkgs or `cargo install +engage`. conduwuit's Nix flake devshell has the nixpkgs engage with `direnv`. +Use `engage --help` for more usage details. -To test, format, lint, etc that CI would do, install engage, allow the `.envrc` file using `direnv allow`, and run `engage`. +To test, format, lint, etc that CI would do, install engage, allow the `.envrc` +file using `direnv allow`, and run `engage`. -All of the tasks are defined at the [engage.toml][engage.toml] file. You can view all of them neatly by running `engage list` +All of the tasks are defined at the [engage.toml][engage.toml] file. You can +view all of them neatly by running `engage list` If you would like to run only a specific engage task group, use `just`: - `engage just ` - Example: `engage just lints` -If you would like to run a specific engage task in a specific group, use `just [TASK]`: `engage just lints cargo-fmt` +If you would like to run a specific engage task in a specific group, use `just + [TASK]`: `engage just lints cargo-fmt` The following binaries are used in [`engage.toml`][engage.toml]: @@ -43,43 +60,75 @@ The following binaries are used in [`engage.toml`][engage.toml]: ### Matrix tests -CI runs [Complement][complement], but currently does not fail if results from the checked-in results differ with the new results. If your changes are done to fix Matrix tests, note that in your pull request. If more Complement tests start failing from your changes, please review the logs (they are uploaded as artifacts) and determine if they're intended or not. +CI runs [Complement][complement], but currently does not fail if results from +the checked-in results differ with the new results. If your changes are done to +fix Matrix tests, note that in your pull request. If more Complement tests start +failing from your changes, please review the logs (they are uploaded as +artifacts) and determine if they're intended or not. -If you'd like to run Complement locally using Nix, see the [testing](docs/development/testing.md) page. +If you'd like to run Complement locally using Nix, see the +[testing](docs/development/testing.md) page. [Sytest][sytest] support will come soon. ### Writing documentation -conduwuit's website uses [`mdbook`][mdbook] and deployed via CI using GitHub Pages in the [`documentation.yml`][documentation.yml] workflow file with Nix's mdbook in the devshell. All documentation is in the `docs/` directory at the top level. The compiled mdbook website is also uploaded as an artifact. +conduwuit's website uses [`mdbook`][mdbook] and deployed via CI using GitHub +Pages in the [`documentation.yml`][documentation.yml] workflow file with Nix's +mdbook in the devshell. All documentation is in the `docs/` directory at the top +level. The compiled mdbook website is also uploaded as an artifact. To build the documentation using Nix, run: `bin/nix-build-and-cache just .#book` -The output of the mdbook generation is in `result/`. mdbooks can be opened in your browser from the individual HTML files without any web server needed. +The output of the mdbook generation is in `result/`. mdbooks can be opened in +your browser from the individual HTML files without any web server needed. ### Inclusivity and Diversity -All **MUST** code and write with inclusivity and diversity in mind. See the [following page by Google on writing inclusive code and documentation](https://developers.google.com/style/inclusive-documentation). +All **MUST** code and write with inclusivity and diversity in mind. See the +[following page by Google on writing inclusive code and +documentation](https://developers.google.com/style/inclusive-documentation). -This **EXPLICITLY** forbids usage of terms like "blacklist"/"whitelist" and "master"/"slave", [forbids gender-specific words and phrases](https://developers.google.com/style/pronouns#gender-neutral-pronouns), forbids ableist language like "sanity-check", "cripple", or "insane", and forbids culture-specific language (e.g. US-only holidays or cultures). +This **EXPLICITLY** forbids usage of terms like "blacklist"/"whitelist" and +"master"/"slave", [forbids gender-specific words and +phrases](https://developers.google.com/style/pronouns#gender-neutral-pronouns), +forbids ableist language like "sanity-check", "cripple", or "insane", and +forbids culture-specific language (e.g. US-only holidays or cultures). -No exceptions are allowed. Dependencies that may use these terms are allowed but [do not replicate the name in your functions or variables](https://developers.google.com/style/inclusive-documentation#write-around). +No exceptions are allowed. Dependencies that may use these terms are allowed but +[do not replicate the name in your functions or +variables](https://developers.google.com/style/inclusive-documentation#write-around). -In addition to language, write and code with the user experience in mind. This is software that intends to be used by everyone, so make it easy and comfortable for everyone to use. 🏳️‍⚧️ +In addition to language, write and code with the user experience in mind. This +is software that intends to be used by everyone, so make it easy and comfortable +for everyone to use. 🏳️‍⚧️ ### Variable, comment, function, etc standards -Rust's default style and standards with regards to [function names, variable names, comments](https://rust-lang.github.io/api-guidelines/naming.html), etc applies here. +Rust's default style and standards with regards to [function names, variable +names, comments](https://rust-lang.github.io/api-guidelines/naming.html), etc +applies here. ### Creating pull requests -Please try to keep contributions to the GitHub. While the mirrors of conduwuit allow for pull/merge requests, there is no guarantee I will see them in a timely manner. Additionally, please mark WIP or unfinished or incomplete PRs as drafts. This prevents me from having to ping once in a while to double check the status of it, especially when the CI completed successfully and everything so it *looks* done. +Please try to keep contributions to the GitHub. While the mirrors of conduwuit +allow for pull/merge requests, there is no guarantee I will see them in a timely +manner. Additionally, please mark WIP or unfinished or incomplete PRs as drafts. +This prevents me from having to ping once in a while to double check the status +of it, especially when the CI completed successfully and everything so it +*looks* done. -If you open a pull request on one of the mirrors, it is your responsibility to inform me about its existence. In the future I may try to solve this with more repo bots in the conduwuit Matrix room. There is no mailing list or email-patch support on the sr.ht mirror, but if you'd like to email me a git patch you can do so at `strawberry@puppygock.gay`. +If you open a pull request on one of the mirrors, it is your responsibility to +inform me about its existence. In the future I may try to solve this with more +repo bots in the conduwuit Matrix room. There is no mailing list or email-patch +support on the sr.ht mirror, but if you'd like to email me a git patch you can +do so at `strawberry@puppygock.gay`. Direct all PRs/MRs to the `main` branch. -By sending a pull request or patch, you are agreeing that your changes are allowed to be licenced under the Apache-2.0 licence and all of your conduct is in line with the Contributor's Covenant. +By sending a pull request or patch, you are agreeing that your changes are +allowed to be licenced under the Apache-2.0 licence and all of your conduct is +in line with the Contributor's Covenant. [issues]: https://github.com/girlbossceo/conduwuit/issues [conduwuit-matrix]: https://matrix.to/#/#conduwuit:puppygock.gay diff --git a/README.md b/README.md index 7da24dc9..3e0ea593 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # conduwuit -`main` / stable: [![CI and Artifacts](https://github.com/girlbossceo/conduwuit/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/girlbossceo/conduwuit/actions/workflows/ci.yml) +`main` / stable: [![CI and +Artifacts](https://github.com/girlbossceo/conduwuit/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/girlbossceo/conduwuit/actions/workflows/ci.yml) - -### a very cool, featureful fork of [Conduit](https://conduit.rs/) - + ### a very cool, featureful fork of +[Conduit](https://conduit.rs/) -Visit the [Conduwuit documentation](https://conduwuit.puppyirl.gay/) for more information. +Visit the [Conduwuit documentation](https://conduwuit.puppyirl.gay/) for more +information. - -#### What is Matrix? + #### What is Matrix? [Matrix](https://matrix.org) is an open network for secure and decentralized communication. Users from every Matrix homeserver can chat with users from all @@ -18,29 +18,32 @@ to communicate with users outside of Matrix, like a community on Discord. #### What is the goal? -An efficient Matrix homeserver that's easy to set up and just works. You can install -it on a mini-computer like the Raspberry Pi to host Matrix for your family, -friends or company. +An efficient Matrix homeserver that's easy to set up and just works. You can +install it on a mini-computer like the Raspberry Pi to host Matrix for your +family, friends or company. #### Can I try it out? -An official conduwuit server ran by me is available at transfem.dev ([element.transfem.dev](https://element.transfem.dev) / [cinny.transfem.dev](https://cinny.transfem.dev)) +An official conduwuit server ran by me is available at transfem.dev +([element.transfem.dev](https://element.transfem.dev) / +[cinny.transfem.dev](https://cinny.transfem.dev)) -transfem.dev is a public homeserver that can be used, it is not a "test only homeserver". This means there are rules, so please read the rules: [https://transfem.dev/homeserver_rules.txt](https://transfem.dev/homeserver_rules.txt) +transfem.dev is a public homeserver that can be used, it is not a "test only +homeserver". This means there are rules, so please read the rules: +[https://transfem.dev/homeserver_rules.txt](https://transfem.dev/homeserver_rules.txt) -transfem.dev is also listed at [servers.joinmatrix.org](https://servers.joinmatrix.org/) +transfem.dev is also listed at +[servers.joinmatrix.org](https://servers.joinmatrix.org/) #### What is the current status? -conduwuit is a hard fork of Conduit which is in beta, meaning you can join and participate in most -Matrix rooms, but not all features are supported and you might run into bugs -from time to time. +conduwuit is a hard fork of Conduit which is in beta, meaning you can join and +participate in most Matrix rooms, but not all features are supported and you +might run into bugs from time to time. - - -#### Contact + #### Contact If you run into any question, feel free to @@ -55,7 +58,9 @@ If you run into any question, feel free to #### Logo -Original repo and Matrix room picture was from bran (<3). Current banner image and logo is directly from [this cohost post](https://cohost.org/RatBaby/post/1028290-finally-a-flag-for). +Original repo and Matrix room picture was from bran (<3). Current banner image +and logo is directly from [this cohost +post](https://cohost.org/RatBaby/post/1028290-finally-a-flag-for). #### Is it conduwuit or Conduwuit? @@ -68,5 +73,5 @@ Both, but I prefer conduwuit. - git.girlcock.ceo: - git.gay: - Codeberg: -- sourcehut: - +- sourcehut: diff --git a/docs/appservices.md b/docs/appservices.md index 839001eb..28ea9717 100644 --- a/docs/appservices.md +++ b/docs/appservices.md @@ -2,13 +2,15 @@ ## Getting help -If you run into any problems while setting up an Appservice: ask us in [#conduwuit:puppygock.gay](https://matrix.to/#/#conduwuit:puppygock.gay) or [open an issue on GitHub](https://github.com/girlbossceo/conduwuit/issues/new). +If you run into any problems while setting up an Appservice: ask us in +[#conduwuit:puppygock.gay](https://matrix.to/#/#conduwuit:puppygock.gay) or +[open an issue on GitHub](https://github.com/girlbossceo/conduwuit/issues/new). ## Set up the appservice - general instructions Follow whatever instructions are given by the appservice. This usually includes -downloading, changing its config (setting domain, homeserver url, port etc.) -and later starting it. +downloading, changing its config (setting domain, homeserver url, port etc.) and +later starting it. At some point the appservice guide should ask you to add a registration yaml file to the homeserver. In Synapse you would do this by adding the path to the diff --git a/docs/conduwuit_coc.md b/docs/conduwuit_coc.md index 1bd519c9..5f71a257 100644 --- a/docs/conduwuit_coc.md +++ b/docs/conduwuit_coc.md @@ -1,75 +1,92 @@ # conduwuit Community Code of Conduct -Welcome to the conduwuit community! We’re excited to have you here. conduwuit is a hard-fork of the Conduit homeserver, -aimed at making Matrix more accessible and inclusive for everyone. +Welcome to the conduwuit community! We’re excited to have you here. conduwuit is +a hard-fork of the Conduit homeserver, aimed at making Matrix more accessible +and inclusive for everyone. -This space is dedicated to fostering a positive, supportive, and inclusive environment for everyone. This Code of -Conduct applies to all conduwuit spaces, including any further community rooms that reference this CoC. Here are our +This space is dedicated to fostering a positive, supportive, and inclusive +environment for everyone. This Code of Conduct applies to all conduwuit spaces, +including any further community rooms that reference this CoC. Here are our guidelines to help maintain the welcoming atmosphere that sets conduwuit apart. -For the general foundational rules, please refer to the [Contributor's Covenant](https://github.com/girlbossceo/conduwuit/blob/main/CODE_OF_CONDUCT.md). +For the general foundational rules, please refer to the [Contributor's +Covenant](https://github.com/girlbossceo/conduwuit/blob/main/CODE_OF_CONDUCT.md). Below are additional guidelines specific to the conduwuit community. ## Our Values and Guidelines -1. **Respect and Inclusivity**: We are committed to maintaining a community where everyone feels safe and respected. - Discrimination, harassment, or hate speech of any kind will not be tolerated. Recognise that each community member - experiences the world differently based on their past experiences, background, and identity. Share your own - experiences and be open to learning about others' diverse perspectives. +1. **Respect and Inclusivity**: We are committed to maintaining a community + where everyone feels safe and respected. Discrimination, harassment, or hate +speech of any kind will not be tolerated. Recognise that each community member +experiences the world differently based on their past experiences, background, +and identity. Share your own experiences and be open to learning about others' +diverse perspectives. -2. **Positivity and Constructiveness**: Engage in constructive discussions and support each other. If you feel angry, - negative, or aggressive, take a break until you can participate in a positive and constructive manner. Process - intense feelings with a friend or in a private setting before engaging in community conversations to help maintain - a supportive and focused environment. +2. **Positivity and Constructiveness**: Engage in constructive discussions and + support each other. If you feel angry, negative, or aggressive, take a break +until you can participate in a positive and constructive manner. Process intense +feelings with a friend or in a private setting before engaging in community +conversations to help maintain a supportive and focused environment. -3. **Clarity and Understanding**: Our community includes neurodivergent individuals and those who may not appreciate - sarcasm or subtlety. Communicate clearly and kindly, avoiding sarcasm and ensuring your messages are easily - understood by all. Additionally, avoid putting the burden of education on marginalized groups by doing your own - research before asking for explanations. +3. **Clarity and Understanding**: Our community includes neurodivergent + individuals and those who may not appreciate sarcasm or subtlety. Communicate +clearly and kindly, avoiding sarcasm and ensuring your messages are easily +understood by all. Additionally, avoid putting the burden of education on +marginalized groups by doing your own research before asking for explanations. -4. **Be Open to Inclusivity**: Actively engage in conversations about making our community more inclusive. Report - discriminatory behavior to the moderators and be open to constructive feedback that aims to improve our community. - Understand that discussing discrimination and negative experiences can be emotionally taxing, so focus on the - message rather than critiquing the tone used. +4. **Be Open to Inclusivity**: Actively engage in conversations about making our + community more inclusive. Report discriminatory behavior to the moderators +and be open to constructive feedback that aims to improve our community. +Understand that discussing discrimination and negative experiences can be +emotionally taxing, so focus on the message rather than critiquing the tone +used. -5. **Commit to Inclusivity**: Building an inclusive community requires time, energy, and resources. Recognise that - addressing discrimination and bias is an ongoing process that necessitates commitment and action from all community - members. +5. **Commit to Inclusivity**: Building an inclusive community requires time, + energy, and resources. Recognise that addressing discrimination and bias is +an ongoing process that necessitates commitment and action from all community +members. ## Matrix Community -This Code of Conduct applies to the entire [conduwuit Matrix Space](https://matrix.to/#/#conduwuit-space:puppygock.gay) -and its rooms, including: +This Code of Conduct applies to the entire [conduwuit Matrix +Space](https://matrix.to/#/#conduwuit-space:puppygock.gay) and its rooms, +including: ### [#conduwuit:puppygock.gay](https://matrix.to/#/#conduwuit:puppygock.gay) -This room is for support and discussions about conduwuit. Ask questions, share insights, and help each other out. +This room is for support and discussions about conduwuit. Ask questions, share +insights, and help each other out. ### [#conduwuit-offtopic:girlboss.ceo](https://matrix.to/#/#conduwuit-offtopic:girlboss.ceo) -For off-topic community conversations about any subject. While this room allows for a wide range of topics, the same -CoC applies. Keep discussions respectful and inclusive, and avoid divisive subjects like country/world politics. -General topics, such as world events, are welcome as long as they follow the CoC. +For off-topic community conversations about any subject. While this room allows +for a wide range of topics, the same CoC applies. Keep discussions respectful +and inclusive, and avoid divisive subjects like country/world politics. General +topics, such as world events, are welcome as long as they follow the CoC. ### [#conduwuit-dev:puppygock.gay](https://matrix.to/#/#conduwuit-dev:puppygock.gay) -This room is dedicated to discussing active development of conduwuit. Posting requires an elevated power level, which -can be requested in one of the other rooms. Use this space to collaborate and innovate. +This room is dedicated to discussing active development of conduwuit. Posting +requires an elevated power level, which can be requested in one of the other +rooms. Use this space to collaborate and innovate. ## Enforcement -We have a zero-tolerance policy for violations of this Code of Conduct. If someone’s behavior makes you uncomfortable, -please report it to the moderators. Actions we may take include: +We have a zero-tolerance policy for violations of this Code of Conduct. If +someone’s behavior makes you uncomfortable, please report it to the moderators. +Actions we may take include: -1. **Warning**: A warning given directly in the room or via a private message from the moderators, identifying - the violation and requesting corrective action. -2. **Temporary Mute**: Temporary restriction from participating in discussions for a specified period to allow for - reflection and cooling off. -3. **Kick or Ban**: Egregious behavior may result in an immediate kick or ban to protect other community members. - Bans are considered permanent and will only be reversed in exceptional circumstances after proven good behavior. +1. **Warning**: A warning given directly in the room or via a private message + from the moderators, identifying the violation and requesting corrective +action. +2. **Temporary Mute**: Temporary restriction from participating in discussions + for a specified period to allow for reflection and cooling off. +3. **Kick or Ban**: Egregious behavior may result in an immediate kick or ban to + protect other community members. Bans are considered permanent and will only +be reversed in exceptional circumstances after proven good behavior. -Please highlight issues directly in rooms when possible, but if you don't feel comfortable doing that, then please send -a DM to one of the moderators directly. +Please highlight issues directly in rooms when possible, but if you don't feel +comfortable doing that, then please send a DM to one of the moderators directly. Together, let’s build a community where everyone feels valued and respected. diff --git a/docs/configuration.md b/docs/configuration.md index cf3ce00b..78646ee3 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -4,20 +4,27 @@ This chapter describes various ways to configure conduwuit. ## Basics -conduwuit uses a config file for the majority of the settings, but also supports setting individual config options via commandline. +conduwuit uses a config file for the majority of the settings, but also supports +setting individual config options via commandline. -Please refer to the [example config file](./configuration/examples.md#example-configuration) for all of those settings. +Please refer to the [example config +file](./configuration/examples.md#example-configuration) for all of those +settings. -The config file to use can be specified on the commandline when running conduwuit by specifying the -`-c`, `--config` flag. Alternatively, you can use the environment variable `CONDUWUIT_CONFIG` to specify the config -file to used. Conduit's environment variables are supported for backwards compatibility. +The config file to use can be specified on the commandline when running +conduwuit by specifying the `-c`, `--config` flag. Alternatively, you can use +the environment variable `CONDUWUIT_CONFIG` to specify the config file to used. +Conduit's environment variables are supported for backwards compatibility. ## Option commandline flag -conduwuit supports setting individual config options in TOML format from the `-O` / `--option` flag. For example, you can set your server name via `-O server_name=\"example.com\"`. +conduwuit supports setting individual config options in TOML format from the +`-O` / `--option` flag. For example, you can set your server name via `-O +server_name=\"example.com\"`. -Note that the config is parsed as TOML, and shells like bash will remove quotes. So unfortunately it is required to escape quotes if the config option takes a string. -This does not apply to options that take booleans or numbers: +Note that the config is parsed as TOML, and shells like bash will remove quotes. +So unfortunately it is required to escape quotes if the config option takes a +string. This does not apply to options that take booleans or numbers: - `--option allow_registration=true` works ✅ - `-O max_request_size=99999999` works ✅ - `-O server_name=example.com` does not work ❌ @@ -27,12 +34,15 @@ This does not apply to options that take booleans or numbers: ## Environment variables -All of the settings that are found in the config file can be specified by using environment variables. -The environment variable names should be all caps and prefixed with `CONDUWUIT_`. +All of the settings that are found in the config file can be specified by using +environment variables. The environment variable names should be all caps and +prefixed with `CONDUWUIT_`. -For example, if the setting you are changing is `max_request_size`, then the environment variable to set is -`CONDUWUIT_MAX_REQUEST_SIZE`. +For example, if the setting you are changing is `max_request_size`, then the +environment variable to set is `CONDUWUIT_MAX_REQUEST_SIZE`. -To modify config options not in the `[global]` context such as `[global.well_known]`, use the `__` suffix split: `CONDUWUIT_WELL_KNOWN__SERVER` +To modify config options not in the `[global]` context such as +`[global.well_known]`, use the `__` suffix split: `CONDUWUIT_WELL_KNOWN__SERVER` -Conduit's environment variables are supported for backwards compatibility (e.g. `CONDUIT_SERVER_NAME`). +Conduit's environment variables are supported for backwards compatibility (e.g. +`CONDUIT_SERVER_NAME`). diff --git a/docs/deploying/arch-linux.md b/docs/deploying/arch-linux.md index e65c2c92..7436e5bf 100644 --- a/docs/deploying/arch-linux.md +++ b/docs/deploying/arch-linux.md @@ -2,8 +2,14 @@ Currently conduwuit is only on the Arch User Repository (AUR). -The conduwuit AUR packages are community maintained and are not maintained by conduwuit development team, but the AUR package maintainers are in the Matrix room. Please attempt to verify your AUR package's PKGBUILD file looks fine before asking for support. +The conduwuit AUR packages are community maintained and are not maintained by +conduwuit development team, but the AUR package maintainers are in the Matrix +room. Please attempt to verify your AUR package's PKGBUILD file looks fine +before asking for support. -- [conduwuit](https://aur.archlinux.org/packages/conduwuit) - latest tagged conduwuit -- [conduwuit-git](https://aur.archlinux.org/packages/conduwuit-git) - latest git conduwuit from `main` branch -- [conduwuit-bin](https://aur.archlinux.org/packages/conduwuit-bin) - latest tagged conduwuit static binary +- [conduwuit](https://aur.archlinux.org/packages/conduwuit) - latest tagged +conduwuit +- [conduwuit-git](https://aur.archlinux.org/packages/conduwuit-git) - latest git +conduwuit from `main` branch +- [conduwuit-bin](https://aur.archlinux.org/packages/conduwuit-bin) - latest +tagged conduwuit static binary diff --git a/docs/deploying/docker.md b/docs/deploying/docker.md index 162d8a74..9fc8dc2f 100644 --- a/docs/deploying/docker.md +++ b/docs/deploying/docker.md @@ -2,20 +2,29 @@ ## Docker -To run conduwuit with Docker you can either build the image yourself or pull it from a registry. +To run conduwuit with Docker you can either build the image yourself or pull it +from a registry. ### Use a registry OCI images for conduwuit are available in the registries listed below. -| Registry | Image | Size | Notes | -| --------------- | --------------------------------------------------------------- | ----------------------------- | ---------------------- | -| GitHub Registry | [ghcr.io/girlbossceo/conduwuit:latest][gh] | ![Image Size][shield-latest] | Stable tagged image. | -| GitLab Registry | [registry.gitlab.com/conduwuit/conduwuit:latest][gl] | ![Image Size][shield-latest] | Stable tagged image. | -| Docker Hub | [docker.io/girlbossceo/conduwuit:latest][dh] | ![Image Size][shield-latest] | Stable tagged image. | -| GitHub Registry | [ghcr.io/girlbossceo/conduwuit:main][gh] | ![Image Size][shield-main] | Stable main branch. | -| GitLab Registry | [registry.gitlab.com/conduwuit/conduwuit:main][gl] | ![Image Size][shield-main] | Stable main branch. | -| Docker Hub | [docker.io/girlbossceo/conduwuit:main][dh] | ![Image Size][shield-main] | Stable main branch. | +| Registry | Image +| Size | Notes | | --------------- | +--------------------------------------------------------------- | +----------------------------- | ---------------------- | | GitHub Registry | +[ghcr.io/girlbossceo/conduwuit:latest][gh] | ![Image Size][shield-latest] | +Stable tagged image. | | GitLab Registry | +[registry.gitlab.com/conduwuit/conduwuit:latest][gl] | ![Image +Size][shield-latest] | Stable tagged image. | | Docker Hub | +[docker.io/girlbossceo/conduwuit:latest][dh] | ![Image +Size][shield-latest] | Stable tagged image. | | GitHub Registry | +[ghcr.io/girlbossceo/conduwuit:main][gh] | ![Image Size][shield-main] | +Stable main branch. | | GitLab Registry | +[registry.gitlab.com/conduwuit/conduwuit:main][gl] | ![Image +Size][shield-main] | Stable main branch. | | Docker Hub | +[docker.io/girlbossceo/conduwuit:main][dh] | ![Image +Size][shield-main] | Stable main branch. | [dh]: https://hub.docker.com/r/girlbossceo/conduwuit [gh]: https://github.com/girlbossceo/conduwuit/pkgs/container/conduwuit @@ -25,9 +34,7 @@ OCI images for conduwuit are available in the registries listed below. Use -```bash -docker image pull -``` +```bash docker image pull ``` to pull it to your machine. @@ -35,61 +42,77 @@ to pull it to your machine. When you have the image you can simply run it with -```bash -docker run -d -p 8448:6167 \ - -v db:/var/lib/conduwuit/ \ - -e CONDUWUIT_SERVER_NAME="your.server.name" \ - -e CONDUWUIT_DATABASE_BACKEND="rocksdb" \ - -e CONDUWUIT_ALLOW_REGISTRATION=false \ - --name conduit +```bash +docker run -d -p 8448:6167 \ + -v db:/var/lib/conduwuit/ \ + -e CONDUWUIT_SERVER_NAME="your.server.name" \ + -e CONDUWUIT_DATABASE_BACKEND="rocksdb" \ + -e CONDUWUIT_ALLOW_REGISTRATION=false \ + --name conduit ``` or you can use [docker compose](#docker-compose). -The `-d` flag lets the container run in detached mode. You may supply an optional `conduwuit.toml` config file, the example config can be found [here](../configuration/examples.md). -You can pass in different env vars to change config values on the fly. You can even configure conduwuit completely by using env vars. For an overview of possible -values, please take a look at the [`docker-compose.yml`](docker-compose.yml) file. +The `-d` flag lets the container run in detached mode. You may supply an +optional `conduwuit.toml` config file, the example config can be found +[here](../configuration/examples.md). You can pass in different env vars to +change config values on the fly. You can even configure conduwuit completely by +using env vars. For an overview of possible values, please take a look at the +[`docker-compose.yml`](docker-compose.yml) file. -If you just want to test conduwuit for a short time, you can use the `--rm` flag, which will clean up everything related to your container after you stop it. +If you just want to test conduwuit for a short time, you can use the `--rm` +flag, which will clean up everything related to your container after you stop +it. ### Docker-compose -If the `docker run` command is not for you or your setup, you can also use one of the provided `docker-compose` files. +If the `docker run` command is not for you or your setup, you can also use one +of the provided `docker-compose` files. Depending on your proxy setup, you can use one of the following files; -- If you already have a `traefik` instance set up, use [`docker-compose.for-traefik.yml`](docker-compose.for-traefik.yml) -- If you don't have a `traefik` instance set up and would like to use it, use [`docker-compose.with-traefik.yml`](docker-compose.with-traefik.yml) -- If you want a setup that works out of the box with `caddy-docker-proxy`, use [`docker-compose.with-caddy.yml`](docker-compose.with-caddy.yml) and replace all `example.com` placeholders with your own domain +- If you already have a `traefik` instance set up, use +[`docker-compose.for-traefik.yml`](docker-compose.for-traefik.yml) +- If you don't have a `traefik` instance set up and would like to use it, use +[`docker-compose.with-traefik.yml`](docker-compose.with-traefik.yml) +- If you want a setup that works out of the box with `caddy-docker-proxy`, use +[`docker-compose.with-caddy.yml`](docker-compose.with-caddy.yml) and replace all +`example.com` placeholders with your own domain - For any other reverse proxy, use [`docker-compose.yml`](docker-compose.yml) -When picking the traefik-related compose file, rename it so it matches `docker-compose.yml`, and -rename the override file to `docker-compose.override.yml`. Edit the latter with the values you want -for your server. +When picking the traefik-related compose file, rename it so it matches +`docker-compose.yml`, and rename the override file to +`docker-compose.override.yml`. Edit the latter with the values you want for your +server. -When picking the `caddy-docker-proxy` compose file, it's important to first create the `caddy` network before spinning up the containers: +When picking the `caddy-docker-proxy` compose file, it's important to first +create the `caddy` network before spinning up the containers: -```bash -docker network create caddy -``` +```bash docker network create caddy ``` -After that, you can rename it so it matches `docker-compose.yml` and spin up the containers! +After that, you can rename it so it matches `docker-compose.yml` and spin up the +containers! Additional info about deploying conduwuit can be found [here](generic.md). ### Build -To build the conduwuit image with docker-compose, you first need to open and modify the `docker-compose.yml` file. There you need to comment the `image:` option and uncomment the `build:` option. Then call docker compose with: +To build the conduwuit image with docker-compose, you first need to open and +modify the `docker-compose.yml` file. There you need to comment the `image:` +option and uncomment the `build:` option. Then call docker compose with: -```bash +```bash docker compose up ``` -This will also start the container right afterwards, so if want it to run in detached mode, you also should use the `-d` flag. +This will also start the container right afterwards, so if want it to run in +detached mode, you also should use the `-d` flag. ### Run -If you already have built the image or want to use one from the registries, you can just start the container and everything else in the compose file in detached mode with: +If you already have built the image or want to use one from the registries, you +can just start the container and everything else in the compose file in detached +mode with: ```bash docker compose up -d @@ -99,18 +122,21 @@ docker compose up -d ### Use Traefik as Proxy -As a container user, you probably know about Traefik. It is a easy to use reverse proxy for making -containerized app and services available through the web. With the two provided files, +As a container user, you probably know about Traefik. It is a easy to use +reverse proxy for making containerized app and services available through the +web. With the two provided files, [`docker-compose.for-traefik.yml`](docker-compose.for-traefik.yml) (or [`docker-compose.with-traefik.yml`](docker-compose.with-traefik.yml)) and -[`docker-compose.override.yml`](docker-compose.override.yml), it is equally easy to deploy -and use conduwuit, with a little caveat. If you already took a look at the files, then you should have -seen the `well-known` service, and that is the little caveat. Traefik is simply a proxy and -loadbalancer and is not able to serve any kind of content, but for conduwuit to federate, we need to -either expose ports `443` and `8448` or serve two endpoints `.well-known/matrix/client` and -`.well-known/matrix/server`. +[`docker-compose.override.yml`](docker-compose.override.yml), it is equally easy +to deploy and use conduwuit, with a little caveat. If you already took a look at +the files, then you should have seen the `well-known` service, and that is the +little caveat. Traefik is simply a proxy and loadbalancer and is not able to +serve any kind of content, but for conduwuit to federate, we need to either +expose ports `443` and `8448` or serve two endpoints `.well-known/matrix/client` +and `.well-known/matrix/server`. -With the service `well-known` we use a single `nginx` container that will serve those two files. +With the service `well-known` we use a single `nginx` container that will serve +those two files. ## Voice communication diff --git a/docs/deploying/freebsd.md b/docs/deploying/freebsd.md index 44a77566..4ac83515 100644 --- a/docs/deploying/freebsd.md +++ b/docs/deploying/freebsd.md @@ -1,8 +1,11 @@ # conduwuit for FreeBSD -conduwuit at the moment does not provide FreeBSD builds. Building conduwuit on FreeBSD requires a specific environment variable to use the -system prebuilt RocksDB library instead of rust-rocksdb / rust-librocksdb-sys which does *not* work and will cause a build error or coredump. +conduwuit at the moment does not provide FreeBSD builds. Building conduwuit on +FreeBSD requires a specific environment variable to use the system prebuilt +RocksDB library instead of rust-rocksdb / rust-librocksdb-sys which does *not* +work and will cause a build error or coredump. Use the following environment variable: `ROCKSDB_LIB_DIR=/usr/local/lib` -Such example commandline with it can be: `ROCKSDB_LIB_DIR=/usr/local/lib cargo build --release` +Such example commandline with it can be: `ROCKSDB_LIB_DIR=/usr/local/lib cargo +build --release` diff --git a/docs/deploying/generic.md b/docs/deploying/generic.md index 18016028..5a5eb5d1 100644 --- a/docs/deploying/generic.md +++ b/docs/deploying/generic.md @@ -2,125 +2,140 @@ > ## Getting help > -> If you run into any problems while setting up conduwuit, ask us -> in `#conduwuit:puppygock.gay` or [open an issue on GitHub](https://github.com/girlbossceo/conduwuit/issues/new). +> If you run into any problems while setting up conduwuit, ask us in +> `#conduwuit:puppygock.gay` or [open an issue on +> GitHub](https://github.com/girlbossceo/conduwuit/issues/new). ## Installing conduwuit -You may simply download the binary that fits your machine. Run `uname -m` to see what you need. +You may simply download the binary that fits your machine. Run `uname -m` to see +what you need. -Prebuilt fully static musl binaries can be downloaded from the latest tagged release [here](https://github.com/girlbossceo/conduwuit/releases/latest) or `main` CI branch workflow artifact output. These also include Debian packages. These binaries have jemalloc and io_uring statically linked and included with them. +Prebuilt fully static musl binaries can be downloaded from the latest tagged +release [here](https://github.com/girlbossceo/conduwuit/releases/latest) or +`main` CI branch workflow artifact output. These also include Debian packages. +These binaries have jemalloc and io_uring statically linked and included with +them. -Alternatively, you may compile the binary yourself. We recommend using [Lix](https://lix.systems) to build conduwuit as this has the most guaranteed +Alternatively, you may compile the binary yourself. We recommend using +[Lix](https://lix.systems) to build conduwuit as this has the most guaranteed reproducibiltiy and easiest to get a build environment and output going. -Otherwise, follow standard Rust project build guides (installing git and cloning the repo, getting the Rust toolchain via rustup, installing LLVM toolchain + libclang for RocksDB, installing liburing for io_uring and RocksDB, etc). +Otherwise, follow standard Rust project build guides (installing git and cloning +the repo, getting the Rust toolchain via rustup, installing LLVM toolchain + +libclang for RocksDB, installing liburing for io_uring and RocksDB, etc). ## Adding a conduwuit user -While conduwuit can run as any user it is better to use dedicated users for different services. This also allows -you to make sure that the file permissions are correctly set up. +While conduwuit can run as any user it is better to use dedicated users for +different services. This also allows you to make sure that the file permissions +are correctly set up. In Debian or Fedora/RHEL, you can use this command to create a conduwuit user: ```bash -sudo adduser --system conduwuit --group --disabled-login --no-create-home +sudo adduser --system conduwuit --group --disabled-login --no-create-home ``` For distros without `adduser`: -```bash -sudo useradd -r --shell /usr/bin/nologin --no-create-home conduwuit -``` +```bash sudo useradd -r --shell /usr/bin/nologin --no-create-home conduwuit ``` ## Forwarding ports in the firewall or the router -conduwuit uses the ports 443 and 8448 both of which need to be open in the firewall. +conduwuit uses the ports 443 and 8448 both of which need to be open in the +firewall. -If conduwuit runs behind a router or in a container and has a different public IP address than the host system these public ports need to be forwarded directly or indirectly to the port mentioned in the config. +If conduwuit runs behind a router or in a container and has a different public +IP address than the host system these public ports need to be forwarded directly +or indirectly to the port mentioned in the config. ## Setting up a systemd service -The systemd unit for conduwuit can be found [here](../configuration/examples.md#example-systemd-unit-file). You may need to change the `ExecStart=` path to where you placed the conduwuit binary. +The systemd unit for conduwuit can be found +[here](../configuration/examples.md#example-systemd-unit-file). You may need to +change the `ExecStart=` path to where you placed the conduwuit binary. ## Creating the conduwuit configuration file -Now we need to create the conduwuit's config file in `/etc/conduwuit/conduwuit.toml`. The example config can be found at [conduwuit-example.toml](../configuration/examples.md).**Please take a moment to read it. You need to change at least the server name.** +Now we need to create the conduwuit's config file in +`/etc/conduwuit/conduwuit.toml`. The example config can be found at +[conduwuit-example.toml](../configuration/examples.md).**Please take a moment to +read it. You need to change at least the server name.** RocksDB is the only supported database backend. ## Setting the correct file permissions -If you are using a dedicated user for conduwuit, you will need to allow it to read the config. To do that you can run this: +If you are using a dedicated user for conduwuit, you will need to allow it to +read the config. To do that you can run this: ```bash -sudo chown -R root:root /etc/conduwuit -sudo chmod -R 755 /etc/conduwuit +sudo chown -R root:root /etc/conduwuit sudo chmod -R 755 /etc/conduwuit ``` If you use the default database path you also need to run this: -```bash -sudo mkdir -p /var/lib/conduwuit/ -sudo chown -R conduwuit:conduwuit /var/lib/conduwuit/ -sudo chmod 700 /var/lib/conduwuit/ +```bash +sudo mkdir -p /var/lib/conduwuit/ sudo chown -R conduwuit:conduwuit +/var/lib/conduwuit/ sudo chmod 700 /var/lib/conduwuit/ ``` ## Setting up the Reverse Proxy -Refer to the documentation or various guides online of your chosen reverse proxy software. A [Caddy](https://caddyserver.com/) example will be provided as this is the recommended reverse proxy for new users and is very trivial to use (handles TLS, reverse proxy headers, etc transparently with proper defaults). +Refer to the documentation or various guides online of your chosen reverse proxy +software. A [Caddy](https://caddyserver.com/) example will be provided as this +is the recommended reverse proxy for new users and is very trivial to use +(handles TLS, reverse proxy headers, etc transparently with proper defaults). -Lighttpd is not supported as it seems to mess with the `X-Matrix` Authorization header, making federation non-functional. If using Apache, you need to use `nocanon` to prevent this. +Lighttpd is not supported as it seems to mess with the `X-Matrix` Authorization +header, making federation non-functional. If using Apache, you need to use +`nocanon` to prevent this. ### Caddy -Create `/etc/caddy/conf.d/conduwuit_caddyfile` and enter this (substitute for your server name). +Create `/etc/caddy/conf.d/conduwuit_caddyfile` and enter this (substitute for +your server name). ```caddy -your.server.name, your.server.name:8448 { - # TCP - reverse_proxy 127.0.0.1:6167 - - # UNIX socket - #reverse_proxy unix//run/conduwuit/conduwuit.sock +your.server.name, your.server.name:8448 { # TCP reverse_proxy + 127.0.0.1:6167 + # UNIX socket + #reverse_proxy unix//run/conduwuit/conduwuit.sock } ``` That's it! Just start and enable the service and you're set. -```bash -sudo systemctl enable --now caddy -``` +```bash sudo systemctl enable --now caddy ``` ## You're done Now you can start conduwuit with: -```bash -sudo systemctl start conduwuit -``` +```bash sudo systemctl start conduwuit ``` Set it to start automatically when your system boots with: -```bash -sudo systemctl enable conduwuit -``` +```bash sudo systemctl enable conduwuit ``` ## How do I know it works? -You can open [a Matrix client](https://matrix.org/ecosystem/clients), enter your homeserver and try to register. +You can open [a Matrix client](https://matrix.org/ecosystem/clients), enter your +homeserver and try to register. -You can also use these commands as a quick health check (replace `your.server.name`). +You can also use these commands as a quick health check (replace +`your.server.name`). -```bash -$ curl https://your.server.name/_conduwuit/server_version +```bash $ curl https://your.server.name/_conduwuit/server_version -# If using port 8448 -$ curl https://your.server.name:8448/_conduwuit/server_version -``` +# If using port 8448 $ curl +https://your.server.name:8448/_conduwuit/server_version ``` -- To check if your server can talk with other homeservers, you can use the [Matrix Federation Tester](https://federationtester.matrix.org/). - If you can register but cannot join federated rooms check your config again and also check if the port 8448 is open and forwarded correctly. +- To check if your server can talk with other homeservers, you can use the +[Matrix Federation Tester](https://federationtester.matrix.org/). If you can +register but cannot join federated rooms check your config again and also check +if the port 8448 is open and forwarded correctly. # What's next? @@ -130,4 +145,5 @@ For Audio/Video call functionality see the [TURN Guide](../turn.md). ## Appservices -If you want to set up an appservice, take a look at the [Appservice Guide](../appservices.md). +If you want to set up an appservice, take a look at the [Appservice +Guide](../appservices.md). diff --git a/docs/deploying/nixos.md b/docs/deploying/nixos.md index 9f247ac4..4a591315 100644 --- a/docs/deploying/nixos.md +++ b/docs/deploying/nixos.md @@ -9,31 +9,29 @@ conduwuit can be acquired by [Lix][lix] from various places: A binary cache for conduwuit that the CI/CD publishes to is available at the following places (both are the same just different names): -``` -https://attic.kennel.juneis.dog/conduit +``` https://attic.kennel.juneis.dog/conduit conduit:eEKoUwlQGDdYmAI/Q/0slVlegqh/QmAvQd7HBSm21Wk= https://attic.kennel.juneis.dog/conduwuit -conduwuit:BbycGUgTISsltcmH0qNjFR9dbrQNYgdIAcmViSGoVTE= -``` +conduwuit:BbycGUgTISsltcmH0qNjFR9dbrQNYgdIAcmViSGoVTE= ``` -The binary caches have been recreated recently due to attic issues. The old public keys were: +The binary caches have been recreated recently due to attic issues. The old +public keys were: -``` -conduit:Isq8FGyEC6FOXH6nD+BOeAA+bKp6X6UIbupSlGEPuOg= +``` conduit:Isq8FGyEC6FOXH6nD+BOeAA+bKp6X6UIbupSlGEPuOg= -conduwuit:lYPVh7o1hLu1idH4Xt2QHaRa49WRGSAqzcfFd94aOTw= -``` +conduwuit:lYPVh7o1hLu1idH4Xt2QHaRa49WRGSAqzcfFd94aOTw= ``` -If specifying a URL in your flake, please use the GitHub remote: `github:girlbossceo/conduwuit` +If specifying a URL in your flake, please use the GitHub remote: +`github:girlbossceo/conduwuit` The `flake.nix` and `default.nix` do not (currently) provide a NixOS module, so (for now) [`services.matrix-conduit`][module] from Nixpkgs should be used to configure conduwuit. -If you want to run the latest code, you should get conduwuit from the `flake.nix` -or `default.nix` and set [`services.matrix-conduit.package`][package] -appropriately. +If you want to run the latest code, you should get conduwuit from the +`flake.nix` or `default.nix` and set +[`services.matrix-conduit.package`][package] appropriately. [lix]: https://lix.systems/ [module]: https://search.nixos.org/options?channel=unstable&query=services.matrix-conduit diff --git a/docs/development.md b/docs/development.md index 62a03e2f..fbcfb433 100644 --- a/docs/development.md +++ b/docs/development.md @@ -4,29 +4,43 @@ Information about developing the project. If you are only interested in using it, you can safely ignore this section. If you plan on contributing, see the [contributor's guide](contributing.md). -## List of forked dependencies -During conduwuit development, we have had to fork some dependencies to support our use-cases in some areas. This ranges from things said upstream project won't accept for any reason, faster-paced development (unresponsive or slow upstream), conduwuit-specific usecases, or lack of time to upstream some things. +## List of forked dependencies During conduwuit development, we have had to fork +some dependencies to support our use-cases in some areas. This ranges from +things said upstream project won't accept for any reason, faster-paced +development (unresponsive or slow upstream), conduwuit-specific usecases, or +lack of time to upstream some things. -- [ruma/ruma][1]: - various performance improvements, more features, faster-paced development, client/server interop hacks upstream won't accept, etc -- [facebook/rocksdb][2]: - liburing build fixes, GCC build fix, and logging callback C API for Rust tracing integration -- [tikv/jemallocator][3]: - musl builds seem to be broken on upstream -- [zyansheep/rustyline-async][4]: - tab completion callback and `CTRL+\` signal quit event for CLI -- [rust-rocksdb/rust-rocksdb][5]: - [`@zaidoon1`'s][8] fork has quicker updates, more up to date dependencies. Our changes fix musl build issues, Rust part of the logging callback C API, removes unnecessary `gtest` include, and uses our RocksDB and jemallocator -- [tokio-rs/tracing][6]: - Implements `Clone` for `EnvFilter` to support dynamically changing tracing envfilter's alongside other logging/metrics things +- [ruma/ruma][1]: - various performance +improvements, more features, faster-paced development, client/server interop +hacks upstream won't accept, etc +- [facebook/rocksdb][2]: - liburing +build fixes, GCC build fix, and logging callback C API for Rust tracing +integration +- [tikv/jemallocator][3]: - musl +builds seem to be broken on upstream +- [zyansheep/rustyline-async][4]: + - tab completion callback and +`CTRL+\` signal quit event for CLI +- [rust-rocksdb/rust-rocksdb][5]: + - [`@zaidoon1`'s][8] fork +has quicker updates, more up to date dependencies. Our changes fix musl build +issues, Rust part of the logging callback C API, removes unnecessary `gtest` +include, and uses our RocksDB and jemallocator +- [tokio-rs/tracing][6]: - Implements +`Clone` for `EnvFilter` to support dynamically changing tracing envfilter's +alongside other logging/metrics things ## Debugging with `tokio-console` -[`tokio-console`][7] can be a useful tool for debugging and profiling. To make -a `tokio-console`-enabled build of conduwuit, enable the `tokio_console` feature, -disable the default `release_max_log_level` feature, and set the -`--cfg tokio_unstable` flag to enable experimental tokio APIs. A build might -look like this: +[`tokio-console`][7] can be a useful tool for debugging and profiling. To make a +`tokio-console`-enabled build of conduwuit, enable the `tokio_console` feature, +disable the default `release_max_log_level` feature, and set the `--cfg +tokio_unstable` flag to enable experimental tokio APIs. A build might look like +this: -```bash -RUSTFLAGS="--cfg tokio_unstable" cargo build \ - --release \ - --no-default-features \ - --features=systemd,element_hacks,gzip_compression,brotli_compression,zstd_compression,tokio_console +```bash RUSTFLAGS="--cfg tokio_unstable" cargo build \ --release \ +--no-default-features \ +--features=systemd,element_hacks,gzip_compression,brotli_compression,zstd_compression,tokio_console ``` [1]: https://github.com/ruma/ruma/ diff --git a/docs/development/hot_reload.md b/docs/development/hot_reload.md index 426e7c07..018eb4b3 100644 --- a/docs/development/hot_reload.md +++ b/docs/development/hot_reload.md @@ -2,89 +2,190 @@ ### Summary -When developing in debug-builds with the nightly toolchain, conduwuit is modular using dynamic libraries and various parts of the application are hot-reloadable while the server is running: http api handlers, admin commands, services, database, etc. These are all split up into individual workspace crates as seen in the `src/` directory. Changes to sourcecode in a crate rebuild that crate and subsequent crates depending on it. Reloading then occurs for the changed crates. +When developing in debug-builds with the nightly toolchain, conduwuit is modular +using dynamic libraries and various parts of the application are hot-reloadable +while the server is running: http api handlers, admin commands, services, +database, etc. These are all split up into individual workspace crates as seen +in the `src/` directory. Changes to sourcecode in a crate rebuild that crate and +subsequent crates depending on it. Reloading then occurs for the changed crates. -Release builds still produce static binaries which are unaffected. Rust's soundness guarantees are in full force. Thus you cannot hot-reload release binaries. +Release builds still produce static binaries which are unaffected. Rust's +soundness guarantees are in full force. Thus you cannot hot-reload release +binaries. ### Requirements -Currently, this development setup only works on x86_64 and aarch64 Linux glibc. [musl explicitly does not support hot reloadable libraries, and does not implement `dlclose`][2]. macOS does not fully support our usage of `RTLD_GLOBAL` possibly due to some thread-local issues. [This Rust issue][3] may be of relevance, specifically [this comment][4]. It may be possible to get it working on only very modern macOS versions such as at least Sonoma, as currently loading dylibs is supported, but not unloading them in our setup, and the cited comment mentions an Apple WWDC confirming there have been TLS changes to somewhat make this possible. +Currently, this development setup only works on x86_64 and aarch64 Linux glibc. +[musl explicitly does not support hot reloadable libraries, and does not +implement `dlclose`][2]. macOS does not fully support our usage of `RTLD_GLOBAL` +possibly due to some thread-local issues. [This Rust issue][3] may be of +relevance, specifically [this comment][4]. It may be possible to get it working +on only very modern macOS versions such as at least Sonoma, as currently loading +dylibs is supported, but not unloading them in our setup, and the cited comment +mentions an Apple WWDC confirming there have been TLS changes to somewhat make +this possible. -As mentioned above this requires the nightly toolchain. This is due to reliance on various Cargo.toml features that are only available on nightly, most specifically `RUSTFLAGS` in Cargo.toml. Some of the implementation could also be simpler based on other various nightly features. We hope lots of nightly features start making it out of nightly sooner as there have been dozens of very helpful features that have been stuck in nightly ("unstable") for at least 5+ years that would make this simpler. We encourage greater community consensus to move these features into stability. +As mentioned above this requires the nightly toolchain. This is due to reliance +on various Cargo.toml features that are only available on nightly, most +specifically `RUSTFLAGS` in Cargo.toml. Some of the implementation could also be +simpler based on other various nightly features. We hope lots of nightly +features start making it out of nightly sooner as there have been dozens of very +helpful features that have been stuck in nightly ("unstable") for at least 5+ +years that would make this simpler. We encourage greater community consensus to +move these features into stability. -This currently only works on x86_64/aarch64 Linux with a glibc C library. musl C library, macOS, and likely other host architectures are not supported (if other architectures work, feel free to let us know and/or make a PR updating this). This should work on GNU ld and lld (rust-lld) and gcc/clang, however if you happen to have linker issues it's recommended to try using `mold` or `gold` linkers, and please let us know in the [conduwuit Matrix room][7] the linker error and what linker solved this issue so we can figure out a solution. Ideally there should be minimal friction to using this, and in the future a build script (`build.rs`) may be suitable to making this easier to use if the capabilities allow us. +This currently only works on x86_64/aarch64 Linux with a glibc C library. musl C +library, macOS, and likely other host architectures are not supported (if other +architectures work, feel free to let us know and/or make a PR updating this). +This should work on GNU ld and lld (rust-lld) and gcc/clang, however if you +happen to have linker issues it's recommended to try using `mold` or `gold` +linkers, and please let us know in the [conduwuit Matrix room][7] the linker +error and what linker solved this issue so we can figure out a solution. Ideally +there should be minimal friction to using this, and in the future a build script +(`build.rs`) may be suitable to making this easier to use if the capabilities +allow us. ### Usage As of 19 May 2024, the instructions for using this are: -0. Have patience. Don't hesitate to join the [conduwuit Matrix room][7] to receive help using this. As indicated by the various rustflags used and some of the interesting issues linked at the bottom, this is definitely not something the Rust ecosystem or toolchain is used to doing. +0. Have patience. Don't hesitate to join the [conduwuit Matrix room][7] to + receive help using this. As indicated by the various rustflags used and some +of the interesting issues linked at the bottom, this is definitely not something +the Rust ecosystem or toolchain is used to doing. -1. Install the nightly toolchain using rustup. You may need to use `rustup override set nightly` in your local conduwuit directory, or use `cargo +nightly` for all actions. +1. Install the nightly toolchain using rustup. You may need to use `rustup + override set nightly` in your local conduwuit directory, or use `cargo ++nightly` for all actions. 2. Uncomment `cargo-features` at the top level / root Cargo.toml -3. Scroll down to the `# Developer profile` section and uncomment ALL the rustflags for each dev profile and their respective packages. +3. Scroll down to the `# Developer profile` section and uncomment ALL the + rustflags for each dev profile and their respective packages. -4. In each workspace crate's Cargo.toml (everything under `src/*` AND `deps/rust-rocksdb/Cargo.toml`), uncomment the `dylib` crate type under `[lib]`. +4. In each workspace crate's Cargo.toml (everything under `src/*` AND + `deps/rust-rocksdb/Cargo.toml`), uncomment the `dylib` crate type under +`[lib]`. -5. Due to [this rpath issue][5], you must export the `LD_LIBRARY_PATH` environment variable to your nightly Rust toolchain library directory. If using rustup (hopefully), use this: `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/` +5. Due to [this rpath issue][5], you must export the `LD_LIBRARY_PATH` + environment variable to your nightly Rust toolchain library directory. If +using rustup (hopefully), use this: `export +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/` -6. Start the server. You can use `cargo +nightly run` for this along with the standard. +6. Start the server. You can use `cargo +nightly run` for this along with the + standard. 7. Make some changes where you need to. -8. In a separate terminal window in the same directory (or using a terminal multiplexer like tmux), run the *build* Cargo command `cargo +nightly build`. Cargo should only rebuild what was changed / what's necessary, so it should not be rebuilding all the crates. +8. In a separate terminal window in the same directory (or using a terminal + multiplexer like tmux), run the *build* Cargo command `cargo +nightly build`. + Cargo should only rebuild what was changed / what's necessary, so it should + not be rebuilding all the crates. -9. In your conduwuit server terminal, hit/send `CTRL+C` signal. This will tell conduwuit to find which libraries need to be reloaded, and reloads them as necessary. +9. In your conduwuit server terminal, hit/send `CTRL+C` signal. This will tell + conduwuit to find which libraries need to be reloaded, and reloads them as + necessary. -10. If there were no errors, it will tell you it successfully reloaded `#` modules, and your changes should now be visible. Repeat 7 - 9 as needed. +10. If there were no errors, it will tell you it successfully reloaded `#` + modules, and your changes should now be visible. Repeat 7 - 9 as needed. -To shutdown conduwuit in this setup, hit/send `CTRL+\`. Normal builds still shutdown with `CTRL+C` as usual. +To shutdown conduwuit in this setup, hit/send `CTRL+\`. Normal builds still +shutdown with `CTRL+C` as usual. -Steps 1 - 5 are the initial first-time steps for using this. To remove the hot reload setup, revert/comment all the Cargo.toml changes. +Steps 1 - 5 are the initial first-time steps for using this. To remove the hot +reload setup, revert/comment all the Cargo.toml changes. -As mentioned in the requirements section, if you happen to have some linker issues, try using the `-fuse-ld=` rustflag and specify mold or gold in all the `rustflags` definitions in the top level Cargo.toml, and please let us know in the [conduwuit Matrix room][7] the problem. mold can be installed typically through your distro, and gold is provided by the binutils package. +As mentioned in the requirements section, if you happen to have some linker +issues, try using the `-fuse-ld=` rustflag and specify mold or gold in all the +`rustflags` definitions in the top level Cargo.toml, and please let us know in +the [conduwuit Matrix room][7] the problem. mold can be installed typically +through your distro, and gold is provided by the binutils package. -It's possible a helper script can be made to do all of this, or most preferably a specially made build script (build.rs). `cargo watch` support will be implemented soon which will eliminate the need to manually run `cargo build` all together. +It's possible a helper script can be made to do all of this, or most preferably +a specially made build script (build.rs). `cargo watch` support will be +implemented soon which will eliminate the need to manually run `cargo build` all +together. ### Addendum -Conduit was inherited as a single crate without modularity or reloading in its design. Reasonable partitioning and abstraction allowed a split into several crates, though many circular dependencies had to be corrected. The resulting crates now form a directed graph as depicted in figures below. The interfacing between these crates is still extremely broad which is not mitigable. +Conduit was inherited as a single crate without modularity or reloading in its +design. Reasonable partitioning and abstraction allowed a split into several +crates, though many circular dependencies had to be corrected. The resulting +crates now form a directed graph as depicted in figures below. The interfacing +between these crates is still extremely broad which is not mitigable. -Initially [hot_lib_reload][6] was investigated but found appropriate for a project designed with modularity through limited interfaces, not a large and complex existing codebase. Instead a bespoke solution built directly on [libloading][8] satisfied our constraints. This required relatively minimal modifications and zero maintenance burden compared to what would be required otherwise. The technical difference lies with relocation processing: we leverage global bindings (`RTLD_GLOBAL`) in a very intentional way. Most libraries and off-the-shelf module systems (such as [hot_lib_reload][6]) restrict themselves to local bindings (`RTLD_LOCAL`). This allows them to release software to multiple platforms with much greater consistency, but at the cost of burdening applications to explicitly manage these bindings. In our case with an optional feature for developers, we shrug any such requirement to enjoy the cost/benefit on platforms where global relocations are properly cooperative. +Initially [hot_lib_reload][6] was investigated but found appropriate for a +project designed with modularity through limited interfaces, not a large and +complex existing codebase. Instead a bespoke solution built directly on +[libloading][8] satisfied our constraints. This required relatively minimal +modifications and zero maintenance burden compared to what would be required +otherwise. The technical difference lies with relocation processing: we leverage +global bindings (`RTLD_GLOBAL`) in a very intentional way. Most libraries and +off-the-shelf module systems (such as [hot_lib_reload][6]) restrict themselves +to local bindings (`RTLD_LOCAL`). This allows them to release software to +multiple platforms with much greater consistency, but at the cost of burdening +applications to explicitly manage these bindings. In our case with an optional +feature for developers, we shrug any such requirement to enjoy the cost/benefit +on platforms where global relocations are properly cooperative. -To make use of `RTLD_GLOBAL` the application has to be oriented as a directed acyclic graph. The primary rule is simple and illustrated in the figure below: **no crate is allowed to call a function or use a variable from a crate below it.** +To make use of `RTLD_GLOBAL` the application has to be oriented as a directed +acyclic graph. The primary rule is simple and illustrated in the figure below: +**no crate is allowed to call a function or use a variable from a crate below +it.** -![conduwuit's dynamic library setup diagram - created by Jason Volk](assets/libraries.png) +![conduwuit's dynamic library setup diagram - created by Jason +Volk](assets/libraries.png) -When a symbol is referenced between crates they become bound: **crates cannot be unloaded until their calling crates are first unloaded.** Thus we start the reloading process from the crate which has no callers. There is a small problem though: the first crate is called by the base executable itself! This is solved by using an `RTLD_LOCAL` binding for just one link between the main executable and the first crate, freeing the executable from all modules as no global binding ever occurs between them. +When a symbol is referenced between crates they become bound: **crates cannot be +unloaded until their calling crates are first unloaded.** Thus we start the +reloading process from the crate which has no callers. There is a small problem +though: the first crate is called by the base executable itself! This is solved +by using an `RTLD_LOCAL` binding for just one link between the main executable +and the first crate, freeing the executable from all modules as no global +binding ever occurs between them. -![conduwuit's reload and load order diagram - created by Jason Volk](assets/reload_order.png) +![conduwuit's reload and load order diagram - created by Jason +Volk](assets/reload_order.png) -Proper resource management is essential for reliable reloading to occur. This is a very basic ask in RAII-idiomatic Rust and the exposure to reloading hazards is remarkably low, generally stemming from poor patterns and practices. Unfortunately static analysis doesn't enforce reload-safety programmatically (though it could one day), for now hazards can be avoided by knowing a few basic do's and dont's: +Proper resource management is essential for reliable reloading to occur. This is +a very basic ask in RAII-idiomatic Rust and the exposure to reloading hazards is +remarkably low, generally stemming from poor patterns and practices. +Unfortunately static analysis doesn't enforce reload-safety programmatically +(though it could one day), for now hazards can be avoided by knowing a few basic +do's and dont's: -1. Understand that code is memory. Just like one is forbidden from referencing free'd memory, one must not transfer control to free'd code. Exposure to this is primarily from two things: +1. Understand that code is memory. Just like one is forbidden from referencing + free'd memory, one must not transfer control to free'd code. Exposure to this +is primarily from two things: -- Callbacks, which this project makes very little use of. -- Async tasks, which are addressed below. + - Callbacks, which this project makes very little use of. + - Async tasks, which are addressed below. -2. Tie all resources to a scope or object lifetime with greatest possible symmetry (locality). For our purposes this applies to code resources, which means async blocks and tokio tasks. +2. Tie all resources to a scope or object lifetime with greatest possible +symmetry (locality). For our purposes this applies to code resources, which +means async blocks and tokio tasks. -- **Never spawn a task without receiving and storing its JoinHandle**. -- **Always wait on join handles** before leaving a scope or in another cleanup function called by an owning scope. + - **Never spawn a task without receiving and storing its JoinHandle**. + - **Always wait on join handles** before leaving a scope or in another cleanup + function called by an owning scope. 3. Know any minor specific quirks documented in code or here: -- Don't use `tokio::spawn`, instead use our `Handle` in `core/server.rs`, which is reachable in most of the codebase via `services()` or other state. This is due to some bugs or assumptions made in tokio, as it happens in `unsafe {}` blocks, which are mitigated by circumventing some thread-local variables. Using runtime handles is good practice in any case. + - Don't use `tokio::spawn`, instead use our `Handle` in `core/server.rs`, which + is reachable in most of the codebase via `services()` or other state. This is + due to some bugs or assumptions made in tokio, as it happens in `unsafe {}` + blocks, which are mitigated by circumventing some thread-local variables. Using + runtime handles is good practice in any case. The initial implementation PR is available [here][1]. ### Interesting related issues/bugs - [DT_RUNPATH produced in binary with rpath = true is wrong (cargo)][5] -- [Disabling MIR Optimization in Rust Compilation (cargo)](https://internals.rust-lang.org/t/disabling-mir-optimization-in-rust-compilation/19066/5) -- [Workspace-level metadata (cargo-deb)](https://github.com/kornelski/cargo-deb/issues/68) +- [Disabling MIR Optimization in Rust Compilation +(cargo)](https://internals.rust-lang.org/t/disabling-mir-optimization-in-rust-compilation/19066/5) +- [Workspace-level metadata +(cargo-deb)](https://github.com/kornelski/cargo-deb/issues/68) [1]: https://github.com/girlbossceo/conduwuit/pull/387 [2]: https://wiki.musl-libc.org/functional-differences-from-glibc.html#Unloading-libraries diff --git a/docs/development/testing.md b/docs/development/testing.md index f3fb7d9d..00f8e258 100644 --- a/docs/development/testing.md +++ b/docs/development/testing.md @@ -5,15 +5,18 @@ Have a look at [Complement's repository][complement] for an explanation of what it is. -To test against Complement, with [Lix][lix] and direnv installed and set up, you can: +To test against Complement, with [Lix][lix] and direnv installed and set up, you +can: -* Run `./bin/complement "$COMPLEMENT_SRC" ./path/to/logs.jsonl ./path/to/results.jsonl` - to build a Complement image, run the tests, and output the logs and results - to the specified paths. This will also output the OCI image at `result` +* Run `./bin/complement "$COMPLEMENT_SRC" ./path/to/logs.jsonl +./path/to/results.jsonl` to build a Complement image, run the tests, and output +the logs and results to the specified paths. This will also output the OCI image +at `result` * Run `nix build .#complement` from the root of the repository to just build a - Complement OCI image outputted to `result` (it's a `.tar.gz` file) -* Or download the latest Complement OCI image from the CI workflow artifacts output - from the commit/revision you want to test (e.g. from main) [here][ci-workflows] +Complement OCI image outputted to `result` (it's a `.tar.gz` file) +* Or download the latest Complement OCI image from the CI workflow artifacts +output from the commit/revision you want to test (e.g. from main) +[here][ci-workflows] [lix]: https://lix.systems/ [ci-workflows]: https://github.com/girlbossceo/conduwuit/actions/workflows/ci.yml?query=event%3Apush+is%3Asuccess+actor%3Agirlbossceo diff --git a/docs/differences.md b/docs/differences.md index 7dfbedc1..6815d248 100644 --- a/docs/differences.md +++ b/docs/differences.md @@ -1,4 +1,8 @@ -#### **Note: This list may not up to date. There are rapidly more and more improvements, fixes, changes, etc being made that it is becoming more difficult to maintain this list. I recommend that you give conduwuit a try and see the differences for yourself. If you have any concerns, feel free to join the conduwuit Matrix room and ask any pre-usage questions.** +#### **Note: This list may not up to date. There are rapidly more and more +improvements, fixes, changes, etc being made that it is becoming more difficult +to maintain this list. I recommend that you give conduwuit a try and see the +differences for yourself. If you have any concerns, feel free to join the +conduwuit Matrix room and ask any pre-usage questions.** ### list of features, bug fixes, etc that conduwuit does that Conduit does not @@ -6,192 +10,371 @@ Outgoing typing indicators, outgoing read receipts, **and** outgoing presence! ## Performance -- Concurrency support for individual homeserver key fetching for faster remote room joins and room joins that will error less frequently -- Send `Cache-Control` response header with `immutable` and 1 year cache length for all media requests (download and thumbnail) to instruct clients to cache media, and reduce server load from media requests that could be otherwise cached -- Add feature flags and config options to enable/build with zstd, brotli, and/or gzip HTTP body compression (response and request) -- Eliminate all usage of the thread-blocking `getaddrinfo(3)` call upon DNS queries, significantly improving federation latency/ping and cache DNS results (NXDOMAINs, successful queries, etc) using hickory-dns / hickory-resolver +- Concurrency support for individual homeserver key fetching for faster remote +room joins and room joins that will error less frequently +- Send `Cache-Control` response header with `immutable` and 1 year cache length +for all media requests (download and thumbnail) to instruct clients to cache +media, and reduce server load from media requests that could be otherwise cached +- Add feature flags and config options to enable/build with zstd, brotli, and/or +gzip HTTP body compression (response and request) +- Eliminate all usage of the thread-blocking `getaddrinfo(3)` call upon DNS +queries, significantly improving federation latency/ping and cache DNS results +(NXDOMAINs, successful queries, etc) using hickory-dns / hickory-resolver - Enable HTTP/2 support on all requests -- Vastly improve RocksDB default settings to use new features that help with performance significantly, uses settings tailored to SSDs, various ways to tweak RocksDB, and a conduwuit setting to tell RocksDB to use settings that are tailored to HDDs or slow spinning rust storage or buggy filesystems. +- Vastly improve RocksDB default settings to use new features that help with +performance significantly, uses settings tailored to SSDs, various ways to tweak +RocksDB, and a conduwuit setting to tell RocksDB to use settings that are +tailored to HDDs or slow spinning rust storage or buggy filesystems. - Implement database flush and cleanup conduwuit operations when using RocksDB -- Implement RocksDB write buffer corking and coalescing in database write-heavy areas -- Perform connection pooling and keepalives where necessary to significantly improve federation performance and latency -- Various config options to tweak connection pooling, request timeouts, connection timeouts, DNS timeouts and settings, etc with good defaults which also help huge with performance via reusing connections and retrying where needed +- Implement RocksDB write buffer corking and coalescing in database write-heavy +areas +- Perform connection pooling and keepalives where necessary to significantly +improve federation performance and latency +- Various config options to tweak connection pooling, request timeouts, +connection timeouts, DNS timeouts and settings, etc with good defaults which +also help huge with performance via reusing connections and retrying where +needed - Properly get and use the amount of parallelism / tokio workers -- Implement building conduwuit with jemalloc (which extends to the RocksDB jemalloc feature for maximum gains) or hardened_malloc light variant, and io_uring support, and produce CI builds with jemalloc and io_uring by default for performance (Nix doesn't seem to build [hardened_malloc-rs](https://github.com/girlbossceo/hardened_malloc-rs) properly) -- Add support for caching DNS results with hickory-dns / hickory-resolver in conduwuit (not a replacement for a proper resolver cache, but still far better than nothing), also properly falls back on TCP for UDP errors or if a SRV response is too large -- Add config option for using DNS over TCP, and config option for controlling A/AAAA record lookup strategy (e.g. don't query AAAA records if you don't have IPv6 connectivity) -- Overall significant database, Client-Server, and federation performance and latency improvements (check out the ping room leaderboards if you don't believe me :>) -- Add config options for RocksDB compression and bottommost compression, including choosing the algorithm and compression level -- Use [loole](https://github.com/mahdi-shojaee/loole) MPSC channels instead of tokio MPSC channels for huge performance boosts in sending channels (mainly relevant for federation) and presence channels -- Use `tracing`/`log`'s `release_max_level_info` feature to improve performance, build speeds, binary size, and CPU usage in release builds by avoid compiling debug/trace log level macros that users will generally never use (can be disabled with a build-time feature flag) -- Remove some unnecessary checks on EDU handling for incoming transactions, effectively speeding them up -- Simplify, dedupe, etc huge chunks of the codebase, including some that were unnecessary overhead, binary bloats, or preventing compiler/linker optimisations -- Implement zero-copy RocksDB database accessors, substantially improving performance caused by unnecessary memory allocations +- Implement building conduwuit with jemalloc (which extends to the RocksDB +jemalloc feature for maximum gains) or hardened_malloc light variant, and +io_uring support, and produce CI builds with jemalloc and io_uring by default +for performance (Nix doesn't seem to build +[hardened_malloc-rs](https://github.com/girlbossceo/hardened_malloc-rs) +properly) +- Add support for caching DNS results with hickory-dns / hickory-resolver in +conduwuit (not a replacement for a proper resolver cache, but still far better +than nothing), also properly falls back on TCP for UDP errors or if a SRV +response is too large +- Add config option for using DNS over TCP, and config option for controlling +A/AAAA record lookup strategy (e.g. don't query AAAA records if you don't have +IPv6 connectivity) +- Overall significant database, Client-Server, and federation performance and +latency improvements (check out the ping room leaderboards if you don't believe +me :>) +- Add config options for RocksDB compression and bottommost compression, +including choosing the algorithm and compression level +- Use [loole](https://github.com/mahdi-shojaee/loole) MPSC channels instead of +tokio MPSC channels for huge performance boosts in sending channels (mainly +relevant for federation) and presence channels +- Use `tracing`/`log`'s `release_max_level_info` feature to improve performance, +build speeds, binary size, and CPU usage in release builds by avoid compiling +debug/trace log level macros that users will generally never use (can be +disabled with a build-time feature flag) +- Remove some unnecessary checks on EDU handling for incoming transactions, +effectively speeding them up +- Simplify, dedupe, etc huge chunks of the codebase, including some that were +unnecessary overhead, binary bloats, or preventing compiler/linker optimisations +- Implement zero-copy RocksDB database accessors, substantially improving +performance caused by unnecessary memory allocations ## General Fixes/Features -- Add legacy Element client hack fixing password changes and deactivations on legacy Element Android/iOS due to usage of an unspecced `user` field for UIAA -- Raise and improve all the various request timeouts making some things like room joins and client bugs error less or none at all than they should, and make them all user configurable +- Add legacy Element client hack fixing password changes and deactivations on +legacy Element Android/iOS due to usage of an unspecced `user` field for UIAA +- Raise and improve all the various request timeouts making some things like +room joins and client bugs error less or none at all than they should, and make +them all user configurable - Add missing `reason` field to user ban events (`/ban`) -- Safer and cleaner shutdowns across incoming/outgoing requests (graceful shutdown) and the database -- Stop sending `make_join` requests on room joins if 15 servers respond with `M_UNSUPPORTED_ROOM_VERSION` or `M_INVALID_ROOM_VERSION` -- Stop sending `make_join` requests if 50 servers cannot provide `make_join` for us -- Respect *most* client parameters for `/media/` requests (`allow_redirect` still needs work) -- Return joined member count of rooms for push rules/conditions instead of a hardcoded value of 10 -- Make `CONDUIT_CONFIG` optional, relevant for container users that configure only by environment variables and no longer need to set `CONDUIT_CONFIG` to an empty string. -- Allow HEAD and PATCH (MSC4138) HTTP requests in CORS for clients (despite not being explicity mentioned in Matrix spec, HTTP spec says all HEAD requests need to behave the same as GET requests, Synapse supports HEAD requests) +- Safer and cleaner shutdowns across incoming/outgoing requests (graceful +shutdown) and the database +- Stop sending `make_join` requests on room joins if 15 servers respond with +`M_UNSUPPORTED_ROOM_VERSION` or `M_INVALID_ROOM_VERSION` +- Stop sending `make_join` requests if 50 servers cannot provide `make_join` for +us +- Respect *most* client parameters for `/media/` requests (`allow_redirect` +still needs work) +- Return joined member count of rooms for push rules/conditions instead of a +hardcoded value of 10 +- Make `CONDUIT_CONFIG` optional, relevant for container users that configure +only by environment variables and no longer need to set `CONDUIT_CONFIG` to an +empty string. +- Allow HEAD and PATCH (MSC4138) HTTP requests in CORS for clients (despite not +being explicity mentioned in Matrix spec, HTTP spec says all HEAD requests need +to behave the same as GET requests, Synapse supports HEAD requests) - Fix using conduwuit with flake-compat on NixOS -- Resolve and remove some "features" from upstream that result in concurrency hazards, exponential backoff issues, or arbitrary performance limiters -- Find more servers for outbound federation `/hierarchy` requests instead of just the room ID server name -- Support for suggesting servers to join through at `/_matrix/client/v3/directory/room/{roomAlias}` -- Support for suggesting servers to join through us at `/_matrix/federation/v1/query/directory` +- Resolve and remove some "features" from upstream that result in concurrency +hazards, exponential backoff issues, or arbitrary performance limiters +- Find more servers for outbound federation `/hierarchy` requests instead of +just the room ID server name +- Support for suggesting servers to join through at +`/_matrix/client/v3/directory/room/{roomAlias}` +- Support for suggesting servers to join through us at +`/_matrix/federation/v1/query/directory` - Misc edge-case search fixes (e.g. potentially missing some events) -- Misc `/sync` fixes (e.g. returning unnecessary data or incorrect/invalid responses) -- Add `replaces_state` and `prev_sender` in `unsigned` for state event changes which primarily makes Element's "See history" button on a state event functional -- Fix Conduit not allowing incoming federation requests for various world readable rooms +- Misc `/sync` fixes (e.g. returning unnecessary data or incorrect/invalid +responses) +- Add `replaces_state` and `prev_sender` in `unsigned` for state event changes +which primarily makes Element's "See history" button on a state event functional +- Fix Conduit not allowing incoming federation requests for various world +readable rooms - Fix Conduit not respecting the client-requested file name on media requests -- Prevent sending junk / non-membership events to `/send_join` and `/send_leave` endpoints -- Only allow the requested membership type on `/send_join` and `/send_leave` endpoints (e.g. don't allow leave memberships on join endpoints) +- Prevent sending junk / non-membership events to `/send_join` and `/send_leave` +endpoints +- Only allow the requested membership type on `/send_join` and `/send_leave` +endpoints (e.g. don't allow leave memberships on join endpoints) - Prevent state key impersonation on `/send_join` and `/send_leave` endpoints -- Validate `X-Matrix` origin and request body `"origin"` field on incoming transactions -- Add `GET /_matrix/client/v1/register/m.login.registration_token/validity` endpoint -- Explicitly define support for sliding sync at `/_matrix/client/versions` (`org.matrix.msc3575`) +- Validate `X-Matrix` origin and request body `"origin"` field on incoming +transactions +- Add `GET /_matrix/client/v1/register/m.login.registration_token/validity` +endpoint +- Explicitly define support for sliding sync at `/_matrix/client/versions` +(`org.matrix.msc3575`) - Fix seeing empty status messages on user presences ## Moderation -- (Also see [Admin Room](#admin-room) for all the admin commands pertaining to moderation, there's a lot!) +- (Also see [Admin Room](#admin-room) for all the admin commands pertaining to +moderation, there's a lot!) - Add support for room banning/blocking by ID using admin command -- Add support for serving `support` well-known from `[global.well_known]` (MSC1929) (`/.well-known/matrix/support`) -- Config option to forbid publishing rooms to the room directory (`lockdown_public_room_directory`) except for admins -- Admin commands to delete room aliases and unpublish rooms from our room directory -- For all [`/report`](https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3roomsroomidreporteventid) requests: check if the reported event ID belongs to the reported room ID, raise report reasoning character limit to 750, fix broken formatting, make a small delayed random response per spec suggestion on privacy, and check if the sender user is in the reported room. +- Add support for serving `support` well-known from `[global.well_known]` +(MSC1929) (`/.well-known/matrix/support`) +- Config option to forbid publishing rooms to the room directory +(`lockdown_public_room_directory`) except for admins +- Admin commands to delete room aliases and unpublish rooms from our room +directory +- For all +[`/report`](https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3roomsroomidreporteventid) +requests: check if the reported event ID belongs to the reported room ID, raise +report reasoning character limit to 750, fix broken formatting, make a small +delayed random response per spec suggestion on privacy, and check if the sender +user is in the reported room. - Support blocking servers from downloading remote media from, returning a 404 -- Don't allow `m.call.invite` events to be sent in public rooms (prevents calling the entire room) -- On new public room creations, only allow moderators to send `m.call.invite`, `org.matrix.msc3401.call`, and `org.matrix.msc3401.call.member` events to prevent unprivileged users from calling the entire room -- Add support for a "global ACLs" feature (`forbidden_remote_server_names`) that blocks inbound remote room invites, room joins by room ID on server name, room joins by room alias on server name, incoming federated joins, and incoming federated room directory requests. This is very helpful for blocking servers that are purely toxic/bad and serve no value in allowing our users to suffer from things like room invite spam or such. Please note that this is not a substitute for room ACLs. -- Add support for a config option to forbid our local users from sending federated room directory requests for (`forbidden_remote_room_directory_server_names`). Similar to above, useful for blocking servers that help prevent our users from wandering into bad areas of Matrix via room directories of those malicious servers. -- Add config option for auto remediating/deactivating local non-admin users who attempt to join bad/forbidden rooms (`auto_deactivate_banned_room_attempts`) -- Deactivating users will remove their profile picture, blurhash, display name, and leave all rooms by default just like Synapse and for additional privacy +- Don't allow `m.call.invite` events to be sent in public rooms (prevents +calling the entire room) +- On new public room creations, only allow moderators to send `m.call.invite`, +`org.matrix.msc3401.call`, and `org.matrix.msc3401.call.member` events to +prevent unprivileged users from calling the entire room +- Add support for a "global ACLs" feature (`forbidden_remote_server_names`) that +blocks inbound remote room invites, room joins by room ID on server name, room +joins by room alias on server name, incoming federated joins, and incoming +federated room directory requests. This is very helpful for blocking servers +that are purely toxic/bad and serve no value in allowing our users to suffer +from things like room invite spam or such. Please note that this is not a +substitute for room ACLs. +- Add support for a config option to forbid our local users from sending +federated room directory requests for +(`forbidden_remote_room_directory_server_names`). Similar to above, useful for +blocking servers that help prevent our users from wandering into bad areas of +Matrix via room directories of those malicious servers. +- Add config option for auto remediating/deactivating local non-admin users who +attempt to join bad/forbidden rooms (`auto_deactivate_banned_room_attempts`) +- Deactivating users will remove their profile picture, blurhash, display name, +and leave all rooms by default just like Synapse and for additional privacy - Reject some EDUs from ACL'd users such as read receipts and typing indicators ## Privacy/Security -- Add config option for device name federation with a privacy-friendly default (disabled) -- Add config option for requiring authentication to the `/publicRooms` endpoint (room directory) with a default enabled for privacy -- Add config option for federating `/publicRooms` endpoint (room directory) to other servers with a default disabled for privacy -- Uses proper `argon2` crate by RustCrypto instead of questionable `rust-argon2` crate +- Add config option for device name federation with a privacy-friendly default +(disabled) +- Add config option for requiring authentication to the `/publicRooms` endpoint +(room directory) with a default enabled for privacy +- Add config option for federating `/publicRooms` endpoint (room directory) to +other servers with a default disabled for privacy +- Uses proper `argon2` crate by RustCrypto instead of questionable `rust-argon2` +crate - Generate passwords with 25 characters instead of 15 -- Config option `ip_range_denylist` to support refusing to send requests (typically federation) to specific IP ranges, typically RFC 1918, non-routable, testnet, etc addresses like Synapse for security (note: this is not a guaranteed protection, and you should be using a firewall with zones if you want guaranteed protection as doing this on the application level is prone to bypasses). -- Config option to block non-admin users from sending room invites or receiving remote room invites. Admin users are still allowed. +- Config option `ip_range_denylist` to support refusing to send requests +(typically federation) to specific IP ranges, typically RFC 1918, non-routable, +testnet, etc addresses like Synapse for security (note: this is not a guaranteed +protection, and you should be using a firewall with zones if you want guaranteed +protection as doing this on the application level is prone to bypasses). +- Config option to block non-admin users from sending room invites or receiving +remote room invites. Admin users are still allowed. - Config option to disable incoming and/or outgoing remote read receipts - Config option to disable incoming and/or outgoing remote typing indicators -- Config option to disable incoming, outgoing, and/or local presence and for timing out remote users -- Sanitise file names for the `Content-Disposition` header for all media requests (thumbnails, downloads, uploads) -- Media repository on handling `Content-Disposition` and `Content-Type` is fully spec compliant and secured -- Send secure default HTTP headers such as a strong restrictive CSP (see MSC4149), deny iframes, disable `X-XSS-Protection`, disable interest cohort in `Permission-Policy`, etc to mitigate any potential attack surface such as from untrusted media +- Config option to disable incoming, outgoing, and/or local presence and for +timing out remote users +- Sanitise file names for the `Content-Disposition` header for all media +requests (thumbnails, downloads, uploads) +- Media repository on handling `Content-Disposition` and `Content-Type` is fully +spec compliant and secured +- Send secure default HTTP headers such as a strong restrictive CSP (see +MSC4149), deny iframes, disable `X-XSS-Protection`, disable interest cohort in +`Permission-Policy`, etc to mitigate any potential attack surface such as from +untrusted media ## Administration/Logging -- Commandline argument to specify the path to a config file instead of relying on `CONDUIT_CONFIG` +- Commandline argument to specify the path to a config file instead of relying +on `CONDUIT_CONFIG` - Revamped admin room infrastructure and commands -- Substantially clean up, improve, and fix logging (less noisy dead server logging, registration attempts, more useful troubleshooting logging, proper error propagation, etc) -- Configurable RocksDB logging (`LOG` files) with proper defaults (rotate, max size, verbosity, etc) to stop LOG files from accumulating so much -- Explicit startup error if your configuration allows open registration without a token or such like Synapse with a way to bypass it if needed -- Replace the lightning bolt emoji option with support for setting any arbitrary text (e.g. another emoji) to suffix to all new user registrations, with a conduwuit default of "🏳️‍⚧️" +- Substantially clean up, improve, and fix logging (less noisy dead server +logging, registration attempts, more useful troubleshooting logging, proper +error propagation, etc) +- Configurable RocksDB logging (`LOG` files) with proper defaults (rotate, max +size, verbosity, etc) to stop LOG files from accumulating so much +- Explicit startup error if your configuration allows open registration without +a token or such like Synapse with a way to bypass it if needed +- Replace the lightning bolt emoji option with support for setting any arbitrary +text (e.g. another emoji) to suffix to all new user registrations, with a +conduwuit default of "🏳️‍⚧️" - Implement config option to auto join rooms upon registration - Warn on unknown config options specified -- Add `/_conduwuit/server_version` route to return the version of conduwuit without relying on the federation API `/_matrix/federation/v1/version` -- Add `/_conduwuit/local_user_count` route to return the amount of registered active local users on your homeserver *if federation is enabled* -- Add configurable RocksDB recovery modes to aid in recovering corrupted RocksDB databases -- Support config options via `CONDUWUIT_` prefix and accessing non-global struct config options with the `__` split (e.g. `CONDUWUIT_WELL_KNOWN__SERVER`) +- Add `/_conduwuit/server_version` route to return the version of conduwuit +without relying on the federation API `/_matrix/federation/v1/version` +- Add `/_conduwuit/local_user_count` route to return the amount of registered +active local users on your homeserver *if federation is enabled* +- Add configurable RocksDB recovery modes to aid in recovering corrupted RocksDB +databases +- Support config options via `CONDUWUIT_` prefix and accessing non-global struct +config options with the `__` split (e.g. `CONDUWUIT_WELL_KNOWN__SERVER`) - Add support for listening on multiple TCP ports and multiple addresses - **Opt-in** Sentry.io telemetry and metrics, mainly used for crash reporting -- Log the client IP on various requests such as registrations, banned room join attempts, logins, deactivations, federation transactions, etc +- Log the client IP on various requests such as registrations, banned room join +attempts, logins, deactivations, federation transactions, etc - Fix Conduit dropping some remote server federation response errors ## Maintenance/Stability - GitLab CI ported to GitHub Actions -- Add support for the Matrix spec compliance test suite [Complement](https://github.com/matrix-org/complement/) via the Nix flake and various other fixes for it -- Implement running and diff'ing Complement results in CI and error if any mismatch occurs to prevent large cases of conduwuit regressions -- Repo is (officially) mirrored to GitHub, GitLab, git.gay, git.girlcock.ceo, sourcehut, and Codeberg (see README.md for their links) -- Docker container images published to GitLab Container Registry, GitHub Container Registry, and Dockerhub -- Extensively revamp the example config to be extremely helpful and useful to both new users and power users -- Fixed every single clippy (default lints) and rustc warnings, including some that were performance related or potential safety issues / unsoundness +- Add support for the Matrix spec compliance test suite +[Complement](https://github.com/matrix-org/complement/) via the Nix flake and +various other fixes for it +- Implement running and diff'ing Complement results in CI and error if any +mismatch occurs to prevent large cases of conduwuit regressions +- Repo is (officially) mirrored to GitHub, GitLab, git.gay, git.girlcock.ceo, +sourcehut, and Codeberg (see README.md for their links) +- Docker container images published to GitLab Container Registry, GitHub +Container Registry, and Dockerhub +- Extensively revamp the example config to be extremely helpful and useful to +both new users and power users +- Fixed every single clippy (default lints) and rustc warnings, including some +that were performance related or potential safety issues / unsoundness - Add a **lot** of other clippy and rustc lints and a rustfmt.toml file -- Repo uses [Renovate](https://docs.renovatebot.com/), [Trivy](https://github.com/aquasecurity/trivy-action), and keeps ALL dependencies as up to date as possible -- Purge unmaintained/irrelevant/broken database backends (heed, sled, persy) and other unnecessary code or overhead +- Repo uses [Renovate](https://docs.renovatebot.com/), +[Trivy](https://github.com/aquasecurity/trivy-action), and keeps ALL +dependencies as up to date as possible +- Purge unmaintained/irrelevant/broken database backends (heed, sled, persy) and +other unnecessary code or overhead - webp support for images - Add cargo audit support to CI - Add documentation lints via lychee and markdownlint-cli to CI -- CI tests for all sorts of feature matrixes (jemalloc, non-defaullt, all features, etc) -- Add static and dynamic linking smoke tests in CI to prevent any potential linking regressions for Complement, static binaries, Nix devshells, etc -- Add timestamp by commit date when building OCI images for keeping image build reproducibility and still have a meaningful "last modified date" for OCI image +- CI tests for all sorts of feature matrixes (jemalloc, non-defaullt, all +features, etc) +- Add static and dynamic linking smoke tests in CI to prevent any potential +linking regressions for Complement, static binaries, Nix devshells, etc +- Add timestamp by commit date when building OCI images for keeping image build +reproducibility and still have a meaningful "last modified date" for OCI image - Add timestamp by commit date via `SOURCE_DATE_EPOCH` for Debian packages -- Startup check if conduwuit running in a container and is listening on 127.0.0.1 (generally containers are using NAT networking and 0.0.0.0 is the intended listening address) -- Add a panic catcher layer to return panic messages in HTTP responses if a panic occurs -- Add full compatibility support for SHA256 media file names instead of base64 file names to overcome filesystem file name length limitations (OS error file name too long) while still retaining upstream database compatibility -- Remove SQLite support due to being very poor performance, difficult to maintain against RocksDB, and is a blocker to significantly improved database code +- Startup check if conduwuit running in a container and is listening on +127.0.0.1 (generally containers are using NAT networking and 0.0.0.0 is the +intended listening address) +- Add a panic catcher layer to return panic messages in HTTP responses if a +panic occurs +- Add full compatibility support for SHA256 media file names instead of base64 +file names to overcome filesystem file name length limitations (OS error file +name too long) while still retaining upstream database compatibility +- Remove SQLite support due to being very poor performance, difficult to +maintain against RocksDB, and is a blocker to significantly improved database +code ## Admin Room -- Add support for a console CLI interface that can issue admin commands and output them in your terminal -- Add support for an admin-user-only commandline admin room interface that can be issued in any room with the `\\!admin` or `\!admin` prefix and returns the response as yourself in the same room -- Add admin commands for uptime, server startup, server shutdown, and server restart -- Fix admin room handler to not panic/crash if the admin room command response fails (e.g. too large message) -- Add command to dynamically change conduwuit's tracing log level filter on the fly +- Add support for a console CLI interface that can issue admin commands and +output them in your terminal +- Add support for an admin-user-only commandline admin room interface that can +be issued in any room with the `\\!admin` or `\!admin` prefix and returns the +response as yourself in the same room +- Add admin commands for uptime, server startup, server shutdown, and server +restart +- Fix admin room handler to not panic/crash if the admin room command response +fails (e.g. too large message) +- Add command to dynamically change conduwuit's tracing log level filter on the +fly - Add admin command to fetch a server's `/.well-known/matrix/support` file -- Add debug admin command to force update user device lists (could potentially resolve some E2EE flukes) -- Implement **RocksDB online backups**, listing RocksDB backups, and listing database file counts all via admin commands -- Add various database visibility commands such as being able to query the getters and iterators used in conduwuit, a very helpful online debugging utility +- Add debug admin command to force update user device lists (could potentially +resolve some E2EE flukes) +- Implement **RocksDB online backups**, listing RocksDB backups, and listing +database file counts all via admin commands +- Add various database visibility commands such as being able to query the +getters and iterators used in conduwuit, a very helpful online debugging utility - Forbid the admin room from being made public or world readable history - Add `!admin` as a way to call the admin bot -- Extend clear cache admin command to support clearing more caches such as DNS and TLS name overrides -- Admin debug command to send a federation request/ping to a server's `/_matrix/federation/v1/version` endpoint and measures the latency it took +- Extend clear cache admin command to support clearing more caches such as DNS +and TLS name overrides +- Admin debug command to send a federation request/ping to a server's +`/_matrix/federation/v1/version` endpoint and measures the latency it took - Add admin command to bulk delete media via a codeblock list of MXC URLs. -- Add admin command to delete both the thumbnail and media MXC URLs from an event ID (e.g. from an abuse report) +- Add admin command to delete both the thumbnail and media MXC URLs from an +event ID (e.g. from an abuse report) - Add admin command to list all the rooms a local user is joined in - Add admin command to list joined members in a room - Add admin command to view the room topic of a room -- Add admin command to delete all remote media in the past X minutes as a form of deleting media that you don't want on your server that a remote user posted in a room, a `--force` flag to ignore errors, and support for reading `last modified time` instead of `creation time` for filesystems that don't support file created metadata +- Add admin command to delete all remote media in the past X minutes as a form +of deleting media that you don't want on your server that a remote user posted +in a room, a `--force` flag to ignore errors, and support for reading `last +modified time` instead of `creation time` for filesystems that don't support +file created metadata - Add admin command to return a room's full/complete state -- Admin debug command to fetch a PDU from a remote server and inserts it into our database/timeline as backfill -- Add admin command to delete media via a specific MXC. This deletes the MXC from our database, and the file locally. -- Add admin commands for banning (blocking) room IDs from our local users joining (admins are always allowed) and evicts all our local users from that room, in addition to bulk room banning support, and blocks room invites (remote and local) to the banned room, as a moderation feature +- Admin debug command to fetch a PDU from a remote server and inserts it into +our database/timeline as backfill +- Add admin command to delete media via a specific MXC. This deletes the MXC +from our database, and the file locally. +- Add admin commands for banning (blocking) room IDs from our local users +joining (admins are always allowed) and evicts all our local users from that +room, in addition to bulk room banning support, and blocks room invites (remote +and local) to the banned room, as a moderation feature - Add admin commands to output jemalloc memory stats and memory usage - Add admin command to get rooms a *remote* user shares with us - Add debug admin commands to get the earliest and latest PDU in a room - Add debug admin command to echo a message -- Add admin command to insert rooms tags for a user, most useful for inserting the `m.server_notice` tag on your admin room to make it "persistent" in the "System Alerts" section of Element -- Add experimental admin debug command for Dendrite's `AdminDownloadState` (`/admin/downloadState/{serverName}/{roomID}`) admin API endpoint to download and use a remote server's room state in the room -- Disable URL previews by default in the admin room due to various command outputs having "URLs" in them that clients may needlessly render/request -- Extend memory usage admin server command to support showing memory allocator stats such as jemalloc's -- Add admin debug command to see memory allocator's full extended debug statistics such as jemalloc's +- Add admin command to insert rooms tags for a user, most useful for inserting +the `m.server_notice` tag on your admin room to make it "persistent" in the +"System Alerts" section of Element +- Add experimental admin debug command for Dendrite's `AdminDownloadState` +(`/admin/downloadState/{serverName}/{roomID}`) admin API endpoint to download +and use a remote server's room state in the room +- Disable URL previews by default in the admin room due to various command +outputs having "URLs" in them that clients may needlessly render/request +- Extend memory usage admin server command to support showing memory allocator +stats such as jemalloc's +- Add admin debug command to see memory allocator's full extended debug +statistics such as jemalloc's ## Misc -- Add guest support for accessing TURN servers via `turn_allow_guests` like Synapse -- Support for creating rooms with custom room IDs like Maunium Synapse (`room_id` request body field to `/createRoom`) -- Query parameter `?format=event|content` for returning either the room state event's content (default) for the full room state event on `/_matrix/client/v3/rooms/{roomId}/state/{eventType}[/{stateKey}]` requests (see ) +- Add guest support for accessing TURN servers via `turn_allow_guests` like +Synapse +- Support for creating rooms with custom room IDs like Maunium Synapse +(`room_id` request body field to `/createRoom`) +- Query parameter `?format=event|content` for returning either the room state +event's content (default) for the full room state event on +`/_matrix/client/v3/rooms/{roomId}/state/{eventType}[/{stateKey}]` requests (see +) - Send a User-Agent on all of our requests - Send `avatar_url` on invite room membership events/changes -- Support sending [`well_known` response to client login responses](https://spec.matrix.org/v1.10/client-server-api/#post_matrixclientv3login) if using config option `[well_known.client]` -- Implement `include_state` search criteria support for `/search` requests (response now can include room states) -- Declare various missing Matrix versions and features at `/_matrix/client/versions` -- Implement legacy Matrix `/v1/` media endpoints that some clients and servers may still call -- Config option to change Conduit's behaviour of homeserver key fetching (`query_trusted_key_servers_first`). This option sets whether conduwuit will query trusted notary key servers first before the individual homeserver(s), or vice versa which may help in joining certain rooms. +- Support sending [`well_known` response to client login +responses](https://spec.matrix.org/v1.10/client-server-api/#post_matrixclientv3login) +if using config option `[well_known.client]` +- Implement `include_state` search criteria support for `/search` requests +(response now can include room states) +- Declare various missing Matrix versions and features at +`/_matrix/client/versions` +- Implement legacy Matrix `/v1/` media endpoints that some clients and servers +may still call +- Config option to change Conduit's behaviour of homeserver key fetching +(`query_trusted_key_servers_first`). This option sets whether conduwuit will +query trusted notary key servers first before the individual homeserver(s), or +vice versa which may help in joining certain rooms. - Implement unstable MSC2666 support for querying mutual rooms with a user - Implement unstable MSC3266 room summary API support -- Implement unstable MSC4125 support for specifying servers to join via on federated invites +- Implement unstable MSC4125 support for specifying servers to join via on +federated invites - Make conduwuit build and be functional under Nix + macOS - Log out all sessions after unsetting the emergency password - Assume well-knowns are broken if they exceed past 12288 characters. -- Add support for listening on both HTTP and HTTPS if using direct TLS with conduwuit for usecases such as Complement +- Add support for listening on both HTTP and HTTPS if using direct TLS with +conduwuit for usecases such as Complement - Add config option for disabling RocksDB Direct IO if needed -- Add various documentation on maintaining conduwuit, using RocksDB online backups, some troubleshooting, using admin commands, moderation documentation, etc -- (Developers): Add support for [hot reloadable/"live" modular development](development/hot_reload.md) +- Add various documentation on maintaining conduwuit, using RocksDB online +backups, some troubleshooting, using admin commands, moderation documentation, +etc +- (Developers): Add support for [hot reloadable/"live" modular +development](development/hot_reload.md) - (Developers): Add support for tokio-console - (Developers): Add support for tracing flame graphs -- No cryptocurrency donations allowed, conduwuit is fully maintained by independent queer maintainers, and with a strong priority on inclusitivity and comfort for protected groups 🏳️‍⚧️ -- [Add a community Code of Conduct for all conduwuit community spaces, primarily the Matrix space](https://conduwuit.puppyirl.gay/conduwuit_coc.html) +- No cryptocurrency donations allowed, conduwuit is fully maintained by +independent queer maintainers, and with a strong priority on inclusitivity and +comfort for protected groups 🏳️‍⚧️ +- [Add a community Code of Conduct for all conduwuit community spaces, primarily +the Matrix space](https://conduwuit.puppyirl.gay/conduwuit_coc.html) diff --git a/docs/introduction.md b/docs/introduction.md index 6b1c35e3..9db76681 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -12,7 +12,8 @@ See the [differences](differences.md) page - [Deployment options](deploying.md) -If you want to connect an appservice to conduwuit, take a look at the [appservices documentation](appservices.md). +If you want to connect an appservice to conduwuit, take a look at the +[appservices documentation](appservices.md). #### How can I contribute? diff --git a/docs/maintenance.md b/docs/maintenance.md index 3cf2cf98..c8df95af 100644 --- a/docs/maintenance.md +++ b/docs/maintenance.md @@ -2,7 +2,11 @@ ## Moderation -conduwuit has moderation through admin room commands. "binary commands" (medium priority) and an admin API (low priority) is planned. Some moderation-related config options are available in the example config such as "global ACLs" and blocking media requests to certain servers. See the example config for the moderation config options under the "Moderation / Privacy / Security" section. +conduwuit has moderation through admin room commands. "binary commands" (medium +priority) and an admin API (low priority) is planned. Some moderation-related +config options are available in the example config such as "global ACLs" and +blocking media requests to certain servers. See the example config for the +moderation config options under the "Moderation / Privacy / Security" section. conduwuit has moderation admin commands for: @@ -11,56 +15,83 @@ conduwuit has moderation admin commands for: - managing room banning/blocking and user removal (`!admin rooms moderation`) - managing user accounts (`!admin users`) - fetching `/.well-known/matrix/support` from servers (`!admin federation`) -- blocking incoming federation for certain rooms (not the same as room banning) (`!admin federation`) +- blocking incoming federation for certain rooms (not the same as room banning) +(`!admin federation`) - deleting media (see [the media section](#media)) -Any commands with `-list` in them will require a codeblock in the message with each object being newline delimited. An example of doing this is: +Any commands with `-list` in them will require a codeblock in the message with +each object being newline delimited. An example of doing this is: -```` -!admin rooms moderation ban-list-of-rooms -``` -!roomid1:server.name -!roomid2:server.name -!roomid3:server.name -``` -```` +```` !admin rooms moderation ban-list-of-rooms ``` !roomid1:server.name +!roomid2:server.name !roomid3:server.name ``` ```` ## Database -If using RocksDB, there's very little you need to do. Compaction is ran automatically based on various defined thresholds tuned for conduwuit to be high performance with the least I/O amplifcation or overhead. Manually running compaction is not recommended, or compaction via a timer. RocksDB is built with io_uring support via liburing for async read I/O. +If using RocksDB, there's very little you need to do. Compaction is ran +automatically based on various defined thresholds tuned for conduwuit to be high +performance with the least I/O amplifcation or overhead. Manually running +compaction is not recommended, or compaction via a timer. RocksDB is built with +io_uring support via liburing for async read I/O. -Some RocksDB settings can be adjusted such as the compression method chosen. See the RocksDB section in the [example config](configuration/examples.md). btrfs users may benefit from disabling compression on RocksDB if CoW is in use. +Some RocksDB settings can be adjusted such as the compression method chosen. See +the RocksDB section in the [example config](configuration/examples.md). btrfs +users may benefit from disabling compression on RocksDB if CoW is in use. -RocksDB troubleshooting can be found [in the RocksDB section of troubleshooting](troubleshooting.md). +RocksDB troubleshooting can be found [in the RocksDB section of +troubleshooting](troubleshooting.md). ## Backups -Currently only RocksDB supports online backups. If you'd like to backup your database online without any downtime, see the `!admin server` command for the backup commands and the `database_backup_path` config options in the example config. Please note that the format of the database backup is not the exact same. This is unfortunately a bad design choice by Facebook as we are using the database backup engine API from RocksDB, however the data is still there and can still be joined together. +Currently only RocksDB supports online backups. If you'd like to backup your +database online without any downtime, see the `!admin server` command for the +backup commands and the `database_backup_path` config options in the example +config. Please note that the format of the database backup is not the exact +same. This is unfortunately a bad design choice by Facebook as we are using the +database backup engine API from RocksDB, however the data is still there and can +still be joined together. To restore a backup from an online RocksDB backup: - shutdown conduwuit - create a new directory for merging together the data -- in the online backup created, copy all `.sst` files in `$DATABASE_BACKUP_PATH/shared_checksum` to your new directory -- trim all the strings so instead of `######_sxxxxxxxxx.sst`, it reads `######.sst`. A way of doing this with sed and bash is `for file in *.sst; do mv "$file" "$(echo "$file" | sed 's/_s.*/.sst/')"; done` -- copy all the files in `$DATABASE_BACKUP_PATH/1` (or the latest backup number if you have multiple) to your new directory -- set your `database_path` config option to your new directory, or replace your old one with the new one you crafted +- in the online backup created, copy all `.sst` files in +`$DATABASE_BACKUP_PATH/shared_checksum` to your new directory +- trim all the strings so instead of `######_sxxxxxxxxx.sst`, it reads +`######.sst`. A way of doing this with sed and bash is `for file in *.sst; do mv +"$file" "$(echo "$file" | sed 's/_s.*/.sst/')"; done` +- copy all the files in `$DATABASE_BACKUP_PATH/1` (or the latest backup number +if you have multiple) to your new directory +- set your `database_path` config option to your new directory, or replace your +old one with the new one you crafted - start up conduwuit again and it should open as normal -If you'd like to do an offline backup, shutdown conduwuit and copy your `database_path` directory elsewhere. This can be restored with no modifications needed. +If you'd like to do an offline backup, shutdown conduwuit and copy your +`database_path` directory elsewhere. This can be restored with no modifications +needed. -Backing up media is also just copying the `media/` directory from your database directory. +Backing up media is also just copying the `media/` directory from your database +directory. ## Media Media still needs various work, however conduwuit implements media deletion via: -- MXC URI or Event ID (unencrypted and attempts to find the MXC URI in the event) +- MXC URI or Event ID (unencrypted and attempts to find the MXC URI in the +event) - Delete list of MXC URIs -- Delete remote media in the past `N` seconds/minutes via filesystem metadata on the file created time (`btime`) or file modified time (`mtime`) +- Delete remote media in the past `N` seconds/minutes via filesystem metadata on +the file created time (`btime`) or file modified time (`mtime`) -See the `!admin media` command for further information. All media in conduwuit is stored at `$DATABASE_DIR/media`. This will be configurable soon. +See the `!admin media` command for further information. All media in conduwuit +is stored at `$DATABASE_DIR/media`. This will be configurable soon. -If you are finding yourself needing extensive granular control over media, we recommend looking into [Matrix Media Repo](https://github.com/t2bot/matrix-media-repo). conduwuit intends to implement various utilities for media, but MMR is dedicated to extensive media management. +If you are finding yourself needing extensive granular control over media, we +recommend looking into [Matrix Media +Repo](https://github.com/t2bot/matrix-media-repo). conduwuit intends to +implement various utilities for media, but MMR is dedicated to extensive media +management. -Built-in S3 support is also planned, but for now using a "S3 filesystem" on `media/` works. conduwuit also sends a `Cache-Control` header of 1 year and immutable for all media requests (download and thumbnail) to reduce unnecessary media requests from browsers, reduce bandwidth usage, and reduce load. +Built-in S3 support is also planned, but for now using a "S3 filesystem" on +`media/` works. conduwuit also sends a `Cache-Control` header of 1 year and +immutable for all media requests (download and thumbnail) to reduce unnecessary +media requests from browsers, reduce bandwidth usage, and reduce load. diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 61a22864..dd63d9bb 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -2,34 +2,55 @@ > ## Docker users ⚠️ > -> Docker is extremely UX unfriendly. Because of this, a ton of issues or support is actually Docker support, not conduwuit support. We also cannot document the ever-growing list of Docker issues here. +> Docker is extremely UX unfriendly. Because of this, a ton of issues or support +> is actually Docker support, not conduwuit support. We also cannot document the +> ever-growing list of Docker issues here. > -> If you intend on asking for support and you are using Docker, **PLEASE** triple validate your issues are **NOT** because you have a misconfiguration in your Docker setup. +> If you intend on asking for support and you are using Docker, **PLEASE** +> triple validate your issues are **NOT** because you have a misconfiguration in +> your Docker setup. > -> If there are things like Compose file issues or Dockerhub image issues, those can still be mentioned as long as they're something we can fix. +> If there are things like Compose file issues or Dockerhub image issues, those +> can still be mentioned as long as they're something we can fix. ## General potential issues #### Potential DNS issues when using Docker -Docker has issues with its default DNS setup that may cause DNS to not be properly functional when running conduwuit, resulting in federation issues. -The symptoms of this have shown in excessively long room joins (30+ minutes) from very long DNS timeouts, log entries of "mismatching responding nameservers", and/or partial or non-functional inbound/outbound federation. +Docker has issues with its default DNS setup that may cause DNS to not be +properly functional when running conduwuit, resulting in federation issues. The +symptoms of this have shown in excessively long room joins (30+ minutes) from +very long DNS timeouts, log entries of "mismatching responding nameservers", +and/or partial or non-functional inbound/outbound federation. -This is **not** a conduwuit issue, and is purely a Docker issue. It is not sustainable for heavy DNS activity which is normal for Matrix federation. The workarounds for this are: +This is **not** a conduwuit issue, and is purely a Docker issue. It is not +sustainable for heavy DNS activity which is normal for Matrix federation. The +workarounds for this are: - Use DNS over TCP via the config option `query_over_tcp_only = true` -- Don't use Docker's default DNS setup and instead allow the container to use and communicate with your host's DNS servers (host's `/etc/resolv.conf`) +- Don't use Docker's default DNS setup and instead allow the container to use +and communicate with your host's DNS servers (host's `/etc/resolv.conf`) ## Rocksdb / database issues #### Direct IO -Some filesystems may not like RocksDB using [Direct IO](https://github.com/facebook/rocksdb/wiki/Direct-IO). Direct IO is for non-buffered I/O which improves conduwuit performance, but at least FUSE is a filesystem potentially known to not like this. See the [example config](configuration/examples.md) for disabling it if needed. Issues from Direct IO on unsupported filesystems are usually shown as startup errors. +Some filesystems may not like RocksDB using [Direct +IO](https://github.com/facebook/rocksdb/wiki/Direct-IO). Direct IO is for +non-buffered I/O which improves conduwuit performance, but at least FUSE is a +filesystem potentially known to not like this. See the [example +config](configuration/examples.md) for disabling it if needed. Issues from +Direct IO on unsupported filesystems are usually shown as startup errors. #### Database corruption -If your database is corrupted *and* is failing to start (e.g. checksum mismatch), it may be recoverable but careful steps must be taken, and there is no guarantee it may be recoverable. +If your database is corrupted *and* is failing to start (e.g. checksum +mismatch), it may be recoverable but careful steps must be taken, and there is +no guarantee it may be recoverable. -The first thing that can be done is launching conduwuit with the `rocksdb_repair` config option set to true. This will tell RocksDB to attempt to repair itself at launch. If this does not work, disable the option and continue reading. +The first thing that can be done is launching conduwuit with the +`rocksdb_repair` config option set to true. This will tell RocksDB to attempt to +repair itself at launch. If this does not work, disable the option and continue +reading. RocksDB has the following recovery modes: @@ -38,33 +59,59 @@ RocksDB has the following recovery modes: - `PointInTime` - `SkipAnyCorruptedRecord` -By default, conduwuit uses `TolerateCorruptedTailRecords` as generally these may be due to bad federation and we can re-fetch the correct data over federation. The RocksDB default is `PointInTime` which will attempt to restore a "snapshot" of the data when it was last known to be good. This data can be either a few seconds old, or multiple minutes prior. `PointInTime` may not be suitable for default usage due to clients and servers possibly not being able to handle sudden "backwards time travels", and `AbsoluteConsistency` may be too strict. +By default, conduwuit uses `TolerateCorruptedTailRecords` as generally these may +be due to bad federation and we can re-fetch the correct data over federation. +The RocksDB default is `PointInTime` which will attempt to restore a "snapshot" +of the data when it was last known to be good. This data can be either a few +seconds old, or multiple minutes prior. `PointInTime` may not be suitable for +default usage due to clients and servers possibly not being able to handle +sudden "backwards time travels", and `AbsoluteConsistency` may be too strict. -`AbsoluteConsistency` will fail to start the database if any sign of corruption is detected. `SkipAnyCorruptedRecord` will skip all forms of corruption unless it forbids the database from opening (e.g. too severe). Usage of `SkipAnyCorruptedRecord` voids any support as this may cause more damage and/or leave your database in a permanently inconsistent state, but it may do something if `PointInTime` does not work as a last ditch effort. +`AbsoluteConsistency` will fail to start the database if any sign of corruption +is detected. `SkipAnyCorruptedRecord` will skip all forms of corruption unless +it forbids the database from opening (e.g. too severe). Usage of +`SkipAnyCorruptedRecord` voids any support as this may cause more damage and/or +leave your database in a permanently inconsistent state, but it may do something +if `PointInTime` does not work as a last ditch effort. With this in mind: -- First start conduwuit with the `PointInTime` recovery method. See the [example config](configuration/examples.md) for how to do this using `rocksdb_recovery_mode` -- If your database successfully opens, clients are recommended to clear their client cache to account for the rollback -- Leave your conduwuit running in `PointInTime` for at least 30-60 minutes so as much possible corruption is restored -- If all goes will, you should be able to restore back to using `TolerateCorruptedTailRecords` and you have successfully recovered your database +- First start conduwuit with the `PointInTime` recovery method. See the [example +config](configuration/examples.md) for how to do this using +`rocksdb_recovery_mode` +- If your database successfully opens, clients are recommended to clear their +client cache to account for the rollback +- Leave your conduwuit running in `PointInTime` for at least 30-60 minutes so as +much possible corruption is restored +- If all goes will, you should be able to restore back to using +`TolerateCorruptedTailRecords` and you have successfully recovered your database ## Debugging -Note that users should not really be debugging things. If you find yourself debugging and find the issue, please let us know and/or how we can fix it. Various debug commands can be found in `!admin debug`. +Note that users should not really be debugging things. If you find yourself +debugging and find the issue, please let us know and/or how we can fix it. +Various debug commands can be found in `!admin debug`. #### Debug/Trace log level -conduwuit builds without debug or trace log levels by default for at least performance reasons. This may change in the future and/or binaries providing such configurations may be provided. If you need to access debug/trace log levels, you will need to build without the `release_max_log_level` feature. +conduwuit builds without debug or trace log levels by default for at least +performance reasons. This may change in the future and/or binaries providing +such configurations may be provided. If you need to access debug/trace log +levels, you will need to build without the `release_max_log_level` feature. #### Changing log level dynamically -conduwuit supports changing the tracing log environment filter on-the-fly using the admin command `!admin debug change-log-level`. This accepts a string **without quotes** the same format as the `log` config option. +conduwuit supports changing the tracing log environment filter on-the-fly using +the admin command `!admin debug change-log-level`. This accepts a string +**without quotes** the same format as the `log` config option. #### Pinging servers -conduwuit can ping other servers using `!admin debug ping`. This takes a server name and goes through the server discovery process and queries `/_matrix/federation/v1/version`. Errors are outputted. +conduwuit can ping other servers using `!admin debug ping`. This takes a server +name and goes through the server discovery process and queries +`/_matrix/federation/v1/version`. Errors are outputted. #### Allocator memory stats -When using jemalloc with jemallocator's `stats` feature, you can see conduwuit's jemalloc memory stats by using `!admin debug memory-stats` +When using jemalloc with jemallocator's `stats` feature, you can see conduwuit's +jemalloc memory stats by using `!admin debug memory-stats` diff --git a/docs/turn.md b/docs/turn.md index 29ddb79c..d54398ae 100644 --- a/docs/turn.md +++ b/docs/turn.md @@ -1,6 +1,8 @@ # Setting up TURN/STURN -In order to make or receive calls, a TURN server is required. conduwuit suggests using [Coturn](https://github.com/coturn/coturn) for this purpose, which is also available as a Docker image. +In order to make or receive calls, a TURN server is required. conduwuit suggests +using [Coturn](https://github.com/coturn/coturn) for this purpose, which is also +available as a Docker image. ### Configuration @@ -12,20 +14,25 @@ static-auth-secret= realm= ``` -A common way to generate a suitable alphanumeric secret key is by using `pwgen -s 64 1`. +A common way to generate a suitable alphanumeric secret key is by using `pwgen +-s 64 1`. -These same values need to be set in conduwuit. See the [example config](configuration/examples.md) in the TURN section for configuring these and restart conduwuit after. +These same values need to be set in conduwuit. See the [example +config](configuration/examples.md) in the TURN section for configuring these and +restart conduwuit after. ### Run Run the [Coturn](https://hub.docker.com/r/coturn/coturn) image using ```bash -docker run -d --network=host -v $(pwd)/coturn.conf:/etc/coturn/turnserver.conf coturn/coturn +docker run -d --network=host -v +$(pwd)/coturn.conf:/etc/coturn/turnserver.conf coturn/coturn ``` -or docker-compose. For the latter, paste the following section into a file called `docker-compose.yml` -and run `docker compose up -d` in the same directory. +or docker-compose. For the latter, paste the following section into a file +called `docker-compose.yml` and run `docker compose up -d` in the same +directory. ```yml version: 3 @@ -39,6 +46,9 @@ services: - ./coturn.conf:/etc/coturn/turnserver.conf ``` -To understand why the host networking mode is used and explore alternative configuration options, please visit [Coturn's Docker documentation](https://github.com/coturn/coturn/blob/master/docker/coturn/README.md). +To understand why the host networking mode is used and explore alternative +configuration options, please visit [Coturn's Docker +documentation](https://github.com/coturn/coturn/blob/master/docker/coturn/README.md). -For security recommendations see Synapse's [Coturn documentation](https://element-hq.github.io/synapse/latest/turn-howto.html). +For security recommendations see Synapse's [Coturn +documentation](https://element-hq.github.io/synapse/latest/turn-howto.html).