mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-26 22:56:36 +02:00
Compare commits
26 commits
v0.5.0-rc.
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
db58d841aa | ||
|
f1ca84fcaf | ||
|
63962fc040 | ||
|
a24278dc1b | ||
|
b787e97dc1 | ||
|
eb75c4ecb0 | ||
|
9bbe333082 | ||
|
3177545a6f | ||
|
4a289a9fee | ||
|
4d69a1ad51 | ||
|
4f174324ba | ||
|
2ecbd75d64 | ||
|
a682e9dbb8 | ||
|
46c193e74b | ||
|
93719018a8 | ||
|
70df8364b3 | ||
|
bae8192fb3 | ||
|
add5c7052c | ||
|
01200d9b54 | ||
|
0ba4a265be | ||
|
08fbcbba69 | ||
|
b526935d45 | ||
|
a737d845a4 | ||
|
e508b1197f | ||
|
d6fd30393c | ||
|
6e16a6ef8f |
33 changed files with 745 additions and 391 deletions
|
@ -23,6 +23,6 @@ indent_size = 2
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
max_line_length = 98
|
max_line_length = 98
|
||||||
|
|
||||||
[{.forgejo/**/*.yml,.github/**/*.yml}]
|
[*.yml]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
27
.forgejo/actions/prefligit/action.yml
Normal file
27
.forgejo/actions/prefligit/action.yml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
name: prefligit
|
||||||
|
description: |
|
||||||
|
Runs prefligit, pre-commit reimplemented in Rust.
|
||||||
|
inputs:
|
||||||
|
extra_args:
|
||||||
|
description: options to pass to pre-commit run
|
||||||
|
required: false
|
||||||
|
default: '--all-files'
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Install uv
|
||||||
|
uses: https://github.com/astral-sh/setup-uv@v6
|
||||||
|
with:
|
||||||
|
enable-cache: true
|
||||||
|
ignore-nothing-to-cache: true
|
||||||
|
- name: Install Prefligit
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prefligit/releases/download/v0.0.10/prefligit-installer.sh | sh
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.cache/prefligit
|
||||||
|
key: prefligit-0|${{ hashFiles('.pre-commit-config.yaml') }}
|
||||||
|
- run: prefligit run --show-diff-on-failure --color=always -v ${{ inputs.extra_args }}
|
||||||
|
shell: bash
|
|
@ -17,6 +17,7 @@ jobs:
|
||||||
docs:
|
docs:
|
||||||
name: Build and Deploy Documentation
|
name: Build and Deploy Documentation
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: secrets.CLOUDFLARE_API_TOKEN != ''
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Sync repository
|
- name: Sync repository
|
||||||
|
|
22
.forgejo/workflows/prefligit-checks.yml
Normal file
22
.forgejo/workflows/prefligit-checks.yml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
name: Checks / Prefligit
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prefligit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
FROM_REF: ${{ github.event.pull_request.base.sha || (!github.event.forced && ( github.event.before != '0000000000000000000000000000000000000000' && github.event.before || github.sha )) || format('{0}~', github.sha) }}
|
||||||
|
TO_REF: ${{ github.sha }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: ./.forgejo/actions/prefligit
|
||||||
|
with:
|
||||||
|
extra_args: --all-files --hook-stage manual
|
|
@ -49,6 +49,7 @@ jobs:
|
||||||
const platforms = ['linux/amd64', 'linux/arm64']
|
const platforms = ['linux/amd64', 'linux/arm64']
|
||||||
core.setOutput('build_matrix', JSON.stringify({
|
core.setOutput('build_matrix', JSON.stringify({
|
||||||
platform: platforms,
|
platform: platforms,
|
||||||
|
target_cpu: ['base'],
|
||||||
include: platforms.map(platform => { return {
|
include: platforms.map(platform => { return {
|
||||||
platform,
|
platform,
|
||||||
slug: platform.replace('/', '-')
|
slug: platform.replace('/', '-')
|
||||||
|
@ -66,6 +67,8 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
{
|
{
|
||||||
|
"target_cpu": ["base"],
|
||||||
|
"profile": ["release"],
|
||||||
"include":
|
"include":
|
||||||
[
|
[
|
||||||
{ "platform": "linux/amd64", "slug": "linux-amd64" },
|
{ "platform": "linux/amd64", "slug": "linux-amd64" },
|
||||||
|
@ -73,6 +76,7 @@ jobs:
|
||||||
],
|
],
|
||||||
"platform": ["linux/amd64", "linux/arm64"],
|
"platform": ["linux/amd64", "linux/arm64"],
|
||||||
}
|
}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Echo strategy
|
- name: Echo strategy
|
||||||
run: echo '${{ toJSON(fromJSON(needs.define-variables.outputs.build_matrix)) }}'
|
run: echo '${{ toJSON(fromJSON(needs.define-variables.outputs.build_matrix)) }}'
|
||||||
|
@ -140,8 +144,8 @@ jobs:
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
cargo-target-${{ matrix.slug }}
|
cargo-target-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}
|
||||||
key: cargo-target-${{ matrix.slug }}-${{hashFiles('**/Cargo.lock') }}-${{steps.rust-toolchain.outputs.rustc_version}}
|
key: cargo-target-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}-${{hashFiles('**/Cargo.lock') }}-${{steps.rust-toolchain.outputs.rustc_version}}
|
||||||
- name: Cache apt cache
|
- name: Cache apt cache
|
||||||
id: cache-apt
|
id: cache-apt
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -163,9 +167,9 @@ jobs:
|
||||||
{
|
{
|
||||||
".cargo/registry": "/usr/local/cargo/registry",
|
".cargo/registry": "/usr/local/cargo/registry",
|
||||||
".cargo/git/db": "/usr/local/cargo/git/db",
|
".cargo/git/db": "/usr/local/cargo/git/db",
|
||||||
"cargo-target-${{ matrix.slug }}": {
|
"cargo-target-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}": {
|
||||||
"target": "/app/target",
|
"target": "/app/target",
|
||||||
"id": "cargo-target-${{ matrix.platform }}"
|
"id": "cargo-target-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}"
|
||||||
},
|
},
|
||||||
"var-cache-apt-${{ matrix.slug }}": "/var/cache/apt",
|
"var-cache-apt-${{ matrix.slug }}": "/var/cache/apt",
|
||||||
"var-lib-apt-${{ matrix.slug }}": "/var/lib/apt"
|
"var-lib-apt-${{ matrix.slug }}": "/var/lib/apt"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
name: Rust Checks
|
name: Checks / Rust
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
|
@ -5,3 +5,5 @@ f419c64aca300a338096b4e0db4c73ace54f23d0
|
||||||
# use chain_width 60
|
# use chain_width 60
|
||||||
162948313c212193965dece50b816ef0903172ba
|
162948313c212193965dece50b816ef0903172ba
|
||||||
5998a0d883d31b866f7c8c46433a8857eae51a89
|
5998a0d883d31b866f7c8c46433a8857eae51a89
|
||||||
|
# trailing whitespace and newlines
|
||||||
|
46c193e74b2ce86c48ce802333a0aabce37fd6e9
|
||||||
|
|
47
.pre-commit-config.yaml
Normal file
47
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
default_install_hook_types:
|
||||||
|
- pre-commit
|
||||||
|
- commit-msg
|
||||||
|
default_stages:
|
||||||
|
- pre-commit
|
||||||
|
- manual
|
||||||
|
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v5.0.0
|
||||||
|
hooks:
|
||||||
|
- id: check-byte-order-marker
|
||||||
|
- id: check-case-conflict
|
||||||
|
- id: check-symlinks
|
||||||
|
- id: destroyed-symlinks
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-json
|
||||||
|
- id: check-toml
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: mixed-line-ending
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: check-added-large-files
|
||||||
|
|
||||||
|
- repo: https://github.com/crate-ci/typos
|
||||||
|
rev: v1.26.0
|
||||||
|
hooks:
|
||||||
|
- id: typos
|
||||||
|
- id: typos
|
||||||
|
name: commit-msg-typos
|
||||||
|
stages: [commit-msg]
|
||||||
|
|
||||||
|
- repo: https://github.com/crate-ci/committed
|
||||||
|
rev: v1.1.7
|
||||||
|
hooks:
|
||||||
|
- id: committed
|
||||||
|
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: cargo-fmt
|
||||||
|
name: cargo fmt
|
||||||
|
entry: cargo +nightly fmt --
|
||||||
|
language: system
|
||||||
|
types: [rust]
|
||||||
|
pass_filenames: false
|
||||||
|
stages:
|
||||||
|
- pre-commit
|
166
CONTRIBUTING.md
166
CONTRIBUTING.md
|
@ -1,6 +1,6 @@
|
||||||
# Contributing guide
|
# Contributing guide
|
||||||
|
|
||||||
This page is for about contributing to Continuwuity. The
|
This page is about contributing to Continuwuity. The
|
||||||
[development](./development.md) page may be of interest for you as well.
|
[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
|
If you would like to work on an [issue][issues] that is not assigned, preferably
|
||||||
|
@ -10,7 +10,7 @@ and comment on it.
|
||||||
### Linting and Formatting
|
### Linting and Formatting
|
||||||
|
|
||||||
It is mandatory all your changes satisfy the lints (clippy, rustc, rustdoc, etc)
|
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
|
and your code is formatted via the **nightly** rustfmt (`cargo +nightly fmt`). A lot of the
|
||||||
`rustfmt.toml` features depend on nightly toolchain. It would be ideal if they
|
`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
|
weren't nightly-exclusive features, but they currently still are. CI's rustfmt
|
||||||
uses nightly.
|
uses nightly.
|
||||||
|
@ -21,67 +21,91 @@ 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
|
lints. If a lint is wrong and provides a more inefficient solution or
|
||||||
suggestion, allow the lint and mention that in a comment.
|
suggestion, allow the lint and mention that in a comment.
|
||||||
|
|
||||||
### Running CI tests locally
|
### Pre-commit Checks
|
||||||
|
|
||||||
continuwuity's CI for tests, linting, formatting, audit, etc use
|
Continuwuity uses pre-commit hooks to enforce various coding standards and catch common issues before they're committed. These checks include:
|
||||||
[`engage`][engage]. engage can be installed from nixpkgs or `cargo install
|
|
||||||
engage`. continuwuity'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`
|
- Code formatting and linting
|
||||||
file using `direnv allow`, and run `engage`.
|
- Typo detection (both in code and commit messages)
|
||||||
|
- Checking for large files
|
||||||
|
- Ensuring proper line endings and no trailing whitespace
|
||||||
|
- Validating YAML, JSON, and TOML files
|
||||||
|
- Checking for merge conflicts
|
||||||
|
|
||||||
All of the tasks are defined at the [engage.toml][engage.toml] file. You can
|
You can run these checks locally by installing [prefligit](https://github.com/j178/prefligit):
|
||||||
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 <group>`
|
```bash
|
||||||
- Example: `engage just lints`
|
# Install prefligit using cargo-binstall
|
||||||
|
cargo binstall prefligit
|
||||||
|
|
||||||
If you would like to run a specific engage task in a specific group, use `just
|
# Install git hooks to run checks automatically
|
||||||
<GROUP> [TASK]`: `engage just lints cargo-fmt`
|
prefligit install
|
||||||
|
|
||||||
The following binaries are used in [`engage.toml`][engage.toml]:
|
# Run all checks
|
||||||
|
prefligit --all-files
|
||||||
|
```
|
||||||
|
|
||||||
- [`engage`][engage]
|
Alternatively, you can use [pre-commit](https://pre-commit.com/):
|
||||||
- `nix`
|
```bash
|
||||||
- [`direnv`][direnv]
|
# Install pre-commit
|
||||||
- `rustc`
|
pip install pre-commit
|
||||||
- `cargo`
|
|
||||||
- `cargo-fmt`
|
# Install the hooks
|
||||||
- `rustdoc`
|
pre-commit install
|
||||||
- `cargo-clippy`
|
|
||||||
- [`cargo-audit`][cargo-audit]
|
# Run all checks manually
|
||||||
- [`cargo-deb`][cargo-deb]
|
pre-commit run --all-files
|
||||||
- [`lychee`][lychee]
|
```
|
||||||
- [`markdownlint-cli`][markdownlint-cli]
|
|
||||||
- `dpkg`
|
These same checks are run in CI via the prefligit-checks workflow to ensure consistency.
|
||||||
|
|
||||||
|
### Running tests locally
|
||||||
|
|
||||||
|
Tests, compilation, and linting can be run with standard Cargo commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run tests
|
||||||
|
cargo test
|
||||||
|
|
||||||
|
# Check compilation
|
||||||
|
cargo check --workspace
|
||||||
|
|
||||||
|
# Run lints
|
||||||
|
cargo clippy --workspace
|
||||||
|
# Auto-fix: cargo clippy --workspace --fix --allow-staged;
|
||||||
|
|
||||||
|
# Format code (must use nightly)
|
||||||
|
cargo +nightly fmt
|
||||||
|
```
|
||||||
|
|
||||||
### Matrix tests
|
### Matrix tests
|
||||||
|
|
||||||
CI runs [Complement][complement], but currently does not fail if results from
|
Continuwuity uses [Complement][complement] for Matrix protocol compliance testing. Complement tests are run manually by developers, and documentation on how to run these tests locally is currently being developed.
|
||||||
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
|
If your changes are done to fix Matrix tests, please note that in your pull request. If more Complement tests start failing from your changes, please review the logs and determine if they're intended or not.
|
||||||
[testing](development/testing.md) page.
|
|
||||||
|
|
||||||
[Sytest][sytest] support will come soon.
|
[Sytest][sytest] is currently unsupported.
|
||||||
|
|
||||||
### Writing documentation
|
### Writing documentation
|
||||||
|
|
||||||
Continuwuity's website uses [`mdbook`][mdbook] and deployed via CI using GitHub
|
Continuwuity's website uses [`mdbook`][mdbook] and is deployed via CI using Cloudflare Pages
|
||||||
Pages in the [`documentation.yml`][documentation.yml] workflow file with Nix's
|
in the [`documentation.yml`][documentation.yml] workflow file. All documentation is in the `docs/`
|
||||||
mdbook in the devshell. All documentation is in the `docs/` directory at the top
|
directory at the top level.
|
||||||
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`
|
To build the documentation locally:
|
||||||
|
|
||||||
The output of the mdbook generation is in `result/`. mdbooks can be opened in
|
1. Install mdbook if you don't have it already:
|
||||||
your browser from the individual HTML files without any web server needed.
|
```bash
|
||||||
|
cargo install mdbook # or cargo binstall, or another method
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Build the documentation:
|
||||||
|
```bash
|
||||||
|
mdbook build
|
||||||
|
```
|
||||||
|
|
||||||
|
The output of the mdbook generation is in `public/`. You can open the HTML files directly in your browser without needing a web server.
|
||||||
|
|
||||||
### Inclusivity and Diversity
|
### Inclusivity and Diversity
|
||||||
|
|
||||||
|
@ -109,6 +133,40 @@ Rust's default style and standards with regards to [function names, variable
|
||||||
names, comments](https://rust-lang.github.io/api-guidelines/naming.html), etc
|
names, comments](https://rust-lang.github.io/api-guidelines/naming.html), etc
|
||||||
applies here.
|
applies here.
|
||||||
|
|
||||||
|
### Commit Messages
|
||||||
|
|
||||||
|
Continuwuity follows the [Conventional Commits](https://www.conventionalcommits.org/) specification for commit messages. This provides a standardized format that makes the commit history more readable and enables automated tools to generate changelogs.
|
||||||
|
|
||||||
|
The basic structure is:
|
||||||
|
```
|
||||||
|
<type>[(optional scope)]: <description>
|
||||||
|
|
||||||
|
[optional body]
|
||||||
|
|
||||||
|
[optional footer(s)]
|
||||||
|
```
|
||||||
|
|
||||||
|
The allowed types for commits are:
|
||||||
|
- `fix`: Bug fixes
|
||||||
|
- `feat`: New features
|
||||||
|
- `docs`: Documentation changes
|
||||||
|
- `style`: Changes that don't affect the meaning of the code (formatting, etc.)
|
||||||
|
- `refactor`: Code changes that neither fix bugs nor add features
|
||||||
|
- `perf`: Performance improvements
|
||||||
|
- `test`: Adding or fixing tests
|
||||||
|
- `build`: Changes to the build system or dependencies
|
||||||
|
- `ci`: Changes to CI configuration
|
||||||
|
- `chore`: Other changes that don't modify source or test files
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
```
|
||||||
|
feat: add user authentication
|
||||||
|
fix(database): resolve connection pooling issue
|
||||||
|
docs: update installation instructions
|
||||||
|
```
|
||||||
|
|
||||||
|
The project uses the `committed` hook to validate commit messages in pre-commit. This ensures all commits follow the conventional format.
|
||||||
|
|
||||||
### Creating pull requests
|
### Creating pull requests
|
||||||
|
|
||||||
Please try to keep contributions to the Forgejo Instance. While the mirrors of continuwuity
|
Please try to keep contributions to the Forgejo Instance. While the mirrors of continuwuity
|
||||||
|
@ -118,6 +176,13 @@ This prevents us 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
|
of it, especially when the CI completed successfully and everything so it
|
||||||
*looks* done.
|
*looks* done.
|
||||||
|
|
||||||
|
Before submitting a pull request, please ensure:
|
||||||
|
1. Your code passes all CI checks (formatting, linting, typo detection, etc.)
|
||||||
|
2. Your commit messages follow the conventional commits format
|
||||||
|
3. Tests are added for new functionality
|
||||||
|
4. Documentation is updated if needed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Direct all PRs/MRs to the `main` branch.
|
Direct all PRs/MRs to the `main` branch.
|
||||||
|
|
||||||
|
@ -125,20 +190,13 @@ 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
|
allowed to be licenced under the Apache-2.0 licence and all of your conduct is
|
||||||
in line with the Contributor's Covenant, and continuwuity's Code of Conduct.
|
in line with the Contributor's Covenant, and continuwuity's Code of Conduct.
|
||||||
|
|
||||||
Contribution by users who violate either of these code of conducts will not have
|
Contribution by users who violate either of these code of conducts may not have
|
||||||
their contributions accepted. This includes users who have been banned from
|
their contributions accepted. This includes users who have been banned from
|
||||||
continuwuityMatrix rooms for Code of Conduct violations.
|
continuwuity Matrix rooms for Code of Conduct violations.
|
||||||
|
|
||||||
[issues]: https://forgejo.ellis.link/continuwuation/continuwuity/issues
|
[issues]: https://forgejo.ellis.link/continuwuation/continuwuity/issues
|
||||||
[continuwuity-matrix]: https://matrix.to/#/#continuwuity:continuwuity.org
|
[continuwuity-matrix]: https://matrix.to/#/#continuwuity:continuwuity.org
|
||||||
[complement]: https://github.com/matrix-org/complement/
|
[complement]: https://github.com/matrix-org/complement/
|
||||||
[engage.toml]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/engage.toml
|
|
||||||
[engage]: https://charles.page.computer.surgery/engage/
|
|
||||||
[sytest]: https://github.com/matrix-org/sytest/
|
[sytest]: https://github.com/matrix-org/sytest/
|
||||||
[cargo-deb]: https://github.com/kornelski/cargo-deb
|
|
||||||
[lychee]: https://github.com/lycheeverse/lychee
|
|
||||||
[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
|
|
||||||
[cargo-audit]: https://github.com/RustSec/rustsec/tree/main/cargo-audit
|
|
||||||
[direnv]: https://direnv.net/
|
|
||||||
[mdbook]: https://rust-lang.github.io/mdBook/
|
[mdbook]: https://rust-lang.github.io/mdBook/
|
||||||
[documentation.yml]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/.forgejo/workflows/documentation.yml
|
[documentation.yml]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/.forgejo/workflows/documentation.yml
|
||||||
|
|
639
Cargo.lock
generated
639
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
13
Cargo.toml
13
Cargo.toml
|
@ -556,11 +556,11 @@ rev = "1e64095a8051a1adf0d1faa307f9f030889ec2aa"
|
||||||
git = "https://forgejo.ellis.link/continuwuation/tracing"
|
git = "https://forgejo.ellis.link/continuwuation/tracing"
|
||||||
rev = "1e64095a8051a1adf0d1faa307f9f030889ec2aa"
|
rev = "1e64095a8051a1adf0d1faa307f9f030889ec2aa"
|
||||||
|
|
||||||
# adds a tab completion callback: https://forgejo.ellis.link/continuwuation/rustyline-async/commit/de26100b0db03e419a3d8e1dd26895d170d1fe50
|
# adds a tab completion callback: https://forgejo.ellis.link/continuwuation/rustyline-async/src/branch/main/.patchy/0002-add-tab-completion-callback.patch
|
||||||
# adds event for CTRL+\: https://forgejo.ellis.link/continuwuation/rustyline-async/commit/67d8c49aeac03a5ef4e818f663eaa94dd7bf339b
|
# adds event for CTRL+\: https://forgejo.ellis.link/continuwuation/rustyline-async/src/branch/main/.patchy/0001-add-event-for-ctrl.patch
|
||||||
[patch.crates-io.rustyline-async]
|
[patch.crates-io.rustyline-async]
|
||||||
git = "https://forgejo.ellis.link/continuwuation/rustyline-async"
|
git = "https://forgejo.ellis.link/continuwuation/rustyline-async"
|
||||||
rev = "deaeb0694e2083f53d363b648da06e10fc13900c"
|
rev = "e9f01cf8c6605483cb80b3b0309b400940493d7f"
|
||||||
|
|
||||||
# adds LIFO queue scheduling; this should be updated with PR progress.
|
# adds LIFO queue scheduling; this should be updated with PR progress.
|
||||||
[patch.crates-io.event-listener]
|
[patch.crates-io.event-listener]
|
||||||
|
@ -580,12 +580,11 @@ rev = "9c8e51510c35077df888ee72a36b4b05637147da"
|
||||||
git = "https://forgejo.ellis.link/continuwuation/hyper-util"
|
git = "https://forgejo.ellis.link/continuwuation/hyper-util"
|
||||||
rev = "e4ae7628fe4fcdacef9788c4c8415317a4489941"
|
rev = "e4ae7628fe4fcdacef9788c4c8415317a4489941"
|
||||||
|
|
||||||
# allows no-aaaa option in resolv.conf
|
# Allows no-aaaa option in resolv.conf
|
||||||
# bumps rust edition and toolchain to 1.86.0 and 2024
|
# Use 1-indexed line numbers when displaying parse error messages
|
||||||
# use sat_add on line number errors
|
|
||||||
[patch.crates-io.resolv-conf]
|
[patch.crates-io.resolv-conf]
|
||||||
git = "https://forgejo.ellis.link/continuwuation/resolv-conf"
|
git = "https://forgejo.ellis.link/continuwuation/resolv-conf"
|
||||||
rev = "200e958941d522a70c5877e3d846f55b5586c68d"
|
rev = "56251316cc4127bcbf36e68ce5e2093f4d33e227"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Our crates
|
# Our crates
|
||||||
|
|
10
README.md
10
README.md
|
@ -11,11 +11,13 @@ It's a community continuation of the [conduwuit](https://github.com/girlbossceo/
|
||||||
|
|
||||||
<!-- ANCHOR: body -->
|
<!-- ANCHOR: body -->
|
||||||
|
|
||||||
[](https://forgejo.ellis.link/continuwuation/continuwuity)  [](https://forgejo.ellis.link/continuwuation/continuwuity/issues?state=open) [](https://forgejo.ellis.link/continuwuation/continuwuity/pulls?state=open)
|
[](https://forgejo.ellis.link/continuwuation/continuwuity) [](https://forgejo.ellis.link/continuwuation/continuwuity/stars) [](https://forgejo.ellis.link/continuwuation/continuwuity/issues?state=open) [](https://forgejo.ellis.link/continuwuation/continuwuity/pulls?state=open)
|
||||||
|
|
||||||
[](https://github.com/continuwuity/continuwuity) 
|
[](https://github.com/continuwuity/continuwuity) [](https://github.com/continuwuity/continuwuity/stargazers)
|
||||||
|
|
||||||
[](https://codeberg.org/nexy7574/continuwuity) 
|
[](https://gitlab.com/continuwuity/continuwuity) [](https://gitlab.com/continuwuity/continuwuity/-/starrers)
|
||||||
|
|
||||||
|
[](https://codeberg.org/continuwuity/continuwuity) [](https://codeberg.org/continuwuity/continuwuity/stars)
|
||||||
|
|
||||||
### Why does this exist?
|
### Why does this exist?
|
||||||
|
|
||||||
|
@ -59,8 +61,6 @@ There are currently no open registration Continuwuity instances available.
|
||||||
|
|
||||||
We're working our way through all of the issues in the [Forgejo project](https://forgejo.ellis.link/continuwuation/continuwuity/issues).
|
We're working our way through all of the issues in the [Forgejo project](https://forgejo.ellis.link/continuwuation/continuwuity/issues).
|
||||||
|
|
||||||
- [Replacing old conduwuit links with working continuwuity links](https://forgejo.ellis.link/continuwuation/continuwuity/issues/742)
|
|
||||||
- [Getting CI and docs deployment working on the new Forgejo project](https://forgejo.ellis.link/continuwuation/continuwuity/issues/740)
|
|
||||||
- [Packaging & availability in more places](https://forgejo.ellis.link/continuwuation/continuwuity/issues/747)
|
- [Packaging & availability in more places](https://forgejo.ellis.link/continuwuation/continuwuity/issues/747)
|
||||||
- [Appservices bugs & features](https://forgejo.ellis.link/continuwuation/continuwuity/issues?q=&type=all&state=open&labels=178&milestone=0&assignee=0&poster=0)
|
- [Appservices bugs & features](https://forgejo.ellis.link/continuwuation/continuwuity/issues?q=&type=all&state=open&labels=178&milestone=0&assignee=0&poster=0)
|
||||||
- [Improving compatibility and spec compliance](https://forgejo.ellis.link/continuwuation/continuwuity/issues?labels=119)
|
- [Improving compatibility and spec compliance](https://forgejo.ellis.link/continuwuation/continuwuity/issues?labels=119)
|
||||||
|
|
|
@ -6,6 +6,7 @@ After=network-online.target
|
||||||
Documentation=https://continuwuity.org/
|
Documentation=https://continuwuity.org/
|
||||||
RequiresMountsFor=/var/lib/private/conduwuit
|
RequiresMountsFor=/var/lib/private/conduwuit
|
||||||
Alias=matrix-conduwuit.service
|
Alias=matrix-conduwuit.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
DynamicUser=yes
|
DynamicUser=yes
|
||||||
Type=notify-reload
|
Type=notify-reload
|
||||||
|
@ -59,7 +60,8 @@ StateDirectory=conduwuit
|
||||||
RuntimeDirectory=conduwuit
|
RuntimeDirectory=conduwuit
|
||||||
RuntimeDirectoryMode=0750
|
RuntimeDirectoryMode=0750
|
||||||
|
|
||||||
Environment="CONTINUWUITY_CONFIG=/etc/conduwuit/conduwuit.toml"
|
Environment=CONTINUWUITY_CONFIG=${CREDENTIALS_DIRECTORY}/config.toml
|
||||||
|
LoadCredential=config.toml:/etc/conduwuit/conduwuit.toml
|
||||||
BindPaths=/var/lib/private/conduwuit:/var/lib/matrix-conduit
|
BindPaths=/var/lib/private/conduwuit:/var/lib/matrix-conduit
|
||||||
BindPaths=/var/lib/private/conduwuit:/var/lib/private/matrix-conduit
|
BindPaths=/var/lib/private/conduwuit:/var/lib/private/matrix-conduit
|
||||||
|
|
||||||
|
|
2
committed.toml
Normal file
2
committed.toml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
style = "conventional"
|
||||||
|
allowed_types = ["ci", "build", "fix", "feat", "chore", "docs", "style", "refactor", "perf", "test"]
|
|
@ -1,15 +1,16 @@
|
||||||
ARG RUST_VERSION=1
|
ARG RUST_VERSION=1
|
||||||
|
ARG DEBIAN_VERSION=bookworm
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
|
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
|
||||||
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-bookworm AS base
|
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-${DEBIAN_VERSION} AS base
|
||||||
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-bookworm AS toolchain
|
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-${DEBIAN_VERSION} AS toolchain
|
||||||
|
|
||||||
# Prevent deletion of apt cache
|
# Prevent deletion of apt cache
|
||||||
RUN rm -f /etc/apt/apt.conf.d/docker-clean
|
RUN rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
|
|
||||||
# Match Rustc version as close as possible
|
# Match Rustc version as close as possible
|
||||||
# rustc -vV
|
# rustc -vV
|
||||||
ARG LLVM_VERSION=19
|
ARG LLVM_VERSION=20
|
||||||
# ENV RUSTUP_TOOLCHAIN=${RUST_VERSION}
|
# ENV RUSTUP_TOOLCHAIN=${RUST_VERSION}
|
||||||
|
|
||||||
# Install repo tools
|
# Install repo tools
|
||||||
|
@ -19,10 +20,18 @@ ARG LLVM_VERSION=19
|
||||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||||
apt-get update && apt-get install -y \
|
apt-get update && apt-get install -y \
|
||||||
clang-${LLVM_VERSION} lld-${LLVM_VERSION} pkg-config make jq \
|
pkg-config make jq \
|
||||||
curl git \
|
curl git software-properties-common \
|
||||||
file
|
file
|
||||||
|
|
||||||
|
# LLVM packages
|
||||||
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||||
|
curl https://apt.llvm.org/llvm.sh > llvm.sh && \
|
||||||
|
chmod +x llvm.sh && \
|
||||||
|
./llvm.sh ${LLVM_VERSION} && \
|
||||||
|
rm llvm.sh
|
||||||
|
|
||||||
# Create symlinks for LLVM tools
|
# Create symlinks for LLVM tools
|
||||||
RUN <<EOF
|
RUN <<EOF
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
@ -39,7 +48,7 @@ EOF
|
||||||
|
|
||||||
# Developer tool versions
|
# Developer tool versions
|
||||||
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
|
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
|
||||||
ENV BINSTALL_VERSION=1.12.3
|
ENV BINSTALL_VERSION=1.13.0
|
||||||
# renovate: datasource=github-releases depName=psastras/sbom-rs
|
# renovate: datasource=github-releases depName=psastras/sbom-rs
|
||||||
ENV CARGO_SBOM_VERSION=0.9.1
|
ENV CARGO_SBOM_VERSION=0.9.1
|
||||||
# renovate: datasource=crate depName=lddtree
|
# renovate: datasource=crate depName=lddtree
|
||||||
|
@ -140,11 +149,12 @@ ENV GIT_REMOTE_COMMIT_URL=$GIT_REMOTE_COMMIT_URL
|
||||||
ENV CONDUWUIT_VERSION_EXTRA=$CONDUWUIT_VERSION_EXTRA
|
ENV CONDUWUIT_VERSION_EXTRA=$CONDUWUIT_VERSION_EXTRA
|
||||||
ENV CONTINUWUITY_VERSION_EXTRA=$CONTINUWUITY_VERSION_EXTRA
|
ENV CONTINUWUITY_VERSION_EXTRA=$CONTINUWUITY_VERSION_EXTRA
|
||||||
|
|
||||||
|
ARG RUST_PROFILE=release
|
||||||
|
|
||||||
# Build the binary
|
# Build the binary
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git/db \
|
--mount=type=cache,target=/usr/local/cargo/git/db \
|
||||||
--mount=type=cache,target=/app/target,id=cargo-target-${TARGETPLATFORM} \
|
--mount=type=cache,target=/app/target,id=cargo-target-${TARGET_CPU}-${TARGETPLATFORM}-${RUST_PROFILE} \
|
||||||
bash <<'EOF'
|
bash <<'EOF'
|
||||||
set -o allexport
|
set -o allexport
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
@ -153,7 +163,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
jq -r ".target_directory"))
|
jq -r ".target_directory"))
|
||||||
mkdir /out/sbin
|
mkdir /out/sbin
|
||||||
PACKAGE=conduwuit
|
PACKAGE=conduwuit
|
||||||
xx-cargo build --locked --release \
|
xx-cargo build --locked --profile ${RUST_PROFILE} \
|
||||||
-p $PACKAGE;
|
-p $PACKAGE;
|
||||||
BINARIES=($(cargo metadata --no-deps --format-version 1 | \
|
BINARIES=($(cargo metadata --no-deps --format-version 1 | \
|
||||||
jq -r ".packages[] | select(.name == \"$PACKAGE\") | .targets[] | select( .kind | map(. == \"bin\") | any ) | .name"))
|
jq -r ".packages[] | select(.name == \"$PACKAGE\") | .targets[] | select( .kind | map(. == \"bin\") | any ) | .name"))
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
# Continuwuity for Arch Linux
|
# Continuwuity for Arch Linux
|
||||||
|
|
||||||
Continuwuity does not have any Arch Linux packages at this time.
|
Continuwuity is available on the `archlinuxcn` repository and AUR, with the same package name `continuwuity`, which includes latest taggged version. The development version is available on AUR as `continuwuity-git`
|
||||||
|
|
||||||
|
Simply install the `continuwuity` package. Configure the service in `/etc/conduwuit/conduwuit.toml`, then enable/start the continuwuity.service.
|
||||||
|
|
|
@ -34,4 +34,3 @@ services:
|
||||||
# - "traefik.http.routers.to-element-web.tls.certresolver=letsencrypt"
|
# - "traefik.http.routers.to-element-web.tls.certresolver=letsencrypt"
|
||||||
|
|
||||||
# vim: ts=2:sw=2:expandtab
|
# vim: ts=2:sw=2:expandtab
|
||||||
|
|
||||||
|
|
|
@ -68,31 +68,22 @@ do this if Rust supported workspace-level features to begin with.
|
||||||
|
|
||||||
## List of forked dependencies
|
## List of forked dependencies
|
||||||
|
|
||||||
During Continuwuity development, we have had to fork
|
During Continuwuity (and prior projects) development, we have had to fork some dependencies to support our use-cases.
|
||||||
some dependencies to support our use-cases in some areas. This ranges from
|
These forks exist for various reasons including features that upstream projects won't accept,
|
||||||
things said upstream project won't accept for any reason, faster-paced
|
faster-paced development, Continuwuity-specific usecases, or lack of time to upstream changes.
|
||||||
development (unresponsive or slow upstream), Continuwuity-specific usecases, or
|
|
||||||
lack of time to upstream some things.
|
|
||||||
|
|
||||||
- [ruma/ruma][1]: <https://github.com/girlbossceo/ruwuma> - various performance
|
All forked dependencies are maintained under the [continuwuation organization on Forgejo](https://forgejo.ellis.link/continuwuation):
|
||||||
improvements, more features, faster-paced development, better client/server interop
|
|
||||||
hacks upstream won't accept, etc
|
- [ruwuma][continuwuation-ruwuma] - Fork of [ruma/ruma][ruma] with various performance improvements, more features and better client/server interop
|
||||||
- [facebook/rocksdb][2]: <https://github.com/girlbossceo/rocksdb> - liburing
|
- [rocksdb][continuwuation-rocksdb] - Fork of [facebook/rocksdb][rocksdb] via [`@zaidoon1`][8] with liburing build fixes and GCC debug build fixes
|
||||||
build fixes and GCC debug build fix
|
- [jemallocator][continuwuation-jemallocator] - Fork of [tikv/jemallocator][jemallocator] fixing musl builds, suspicious code,
|
||||||
- [tikv/jemallocator][3]: <https://github.com/girlbossceo/jemallocator> - musl
|
and adding support for redzones in Valgrind
|
||||||
builds seem to be broken on upstream, fixes some broken/suspicious code in
|
- [rustyline-async][continuwuation-rustyline-async] - Fork of [zyansheep/rustyline-async][rustyline-async] with tab completion callback
|
||||||
places, additional safety measures, and support redzones for Valgrind
|
and `CTRL+\` signal quit event for Continuwuity console CLI
|
||||||
- [zyansheep/rustyline-async][4]:
|
- [rust-rocksdb][continuwuation-rust-rocksdb] - Fork of [rust-rocksdb/rust-rocksdb][rust-rocksdb] fixing musl build issues,
|
||||||
<https://github.com/girlbossceo/rustyline-async> - tab completion callback and
|
removing unnecessary `gtest` include, and using our RocksDB and jemallocator forks
|
||||||
`CTRL+\` signal quit event for Continuwuity console CLI
|
- [tracing][continuwuation-tracing] - Fork of [tokio-rs/tracing][tracing] implementing `Clone` for `EnvFilter` to
|
||||||
- [rust-rocksdb/rust-rocksdb][5]:
|
support dynamically changing tracing environments
|
||||||
<https://github.com/girlbossceo/rust-rocksdb-zaidoon1> - [`@zaidoon1`][8]'s fork
|
|
||||||
has quicker updates, more up to date dependencies, etc. Our fork fixes musl build
|
|
||||||
issues, removes unnecessary `gtest` include, and uses our RocksDB and jemallocator
|
|
||||||
forks.
|
|
||||||
- [tokio-rs/tracing][6]: <https://github.com/girlbossceo/tracing> - Implements
|
|
||||||
`Clone` for `EnvFilter` to support dynamically changing tracing envfilter's
|
|
||||||
alongside other logging/metrics things
|
|
||||||
|
|
||||||
## Debugging with `tokio-console`
|
## Debugging with `tokio-console`
|
||||||
|
|
||||||
|
@ -113,12 +104,30 @@ You will also need to enable the `tokio_console` config option in Continuwuity w
|
||||||
starting it. This was due to tokio-console causing gradual memory leak/usage
|
starting it. This was due to tokio-console causing gradual memory leak/usage
|
||||||
if left enabled.
|
if left enabled.
|
||||||
|
|
||||||
[1]: https://github.com/ruma/ruma/
|
## Building Docker Images
|
||||||
[2]: https://github.com/facebook/rocksdb/
|
|
||||||
[3]: https://github.com/tikv/jemallocator/
|
To build a Docker image for Continuwuity, use the standard Docker build command:
|
||||||
[4]: https://github.com/zyansheep/rustyline-async/
|
|
||||||
[5]: https://github.com/rust-rocksdb/rust-rocksdb/
|
```bash
|
||||||
[6]: https://github.com/tokio-rs/tracing/
|
docker build -f docker/Dockerfile .
|
||||||
|
```
|
||||||
|
|
||||||
|
The image can be cross-compiled for different architectures.
|
||||||
|
|
||||||
|
[continuwuation-ruwuma]: https://forgejo.ellis.link/continuwuation/ruwuma
|
||||||
|
[continuwuation-rocksdb]: https://forgejo.ellis.link/continuwuation/rocksdb
|
||||||
|
[continuwuation-jemallocator]: https://forgejo.ellis.link/continuwuation/jemallocator
|
||||||
|
[continuwuation-rustyline-async]: https://forgejo.ellis.link/continuwuation/rustyline-async
|
||||||
|
[continuwuation-rust-rocksdb]: https://forgejo.ellis.link/continuwuation/rust-rocksdb
|
||||||
|
[continuwuation-tracing]: https://forgejo.ellis.link/continuwuation/tracing
|
||||||
|
|
||||||
|
[ruma]: https://github.com/ruma/ruma/
|
||||||
|
[rocksdb]: https://github.com/facebook/rocksdb/
|
||||||
|
[jemallocator]: https://github.com/tikv/jemallocator/
|
||||||
|
[rustyline-async]: https://github.com/zyansheep/rustyline-async/
|
||||||
|
[rust-rocksdb]: https://github.com/rust-rocksdb/rust-rocksdb/
|
||||||
|
[tracing]: https://github.com/tokio-rs/tracing/
|
||||||
|
|
||||||
[7]: https://docs.rs/tokio-console/latest/tokio_console/
|
[7]: https://docs.rs/tokio-console/latest/tokio_console/
|
||||||
[8]: https://github.com/zaidoon1/
|
[8]: https://github.com/zaidoon1/
|
||||||
[9]: https://github.com/rust-lang/cargo/issues/12162
|
[9]: https://github.com/rust-lang/cargo/issues/12162
|
||||||
|
|
4
docs/static/announcements.json
vendored
4
docs/static/announcements.json
vendored
|
@ -4,6 +4,10 @@
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"message": "Welcome to Continuwuity! Important announcements about the project will appear here."
|
"message": "Welcome to Continuwuity! Important announcements about the project will appear here."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"message": "🎉 Continuwuity v0.5.0-rc.6 is now available! This release includes improved knock-restricted room handling, automatic support contact configuration, and a new HTML landing page. Check [the release notes for full details](https://forgejo.ellis.link/continuwuation/continuwuity/releases/tag/v0.5.0-rc.6) and upgrade instructions."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -9,7 +9,7 @@
|
||||||
# If you're having trouble making the relevant changes, bug a maintainer.
|
# If you're having trouble making the relevant changes, bug a maintainer.
|
||||||
|
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.86.0"
|
channel = "1.87.0"
|
||||||
profile = "minimal"
|
profile = "minimal"
|
||||||
components = [
|
components = [
|
||||||
# For rust-analyzer
|
# For rust-analyzer
|
||||||
|
@ -19,11 +19,3 @@ components = [
|
||||||
"rustfmt",
|
"rustfmt",
|
||||||
"clippy",
|
"clippy",
|
||||||
]
|
]
|
||||||
targets = [
|
|
||||||
#"x86_64-apple-darwin",
|
|
||||||
"x86_64-unknown-linux-gnu",
|
|
||||||
"x86_64-unknown-linux-musl",
|
|
||||||
"aarch64-unknown-linux-musl",
|
|
||||||
"aarch64-unknown-linux-gnu",
|
|
||||||
#"aarch64-apple-darwin",
|
|
||||||
]
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
#[command(name = "conduwuit", version = conduwuit::version())]
|
#[command(name = conduwuit_core::name(), version = conduwuit_core::version())]
|
||||||
pub(super) enum AdminCommand {
|
pub(super) enum AdminCommand {
|
||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
/// - Commands for managing appservices
|
/// - Commands for managing appservices
|
||||||
|
|
|
@ -239,10 +239,11 @@ pub(super) async fn get_remote_pdu(
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
| Err(e) =>
|
| Err(e) => {
|
||||||
return Err!(
|
return Err!(
|
||||||
"Remote server did not have PDU or failed sending request to remote server: {e}"
|
"Remote server did not have PDU or failed sending request to remote server: {e}"
|
||||||
),
|
);
|
||||||
|
},
|
||||||
| Ok(response) => {
|
| Ok(response) => {
|
||||||
let json: CanonicalJsonObject =
|
let json: CanonicalJsonObject =
|
||||||
serde_json::from_str(response.pdu.get()).map_err(|e| {
|
serde_json::from_str(response.pdu.get()).map_err(|e| {
|
||||||
|
@ -384,8 +385,9 @@ pub(super) async fn change_log_level(&self, filter: Option<String>, reset: bool)
|
||||||
.reload
|
.reload
|
||||||
.reload(&old_filter_layer, Some(handles))
|
.reload(&old_filter_layer, Some(handles))
|
||||||
{
|
{
|
||||||
| Err(e) =>
|
| Err(e) => {
|
||||||
return Err!("Failed to modify and reload the global tracing log level: {e}"),
|
return Err!("Failed to modify and reload the global tracing log level: {e}");
|
||||||
|
},
|
||||||
| Ok(()) => {
|
| Ok(()) => {
|
||||||
let value = &self.services.server.config.log;
|
let value = &self.services.server.config.log;
|
||||||
let out = format!("Successfully changed log level back to config value {value}");
|
let out = format!("Successfully changed log level back to config value {value}");
|
||||||
|
@ -408,8 +410,9 @@ pub(super) async fn change_log_level(&self, filter: Option<String>, reset: bool)
|
||||||
.reload(&new_filter_layer, Some(handles))
|
.reload(&new_filter_layer, Some(handles))
|
||||||
{
|
{
|
||||||
| Ok(()) => return self.write_str("Successfully changed log level").await,
|
| Ok(()) => return self.write_str("Successfully changed log level").await,
|
||||||
| Err(e) =>
|
| Err(e) => {
|
||||||
return Err!("Failed to modify and reload the global tracing log level: {e}"),
|
return Err!("Failed to modify and reload the global tracing log level: {e}");
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -529,6 +532,7 @@ pub(super) async fn force_set_room_state_from_server(
|
||||||
&self,
|
&self,
|
||||||
room_id: OwnedRoomId,
|
room_id: OwnedRoomId,
|
||||||
server_name: OwnedServerName,
|
server_name: OwnedServerName,
|
||||||
|
at_event: Option<OwnedEventId>,
|
||||||
) -> Result {
|
) -> Result {
|
||||||
if !self
|
if !self
|
||||||
.services
|
.services
|
||||||
|
@ -540,13 +544,18 @@ pub(super) async fn force_set_room_state_from_server(
|
||||||
return Err!("We are not participating in the room / we don't know about the room ID.");
|
return Err!("We are not participating in the room / we don't know about the room ID.");
|
||||||
}
|
}
|
||||||
|
|
||||||
let first_pdu = self
|
let at_event_id = match at_event {
|
||||||
|
| Some(event_id) => event_id,
|
||||||
|
| None => self
|
||||||
.services
|
.services
|
||||||
.rooms
|
.rooms
|
||||||
.timeline
|
.timeline
|
||||||
.latest_pdu_in_room(&room_id)
|
.latest_pdu_in_room(&room_id)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| err!(Database("Failed to find the latest PDU in database")))?;
|
.map_err(|_| err!(Database("Failed to find the latest PDU in database")))?
|
||||||
|
.event_id
|
||||||
|
.clone(),
|
||||||
|
};
|
||||||
|
|
||||||
let room_version = self.services.rooms.state.get_room_version(&room_id).await?;
|
let room_version = self.services.rooms.state.get_room_version(&room_id).await?;
|
||||||
|
|
||||||
|
@ -557,7 +566,7 @@ pub(super) async fn force_set_room_state_from_server(
|
||||||
.sending
|
.sending
|
||||||
.send_federation_request(&server_name, get_room_state::v1::Request {
|
.send_federation_request(&server_name, get_room_state::v1::Request {
|
||||||
room_id: room_id.clone(),
|
room_id: room_id.clone(),
|
||||||
event_id: first_pdu.event_id.clone(),
|
event_id: at_event_id,
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|
|
@ -177,6 +177,9 @@ pub(super) enum DebugCommand {
|
||||||
room_id: OwnedRoomId,
|
room_id: OwnedRoomId,
|
||||||
/// The server we will use to query the room state for
|
/// The server we will use to query the room state for
|
||||||
server_name: OwnedServerName,
|
server_name: OwnedServerName,
|
||||||
|
/// The event ID of the latest known PDU in the room. Will be found
|
||||||
|
/// automatically if not provided.
|
||||||
|
event_id: Option<OwnedEventId>,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// - Runs a server name through conduwuit's true destination resolution
|
/// - Runs a server name through conduwuit's true destination resolution
|
||||||
|
|
|
@ -121,7 +121,9 @@ where
|
||||||
.map(|(key, val)| (key, val.collect()))
|
.map(|(key, val)| (key, val.collect()))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if !populate {
|
if populate {
|
||||||
|
rooms.push(summary_to_chunk(summary.clone()));
|
||||||
|
} else {
|
||||||
children = children
|
children = children
|
||||||
.iter()
|
.iter()
|
||||||
.rev()
|
.rev()
|
||||||
|
@ -144,10 +146,8 @@ where
|
||||||
.collect();
|
.collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
if populate {
|
if !populate && queue.is_empty() && children.is_empty() {
|
||||||
rooms.push(summary_to_chunk(summary.clone()));
|
break;
|
||||||
} else if queue.is_empty() && children.is_empty() {
|
|
||||||
return Err!(Request(InvalidParam("Room IDs in token were not found.")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parents.insert(current_room.clone());
|
parents.insert(current_room.clone());
|
||||||
|
|
|
@ -77,7 +77,7 @@ pub(crate) fn init(
|
||||||
);
|
);
|
||||||
let tracer = opentelemetry_jaeger::new_agent_pipeline()
|
let tracer = opentelemetry_jaeger::new_agent_pipeline()
|
||||||
.with_auto_split_batch(true)
|
.with_auto_split_batch(true)
|
||||||
.with_service_name("conduwuit")
|
.with_service_name(conduwuit_core::name())
|
||||||
.install_batch(opentelemetry_sdk::runtime::Tokio)
|
.install_batch(opentelemetry_sdk::runtime::Tokio)
|
||||||
.expect("jaeger agent pipeline");
|
.expect("jaeger agent pipeline");
|
||||||
let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
|
let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
|
||||||
|
|
|
@ -605,4 +605,3 @@ ul#searchresults span.teaser em {
|
||||||
margin-inline-start: -14px;
|
margin-inline-start: -14px;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue