Compare commits

...
103 Commits
Author SHA1 Message Date
timedout a237672c90 chore: Release 2026-09-16 19:37:06 +01:00
Allinen d52d5003b1 refactor: cleaned up code 2026-09-16 17:57:11 +00:00
Allinen 7026f62ff8 chore: added changelog.d 2026-09-16 17:57:11 +00:00
Allinen bdaa78340e style: fix typo 2026-09-16 17:57:11 +00:00
Allinen 89e07ae239 feat(config): connection_uri_file added to config 2026-09-16 17:57:11 +00:00
Jade ffcf152016 revert d330930bb5
revert feat: Add timestamp to event endpoint

This implementation unfortunately resulted in resource exhaustion when run on some rooms.
2026-09-16 13:05:45 +00:00
Renovate Bot 32a36f56c7 chore(deps): update pre-commit hook crate-ci/typos to v1.50.2 2026-09-16 05:03:57 +00:00
Renovate Bot 0e3dbb149c chore(deps): update rust crate rustls to v0.23.45 2026-09-15 16:24:21 +00:00
Renovate Bot 85a600a466 chore(deps): update github-actions-digest 2026-09-15 05:01:33 +00:00
timedout 77d47f268e fix(stateres): Don't panic when the create event goes missing
I have no idea how this can even happen and frankly I'm scared to look
however that's a problem for another time.
Panicking causes entire transactions to explode, this just makes one
event explode.
2026-09-14 18:14:22 +01:00
Renovate Bot 5e7cb169ae chore(deps): update rust crate serde-saphyr to v1 2026-09-14 12:53:59 +00:00
Renovate Bot 7d8a3ba167 chore(deps): lock file maintenance 2026-09-14 12:53:27 +00:00
Renovate Bot 0299297232 chore(deps): update ghcr.io/renovatebot/renovate docker tag to v44.83.2 2026-09-14 05:04:11 +00:00
timedout 5f31f3fb10 Merge remote-tracking branch 'origin/main' into lake/feature/shear-unused-deps 2026-09-13 19:57:41 +01:00
Erwan Leboucher ac8b17db1b fix: Only count non-outlier prev_events in get_missing_events assertion 2026-09-13 18:50:38 +00:00
Erwan Leboucher 9bb203abe8 fix(sync): Omit empty room account data from sliding sync responses 2026-09-13 18:50:26 +00:00
Lake 8ab842b198 deps: shear the dependencies again 2026-09-12 15:07:42 -05:00
Lake 439f266d8f chore: resolve conflicts with main 2026-09-12 15:07:35 -05:00
Henry-Hiles 5117b104af fix: don't allow calling update-flake-hashes manually
Fixes #1862.
2026-09-12 15:00:01 -04:00
ginger c6f2c5eb39 fix: Log new password when using reset-password --convert-to-local-account 2026-09-12 16:23:46 +00:00
Henry-Hiles 7e2e033e4e chore: Bump Nix flake lock 2026-09-12 16:05:41 +00:00
Henry-Hiles b221a49b77 chore: upgrade argon2 2026-09-11 16:13:03 -04:00
Jade Ellis 71e101a4dc style: Run formatting 2026-09-11 15:54:42 +01:00
Erwan Leboucher 031039e879 chore(complement): Remove workflow 2026-09-11 14:48:35 +00:00
Erwan Leboucher 749c3f58d0 feat(complement): Load test image archives 2026-09-11 14:48:35 +00:00
Erwan Leboucher e48fe5bc4b feat(complement): Simplify local test runs 2026-09-11 14:48:35 +00:00
Jade Ellis 0f97eea31f style: Run formatting 2026-09-11 15:39:54 +01:00
Erwan Leboucher d330930bb5 feat: Add timestamp to event endpoint 2026-09-11 14:22:11 +00:00
stratself 272f93a634 chore: Add detailed changelog on turning legacy media off 2026-09-11 14:21:08 +00:00
stratself 5fbd4914ca fix: Disable unauthenticated media by default 2026-09-11 14:21:08 +00:00
Erwan Leboucher 6c6e8e72af chore: Add changelog entry 2026-09-11 14:17:45 +00:00
Erwan Leboucher aa92bf8814 fix(federation): Read the backoff window once when gating requests 2026-09-11 14:17:45 +00:00
Erwan Leboucher 9d7c8be390 fix(sender): Only claim a destination when the send is allowed 2026-09-11 14:17:45 +00:00
Ginger 644d247007 fix: Size background gradient relative to the viewport 2026-09-11 14:14:39 +00:00
Ginger 32c8ff5b1b feat: Show profile banners in web UI 2026-09-11 14:14:39 +00:00
Renovate Bot f95292a83e chore(deps): update rust crate base64 to 0.23.0 2026-09-11 14:10:10 +00:00
Renovate Bot 13a2f5f2d5 chore(deps): update rust-zerover-patch-updates 2026-09-11 14:06:47 +00:00
Renovate Bot a539977816 chore(deps): update dependency cargo-bins/cargo-binstall to v1.23.0 2026-09-11 14:05:56 +00:00
Henry-Hiles a11fc97800 fix(nix): use new isLinux flag
Fixes a deprecation warning from nix
2026-09-11 14:05:46 +00:00
Ginger b32264dc4d fix: Don't let OIDC users try to deactivate their accounts 2026-09-10 19:55:50 +00:00
Ginger 7997cda678 fix: Don't show a broken back link when removing a device 2026-09-10 19:54:45 +00:00
Erwan Leboucher 59b1652f4a fix(sync): Keep sync positions of rooms outside a list's window 2026-09-10 17:11:33 +02:00
Erwan Leboucher fe38efbb63 feat(oidc): Show the provider's name and icon on the login page 2026-09-10 14:08:03 +00:00
Erwan Leboucher 0060a4aac4 feat(rtc): Advertise MSC4143 in /versions 2026-09-08 13:30:35 -04:00
renovate d4e7e5d362 chore(Nix): Updated flake hashes 2026-09-08 13:41:16 +00:00
Renovate Bot 0826e6f0bb chore(deps): update rust to v1.98.1 2026-09-08 13:41:16 +00:00
Ginger 65b9d27fef fix: Remove duplicate logging for new user registration 2026-09-08 09:18:53 -04:00
Renovate Bot d85a6f02d6 chore(deps): update github-actions-digest 2026-09-08 05:01:46 +00:00
Renovate Bot 8fab950025 chore(deps): update ghcr.io/renovatebot/renovate docker tag to v44.65.5 2026-09-07 05:03:02 +00:00
Renovate Bot f7c804b5c3 chore(deps): update pre-commit hook crate-ci/typos to v1.50.1 2026-09-05 05:15:46 +00:00
Renovate Bot 2aeff0755a chore(deps): update ghcr.io/renovatebot/renovate docker tag to v44.65.2 2026-09-05 05:04:54 +00:00
ginger 90a96c11d0 fix(docs): Remove unhelpful bullet point from reverse proxy instructions 2026-09-04 20:23:49 +00:00
Renovate Bot 37d4cc5a38 chore(deps): update github-actions-digest 2026-09-02 05:02:43 +00:00
Ginger 62822febfe chore: Update .git-blame-ignore-revs 2026-09-01 12:55:52 -04:00
Ginger 9fbabe2210 chore: Reformat with latest nightly 2026-09-01 12:55:05 -04:00
timedout 03d669594e fix: Re-invert prev events filter in fetch_prev_events 2026-09-01 16:24:18 +00:00
timedout c05ead912e fix: Don't increment backoff if we're still in backoff 2026-09-01 16:24:18 +00:00
timedout 5a19e9404f chore: Add newsfrag 2026-09-01 16:24:18 +00:00
timedout 32c652d67d fix: Actually check backoff before attempting to fetch prevs 2026-09-01 16:24:18 +00:00
timedout ebf48d1b08 fix: Rebase properly 2026-09-01 16:24:18 +00:00
timedout 37842d482c style: Remove unused import and reformat 2026-09-01 16:24:18 +00:00
timedout e58601d8a7 feat: Plumb event backoff into auth and prev fetchers 2026-09-01 16:24:18 +00:00
timedout dc302799a0 feat: Add pdu pull backoff
# Conflicts:
#	src/service/rooms/event_handler/mod.rs
2026-09-01 16:24:18 +00:00
timedout 53fdb8aef6 style: Don't log info when preparing a local room summary 2026-08-30 21:16:07 +01:00
timedout dbe4d0035a style: Don't log warnings when receiving unrecognised PDUs 2026-08-30 21:16:07 +01:00
Erwan Leboucher f92032f6da fix(sync): Retain overlapping sync positions 2026-08-29 17:08:01 +00:00
timedout 6919f9681e fix: Remove OTKs and fallback keys when deleting a device 2026-08-29 14:51:19 +01:00
Renovate Bot e1d0537138 chore(deps): update node-patch-updates to v2.0.21 2026-08-29 13:39:13 +00:00
Erwan Leboucher c731ec5421 fix: Stop applying MSC4155 invite filtering to outgoing invites 2026-08-29 13:38:51 +00:00
Erwan Leboucher 4dc7e06c90 fix(admin): Own pushkeys before deleting all of a user's pushers 2026-08-27 15:36:43 +00:00
31a05b9c 5cf0a5b376 fix: inverted log statement 2026-08-27 13:39:41 +00:00
Renovate Bot 35bdbf66cb chore(deps): update node-patch-updates to v2.0.20 2026-08-27 13:39:15 +00:00
Renovate Bot d5dacb5bce chore(deps): update rust crate log to v0.4.34 2026-08-27 13:38:16 +00:00
koshchki123 c132ad5f39 docs: Fix typo of "yourself" 2026-08-26 22:41:27 +00:00
timedout b89c3e9313 fix: Actually add the openreg feature to the crates 2026-08-26 18:21:22 +01:00
timedout b784b64576 chore: Add news fragment
Some people might be interested I guess
2026-08-26 18:14:10 +01:00
timedout 2250e1261a chore: Update config file 2026-08-26 18:11:52 +01:00
timedout dd5b9c6c46 feat: Disable challengeless registration without signing a waiver 2026-08-26 18:01:24 +01:00
timedout 9deff20f1c style: Remove unused dependency 2026-08-26 17:06:33 +01:00
timedout a8220c8444 perf: Don't scream at every server in a room when we receive a receipt 2026-08-26 16:58:59 +01:00
timedout 6129f7f87a fix: Don't insert a status at all if we're in backoff 2026-08-26 13:24:19 +01:00
Ginger eadcea8034 chore: Clippy fixes 2026-08-25 12:37:13 -04:00
Erwan Leboucher 18b0a87b2d fix(sync): Order sliding sync rooms by activity 2026-08-25 13:59:18 +00:00
stratself c049d4cbb3 fix(docs): Remove CADDY_INGRESS_NETWORKS env var requirement
Following some discussions in the support room, this env is best made
redundant. It is only recommended as a workaround for some scenarios
where Caddy fails to detect the ingress network.
However, Docker breaks this by appending prefixes to network names.

The other approach of:

```diff
services:
  caddy:
+   environment:
+     - CADDY_INGRESS_NETWORKS=proxy
networks:
  proxy:
+   name: proxy
```

Can be suggested, but probably not necessary to document.

See https://github.com/lucaslorentz/caddy-docker-proxy/issues/207
for further details
2026-08-25 13:59:09 +00:00
renovate 6c7f5cbe93 chore(Nix): Updated flake hashes 2026-08-25 13:54:30 +00:00
Renovate Bot b2f5c746c5 chore(deps): update rust to v1.98.0 2026-08-25 13:54:30 +00:00
Renovate Bot a971bd9b4e chore(deps): update dependency cargo-bins/cargo-binstall to v1.22.0 2026-08-25 13:54:10 +00:00
Renovate Bot f273a66001 chore(deps): update rust crate ipaddress to 0.2.0 2026-08-25 13:53:58 +00:00
Renovate BotandGinger 746a2686e3 chore(deps): Update ruma digest to 83d80c8
Co-authored-by: Ginger <ginger@gingershaped.computer>
2026-08-25 13:53:39 +00:00
Renovate Bot 4201f44445 chore(deps): update github-actions-digest 2026-08-25 05:02:59 +00:00
Kyle Jones 0523688125 chore(oidc error): expose actual error information 2026-08-25 00:14:48 +00:00
Julian Anderson 5348bd1f25 docs(deploying/rpm): Update SUSE support to include Slowroll 2026-08-25 00:07:34 +00:00
Sam Edwards 1023af68ca docs: add explicit width to forgejo icon in header 2026-08-25 00:01:29 +00:00
Erwan Leboucher 16ebb1fcf7 fix(sync): Deliver device list updates for timeline-only rooms 2026-08-25 00:01:14 +00:00
Erwan Leboucher 2d633a5ee1 fix(spaces): Honour suggested_only when listing children_state 2026-08-24 23:59:17 +00:00
Jacob Taylor 224710e0fb fix(chore): Announce the new release to admin rooms 2026-08-24 08:49:50 -07:00
Renovate Bot 271eecd4d0 chore(deps): update ghcr.io/renovatebot/renovate docker tag to v44.39.3 2026-08-24 05:03:08 +00:00
Jade Ellis 06825fdddb fix: Add the v to the version 2026-08-22 22:49:57 +01:00
Lake a0f8c818f3 chore(git): ignore web/Cargo.toml reformat in blame 2026-07-17 17:02:21 -05:00
Lake 2717ce9a76 chore: write news fragment for #1976 2026-07-17 17:02:21 -05:00
Lake 7d3d421564 ci: run 'cargo shear' 2026-07-17 17:02:21 -05:00
Lake 75b725908a style(web): format Cargo.toml 2026-07-17 17:02:21 -05:00
Lake bb8703e0f0 build: shear unused dependencies 2026-07-17 17:02:20 -05:00
192 changed files with 3194 additions and 2072 deletions

No files matched your search

@@ -52,7 +52,7 @@ runs:
- name: Set up Docker Buildx
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4
with:
# Use persistent BuildKit if BUILDKIT_ENDPOINT is set (e.g. tcp://buildkit:8125)
driver: ${{ env.BUILDKIT_ENDPOINT != '' && 'remote' || 'docker-container' }}
@@ -67,7 +67,7 @@ runs:
uses: ./.forgejo/actions/rust-toolchain
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4
with:
# Use persistent BuildKit if BUILDKIT_ENDPOINT is set (e.g. tcp://buildkit:8125)
driver: ${{ env.BUILDKIT_ENDPOINT != '' && 'remote' || 'docker-container' }}
@@ -75,7 +75,7 @@ runs:
- name: Set up QEMU
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4
uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4
- name: Login to builtin registry
if: ${{ env.BUILTIN_REGISTRY_ENABLED == 'true' }}
+8
View File
@@ -189,6 +189,13 @@ runs:
cargo-binstall -y --no-symlinks timelord-cli
echo "::endgroup::"
fi
if command -v cargo-shear &> /dev/null; then
echo "✅ cargo-shear already available"
else
echo "::group::📦 Installing cargo-shear"
cargo binstall -y --no-symlinks cargo-shear
echo "::endgroup::"
fi
- name: Configure sccache environment
shell: bash
@@ -214,3 +221,4 @@ runs:
echo " Cargo: $(cargo --version)"
echo " prek: $(prek --version 2>/dev/null || echo 'installed')"
echo " timelord: $(timelord --version 2>/dev/null || echo 'installed')"
echo " cargo-shear: $(cargo-shear --version 2>/dev/null || echo 'installed')"
+1 -1
View File
@@ -71,7 +71,7 @@ runs:
- name: Install timelord-cli and git-warp-time
if: steps.check-binaries.outputs.need-install == 'true'
uses: https://github.com/taiki-e/install-action@b6b84cf49ebfe0176417bdce007c624f0db37f20 # v2
uses: https://github.com/taiki-e/install-action@3f74d7c16a4242f1c95561e98edc25d36adb4375 # v2
with:
tool: git-warp-time,timelord-cli@3.0.1
+1 -1
View File
@@ -65,7 +65,7 @@ jobs:
path: binaries
merge-multiple: true
- name: Create Release and Upload
uses: https://github.com/softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3
uses: https://github.com/softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3
with:
draft: true
files: binaries/*
+1 -1
View File
@@ -55,7 +55,7 @@ jobs:
# repositories: continuwuity
- name: Install regsync
uses: https://github.com/regclient/actions/regsync-installer@78eb729dbdb4ef6480e85ff697b4410e22112583 # main
uses: https://github.com/regclient/actions/regsync-installer@bb562fac724b7b37c17f19671df07fe34fabc376 # main
- name: Check what images need mirroring
run: |
+3
View File
@@ -104,3 +104,6 @@ jobs:
--profile test \
--all-targets \
--no-fail-fast
- name: Check for unused dependencies
run: cargo shear
+1 -1
View File
@@ -218,7 +218,7 @@ jobs:
path: binaries
merge-multiple: true
- name: Create Release and Upload
uses: https://github.com/softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3
uses: https://github.com/softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3
with:
draft: true
files: binaries/*
+1 -1
View File
@@ -43,7 +43,7 @@ jobs:
name: Renovate
runs-on: ubuntu-latest
container:
image: ghcr.io/renovatebot/renovate:44.35.3@sha256:822fd48b8ca3a0ab7b5c6b35088a097729190eb710e7bc4a4b073e605bf23c0f
image: ghcr.io/renovatebot/renovate:44.83.2@sha256:7c83dd134ede3fd12ffbdaa67e426aafebd592f4ffdff8fdbae92d48f98324af
options: --tmpfs /tmp:exec
steps:
- name: Checkout
@@ -1,7 +1,6 @@
name: Update flake hashes
on:
workflow_dispatch:
pull_request:
paths:
- "Cargo.lock"
+3
View File
@@ -7,3 +7,6 @@ f419c64aca300a338096b4e0db4c73ace54f23d0
5998a0d883d31b866f7c8c46433a8857eae51a89
# trailing whitespace and newlines
46c193e74b2ce86c48ce802333a0aabce37fd6e9
# rustfmt update that rewrapped tons of comments
9fbabe221051e6956a05d8824142092ede68971e
b0c0905472b882ff0cc79232e73d307fd0b5035b
+1 -1
View File
@@ -24,7 +24,7 @@ repos:
- id: check-added-large-files
- repo: https://github.com/crate-ci/typos
rev: v1.49.0
rev: v1.50.2
hooks:
- id: typos
- id: typos
+3 -2
View File
@@ -2,7 +2,6 @@
extend-exclude = ["*.csr", "*.lock", "pnpm-lock.yaml"]
[default]
extend-ignore-re = [
"(?Rm)^.*(#|//|<!--)\\s*spellchecker:disable-line(\\s*-->)$", # Ignore a line by making it trail with a `spellchecker:disable-line` comment
"^[0-9a-f]{7,}$", # Commit hashes
@@ -14,7 +13,9 @@ extend-ignore-re = [
"\\$[A-Z0-9+][A-Za-z0-9+]{6,}[a-z0-9+]",
"\\b[a-z0-9+/=][A-Za-z0-9+/=]{7,}[a-z0-9+/=][A-Z]\\b",
# In the renovate config
".ontainer"
".ontainer",
# Allow RDNS identifiers
"([A-Za-z0-9]+)\\.[A-Za-z0-9.]+"
]
[default.extend-words]
+36 -1
View File
@@ -1,4 +1,39 @@
# Continuwuity 26.8.1 (2026-08-22)
# Continuwuity v26.9.0 (2026-09-16)
## Features
- Added connection_uri_file to configuration options ([#1790](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1790))
- Removed the ability to run a server with "challengeless registration" (i.e. the big scary long config option, with no captcha, email, or registration token requirements), without manually compiling
the server with non-default arguments. Contributed by @nex.
(This is part of a wider effort to reduce abuse in the Matrix network, of which servers that are easily automated cause a disproportionate amount of) ([#2189](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2189))
- Disable legacy, unauthenticated media (`allow_legacy_media`) by default as the Matrix ecosystem has completely sunsetted this functionality. Legacy media allows anyone to access a file just by knowing its URL, thereby turning homeservers into unwitting CDNs. Homeserver admins are strongly encouraged to check and turn off this option. ([#2225](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2225))
- Added the `provider_name` and `provider_icon` OIDC options, which show the identity provider's name and icon on the web login page. Contributed by @eleboucher.
- Advertised MatrixRTC ([MSC4143](https://github.com/matrix-org/matrix-spec-proposals/pull/4143)) support in `/_matrix/client/versions`. Contributed by @eleboucher.
- The account management web UI now shows users' [MSC4427](https://github.com/matrix-org/matrix-spec-proposals/pull/4427) profile banners. Contributed by @ginger.
## Bugfixes
- Fixed simplified Sliding Sync lists returning rooms out of activity order. Contributed by @eleboucher. (sliding-sync-activity-ordering)
- Fixed simplified Sliding Sync restarting when overlapping sync responses arrive out of order. Contributed by @eleboucher. (sliding-sync-overlapping-responses)
- Fixed simplified Sliding Sync re-sending rooms in full after a list's window shrinks and grows again. Contributed by @eleboucher. (sliding-sync-window-positions)
- Fixed [MSC4155](https://github.com/matrix-org/matrix-spec-proposals/pull/4155) invite filtering being applied to outgoing invites, which prevented users from inviting anyone they had blocked or ignored invites from. Contributed by @eleboucher. (msc4155-outbound-invites)
- Fixed `!admin query pusher delete-all-user` reporting success without deleting any pushers. Contributed by @eleboucher. ([#1726](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1726))
- Removing a device from the web UI will no longer show a "Back" link pointing to a 404. Contributed by @ginger. ([#2062](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2062))
- Fixed simplified sliding sync omitting device list updates for rooms with only timeline changes. Contributed by @eleboucher. ([#2175](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2175))
- Fixed federation transactions never being sent to a remote that was put into backoff by an unrelated request. Contributed by @eleboucher. ([#2188](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2188))
- Re-added a cooldown when fetching events from remote servers that have previously failed to be pulled, preventing request spam. ([#2201](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2201))
- One-time keys and fallback keys are now properly cleaned up when a device is deleted. ([#2202](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2202))
- Sliding sync responses no longer include an empty room account data entry for every room in a list's range. Contributed by @eleboucher. ([#2226](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2226))
- Fixed the space hierarchy endpoints returning non-suggested `m.space.child` events in `children_state` when `suggested_only` was requested. Contributed by @eleboucher.
- The account deactivation page in the account management web UI now shows a message when OIDC is enabled instead of prompting users for a nonexistent account password.
## Misc
- #1976
# Continuwuity v26.8.1 (2026-08-22)
No significant changes.
+2 -1
View File
@@ -75,7 +75,7 @@ cargo +nightly fmt
### Matrix tests
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.
Continuwuity uses [Complement][complement] for Matrix protocol compliance testing. Complement tests are run manually by developers; see the [local testing instructions][complement-testing].
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.
@@ -174,6 +174,7 @@ continuwuity Matrix rooms for Code of Conduct violations.
[issues]: https://forgejo.ellis.link/continuwuation/continuwuity/issues
[continuwuity-matrix]: https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org
[complement]: https://github.com/matrix-org/complement/
[complement-testing]: docs/development/testing.mdx#complement
[sytest]: https://github.com/matrix-org/sytest/
[nodejs-download]: https://nodejs.org/en/download
[rspress]: https://rspress.rs/
Generated
+713 -461
View File
File diff suppressed because it is too large. Load diff
+10 -21
View File
@@ -12,7 +12,7 @@ license = "Apache-2.0"
# See also `rust-toolchain.toml`
readme = "README.md"
repository = "https://forgejo.ellis.link/continuwuation/continuwuity"
version = "26.8.1"
version = "26.9.0"
[workspace.metadata.crane]
name = "conduwuit"
@@ -58,7 +58,7 @@ features = ["parse", "serde"]
version = "0.6.0"
[workspace.dependencies.base64]
version = "0.22.1"
version = "0.23.0"
default-features = false
# used for TURN server authentication
@@ -68,7 +68,7 @@ default-features = false
# used for checking if an IP is in specific subnets / CIDR ranges easier
[workspace.dependencies.ipaddress]
version = "0.1.3"
version = "0.2.0"
[workspace.dependencies.rand]
version = "0.10.1"
@@ -164,20 +164,16 @@ features = ["raw_value"]
# Used for appservice registration files
[workspace.dependencies.serde-saphyr]
version = "0.0.29"
version = "1.0.0"
# Used to load forbidden room/user regex from config
[workspace.dependencies.serde_regex]
version = "1.1.0"
# Used for ruma wrapper
[workspace.dependencies.serde_html_form]
version = "0.4.0"
# Used for password hashing
[workspace.dependencies.argon2]
version = "0.5.3"
features = ["alloc", "rand"]
version = "0.6.0"
features = ["alloc", "getrandom"]
default-features = false
# Used to generate thumbnails for images
@@ -309,11 +305,6 @@ features = [
version = "2.0.12"
default-features = false
# Used when hashing the state
[workspace.dependencies.ring]
version = "0.17.14"
default-features = false
# Used to make working with iterators easier, was already a transitive depdendency
[workspace.dependencies.itertools]
version = "0.15.0"
@@ -343,7 +334,7 @@ version = "1.1.1"
# Used for matrix spec type definitions and helpers
[workspace.dependencies.ruma]
git = "https://github.com/ruma/ruma.git"
rev = "c1100793d2fd464be34052773360f3f3773d0fc4"
rev = "83d80c8d869e0ba09becbf7e7378eefc7377cfdb"
features = [
"appservice-api-c",
"client-api",
@@ -650,11 +641,6 @@ package = "conduwuit_build_metadata"
path = "src/build_metadata"
default-features = false
[workspace.dependencies.conduwuit]
package = "conduwuit"
path = "src/main"
[workspace.dependencies.ruminuwuity]
package = "ruminuwuity"
path = "src/ruminuwuity"
@@ -984,3 +970,6 @@ collapsible_if = "allow"
# TODO: break these apart
cognitive_complexity = "allow"
[workspace.metadata.cargo-shear]
ignored = ["const-str", "ctor", "dtor"]
+127 -23
View File
@@ -2,14 +2,54 @@
set -euo pipefail
# The root path where complement is available.
COMPLEMENT_SRC="${COMPLEMENT_SRC:-$1}"
toplevel="$(git rev-parse --show-toplevel)"
DEFAULT_COMPLEMENT_SRC="$toplevel/target/complement"
DEFAULT_COMPLEMENT_REVISION="6d2fdc286c2b44faaddd1037205869b2242a4005"
# A `.jsonl` file to write test logs to
LOG_FILE="${2:-tests/test_results/complement/test_logs.jsonl}"
MSC="${COMPLEMENT_MSC:-}"
IMAGE_ARCHIVE=""
while [ "$#" -gt 0 ]; do
case "$1" in
--msc)
if [ "$#" -lt 2 ]; then
echo "--msc requires an MSC number"
exit 2
fi
MSC="$2"
shift 2
;;
--image)
if [ "$#" -lt 2 ]; then
echo "--image requires a path to a Docker image archive"
exit 2
fi
IMAGE_ARCHIVE="$2"
shift 2
;;
*)
break
;;
esac
done
# A `.jsonl` file to write test results to
RESULTS_FILE="${3:-tests/test_results/complement/test_results.jsonl}"
if [ -n "$MSC" ]; then
MSC="${MSC#MSC}"
MSC="${MSC#msc}"
if ! [[ "$MSC" =~ ^[0-9]+$ ]]; then
echo "--msc must be an MSC number, for example: --msc 3391"
exit 2
fi
fi
# The root path where Complement is available.
if [ -n "${COMPLEMENT_SRC:-}" ]; then
LOG_FILE="${1:-tests/test_results/complement/test_logs.jsonl}"
RESULTS_FILE="${2:-tests/test_results/complement/test_results.jsonl}"
else
COMPLEMENT_SRC="${1:-$DEFAULT_COMPLEMENT_SRC}"
LOG_FILE="${2:-tests/test_results/complement/test_logs.jsonl}"
RESULTS_FILE="${3:-tests/test_results/complement/test_results.jsonl}"
fi
# The base docker image to use for complement tests
# You can build the default with `docker build -t continuwuity:complement -f ./docker/complement.Dockerfile .`
@@ -19,45 +59,107 @@ COMPLEMENT_BASE_IMAGE="${COMPLEMENT_BASE_IMAGE:-continuwuity:complement}"
# Complement tests that are skipped due to flakiness/reliability issues or we don't implement such features and won't for a long time
SKIPPED_COMPLEMENT_TESTS='TestPartialStateJoin.*|TestRoomDeleteAlias/Parallel/Regular_users_can_add_and_delete_aliases_when_m.*|TestRoomDeleteAlias/Parallel/Can_delete_canonical_alias|TestUnbanViaInvite.*|TestRoomState/Parallel/GET_/publicRooms_lists.*"|TestRoomDeleteAlias/Parallel/Users_with_sufficient_power-level_can_delete_other.*'
# $COMPLEMENT_SRC needs to be a directory to Complement source code
if [ -f "$COMPLEMENT_SRC" ]; then
echo "\$COMPLEMENT_SRC must be a directory/path to Complement source code"
# Download the pinned upstream Complement checkout on first use. A local
# checkout can be supplied as the first argument or with COMPLEMENT_SRC.
if [ ! -e "$COMPLEMENT_SRC" ]; then
mkdir -p "$(dirname "$COMPLEMENT_SRC")"
git init --quiet "$COMPLEMENT_SRC"
git -C "$COMPLEMENT_SRC" remote add origin https://github.com/matrix-org/complement.git
git -C "$COMPLEMENT_SRC" fetch --depth 1 origin "$DEFAULT_COMPLEMENT_REVISION"
git -C "$COMPLEMENT_SRC" checkout --quiet --detach FETCH_HEAD
fi
if [ ! -d "$COMPLEMENT_SRC" ] || [ ! -f "$COMPLEMENT_SRC/go.mod" ]; then
echo "\$COMPLEMENT_SRC must be a directory containing Complement source code"
exit 1
fi
# quick test to make sure we can actually write to $LOG_FILE and $RESULTS_FILE
touch $LOG_FILE && rm -v $LOG_FILE
touch $RESULTS_FILE && rm -v $RESULTS_FILE
toplevel="$(git rev-parse --show-toplevel)"
pushd "$toplevel" > /dev/null
for command in docker go jq; do
if ! command -v "$command" > /dev/null; then
echo "missing required command: $command"
exit 1
fi
done
if [ -n "$IMAGE_ARCHIVE" ]; then
if [ ! -f "$IMAGE_ARCHIVE" ]; then
echo "Docker image archive not found: $IMAGE_ARCHIVE"
exit 1
fi
load_output="$(docker load --input "$IMAGE_ARCHIVE" 2>&1)"
printf '%s\n' "$load_output"
COMPLEMENT_BASE_IMAGE="$(printf '%s\n' "$load_output" | sed -n 's/^Loaded image: //p; s/^Loaded image ID: //p' | tail -n1)"
if [ -z "$COMPLEMENT_BASE_IMAGE" ]; then
echo "could not determine the image loaded from: $IMAGE_ARCHIVE"
exit 1
fi
fi
if ! docker image inspect "$COMPLEMENT_BASE_IMAGE" > /dev/null 2>&1; then
echo "Complement base image not found: $COMPLEMENT_BASE_IMAGE"
echo "Build it with: cargo build -p conduwuit && docker build -t $COMPLEMENT_BASE_IMAGE -f docker/complement.Dockerfile ."
exit 1
fi
mkdir -p "$(dirname "$LOG_FILE")" "$(dirname "$RESULTS_FILE")"
LOG_TMP="$(mktemp "${LOG_FILE}.XXXXXX")"
RESULTS_TMP="$(mktemp "${RESULTS_FILE}.XXXXXX")"
trap 'rm -f "$LOG_TMP" "$RESULTS_TMP"' EXIT
echo ""
echo "running go test with:"
echo "\$COMPLEMENT_SRC: $COMPLEMENT_SRC"
COMPLEMENT_REVISION="$(git -C "$COMPLEMENT_SRC" rev-parse HEAD 2>/dev/null || echo unknown)"
echo "\$COMPLEMENT_REVISION: $COMPLEMENT_REVISION"
echo "\$COMPLEMENT_MSC: ${MSC:-all}"
echo "\$COMPLEMENT_BASE_IMAGE: $COMPLEMENT_BASE_IMAGE"
echo "\$RESULTS_FILE: $RESULTS_FILE"
echo "\$LOG_FILE: $LOG_FILE"
echo ""
# It's okay (likely, even) that `go test` exits nonzero
TEST_PACKAGES=(./tests/...)
if [ -n "$MSC" ]; then
test_files="$({
grep -rilE --include='*.go' "msc$MSC([^0-9]|$)" "$COMPLEMENT_SRC/tests" || true
find "$COMPLEMENT_SRC/tests" -type f -name '*.go' -print | while IFS= read -r file; do
if [[ "$(basename "$file")" =~ [Mm][Ss][Cc]$MSC([^0-9]|$) ]]; then
printf '%s\n' "$file"
fi
done
} | sort -u)"
if [ -z "$test_files" ]; then
echo "no Complement tests mention MSC$MSC"
exit 1
fi
TEST_PACKAGES=()
while IFS= read -r test_file; do
test_dir="$(dirname "$test_file")"
TEST_PACKAGES+=(".${test_dir#"$COMPLEMENT_SRC"}")
done <<< "$test_files"
fi
# `COMPLEMENT_ENABLE_DIRTY_RUNS=1` reuses the same complement container for faster complement, at the possible expense of test environment pollution
set +o pipefail
env \
-C "$COMPLEMENT_SRC" \
set +e
(cd "$COMPLEMENT_SRC" && \
COMPLEMENT_BASE_IMAGE="$COMPLEMENT_BASE_IMAGE" \
go test -tags="conduwuit_blacklist" -skip="$SKIPPED_COMPLEMENT_TESTS" -v -timeout 1h -json ./tests/... | tee "$LOG_FILE"
set -o pipefail
go test -tags="conduwuit_blacklist" -skip="$SKIPPED_COMPLEMENT_TESTS" -v -timeout 1h -json "${TEST_PACKAGES[@]}"
) | tee "$LOG_TMP"
test_status=${PIPESTATUS[0]}
set -e
# Post-process the results into an easy-to-compare format, sorted by Test name for reproducible results
jq -s -c 'sort_by(.Test)[]' < "$LOG_FILE" | jq -c '
jq -s -c 'sort_by(.Test)[]' < "$LOG_TMP" | jq -c '
select(
(.Action == "pass" or .Action == "fail" or .Action == "skip")
and .Test != null
) | {Action: .Action, Test: .Test}
' > "$RESULTS_FILE"
' > "$RESULTS_TMP"
mv "$LOG_TMP" "$LOG_FILE"
mv "$RESULTS_TMP" "$RESULTS_FILE"
trap - EXIT
echo ""
echo ""
@@ -65,3 +167,5 @@ echo "complement logs saved at $LOG_FILE"
echo "complement results saved at $RESULTS_FILE"
echo ""
echo ""
exit "$test_status"
+1 -1
View File
@@ -6,6 +6,6 @@
set -euo pipefail
cd $WORKSPACE_ROOT
towncrier build --name Continuwuity --version $NEW_VERSION --date "$(date -I)"
towncrier build --name Continuwuity --version v$NEW_VERSION --date "$(date -I)"
"`dirname $0`"/linkify-changelog.py
+28 -3
View File
@@ -643,6 +643,9 @@
# Enabling this setting opens registration to anyone without restrictions.
# This makes your server vulnerable to abuse
#
# Only works if continuwuity was compiled from source with the
# "openreg" compile-time feature.
#
#yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse = false
# A static registration token that new users will have to provide when
@@ -1492,10 +1495,9 @@
#
# The authenticated equivalent endpoints are always enabled.
#
# Defaults to true for now, but this is highly subject to change, likely
# in the next release.
# Defaults to false, as unauthenticated media has been sunsetted.
#
#allow_legacy_media = true
#allow_legacy_media = false
# If set to true, prevents fetching new legacy remote media.
#
@@ -2171,6 +2173,15 @@
#
#connection_uri =
# Same as `connection_uri`, except loaded from a file. If `connection_uri`
# is defined, it is prioritized and `connection_uri_file` is ignored.
#
# The file will be read once, when Continuwuity starts. It is not
# currently reread when the server configuration is reloaded. If the file
# cannot be read, Continuwuity will fail to start.
#
#connection_uri_file =
# The outgoing address which will be used for sending emails.
#
# For a syntax guide, see https://datatracker.ietf.org/doc/html/rfc2822#section-3.4
@@ -2268,6 +2279,20 @@
#
#additional_scopes = []
# The name of the identity provider. If this is set, the login page's
# button reads "Continue with <name>" instead of just "Continue".
#
# example: "Kanidm"
#
#provider_name =
# The URL of an icon for the identity provider, shown on the login page
# next to its name.
#
# example: "https://idm.example.com/pkg/img/logo-square.svg"
#
#provider_icon =
# Whether the user should be prompted to choose a localpart
# when signing in for the first time. If this is `false`, Continuwuity
# will attempt to use the value of the `preferred_username_claim`
+1 -1
View File
@@ -50,7 +50,7 @@ EOF
# Developer tool versions
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
ENV BINSTALL_VERSION=1.21.1
ENV BINSTALL_VERSION=1.23.0
# renovate: datasource=github-releases depName=psastras/sbom-rs
ENV CARGO_SBOM_VERSION=0.9.1
# renovate: datasource=crate depName=lddtree
+1 -1
View File
@@ -18,7 +18,7 @@ RUN --mount=type=cache,target=/etc/apk/cache apk add \
# Developer tool versions
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
ENV BINSTALL_VERSION=1.21.1
ENV BINSTALL_VERSION=1.23.0
# renovate: datasource=github-releases depName=psastras/sbom-rs
ENV CARGO_SBOM_VERSION=0.9.1
# renovate: datasource=crate depName=lddtree
-1
View File
@@ -186,7 +186,6 @@ You can optionally reverse proxy the following individual routes:
Continuwuity to perform delegation (see the `[global.well_known]` config section)
- `/.well-known/matrix/support` if using Continuwuity to send the homeserver admin
[contact and support page][well-known-support]
- `/` and `/_continuwuity/resources` if you would like to see the Continuwuity landing page
Refer to the respective software's documentation and online guides on how to do so.
+1 -1
View File
@@ -22,7 +22,7 @@ approximately 1.5 months behind other ELs—so you may encounter further compati
</Tab>
<Tab label="SUSE">
Available for openSUSE Tumbleweed and [supported Leap versions](https://en.opensuse.org/Lifetime) through the openSUSE Build Service.
Available for openSUSE Tumbleweed, Slowroll, and [supported Leap versions](https://en.opensuse.org/Lifetime) through the openSUSE Build Service.
</Tab>
</Tabs>
+44 -20
View File
@@ -3,30 +3,54 @@
## Complement
Have a look at [Complement's repository][complement] for an explanation of what
it is.
it is. Continuwuity runs Complement manually; it is not part of the normal test
suite.
To test against Complement, with Nix (or [Lix](https://lix.systems) and
[direnv installed and set up][direnv] (run `direnv allow` after setting up the hook), you can:
### Run it locally
* Run `./bin/complement "$COMPLEMENT_SRC"` 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]
Install Git, Rust, Docker, Go, and `jq`. From this repository's root, build the
server image and run the suite:
If you want to use your own prebuilt OCI image (such as from our CI) without needing
Nix installed, put the image at `complement_oci_image.tar.gz` in the root of the repo
and run the script.
```bash
cargo build -p conduwuit
docker build -t continuwuity:complement -f docker/complement.Dockerfile .
./bin/complement
```
If you're on macOS and need to build an image, run `nix build .#linux-complement`.
The run can take up to an hour. The runner writes the full Go test stream to
`tests/test_results/complement/test_logs.jsonl` and a sorted pass/fail/skip
summary to `tests/test_results/complement/test_results.jsonl`. It exits nonzero
when Complement reports failing tests, after writing both files.
We have a Complement fork as some tests have needed to be fixed. This can be found
at [continuwuation/complement](https://forgejo.ellis.link/continuwuation/complement)
On first use, the runner downloads the pinned upstream Complement revision to
`target/complement`. Pass a checkout path or set `COMPLEMENT_SRC` to run a
different revision or the [Continuwuity fork][complement-fork].
To run test packages that mention an MSC, pass its number:
```bash
./bin/complement --msc 3391
```
This selects packages from Complement's source comments and file names, so it
can include tests shared with that MSC but does not claim a complete mapping.
To run a Docker image archive instead of building locally:
```bash
./bin/complement --image path/to/complement-image.tar.gz
```
`COMPLEMENT_ENABLE_DIRTY_RUNS=1` reuses Complement containers for faster local
runs, but can let state leak between tests. Do not use it when validating a
failure or updating the committed result summary.
The checked-in result summary is a baseline, not an assertion that every test
passes. Compare a manual run with it when working on a compliance fix:
```bash
git diff -- tests/test_results/complement/test_results.jsonl
```
[ci-workflows]:
https://forgejo.ellis.link/continuwuation/continuwuity/actions/?workflow=ci.yml&actor=0&status=1
[complement]: https://github.com/matrix-org/complement
[direnv]: https://direnv.net/docs/hook.html
[complement-fork]: https://forgejo.ellis.link/continuwuation/complement
@@ -6,10 +6,10 @@
"message": "Welcome to Continuwuity! Important announcements about the project will appear here."
},
{
"id": 18,
"id": 19,
"mention_room": true,
"date": "2026-08-12",
"message": "[Continuwuity 26.7.3](https://forgejo.ellis.link/continuwuation/continuwuity/releases/tag/v26.7.3) has just been released - this is a security hotfix release that fixes two security vulnerabilities. Please read the release notes for more information, before updating as soon as possible. There are no new features in this release, only the couple fixes.\n\nAny questions? Ask in our [support room](https://matrix.to/#/#continuwuity:continuwuity.org)."
"date": "2026-08-24",
"message": "[Continuwuity 26.8.1](https://forgejo.ellis.link/continuwuation/continuwuity/releases/tag/v26.8.1) has just been released - this is a bug fix and feature release, with one small security patch. Please read the release notes for more information, before updating as soon as possible.\n\nAny questions? Ask in our [support room](https://matrix.to/#/#continuwuity:continuwuity.org)."
}
]
}
@@ -8,8 +8,6 @@ services:
ports:
- 80:80
- 443:443
environment:
- CADDY_INGRESS_NETWORKS=caddy
networks:
- proxy
volumes:
@@ -49,7 +47,7 @@ services:
caddy.reverse_proxy: "{{upstreams 8008}}"
volumes:
db:
db:
networks:
proxy:
proxy:
@@ -27,8 +27,6 @@ services:
ports:
- 80:80
- 443:443
environment:
- CADDY_INGRESS_NETWORKS=proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/data
@@ -8,8 +8,6 @@ services:
ports:
- 80:80
- 443:443
environment:
- CADDY_INGRESS_NETWORKS=proxy
networks:
- proxy
volumes:
+1 -1
View File
@@ -40,7 +40,7 @@ so you might want to delete the result afterwards!
You can reinvite yourself to the admin room through the following methods:
- Use the `--execute "users make_user_admin <username>"` Continuwuity binary
argument once to invite yourslf to the admin room on startup
argument once to invite yourself to the admin room on startup
- Use the Continuwuity console/CLI to run the `users make_user_admin` command
- Or specify the `emergency_password` config option to allow you to temporarily
log into the server account (`@conduit`) from a web client
Generated
+24 -24
View File
@@ -3,11 +3,11 @@
"advisory-db": {
"flake": false,
"locked": {
"lastModified": 1783840254,
"narHash": "sha256-XjyvZk0f3YiinVHmkGOotmLBAzvK+LwEJYj2QqJ5pn8=",
"lastModified": 1789329924,
"narHash": "sha256-mykGMFabQ7yP6G373M3VHkrac9PJPKJstrhQz2D/Rdc=",
"owner": "rustsec",
"repo": "advisory-db",
"rev": "6e3286f4efa8c142fb33e5ea4342c8db6693cf34",
"rev": "455fd4bac659b5f1fca3810661c2d8b3c25dad05",
"type": "github"
},
"original": {
@@ -18,11 +18,11 @@
},
"crane": {
"locked": {
"lastModified": 1783203018,
"narHash": "sha256-G6R9IT/xwFuu+CYBWDUAok6AdC4ERC4ZfPPFtEpxnZE=",
"lastModified": 1788465171,
"narHash": "sha256-Y1/TTVXjYXGF068IThQH9fPSZ0SIE74PABlUxnWTUH0=",
"owner": "ipetkov",
"repo": "crane",
"rev": "80db5bdc391be8a1794f6d8a2d56e3a84ebcede2",
"rev": "eb35abda9f232cc6610b1d1e3200d15c49b7ac54",
"type": "github"
},
"original": {
@@ -39,11 +39,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1783844668,
"narHash": "sha256-3MOpw4y3reoErRLvFBDz0t9aG6FWXUj7leKvUns5eQA=",
"lastModified": 1789298866,
"narHash": "sha256-6eaV5+MdWy1tAlN4HAFr64pTnYc9jiKGXBsu18cyVjE=",
"owner": "nix-community",
"repo": "fenix",
"rev": "4e49ef62eedaa5c149d62b63b3f53844e1cc45d7",
"rev": "1fc6f36a23fa16e3740987957266f6e4b915c3cd",
"type": "github"
},
"original": {
@@ -74,11 +74,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1782949081,
"narHash": "sha256-vp6Y/Grm98ESt6ceOkWiHWyZRDV3J1RID4w+6NWK9yA=",
"lastModified": 1788450739,
"narHash": "sha256-glZLQlzIn1fXH6PazR2iUmTo7kzzyYSshrWhLS9TqCU=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "17c9d6cdfc60c64f4ee8d306f9bc0b4ccb51481e",
"rev": "31729ca8cbdb4fa927b34e5f4353e6a83f39e993",
"type": "github"
},
"original": {
@@ -89,11 +89,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1783776592,
"narHash": "sha256-UgCQzxeWI75XM8G+hPrPh+MKzEPjG3SpAj7dtqSbksA=",
"lastModified": 1789149629,
"narHash": "sha256-H6GwaZzZf+4npqv0tph94w9tZddSjFjmQrVsW0z78uk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e7a3ca8092b61ff85b6a45bf863ea2b2d6a661b3",
"rev": "eaad089433ca2bb662274377d33df3d0e51ef28b",
"type": "github"
},
"original": {
@@ -105,11 +105,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1782614948,
"narHash": "sha256-ePjCwr1sNm9NYUqywL7QfK3JnlS015msC+eBu2zKlp8=",
"lastModified": 1788057806,
"narHash": "sha256-DTQSMxzDWmT0zhguthvegnVkn7CFqGCv4IHCzk5ZUpM=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "db3f255737b94216eb71cce308e2912cf6bc2d7c",
"rev": "596e2e3940e09b2abbeb03f75fa1828c57fcd72c",
"type": "github"
},
"original": {
@@ -132,11 +132,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1783779020,
"narHash": "sha256-vpm418WZa9l1KUl6HRs+Ga+SIfE+D2/sV4olwTlilYc=",
"lastModified": 1789128286,
"narHash": "sha256-KRxxgHiKIBp7R2n41IJuE5K4IUiLOpg47EEi3AxuSp8=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "5be5e89cf0145d73a85c805726821b4adfc3af48",
"rev": "6aeeb8cf02741e5da07a1615a05faa506cecb21a",
"type": "github"
},
"original": {
@@ -153,11 +153,11 @@
]
},
"locked": {
"lastModified": 1780220602,
"narHash": "sha256-eynAfOmbmxJnkp7YewvCEbShNnnYJ9gLLqkzsYtBPeM=",
"lastModified": 1786901030,
"narHash": "sha256-WSFCsDSE5ffgD2MqzkM2CYjeFiKhRF/dJUN8uedb6YE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "db947814a175b7ca6ded66e21383d938df01c227",
"rev": "27b3b12a8e6375f28ebe122f07d230ca5459bbfa",
"type": "github"
},
"original": {
+3 -3
View File
@@ -16,7 +16,7 @@
pkgs.nodejs
pkgs.pkg-config
]
++ lib.optionals pkgs.stdenv.isLinux [
++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [
pkgs.liburing
pkgs.rust-jemalloc-sys-unprefixed
];
@@ -27,13 +27,13 @@
[
pkgs.stdenv.cc.cc.lib
]
++ lib.optionals pkgs.stdenv.isLinux [
++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [
pkgs.liburing
pkgs.jemalloc
]
);
}
// lib.optionalAttrs pkgs.stdenv.isLinux {
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
PKG_CONFIG_PATH = lib.makeSearchPath "lib/pkgconfig" [
pkgs.liburing.dev
];
+1 -1
View File
@@ -12,7 +12,7 @@
target:
target.fromToolchainName {
name = (lib.importTOML "${inputs.self}/rust-toolchain.toml").toolchain.channel;
sha256 = "sha256-A1abGIbOtcBSdrUMhDGrER3pRM1hQP4fp9gh3Y4PKc8=";
sha256 = "sha256-p8h3Sl/YRByZfZTAKXdsvF6xEenXKrXSVvpphmZENH4=";
};
in
{
+204 -161
View File
@@ -125,13 +125,13 @@
}
},
"node_modules/@rsbuild/core": {
"version": "2.1.10",
"resolved": "https://registry.npmjs.org/@rsbuild/core/-/core-2.1.10.tgz",
"integrity": "sha512-lwxC5w88U2AMv6aNwG3VH7+AV33N4JJQjD//egVWFsMbV+OE/bnfCsurSpX8s3lGyRYkJMwUVN+YXMbmmYZFfw==",
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/@rsbuild/core/-/core-2.2.5.tgz",
"integrity": "sha512-nf34ri1iZduYhHUr5Vc79L7Eml+IlN0nFIaF/g3OW4WR/gShxuf5wVXS69/H8FTHJYN4SdYlNcefSZQluEMKgA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rspack/core": "~2.1.8",
"@rspack/core": "~2.2.3",
"@swc/helpers": "^0.5.23"
},
"bin": {
@@ -169,30 +169,32 @@
}
},
"node_modules/@rspack/binding": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-2.1.8.tgz",
"integrity": "sha512-tmAyHzDbPiy8V7HvQqtuPsbs6dPgwV0YjzW5XrPRV9gzf+Hdm7pvsZJKE1QKO9WV5RuvGYav98xIX6O+abZxzQ==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-2.2.3.tgz",
"integrity": "sha512-532+T5N6yIdukChiL85H4NFN2vn9oi8wlLa1ByPNtpNYriE9s24fUhn0RiK7w/xACqnNpYmXCqLYCvjOzyCy+w==",
"dev": true,
"license": "MIT",
"optionalDependencies": {
"@rspack/binding-darwin-arm64": "2.1.8",
"@rspack/binding-darwin-x64": "2.1.8",
"@rspack/binding-linux-arm64-gnu": "2.1.8",
"@rspack/binding-linux-arm64-musl": "2.1.8",
"@rspack/binding-linux-riscv64-gnu": "2.1.8",
"@rspack/binding-linux-riscv64-musl": "2.1.8",
"@rspack/binding-linux-x64-gnu": "2.1.8",
"@rspack/binding-linux-x64-musl": "2.1.8",
"@rspack/binding-wasm32-wasi": "2.1.8",
"@rspack/binding-win32-arm64-msvc": "2.1.8",
"@rspack/binding-win32-ia32-msvc": "2.1.8",
"@rspack/binding-win32-x64-msvc": "2.1.8"
"@rspack/binding-darwin-arm64": "2.2.3",
"@rspack/binding-darwin-x64": "2.2.3",
"@rspack/binding-linux-arm64-gnu": "2.2.3",
"@rspack/binding-linux-arm64-musl": "2.2.3",
"@rspack/binding-linux-ppc64-gnu": "2.2.3",
"@rspack/binding-linux-riscv64-gnu": "2.2.3",
"@rspack/binding-linux-riscv64-musl": "2.2.3",
"@rspack/binding-linux-s390x-gnu": "2.2.3",
"@rspack/binding-linux-x64-gnu": "2.2.3",
"@rspack/binding-linux-x64-musl": "2.2.3",
"@rspack/binding-wasm32-wasi": "2.2.3",
"@rspack/binding-win32-arm64-msvc": "2.2.3",
"@rspack/binding-win32-ia32-msvc": "2.2.3",
"@rspack/binding-win32-x64-msvc": "2.2.3"
}
},
"node_modules/@rspack/binding-darwin-arm64": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-2.1.8.tgz",
"integrity": "sha512-kia+eWtyWPvR4ntg1bWYoVU8nLPbUg2fG3zgBEocsTcsh5ZENSiEPxEKymDgMyIMONUqj611E0775cdUBoNmqw==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-2.2.3.tgz",
"integrity": "sha512-MGLx4lMTY6XEtJi55S+fk83+683GeUDuoqzjixbq6ehHdr/l6nGiHhgvMtV5DYt9sCytUDzyrCkcJ0AWqJxnTA==",
"cpu": [
"arm64"
],
@@ -204,9 +206,9 @@
]
},
"node_modules/@rspack/binding-darwin-x64": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-2.1.8.tgz",
"integrity": "sha512-08pBkFhlD3Y3Qzh94w/Fc3skaIE3e96kl2P14m8+tnYTcglpOfpA2OwS3iHt9fOqy0HjoAVe6/MW3cBgs5iabA==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-2.2.3.tgz",
"integrity": "sha512-5B/c1YTYEz9m7TyqtGQgTmXMr9PoPewyqsyHB4N0AB7nxDhtgmki0GniP2Lqtx3LJzOvQMjwet+I2lmWxvxwCg==",
"cpu": [
"x64"
],
@@ -218,9 +220,9 @@
]
},
"node_modules/@rspack/binding-linux-arm64-gnu": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-2.1.8.tgz",
"integrity": "sha512-KLniMc9GzhKpVqhPzaJo3KJwzdAllXVVqZIk/uL1QipXOxs57fgM4u7IexKPFVla0o/u1PQG/Ah2YLDmda24Ow==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-2.2.3.tgz",
"integrity": "sha512-sU+jPGD2xz3BxFvsdBQVGce538YHqrSKMB4ZSfKhj6RSKjeGzpJ1BVl8+IndiQsfTgaUxi7N+r5cs/ezGy1TVQ==",
"cpu": [
"arm64"
],
@@ -235,9 +237,9 @@
]
},
"node_modules/@rspack/binding-linux-arm64-musl": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-2.1.8.tgz",
"integrity": "sha512-yUKAxHNGnICtw5RnxFWu4dHtsz/tdt7rbeFcsINNVre9HcrRxf5XP+FbOGL/SMxd9oM9XCo10paU2WckTKwbEA==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-2.2.3.tgz",
"integrity": "sha512-EQuADbqWbVgNAh5ep/u/B7Z/8UUkZjMLzHAOKZJklBpe4Y8mnhFNjieX0xc9NadR+drj9tqmEANxzTOkFtVPyQ==",
"cpu": [
"arm64"
],
@@ -251,10 +253,27 @@
"linux"
]
},
"node_modules/@rspack/binding-linux-ppc64-gnu": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-2.2.3.tgz",
"integrity": "sha512-kyXROzr519a5juBII9ysuc5ZD2apEZ0DJqL5PPCAOVHjzMfThEIBwnX3gicNCmp+kY0CCIOl2LagwbtFaOzoiA==",
"cpu": [
"ppc64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rspack/binding-linux-riscv64-gnu": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-2.1.8.tgz",
"integrity": "sha512-gg4S1jaitwYPHR9HZ3zNGH1EK2GXINm66p4kEpOP1gbc+akyOouVF/dMcu9NGPlRg58FbEhVRZYKu7Z/zcpKHg==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-2.2.3.tgz",
"integrity": "sha512-F3x6Nu0RUSoLtiaMse3hYQ3Nf5A2de6vTWWDXj14Ll6BpGWXGn+U/eXT/nB199fFnDEYf+CJEa7d6fzcYdwdjA==",
"cpu": [
"riscv64"
],
@@ -269,9 +288,9 @@
]
},
"node_modules/@rspack/binding-linux-riscv64-musl": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-2.1.8.tgz",
"integrity": "sha512-b/aU5j1h368SLNyz5u+flqpZVhzSZ1UIslaj9sZJuAvqkGWv3xsjc/28/PTo/RYXCxd0FNVAxTxWHKvRiAAS8w==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-2.2.3.tgz",
"integrity": "sha512-O3HK7OnPvoBxZu4MX2j+t3gk4qiUsFYqj/29L3WgU1iQsdUSIN6PInW2JvbiLqyuzt09VltIEXTKayY8EysCpQ==",
"cpu": [
"riscv64"
],
@@ -285,10 +304,27 @@
"linux"
]
},
"node_modules/@rspack/binding-linux-s390x-gnu": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-2.2.3.tgz",
"integrity": "sha512-SIxfGdwBdAjwJ8pDlPTb8MPIZIv/i2lKHn4/ywuDpFOxlUA4Bo/OKqQOenHx2MFD2mN8jigBZQTF0KVe5YP1uQ==",
"cpu": [
"s390x"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rspack/binding-linux-x64-gnu": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-2.1.8.tgz",
"integrity": "sha512-EyegohSx0BJRqieCg9f/caCqFARRWkqI5hwJt6k530MoOTLeq8I3vsbeg24/2MktwIC1dmJi8bl0+WhPKQs4eQ==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-2.2.3.tgz",
"integrity": "sha512-IzQGcw09WYn/IzwB1SQpg7FQ211MBr+fJB2/WoRrPS6CNdtlkDHZaI8z2oq+2Oc5Su21jgX75VlWFajirUx5Dw==",
"cpu": [
"x64"
],
@@ -303,9 +339,9 @@
]
},
"node_modules/@rspack/binding-linux-x64-musl": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-2.1.8.tgz",
"integrity": "sha512-I6E+goN+UQ297q4r1qdbiAyNCI3t0+a5Y0xDIAPOZfRDRxDTnH/LF8/y65gjsJoKRKyn7zxRC0T/NURTkRNQ9A==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-2.2.3.tgz",
"integrity": "sha512-9OKSx2ickrR+PFal94XE6Hkj49AQ2HI3KuR9XeRkKOwSxjwrskV/Pn1wc2itDOHkm/QHP7k+MttsYb4FGuNIqw==",
"cpu": [
"x64"
],
@@ -320,9 +356,9 @@
]
},
"node_modules/@rspack/binding-wasm32-wasi": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-wasm32-wasi/-/binding-wasm32-wasi-2.1.8.tgz",
"integrity": "sha512-om7GAKWAU3lcSvbCon2m7mzw8v9OTrO2LW2MZ1lGe/uVJJmwGGkl9HVoXFyWFLrN6YVFyx8iP+AkN4owDWB9Cw==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-wasm32-wasi/-/binding-wasm32-wasi-2.2.3.tgz",
"integrity": "sha512-gici3jWJi0GDy9kbYh57LoA57H8A2EAD9cV2jFKp1YoJ2aX2U9lANh4L+xoKPTvVQYpRvleoA5jkAvyfeLQ5bw==",
"cpu": [
"wasm32"
],
@@ -336,9 +372,9 @@
}
},
"node_modules/@rspack/binding-win32-arm64-msvc": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-2.1.8.tgz",
"integrity": "sha512-WDnsP/SUb9zbxyGX9XjPw5AXrX86u5oidn0MDdfJduOOqdCSpHwmRjlQ8NUJhbBq9WqVJMFlcab7NwZVWX/yyg==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-2.2.3.tgz",
"integrity": "sha512-1MG66kcuqAGFs9ewiBc+/NJSTQr1jHrkZ2nCVMyhukl1o8embmFZa3BCibYgBYs5P7FRc6Sa+CDXcrfDZOLInQ==",
"cpu": [
"arm64"
],
@@ -350,9 +386,9 @@
]
},
"node_modules/@rspack/binding-win32-ia32-msvc": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-2.1.8.tgz",
"integrity": "sha512-QiMQMPNDiY3dhhaIdaFPzcPDC06cEYkNY89ea+EmDvNVgZq6V+2mFS/WnzZVMeEbGAYJCjsv/ABhhLT1hlYMvg==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-2.2.3.tgz",
"integrity": "sha512-CAigxxh9DYJmEwH9f6FRkSsmt0GhKVqKaFRVFFrF9WDL7gXP3hyE/h/cCeMdmlTzRt8Mht87AvnDX7PG3neMrA==",
"cpu": [
"ia32"
],
@@ -364,9 +400,9 @@
]
},
"node_modules/@rspack/binding-win32-x64-msvc": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-2.1.8.tgz",
"integrity": "sha512-b7sA5eB64vo2mbsuc//MOYzVLeCKHPn0dfP/GmNEoHdWbhRgZ/orZLWurYMQj04ELTLW6YCJEy59g5KRzNYHfw==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-2.2.3.tgz",
"integrity": "sha512-qa5Wc34a+Uux5foZ1Z+9fPQceVRbgTunaIulHezVF/ZxvqKO4DkAC7tFl53shB0YRVBAPg8R78MGd8cByfoxLQ==",
"cpu": [
"x64"
],
@@ -378,13 +414,13 @@
]
},
"node_modules/@rspack/core": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@rspack/core/-/core-2.1.8.tgz",
"integrity": "sha512-na1kyA6Mj8/LWw9O3A8NsrG9rNKN3Iq2WiXrEuIwsU5r/Nl/evm3hO7bWKHxgsRyydI6W7okwx3MXgf8rzel6g==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@rspack/core/-/core-2.2.3.tgz",
"integrity": "sha512-VHejw+PDd5B5v6VduFyjLSTIFaHBMNGPMKw+Y0zjkMqjYhDD1hjLOBC5frRKjTWcfYdk+Q73auWPp9k/H9PfIQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rspack/binding": "2.1.8"
"@rspack/binding": "2.2.3"
},
"engines": {
"node": "^20.19.0 || >=22.12.0"
@@ -419,21 +455,21 @@
}
},
"node_modules/@rspress/core": {
"version": "2.0.19",
"resolved": "https://registry.npmjs.org/@rspress/core/-/core-2.0.19.tgz",
"integrity": "sha512-m0KfQNNXxjP975652nIOwUTqrvbJapRp4NpnoQMc5heawGhkC4+F7zTHvxY+huvzGYnKtL2fMMTrgWhEjKkrug==",
"version": "2.0.21",
"resolved": "https://registry.npmjs.org/@rspress/core/-/core-2.0.21.tgz",
"integrity": "sha512-QxhVqhHhN4guA24MlvlsFTb96pE/X8gBd5RBfp4j1kn5tAu1nJ7A9itKcRAuEw0WYJHcsWtI+WUnd7JPioHtlw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@mdx-js/mdx": "^3.1.1",
"@mdx-js/react": "^3.1.1",
"@rsbuild/core": "^2.1.8",
"@rsbuild/core": "^2.1.13",
"@rsbuild/plugin-react": "~2.1.0",
"@rspress/shared": "2.0.19",
"@rspress/shared": "2.0.21",
"@shikijs/rehype": "^4.2.0",
"@types/mdast": "^4.0.4",
"@types/react": "^19.2.17",
"@unhead/react": "^2.1.16",
"@types/react": "^19.2.18",
"@unhead/react": "^2.1.17",
"body-scroll-lock": "4.0.0-beta.0",
"clsx": "2.1.1",
"copy-to-clipboard": "^3.3.3",
@@ -448,7 +484,7 @@
"react-dom": "^19.2.8",
"react-lazy-with-preload": "^2.2.1",
"react-render-to-markdown": "19.1.0",
"react-router-dom": "^7.18.1",
"react-router-dom": "^7.18.2",
"rehype-external-links": "^3.0.0",
"rehype-raw": "^7.0.0",
"remark-cjk-friendly": "^2.3.1",
@@ -472,9 +508,9 @@
}
},
"node_modules/@rspress/plugin-client-redirects": {
"version": "2.0.19",
"resolved": "https://registry.npmjs.org/@rspress/plugin-client-redirects/-/plugin-client-redirects-2.0.19.tgz",
"integrity": "sha512-BUwgEyj8vCkU58cV3Gp97aTSnfGJm7aXh40K0Dot1BqsCQ8ekdsMuaLXrICROdP9/ctd4oALtLBkOE+PKTa4Sg==",
"version": "2.0.21",
"resolved": "https://registry.npmjs.org/@rspress/plugin-client-redirects/-/plugin-client-redirects-2.0.21.tgz",
"integrity": "sha512-21giX10Blom+dOJBJOxXZUS+pjez1Tb9iNA7L7km8uUkn5L45KfdQvYqbBHY6Nv6L46zaDdz0Mt97eAqBPgNoA==",
"dev": true,
"license": "MIT",
"engines": {
@@ -485,9 +521,9 @@
}
},
"node_modules/@rspress/plugin-sitemap": {
"version": "2.0.19",
"resolved": "https://registry.npmjs.org/@rspress/plugin-sitemap/-/plugin-sitemap-2.0.19.tgz",
"integrity": "sha512-9ydrpj9hmmXWKWKIXUqJ1UrfxSvfxhHZRBZLb5OkTlOuQBNAg6BpsrW1WHoJqJr7p+3zqlz7S/9HTzSA3+EYcA==",
"version": "2.0.21",
"resolved": "https://registry.npmjs.org/@rspress/plugin-sitemap/-/plugin-sitemap-2.0.21.tgz",
"integrity": "sha512-PldjjLDFqtQZ3yPHHsWxmxGNlmoNH7nSx76ww7QkPzkO9rPrlr71sBLZR3MMc1s6cd5Csyd+gHjfIJiP7o77XQ==",
"dev": true,
"license": "MIT",
"engines": {
@@ -498,30 +534,30 @@
}
},
"node_modules/@rspress/shared": {
"version": "2.0.19",
"resolved": "https://registry.npmjs.org/@rspress/shared/-/shared-2.0.19.tgz",
"integrity": "sha512-INrETllWuR49lksqCz+xeLSO6rKtHA+5Ix2YQWcP9nerCuTSyGYwH8eBC0HrIacJkGHxB8wkkbV99tyzGtY8Wg==",
"version": "2.0.21",
"resolved": "https://registry.npmjs.org/@rspress/shared/-/shared-2.0.21.tgz",
"integrity": "sha512-siCWkv1a4n6y7JdVRII+fwCRZGZtG5KGFfKi2w/Tt33UnIgh4XGqozZ5F/K0iZ/QUwg0wi93SoVdOQm2Q+wf8w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rsbuild/core": "^2.1.8",
"@rsbuild/core": "^2.1.13",
"@shikijs/rehype": "^4.2.0",
"@types/react": "^19.2.17",
"@types/react": "^19.2.18",
"mdast-util-mdx-jsx": "^3.2.0",
"unified": "^11.0.5"
}
},
"node_modules/@shikijs/core": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.3.1.tgz",
"integrity": "sha512-ANMDxuaPsNMdDC1m4vfvhlDmJweMwkE5XitTwrq2rWHx5jM+dlm4MmHt2PP6t0uejfR77SuhrhJ0zEijIF/uhA==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.4.3.tgz",
"integrity": "sha512-QCR4q2ZO/ILJEuwiBMel4wdcTDb1JGwfjKTxPDF6x8ixOaluPrVqIn06C99AcRPhmYlBR56d/Fb+GN58GzExpg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@shikijs/primitive": "4.3.1",
"@shikijs/types": "4.3.1",
"@shikijs/primitive": "4.4.3",
"@shikijs/types": "4.4.3",
"@shikijs/vscode-textmate": "^10.0.2",
"@types/hast": "^3.0.4",
"@types/hast": "^3.0.5",
"hast-util-to-html": "^9.0.5"
},
"engines": {
@@ -529,13 +565,13 @@
}
},
"node_modules/@shikijs/engine-javascript": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.3.1.tgz",
"integrity": "sha512-JBItcnPuYq7jVJdZo/vMj94r+szT7XEjHFX+mvFDGSEIbVAXAGyHAHzhbWzpGOwYidCZrErJLLgn2PVeiokHnQ==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.4.3.tgz",
"integrity": "sha512-FbOjFJp9VLdo1Wevs10BBtVxiTWwNLqZh5Gkhjgda/ioL15YOgeSl9n+6XMa3qRlPQzfhFNe641SrynFHYG0nQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@shikijs/types": "4.3.1",
"@shikijs/types": "4.4.3",
"@shikijs/vscode-textmate": "^10.0.2",
"oniguruma-to-es": "^4.3.6"
},
@@ -544,13 +580,13 @@
}
},
"node_modules/@shikijs/engine-oniguruma": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.3.1.tgz",
"integrity": "sha512-OXyNMzg0pews+msMj4cHeqT4xiYKKvbnn6VbdAXxfoFl3SSx4fJTc8FadECuc5/H9p3BzhNAoAUXKwAu9rWYhg==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.4.3.tgz",
"integrity": "sha512-EcOQkxdxGQrc1Row/cC2c96/v1dbZqGnEVu1qTuT/MJmp6+cXCvQussowVmCv5Tqr3KuY3c7IbM6HTW3LJ1k9w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@shikijs/types": "4.3.1",
"@shikijs/types": "4.4.3",
"@shikijs/vscode-textmate": "^10.0.2"
},
"engines": {
@@ -558,44 +594,44 @@
}
},
"node_modules/@shikijs/langs": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.3.1.tgz",
"integrity": "sha512-m0l9nsDqgBHvbZbk7A0/kXz/impK3uB/c6rAn6Gpg/uPtdZRQ+alsN/17MU5thb68XTj/4DxkZAotrM0GGSpDQ==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.4.3.tgz",
"integrity": "sha512-ePic0yfAJGOF83D5wBHK/00EjK65oahBYxFk5epgq33WRv7X9UuxLEV8PtR0szC0z8dl7INIpIodB99JRFlR+A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@shikijs/types": "4.3.1"
"@shikijs/types": "4.4.3"
},
"engines": {
"node": ">=20"
}
},
"node_modules/@shikijs/primitive": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.3.1.tgz",
"integrity": "sha512-CXQRQOYy1leqQ8ceTeJdmXv/bsUY++6QyLpXJ94LZAAYj5X2SKRdc5ipguv4NPyGVKItB2PPwUpRNe0Sjh5S1A==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.4.3.tgz",
"integrity": "sha512-m0wBeLDQDeIxRdUmrCPdQqfuUamDwRL5isCfYbguKD6NiaKpVbsv+3J81DyIKgNW5h4WAIIr8T4EkgQrBBxvaQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@shikijs/types": "4.3.1",
"@shikijs/types": "4.4.3",
"@shikijs/vscode-textmate": "^10.0.2",
"@types/hast": "^3.0.4"
"@types/hast": "^3.0.5"
},
"engines": {
"node": ">=20"
}
},
"node_modules/@shikijs/rehype": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@shikijs/rehype/-/rehype-4.3.1.tgz",
"integrity": "sha512-oshrlfUF3VPUJfnp5K1lLwsS/SRBKrIxONpdWebSKZXdBE3UsZnxgqpvRUA8UsofS7vmjFOCAHIT71ECbmOxTw==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/@shikijs/rehype/-/rehype-4.4.3.tgz",
"integrity": "sha512-vkG9jG1aRnrx05R31uAOKQHE8qpY7r1cBXE2sAZgFK2IaPnQHwaP4L1C6amQixmZ8thBsKwfbSsYxMDoo46UWQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@shikijs/types": "4.3.1",
"@types/hast": "^3.0.4",
"@shikijs/types": "4.4.3",
"@types/hast": "^3.0.5",
"hast-util-to-string": "^3.0.1",
"shiki": "4.3.1",
"shiki": "4.4.3",
"unified": "^11.0.5",
"unist-util-visit": "^5.1.0"
},
@@ -604,27 +640,27 @@
}
},
"node_modules/@shikijs/themes": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.3.1.tgz",
"integrity": "sha512-dgpoJ4WqNi2yTmizQHBJ5zcX6j2lE6icN/0yt4l1kkf16jrY/pwPLoTb1ETsWMz0OBLf9ZNvwmxft+cH+N9qSA==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.4.3.tgz",
"integrity": "sha512-w8UHjeUnIR965KMWJHUPXOc2mNJUnK3vpVLYLvw5IYU2mnTTJ89E24OrJDBNiJDQ0qzb0tc4l7mrIXx5cFeIyw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@shikijs/types": "4.3.1"
"@shikijs/types": "4.4.3"
},
"engines": {
"node": ">=20"
}
},
"node_modules/@shikijs/types": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.3.1.tgz",
"integrity": "sha512-CHFxE0jztBIZRHH6gxXE7DXUCFXjReEGxZ/j0rfSLGKZuwp2xBYycEP14875DSa9KLL/6700oxIq6oO6ef9K2g==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.4.3.tgz",
"integrity": "sha512-UEJxmRR++MAGR6hugn0vgVS2W/6lWAts84FFSrnlH9sP0LNol7E5+NQ792pH8liWUhyMyjhTgSUH3k7iD7tc5g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@shikijs/vscode-textmate": "^10.0.2",
"@types/hast": "^3.0.4"
"@types/hast": "^3.0.5"
},
"engines": {
"node": ">=20"
@@ -648,9 +684,9 @@
}
},
"node_modules/@tybys/wasm-util": {
"version": "0.10.3",
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz",
"integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==",
"version": "0.10.4",
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz",
"integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==",
"dev": true,
"license": "MIT",
"optional": true,
@@ -720,9 +756,9 @@
"license": "MIT"
},
"node_modules/@types/react": {
"version": "19.2.17",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz",
"integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==",
"version": "19.3.0",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz",
"integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1077,9 +1113,9 @@
}
},
"node_modules/@ungap/structured-clone": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.3.tgz",
"integrity": "sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg==",
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz",
"integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==",
"dev": true,
"license": "ISC"
},
@@ -1100,9 +1136,9 @@
}
},
"node_modules/acorn": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz",
"integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==",
"version": "8.18.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz",
"integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==",
"dev": true,
"license": "MIT",
"bin": {
@@ -1434,9 +1470,9 @@
}
},
"node_modules/estree-util-scope": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/estree-util-scope/-/estree-util-scope-1.0.0.tgz",
"integrity": "sha512-2CAASclonf+JFWBNJPndcOpA8EMJwa0Q8LUFJEKqXLW6+qBvbFZuF5gItbQOs/umBUkjviCSDCbBwU2cXbmrhQ==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/estree-util-scope/-/estree-util-scope-1.0.1.tgz",
"integrity": "sha512-B0np3dcdxqILX5e9nEi5/Fr4K7gL4oYFVPV1zRa2e9wRCbQoZZNWOZFYyoInvXUPJXBXjss+QXlWLJChDEHDkA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2489,9 +2525,9 @@
}
},
"node_modules/micromark-extension-gfm-table": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz",
"integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==",
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.2.tgz",
"integrity": "sha512-pRzm4kDTu0MjlmBkxmS9yYhw60nncfcEwu9NNdPFSQEFXS95ZKyIIyTSHu/o3ReBUrLKYEq+7YaXCRn/bPB4MA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3176,9 +3212,9 @@
}
},
"node_modules/react": {
"version": "19.2.8",
"resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz",
"integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==",
"version": "19.3.0",
"resolved": "https://registry.npmjs.org/react/-/react-19.3.0.tgz",
"integrity": "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==",
"dev": true,
"license": "MIT",
"engines": {
@@ -3186,16 +3222,16 @@
}
},
"node_modules/react-dom": {
"version": "19.2.8",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.8.tgz",
"integrity": "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==",
"version": "19.3.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.0.tgz",
"integrity": "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"scheduler": "^0.27.0"
"scheduler": "^0.28.0"
},
"peerDependencies": {
"react": "^19.2.8"
"react": "^19.3.0"
}
},
"node_modules/react-lazy-with-preload": {
@@ -3221,6 +3257,13 @@
"react": "^19.2.0"
}
},
"node_modules/react-reconciler/node_modules/scheduler": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
"integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",
"dev": true,
"license": "MIT"
},
"node_modules/react-refresh": {
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz",
@@ -3245,9 +3288,9 @@
}
},
"node_modules/react-router": {
"version": "7.18.1",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.1.tgz",
"integrity": "sha512-GDLgg3i3uM0aeJO3Fm+TCS+sDQ7gu12T6x0qdTEzcwqEfleci7JwugVNIF3U//0FWKnJT7ptG+20B2jfDqnZAg==",
"version": "7.18.3",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.3.tgz",
"integrity": "sha512-gyXgtdr5uACJ5b1Q4udzjVV+tb/rlHIMJKuJ0e89R4Kzgz47z/rgP0dIKxktqIEUhDHluGTPJJH/wRha7CyqsA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3268,13 +3311,13 @@
}
},
"node_modules/react-router-dom": {
"version": "7.18.1",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.1.tgz",
"integrity": "sha512-KaZh+X/6UtEp28x51AUYZDMg9NGoz2ja3dNHa+ta/tk40vCzKhQ/RypCWBMLbmDr6//E24Vv5uPsrqXFozdkAg==",
"version": "7.18.3",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.3.tgz",
"integrity": "sha512-ytVbyBBM7vMfRCam25r0WMhSVSom909A8p+8m0/f1w853dz/xfFu6etAT2SEbVoSnI+ZoPRDqIsQXVT89gp7kg==",
"dev": true,
"license": "MIT",
"dependencies": {
"react-router": "7.18.1"
"react-router": "7.18.3"
},
"engines": {
"node": ">=20.0.0"
@@ -3565,9 +3608,9 @@
}
},
"node_modules/scheduler": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
"integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz",
"integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==",
"dev": true,
"license": "MIT"
},
@@ -3589,20 +3632,20 @@
"license": "MIT"
},
"node_modules/shiki": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/shiki/-/shiki-4.3.1.tgz",
"integrity": "sha512-oR+qDVi2OjX1tmDpyv+3KviX01KzO6Af+0NNnKnsp9491UEGz2YpxTuJboS/6VhYpTdqzmuJBuiTlrAWWJAssw==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/shiki/-/shiki-4.4.3.tgz",
"integrity": "sha512-Mb/GvXPHBAXdgGIcnfU5L3ldpn1XcxrGkPHwqgRx17/I2XRfqlFKk2vGkHWINn1kdXvzJZeuO3is6I9KLPFm0g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@shikijs/core": "4.3.1",
"@shikijs/engine-javascript": "4.3.1",
"@shikijs/engine-oniguruma": "4.3.1",
"@shikijs/langs": "4.3.1",
"@shikijs/themes": "4.3.1",
"@shikijs/types": "4.3.1",
"@shikijs/core": "4.4.3",
"@shikijs/engine-javascript": "4.4.3",
"@shikijs/engine-oniguruma": "4.4.3",
"@shikijs/langs": "4.4.3",
"@shikijs/themes": "4.4.3",
"@shikijs/types": "4.4.3",
"@shikijs/vscode-textmate": "^10.0.2",
"@types/hast": "^3.0.4"
"@types/hast": "^3.0.5"
},
"engines": {
"node": ">=20"
+1 -1
View File
@@ -42,7 +42,7 @@ export default defineConfig({
},
{
icon: {
svg: `<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Forgejo</title><path fill="currentColor" d="M16.7773 0c1.6018 0 2.9004 1.2986 2.9004 2.9005s-1.2986 2.9004-2.9004 2.9004c-1.0854 0-2.0315-.596-2.5288-1.4787H12.91c-2.3322 0-4.2272 1.8718-4.2649 4.195l-.0007 2.1175a7.0759 7.0759 0 0 1 4.148-1.4205l.1176-.001 1.3385.0002c.4973-.8827 1.4434-1.4788 2.5288-1.4788 1.6018 0 2.9004 1.2986 2.9004 2.9005s-1.2986 2.9004-2.9004 2.9004c-1.0854 0-2.0315-.596-2.5288-1.4787H12.91c-2.3322 0-4.2272 1.8718-4.2649 4.195l-.0007 2.319c.8827.4973 1.4788 1.4434 1.4788 2.5287 0 1.602-1.2986 2.9005-2.9005 2.9005-1.6018 0-2.9004-1.2986-2.9004-2.9005 0-1.0853.596-2.0314 1.4788-2.5287l-.0002-9.9831c0-3.887 3.1195-7.0453 6.9915-7.108l.1176-.001h1.3385C14.7458.5962 15.692 0 16.7773 0ZM7.2227 19.9052c-.6596 0-1.1943.5347-1.1943 1.1943s.5347 1.1943 1.1943 1.1943 1.1944-.5347 1.1944-1.1943-.5348-1.1943-1.1944-1.1943Zm9.5546-10.4644c-.6596 0-1.1944.5347-1.1944 1.1943s.5348 1.1943 1.1944 1.1943c.6596 0 1.1943-.5347 1.1943-1.1943s-.5347-1.1943-1.1943-1.1943Zm0-7.7346c-.6596 0-1.1944.5347-1.1944 1.1943s.5348 1.1943 1.1944 1.1943c.6596 0 1.1943-.5347 1.1943-1.1943s-.5347-1.1943-1.1943-1.1943Z"/></svg>`
svg: `<svg role="img" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><title>Forgejo</title><path fill="currentColor" d="M16.7773 0c1.6018 0 2.9004 1.2986 2.9004 2.9005s-1.2986 2.9004-2.9004 2.9004c-1.0854 0-2.0315-.596-2.5288-1.4787H12.91c-2.3322 0-4.2272 1.8718-4.2649 4.195l-.0007 2.1175a7.0759 7.0759 0 0 1 4.148-1.4205l.1176-.001 1.3385.0002c.4973-.8827 1.4434-1.4788 2.5288-1.4788 1.6018 0 2.9004 1.2986 2.9004 2.9005s-1.2986 2.9004-2.9004 2.9004c-1.0854 0-2.0315-.596-2.5288-1.4787H12.91c-2.3322 0-4.2272 1.8718-4.2649 4.195l-.0007 2.319c.8827.4973 1.4788 1.4434 1.4788 2.5287 0 1.602-1.2986 2.9005-2.9005 2.9005-1.6018 0-2.9004-1.2986-2.9004-2.9005 0-1.0853.596-2.0314 1.4788-2.5287l-.0002-9.9831c0-3.887 3.1195-7.0453 6.9915-7.108l.1176-.001h1.3385C14.7458.5962 15.692 0 16.7773 0ZM7.2227 19.9052c-.6596 0-1.1943.5347-1.1943 1.1943s.5347 1.1943 1.1943 1.1943 1.1944-.5347 1.1944-1.1943-.5348-1.1943-1.1944-1.1943Zm9.5546-10.4644c-.6596 0-1.1944.5347-1.1944 1.1943s.5348 1.1943 1.1944 1.1943c.6596 0 1.1943-.5347 1.1943-1.1943s-.5347-1.1943-1.1943-1.1943Zm0-7.7346c-.6596 0-1.1944.5347-1.1944 1.1943s.5348 1.1943 1.1944 1.1943c.6596 0 1.1943-.5347 1.1943-1.1943s-.5347-1.1943-1.1943-1.1943Z"/></svg>`
},
mode: 'link',
content: 'https://forgejo.ellis.link/continuwuation/continuwuity'
+1 -1
View File
@@ -10,7 +10,7 @@
[toolchain]
profile = "minimal"
channel = "1.97.1"
channel = "1.98.1"
components = [
# For rust-analyzer
"rust-src",
-1
View File
@@ -85,7 +85,6 @@ dtor.workspace = true
futures.workspace = true
lettre.workspace = true
log.workspace = true
assign.workspace = true
ruma.workspace = true
serde_json.workspace = true
serde-saphyr.workspace = true
+9 -7
View File
@@ -206,8 +206,9 @@ impl crate::Context<'_> {
let first_seen = scheduled.insert(auth_event_id.clone());
let auth_pdu = if let Some(auth_pdu) = cached_events.get(&auth_event_id) {
// NOTE: events might be referenced multiple times (like the create event)
// so this saves some cheeky db lookup time
// NOTE: events might be referenced multiple times (like the
// create event) so this saves some cheeky db lookup
// time
Some(auth_pdu.clone())
} else if first_seen {
match self.services.rooms.timeline.get_pdu(&auth_event_id).await {
@@ -221,9 +222,10 @@ impl crate::Context<'_> {
None
};
// NOTE: Depth is used as the primary sorting key here, even though it has no
// bearing on state resolution or anything. Timestamp is used as a
// tiebreaker, failing back to lexicographical comparison.
// NOTE: Depth is used as the primary sorting key here, even
// though it has no bearing on state resolution or anything.
// Timestamp is used as a tiebreaker, failing back to
// lexicographical comparison.
let (depth, ts) = auth_pdu
.as_ref()
.map_or((UInt::MAX, UInt::MAX), |pdu| (pdu.depth, pdu.origin_server_ts));
@@ -254,8 +256,8 @@ impl crate::Context<'_> {
// We have this PDU so will want to traverse it.
stack.push(child_pdu);
} else {
// We don't have this PDU locally so we can't traverse its auth events,
// but we can still render it as a node.
// We don't have this PDU locally so we can't traverse its
// auth events, but we can still render it as a node.
render_node(
&mut graph,
&child.node_id,
+1
View File
@@ -11,6 +11,7 @@ pub enum TesterCommand {
Timer,
}
#[allow(clippy::unused_async_trait_impl)]
impl crate::Context<'_> {
#[rustfmt::skip]
async fn panic(&self) -> Result {
+4 -2
View File
@@ -361,7 +361,8 @@ impl crate::Context<'_> {
.fetch_remote_content(&mxc, None, server.as_deref(), timeout)
.await?;
// Grab the length of the content before clearing it to not flood the output
// Grab the length of the content before clearing it to not flood the
// output
let len = result.content.as_ref().expect("content").len();
result.content.as_mut().expect("content").clear();
@@ -386,7 +387,8 @@ impl crate::Context<'_> {
.fetch_remote_thumbnail(&mxc, None, server.as_deref(), timeout, &dim)
.await?;
// Grab the length of the content before clearing it to not flood the output
// Grab the length of the content before clearing it to not flood the
// output
let len = result.content.as_ref().expect("content").len();
result.content.as_mut().expect("content").clear();
+14 -6
View File
@@ -49,7 +49,7 @@ async fn handle_command(services: Arc<Services>, command: CommandInput) -> Proce
async fn process_command(services: Arc<Services>, input: &CommandInput) -> ProcessorResult {
let (command, args, body) = match parse(&services, input) {
| Err(error) => return Err(error),
| Err(error) => return Err(Box::new(error)),
| Ok(parsed) => parsed,
};
@@ -72,18 +72,26 @@ async fn process_command(services: Arc<Services>, input: &CommandInput) -> Proce
String::from_utf8(take(output.get_mut())).expect("invalid utf8 in command output stream");
match result {
| Ok(()) if logs.is_empty() =>
Ok(Some(reply(RoomMessageEventContent::notice_markdown(output), context.reply_id))),
| Ok(()) if logs.is_empty() => Ok(Some(Box::new(reply(
RoomMessageEventContent::notice_markdown(output),
context.reply_id,
)))),
| Ok(()) => {
logs.write_str(output.as_str()).expect("output buffer");
Ok(Some(reply(RoomMessageEventContent::notice_markdown(logs), context.reply_id)))
Ok(Some(Box::new(reply(
RoomMessageEventContent::notice_markdown(logs),
context.reply_id,
))))
},
| Err(error) => {
write!(&mut logs, "Command failed with error:\n```\n{error:#?}\n```")
.expect("output buffer");
Err(reply(RoomMessageEventContent::notice_markdown(logs), context.reply_id))
Err(Box::new(reply(
RoomMessageEventContent::notice_markdown(logs),
context.reply_id,
)))
},
}
}
@@ -94,7 +102,7 @@ fn handle_panic(error: &Error, command: &CommandInput) -> ProcessorResult {
let msg = format!("Panic occurred while processing command:\n```\n{error:#?}\n```\n{link}");
let content = RoomMessageEventContent::notice_markdown(msg);
error!("Panic while processing command: {error:?}");
Err(reply(content, command.reply_id.as_deref()))
Err(Box::new(reply(content, command.reply_id.as_deref())))
}
/// Parse and process a message from the admin room
+1 -2
View File
@@ -59,7 +59,7 @@ pub(super) async fn process(subcommand: PusherCommand, context: &Context<'_>) ->
pushers
.stream()
.for_each(async |pushkey| {
services.pusher.delete_pusher(&user_id, pushkey).await;
services.pusher.delete_pusher(&user_id, &pushkey).await;
})
.await;
write!(context, "Deleted {pusher_count} pushers for {user_id}.")
@@ -68,7 +68,6 @@ pub(super) async fn process(subcommand: PusherCommand, context: &Context<'_>) ->
let pushers = services
.pusher
.get_pushkeys(&user_id)
.map(ToOwned::to_owned)
.broad_filter_map(async |pushkey| {
services
.pusher
+2 -1
View File
@@ -14,7 +14,8 @@ impl crate::Context<'_> {
include_empty: bool,
no_details: bool,
) -> Result {
// TODO: i know there's a way to do this with clap, but i can't seem to find it
// TODO: i know there's a way to do this with clap, but i can't seem to
// find it
let page = page.unwrap_or(1);
let mut rooms = self
.services
+2 -1
View File
@@ -37,7 +37,8 @@ pub(super) async fn process(command: RoomDirectoryCommand, context: &Context<'_>
context.write_str("Room unpublished").await
},
| RoomDirectoryCommand::List { page } => {
// TODO: i know there's a way to do this with clap, but i can't seem to find it
// TODO: i know there's a way to do this with clap, but i can't seem
// to find it
let page = page.unwrap_or(1);
let mut rooms: Vec<_> = services
.rooms
+3 -2
View File
@@ -28,8 +28,9 @@ impl crate::Context<'_> {
}
pub(super) async fn reload_config(&self, path: Option<PathBuf>) -> Result {
// The path argument is only what's optionally passed via the admin command,
// so we need to merge it with the existing paths if any were given at startup.
// The path argument is only what's optionally passed via the admin
// command, so we need to merge it with the existing paths if any were
// given at startup.
let mut paths = Vec::new();
// Add previously saved paths to the argument list
+5 -5
View File
@@ -206,13 +206,13 @@ impl crate::Context<'_> {
);
},
}
self.write_str(&format!(
"Successfully reset the password for user {user_id}: `{new_password}`"
))
.await?;
}
self.write_str(&format!(
"Successfully reset the password for user {user_id}: `{new_password}`"
))
.await?;
if logout {
self.services
.users
-5
View File
@@ -63,8 +63,6 @@ zstd_compression = [
]
[dependencies]
async-trait.workspace = true
axum-extra.workspace = true
axum.workspace = true
base64.workspace = true
bytes.workspace = true
@@ -80,16 +78,13 @@ hmac.workspace = true
http.workspace = true
http-body-util.workspace = true
hyper.workspace = true
ipaddress.workspace = true
itertools.workspace = true
lettre.workspace = true
log.workspace = true
rand.workspace = true
reqwest.workspace = true
assign.workspace = true
ruma.workspace = true
ruminuwuity.workspace = true
serde_html_form.workspace = true
serde_json.workspace = true
serde.workspace = true
sha1.workspace = true
+7 -8
View File
@@ -83,8 +83,8 @@ pub(crate) async fn change_password_route(
body: Ruma<change_password::v3::Request>,
) -> Result<change_password::v3::Response> {
let identity = if let Some(identity) = body.identity.as_ref() {
// A signed-in user is trying to change their password, prompt them for their
// existing one
// A signed-in user is trying to change their password, prompt them for
// their existing one
services
.uiaa
@@ -99,10 +99,10 @@ pub(crate) async fn change_password_route(
)
.await?
} else {
// A signed-out user is trying to reset their password, prompt them for email
// confirmation. Note that we do not _send_ an email here, their client should
// have already hit `/account/password/requestToken` to send the email. We
// just validate it.
// A signed-out user is trying to reset their password, prompt them for
// email confirmation. Note that we do not _send_ an email here, their
// client should have already hit `/account/password/requestToken` to
// send the email. We just validate it.
services
.uiaa
@@ -145,7 +145,6 @@ pub(crate) async fn change_password_route(
services
.pusher
.get_pushkeys(&sender_user)
.map(ToOwned::to_owned)
.broad_filter_map(async |pushkey| {
services
.pusher
@@ -339,7 +338,7 @@ pub async fn full_user_deactivate(
.pusher
.get_pushkeys(user_id)
.for_each(async |pushkey| {
services.pusher.delete_pusher(user_id, pushkey).await;
services.pusher.delete_pusher(user_id, &pushkey).await;
})
.await;
+7 -31
View File
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use axum::extract::State;
use conduwuit::{Err, Result, debug_info, info};
use conduwuit::{Err, Result, info};
use conduwuit_service::Services;
use futures::StreamExt;
use lettre::{Address, message::Mailbox};
@@ -41,8 +41,8 @@ pub(crate) async fn register_route(
return Err!(Request(GuestAccessForbidden("Guests may not register on this server.")));
}
// Allow registration if it's enabled in the config file or if this is the first
// run (so the first user account can be created)
// Allow registration if it's enabled in the config file or if this is the
// first run (so the first user account can be created)
let allow_registration =
services.config.allow_registration || services.firstrun.is_first_run();
@@ -108,8 +108,9 @@ pub(crate) async fn register_route(
};
let (token, device) = if !body.inhibit_login {
// If UIAA is disabled, we can't create a device. In that case only appservices
// can reach this point in the first place, so we return an error for them.
// If UIAA is disabled, we can't create a device. In that case only
// appservices can reach this point in the first place, so we return
// an error for them.
if !services.config.oauth.compatibility_mode().uiaa_available() {
return Err!(Request(AppserviceLoginUnsupported(
"User-interactive appservice registration is not available on this server."
@@ -137,28 +138,6 @@ pub(crate) async fn register_route(
(None, None)
};
debug_info!(%user_id, ?device, "New account created via legacy registration");
// Only log if the user wasn't registered via an appservice.
if body.identity.is_none() {
let notice = if device.is_some()
&& let Some(device_name) = body.initial_device_display_name.as_ref()
{
format!(
"New user \"{user_id}\" registered on this server from IP {client} and device \
display name \"{device_name}\" via legacy registration",
)
} else {
format!(
"New user \"{user_id}\" registered on this server from IP {client} via legacy \
registration."
)
};
info!("{notice}");
if services.server.config.admin_room_notices {
services.admin.notice(&notice).await;
}
}
Ok(assign!(register::v3::Response::new(user_id), {
access_token: token.map(DeviceToken::into_token),
device_id: device,
@@ -255,10 +234,7 @@ async fn create_registration_uiaa_session(
if flows.is_empty() {
// No flows are configured. Bail out by default
// unless open registration was explicitly enabled.
if !services
.config
.yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse
{
if !services.config.enable_challengeless_registration() {
return Err!(Request(Forbidden(
"This server is not accepting registrations at this time."
)));
+2 -2
View File
@@ -247,8 +247,8 @@ pub(crate) async fn add_backup_keys_for_session_route(
| Ordering::Less => true,
| Ordering::Greater => false,
| Ordering::Equal => {
// If both have same `first_message_index`, prefer the one with lower
// `forwarded_count`
// If both have same `first_message_index`, prefer the one
// with lower `forwarded_count`
let old_forwarded_count = old_key
.get_field::<UInt>("forwarded_count")?
.unwrap_or(UInt::MAX);
+1 -2
View File
@@ -68,8 +68,7 @@ pub(crate) async fn update_device_route(
services
.users
.update_device_metadata(sender_user, &body.device_id, &device)
.await?;
.update_device_metadata(sender_user, &body.device_id, &device)?;
Ok(update_device::v3::Response::new())
},
+5 -3
View File
@@ -111,8 +111,9 @@ pub(crate) async fn upload_keys_route(
.await
.and_then(|keys| keys.deserialize().map_err(Into::into))
{
// NOTE: also serves as a workaround for a nheko bug which omits cross-signing
// NOTE: signatures when re-uploading the same DeviceKeys.
// NOTE: also serves as a workaround for a nheko bug which omits
// cross-signing NOTE: signatures when re-uploading the same
// DeviceKeys.
if existing_keys.keys == deser_device_keys.keys {
debug!(
%sender_user,
@@ -273,7 +274,8 @@ async fn uiaa_needed_to_upload_keys(
);
if let Some(existing_master_signing_key) = existing_master_signing_key {
// If a master key exists, UIAA is required if any of the keys are different.
// If a master key exists, UIAA is required if any of the keys are
// different.
master_signing_key != Some(existing_master_signing_key)
|| user_signing_key != existing_user_signing_key
+10 -10
View File
@@ -49,13 +49,12 @@ pub(crate) async fn invite_user_route(
reason,
..
}) => {
let sender_filter_level = services
// silently drop invites to users the sender has ignored
if services
.users
.invite_filter_level(recipient_user, sender_user)
.await;
if !matches!(sender_filter_level, FilterLevel::Allow) {
// drop invites if the sender has the recipient filtered
.user_is_ignored(recipient_user, sender_user)
.await
{
return Ok(invite_user::v3::Response::new());
}
@@ -78,8 +77,9 @@ pub(crate) async fn invite_user_route(
.await;
// ignored invites aren't handled here
// since the recipient's membership should still be changed to `invite`.
// they're filtered out in the individual /sync handlers.
// since the recipient's membership should still be changed to
// `invite`. they're filtered out in the individual /sync
// handlers.
if matches!(recipient_filter_level, FilterLevel::Block) {
return Err!(Request(InviteBlocked(
"{recipient_user} has blocked invites from you."
@@ -191,8 +191,8 @@ pub(crate) async fn invite_helper(
.send_federation_request(recipient_user.server_name(), request)
.await?;
// We do not add the event_id field to the pdu here because of signature and
// hashes checks
// We do not add the event_id field to the pdu here because of signature
// and hashes checks
let (event_id, value) = gen_event_id_canonical_json(
&response.event,
&room_version_id
+18 -17
View File
@@ -190,10 +190,10 @@ async fn knock_room_by_id_helper(
}
}
// For knock_restricted rooms, check if the user meets the restricted conditions
// If they do, attempt to join instead of knock
// This is not mentioned in the spec, but should be allowable (we're allowed to
// auto-join invites to knocked rooms)
// For knock_restricted rooms, check if the user meets the restricted
// conditions If they do, attempt to join instead of knock
// This is not mentioned in the spec, but should be allowable (we're allowed
// to auto-join invites to knocked rooms)
let join_rule = services.rooms.state_accessor.get_join_rules(room_id).await;
if let JoinRule::KnockRestricted(restricted) = &join_rule {
@@ -226,9 +226,9 @@ async fn knock_room_by_id_helper(
"{sender_user} meets the restricted criteria in knock_restricted room \
{room_id}, attempting to join instead of knock"
);
// For this case, we need to drop the state lock and get a new one in
// join_room_by_id_helper We need to release the lock here and let
// join_room_by_id_helper acquire it again
// For this case, we need to drop the state lock and get a new one
// in join_room_by_id_helper We need to release the lock here and
// let join_room_by_id_helper acquire it again
drop(state_lock);
match services
.rooms
@@ -401,8 +401,8 @@ async fn knock_room_helper_local(
to_canonical_value(content).expect("event is valid, we just created it"),
);
// In order to create a compatible ref hash (EventID) the `hashes` field needs
// to be present
// In order to create a compatible ref hash (EventID) the `hashes` field
// needs to be present
services
.server_keys
.hash_and_sign_event(&mut knock_event_stub, &room_version_rules)?;
@@ -446,10 +446,11 @@ async fn knock_room_helper_local(
.map_err(|e| err!(BadServerResponse("Invalid knock event PDU: {e:?}")))?;
info!("Updating membership locally to knock state with provided stripped state events");
// TODO: this call does not appear to do anything because `update_membership`
// doesn't call `mark_as_knock`. investigate further, ideally with the aim of
// removing this call entirely -- Ginger thinks `update_membership` should only
// be called from `force_state` and `append_pdu`.
// TODO: this call does not appear to do anything because
// `update_membership` doesn't call `mark_as_knock`. investigate further,
// ideally with the aim of removing this call entirely -- Ginger thinks
// `update_membership` should only be called from `force_state` and
// `append_pdu`.
services
.rooms
.state_cache
@@ -524,8 +525,8 @@ async fn knock_room_helper_remote(
to_canonical_value(knock_content).expect("event is valid, we just created it"),
);
// In order to create a compatible ref hash (EventID) the `hashes` field needs
// to be present
// In order to create a compatible ref hash (EventID) the `hashes` field
// needs to be present
services
.server_keys
.hash_and_sign_event(&mut knock_event_stub, &room_version_rules)?;
@@ -671,8 +672,8 @@ async fn knock_room_helper_remote(
.await?;
info!("Setting final room state for new room");
// We set the room state after inserting the pdu, so that we never have a moment
// in time where events in the current room state do not exist
// We set the room state after inserting the pdu, so that we never have a
// moment in time where events in the current room state do not exist
services
.rooms
.state
+19 -15
View File
@@ -110,16 +110,16 @@ pub async fn leave_room(
otherwise `build_and_append_pdu` will take care of updating the state cache for us.
*/
// `leave_pdu` is the outlier `m.room.member` event which will be synced to the
// user. if it's None the sync handler will create a dummy PDU.
// `leave_pdu` is the outlier `m.room.member` event which will be synced to
// the user. if it's None the sync handler will create a dummy PDU.
let leave_pdu = if is_banned.or(is_disabled).await {
// case 1: the room is banned/disabled. we don't want to federate with another
// server to leave, so we can't create an outlier PDU.
// case 1: the room is banned/disabled. we don't want to federate with
// another server to leave, so we can't create an outlier PDU.
None
} else if dont_have_room.and(not_knocked).await {
// case 2: ask a remote server to assist us with leaving
// we always mark the room as left locally, regardless of if the federated leave
// failed
// we always mark the room as left locally, regardless of if the
// federated leave failed
remote_leave_room(services, user_id, room_id, reason.clone(), HashSet::new())
.await
@@ -159,12 +159,14 @@ pub async fn leave_room(
)
.await?;
// `build_and_append_pdu` calls `mark_as_left` internally, so we return early.
// `build_and_append_pdu` calls `mark_as_left` internally, so we
// return early.
return Ok(());
},
| Err(_) => {
// an exception to case 3 is if the user isn't even in the room they're trying
// to leave. this can happen if the client's caching is wrong.
// an exception to case 3 is if the user isn't even in the room
// they're trying to leave. this can happen if the client's
// caching is wrong.
debug_warn!(
"Trying to leave a room you are not a member of, marking room as left \
locally."
@@ -177,11 +179,13 @@ pub async fn leave_room(
.left_state(user_id, room_id)
.await
.inspect_err(|err| {
// `left_state` may return an Err if the user _is_ in the room they're
// trying to leave, but the membership cache is incorrect and
// `left_state` may return an Err if the user _is_ in
// the room they're trying to leave, but the
// membership cache is incorrect and
// they're cached as being joined. In this situation
// we save a `None` to the `roomuserid_leftcount` table, which generates
// and sends a dummy leave to the client.
// we save a `None` to the `roomuserid_leftcount` table,
// which generates and sends a dummy leave to the
// client.
warn!(
?err,
"Trying to leave room not cached as leave, sending dummy leave \
@@ -370,8 +374,8 @@ pub async fn remote_leave_room<S: ::std::hash::BuildHasher>(
// room v3 and above removed the "event_id" field from remote PDU format
leave_event_stub.remove("event_id");
// In order to create a compatible ref hash (EventID) the `hashes` field needs
// to be present
// In order to create a compatible ref hash (EventID) the `hashes` field
// needs to be present
services
.server_keys
.hash_and_sign_event(&mut leave_event_stub, &room_version_rules)?;
+4 -4
View File
@@ -40,8 +40,8 @@ pub(crate) async fn get_pushrules_all_route(
.and_then(|event| event.get("content").cloned())
.filter(CanonicalJsonValue::is_object)
else {
// user somehow has non-existent push rule event. recreate it and return server
// default silently
// user somehow has non-existent push rule event. recreate it and return
// server default silently
return recreate_push_rules_and_return(&services, sender_user).await;
};
@@ -111,8 +111,8 @@ pub(crate) async fn get_pushrules_global_route(
.and_then(|event| event.get("content").cloned())
.filter(CanonicalJsonValue::is_object)
else {
// user somehow has non-existent push rule event. recreate it and return server
// default silently
// user somehow has non-existent push rule event. recreate it and return
// server default silently
let global_ruleset = Ruleset::server_default(sender_user);
let event = PushRulesEvent::new(PushRulesEventContent::new(global_ruleset.clone()));
+2 -2
View File
@@ -48,8 +48,8 @@ pub(crate) async fn report_room_route(
delay_response().await;
// We log this early in case the room ID does actually exist, in which case
// admins who scan their logs can see the report and choose to investigate at
// their discretion.
// admins who scan their logs can see the report and choose to investigate
// at their discretion.
info!(
"Received room report by user {sender_user} for room {} with reason: \"{}\"",
body.room_id, body.reason
+19 -21
View File
@@ -90,15 +90,15 @@ pub(crate) async fn create_room_route(
};
let room_version_rules = room_version.rules().unwrap();
// For custom room IDs, if the user is creating a room with a v1 room ID format,
// we can just use that ID directly. However, if it's a custom *v2* room ID, we
// need to make sure that we don't generate one, which would in turn trick us
// into generating invalid v2 room events.
// For custom room IDs, if the user is creating a room with a v1 room ID
// format, we can just use that ID directly. However, if it's a custom *v2*
// room ID, we need to make sure that we don't generate one, which would in
// turn trick us into generating invalid v2 room events.
//
// expect_room_id is the custom room ID that the user is expecting - for v2
// formatted rooms, we check that the m.room.create event's generated room ID
// exactly matches this, and abort if it doesn't. Otherwise, we use it as the
// room ID itself.
// formatted rooms, we check that the m.room.create event's generated room
// ID exactly matches this, and abort if it doesn't. Otherwise, we use it
// as the room ID itself.
let expect_room_id = {
let body_ref = body.json_body.as_ref().unwrap();
if let Some(CanonicalJsonValue::String(room_id)) = body_ref
@@ -156,21 +156,19 @@ pub(crate) async fn create_room_route(
let mut invitees = BTreeSet::new();
for recipient_user in &body.invite {
if !matches!(
services
.users
.invite_filter_level(recipient_user, sender_user)
.await,
FilterLevel::Allow
) {
// drop invites if the creator has them blocked
// silently drop invites to users the creator has ignored
if services
.users
.user_is_ignored(recipient_user, sender_user)
.await
{
continue;
}
// if the recipient of the invite is local and has the sender blocked, error
// out. if the recipient is remote we can't tell yet, and if they're local and
// have the sender _ignored_ their invite will be filtered out in
// the handlers for the individual /sync endpoints
// if the recipient of the invite is local and has the sender blocked,
// error out. if the recipient is remote we can't tell yet, and if
// they're local and have the sender _ignored_ their invite will be
// filtered out in the handlers for the individual /sync endpoints
if services.globals.user_is_local(recipient_user)
&& matches!(
services
@@ -654,8 +652,8 @@ fn default_power_levels_content(
power_levels_content["events"]["m.poll.response"] =
serde_json::to_value(0).expect("0 is valid Value");
// synapse does this too. clients do not expose these permissions. it prevents
// default users from calling public rooms, for obvious reasons.
// synapse does this too. clients do not expose these permissions. it
// prevents default users from calling public rooms, for obvious reasons.
if *visibility == room::Visibility::Public {
power_levels_content["events"]["m.call.invite"] =
serde_json::to_value(50).expect("50 is valid Value");
+33 -25
View File
@@ -77,8 +77,8 @@ async fn update_parents(
continue; // Skip updating rooms the sender isn't in.
}
let state_lock = services.rooms.state.mutex.lock(parent_id.as_str()).await;
// We're now fetching state from the *space* that has the old room as a *child*.
// Follow along. This will be on the test.
// We're now fetching state from the *space* that has the old room as a
// *child*. Follow along. This will be on the test.
let Ok(child) = services
.rooms
.state_accessor
@@ -98,13 +98,15 @@ async fn update_parents(
);
})
else {
// If the space does not have a child event for this room, we can skip it
// If the space does not have a child event for this room, we can
// skip it
continue;
};
// ...the upgrading server SHOULD send a new m.space.child event with state_key
// set to the new room's ID, copying the order and suggested fields from the
// content of the m.space.child with state_key of the previous room ID.
// ...the upgrading server SHOULD send a new m.space.child event with
// state_key set to the new room's ID, copying the order and suggested
// fields from the content of the m.space.child with state_key of the
// previous room ID.
services
.rooms
.timeline
@@ -199,7 +201,8 @@ async fn update_children(
);
})
else {
// If the child does not have a parent event for this room, we can skip it.
// If the child does not have a parent event for this room, we can
// skip it.
continue;
};
@@ -228,9 +231,10 @@ async fn update_children(
))
.ok();
// If the previous m.space.parent event has canonical set to true in content,
// homeservers SHOULD update the old state event to set canonical to false,
// while setting it to true in the newly-sent m.space.parent event.
// If the previous m.space.parent event has canonical set to true in
// content, homeservers SHOULD update the old state event to set
// canonical to false, while setting it to true in the newly-sent
// m.space.parent event.
if parent.canonical {
services
.rooms
@@ -301,11 +305,12 @@ pub(crate) async fn upgrade_room_route(
return Err!(Request(Forbidden("Upgrading the admin room this way is not allowed.")));
}
// 1. Check that the user has permission to send m.room.tombstone events in the
// room.
// 1. Check that the user has permission to send m.room.tombstone events in
// the room.
let old_room_state_lock = services.rooms.state.mutex.lock(body.room_id.as_str()).await;
// Check tombstone permission by attempting to create (but not send) the event.
// Check tombstone permission by attempting to create (but not send) the
// event.
services
.rooms
.timeline
@@ -389,9 +394,9 @@ pub(crate) async fn upgrade_room_route(
let new_room_state_lock = if let Some(new_room_id) = replacement_room_id.as_ref() {
services.rooms.state.mutex.lock(new_room_id.as_str()).await
} else {
// NOTE: Using a hardcoded room ID for the temporary mutex means only one room
// can be created at a time. This is actually beneficial, as it reduces the
// risk of concurrent in-flight collisions.
// NOTE: Using a hardcoded room ID for the temporary mutex means only
// one room can be created at a time. This is actually beneficial, as
// it reduces the risk of concurrent in-flight collisions.
services.rooms.state.mutex.lock("!new-room").await
};
debug!("Upgrading {} to room version {}", &body.room_id, &body.new_version);
@@ -408,9 +413,9 @@ pub(crate) async fn upgrade_room_route(
.await?;
drop(new_room_state_lock);
// re-acquire a new lock with the new room ID.
// We don't actually need a state lock for sending the m.room.create event, but
// we get one anyway because the function requires it and I can't be bothered
// refactoring it.
// We don't actually need a state lock for sending the m.room.create event,
// but we get one anyway because the function requires it and I can't be
// bothered refactoring it.
let (replacement_room_id, new_room_state_lock) =
if new_version_rules.room_id_format == RoomIdFormatVersion::V2 {
let parsed_room_id = RoomId::new_v2(
@@ -470,8 +475,9 @@ pub(crate) async fn upgrade_room_route(
| Ok(v) => v.content().to_owned(),
| Err(_) => continue, // Skipping missing events.
};
// If this is a power levels event, and the new room version has creators,
// we need to make sure they dont appear in the users block of power levels.
// If this is a power levels event, and the new room version has
// creators, we need to make sure they dont appear in the users
// block of power levels.
if *event_type == StateEventType::RoomPowerLevels {
let creators = body
.additional_creators
@@ -550,8 +556,8 @@ pub(crate) async fn upgrade_room_route(
)?;
}
// 5. Send a `m.room.tombstone` event to the old room to indicate that it is not
// intended to be used any further.
// 5. Send a `m.room.tombstone` event to the old room to indicate that it is
// not intended to be used any further.
debug!(target=?body.room_id, "Sending tombstone to old room");
services
.rooms
@@ -577,7 +583,8 @@ pub(crate) async fn upgrade_room_route(
.get_room_power_levels(&body.room_id)
.await;
// Setting events_default and invite to the greater of 50 and users_default + 1
// Setting events_default and invite to the greater of 50 and users_default
// + 1
let new_level = max(
int!(50),
power_levels
@@ -591,7 +598,8 @@ pub(crate) async fn upgrade_room_route(
power_levels.events_default = new_level;
power_levels.invite = new_level;
// 6. Modify the power levels in the old room to prevent sending of events and
// 6. Modify the power levels in the old room to prevent sending of events
// and
// inviting new users
// Spec dictates that this is allowed to fail.
debug!(target=?body.room_id, ?new_level, "Raising power level in old room to lock it");
+3 -3
View File
@@ -222,7 +222,8 @@ pub(crate) async fn login_route(
.await?
};
// send client well-known if specified so the client knows to reconfigure itself
// send client well-known if specified so the client knows to reconfigure
// itself
let client_discovery_info: Option<DiscoveryInfo> = services
.server
.config
@@ -298,7 +299,6 @@ pub(crate) async fn logout_route(
services
.pusher
.get_pushkeys(sender_user)
.map(ToOwned::to_owned)
.broad_filter_map(async |pushkey| {
services
.pusher
@@ -345,7 +345,7 @@ pub(crate) async fn logout_all_route(
.pusher
.get_pushkeys(sender_user)
.for_each(async |pushkey| {
services.pusher.delete_pusher(sender_user, pushkey).await;
services.pusher.delete_pusher(sender_user, &pushkey).await;
})
.await;
+3 -3
View File
@@ -15,9 +15,9 @@ pub(crate) async fn get_hierarchy_route(
State(services): State<crate::State>,
body: Ruma<get_hierarchy::v1::Request>,
) -> Result<get_hierarchy::v1::Response> {
// We don't do pagination for this route (and therefore ignore `limit`), since
// there's no reasonable way to handle a space hierarchy changing during
// pagination.
// We don't do pagination for this route (and therefore ignore `limit`),
// since there's no reasonable way to handle a space hierarchy changing
// during pagination.
// Default to MAX_MAX_DEPTH when the client doesn't specify one, so an
// unbounded traversal can never happen.
+9 -7
View File
@@ -67,14 +67,16 @@ async fn load_timeline(
})?;
if last_timeline_count <= starting_count {
// no messages have been sent in this room since `starting_count`
// no messages have been sent in this room since
// `starting_count`
return Ok(TimelinePdus::default());
}
// for incremental sync, stream from the DB all PDUs which were sent after
// `starting_count` but before `ending_count`, including `ending_count` but
// not `starting_count`. this code is pretty similar to the initial sync
// branch, they're separate to allow for future optimization
// for incremental sync, stream from the DB all PDUs which were sent
// after `starting_count` but before `ending_count`, including
// `ending_count` but not `starting_count`. this code is pretty
// similar to the initial sync branch, they're separate to allow
// for future optimization
services
.rooms
.timeline
@@ -99,8 +101,8 @@ async fn load_timeline(
.boxed()
},
| None => {
// For initial sync, stream from the DB all PDUs before and including
// `ending_count` in reverse order
// For initial sync, stream from the DB all PDUs before and
// including `ending_count` in reverse order
services
.rooms
.timeline
+37 -32
View File
@@ -148,10 +148,11 @@ async fn build_ephemeral(
SyncContext { syncing_user, last_sync_end_count, .. }: SyncContext<'_>,
room_id: &RoomId,
) -> Result<Ephemeral> {
// note: some of the futures below are boxed. this is because, without the box,
// rustc produces over thirty inscrutable errors in `mod.rs` at the call-site
// of `load_joined_room`. I don't know why boxing them fixes this -- it seems
// to be related to the async closures and borrowing from the sync context.
// note: some of the futures below are boxed. this is because, without the
// box, rustc produces over thirty inscrutable errors in `mod.rs` at the
// call-site of `load_joined_room`. I don't know why boxing them fixes this
// -- it seems to be related to the async closures and borrowing from the
// sync context.
// collect updates to read receipts
let receipt_events = services
@@ -176,8 +177,8 @@ async fn build_ephemeral(
| Some(last_sync_end_count) => {
match services.rooms.typing.last_typing_update(room_id).await {
| Ok(last_typing_update) => {
// update the typing list if the users typing have changed since the last
// sync
// update the typing list if the users typing have
// changed since the last sync
last_typing_update > last_sync_end_count
},
| Err(err) => {
@@ -288,7 +289,8 @@ async fn build_sticky_events(
.flatten()
.map(PduCount::Normal);
// nothing older than this can still be sticky, so the walk back never goes far
// nothing older than this can still be sticky, so the walk back never goes
// far
let oldest_sticky_ts = now.saturating_sub(sticky::MAX_DURATION_MS);
let mut events = Vec::new();
@@ -393,14 +395,14 @@ async fn build_state_and_timeline(
// history
let prev_batch = timeline.pdus.front().map(at!(0));
// note: we always indicate a limited timeline if the syncing user just joined
// the room, to indicate to the client that it should request backfill (and to
// copy Synapse's behavior). for federated room joins, the `timeline` will
// usually only include the syncing user's join event.
// note: we always indicate a limited timeline if the syncing user just
// joined the room, to indicate to the client that it should request
// backfill (and to copy Synapse's behavior). for federated room joins, the
// `timeline` will usually only include the syncing user's join event.
let limited = timeline.limited || joined_since_last_sync;
// filter out ignored events from the timeline and convert the PDUs into Ruma's
// AnySyncTimelineEvent type
// filter out ignored events from the timeline and convert the PDUs into
// Ruma's AnySyncTimelineEvent type
let filtered_timeline = timeline
.pdus
.into_iter()
@@ -442,8 +444,8 @@ async fn fetch_shortstatehashes(
room_id: &RoomId,
) -> Result<ShortStateHashes> {
// the room state currently.
// TODO: this should be the room state as of `current_count`, but there's no way
// to get that right now.
// TODO: this should be the room state as of `current_count`, but there's no
// way to get that right now.
let current_shortstatehash = services
.rooms
.state
@@ -484,7 +486,8 @@ async fn fetch_shortstatehashes(
}
},
| None => {
// No events have been sent since the last sync, or we just joined this room
// No events have been sent since the last sync, or we just
// joined this room
None
},
}
@@ -561,12 +564,13 @@ async fn build_state_events(
} = shortstatehashes;
if timeline.pdus.is_empty() {
// If the timeline is empty there can't possibly be any changes to the state
// If the timeline is empty there can't possibly be any changes to the
// state
return Ok(vec![]);
}
// the user IDs of members whose membership needs to be sent to the client, if
// lazy-loading is enabled.
// the user IDs of members whose membership needs to be sent to the client,
// if lazy-loading is enabled.
let lazily_loaded_members =
prepare_lazily_loaded_members(services, sync_context, room_id, timeline.senders()).await;
@@ -619,14 +623,14 @@ async fn build_notification_counts(
) -> Result<Option<UnreadNotificationsCount>> {
// determine whether to actually update the notification counts
let should_send_notification_counts = async {
// if we're going to sync some timeline events, the notification count has
// definitely changed to include them
// if we're going to sync some timeline events, the notification count
// has definitely changed to include them
if !timeline.pdus.is_empty() {
return true;
}
// if this is an initial sync, we need to send notification counts because the
// client doesn't know what they are yet
// if this is an initial sync, we need to send notification counts
// because the client doesn't know what they are yet
let Some(last_sync_end_count) = last_sync_end_count else {
return true;
};
@@ -637,8 +641,8 @@ async fn build_notification_counts(
.last_notification_read(syncing_user, room_id)
.await;
// if the syncing user has read the events we sent during the last sync, we need
// to send a new notification count on this sync.
// if the syncing user has read the events we sent during the last sync,
// we need to send a new notification count on this sync.
if last_notification_read > last_sync_end_count {
return true;
}
@@ -683,8 +687,8 @@ async fn check_joined_since_last_sync(
SyncContext { syncing_user, .. }: SyncContext<'_>,
) -> Result<bool> {
let Some(last_sync_end_shortstatehash) = last_sync_end_shortstatehash else {
// For initial syncs always return false, since there's no "last sync" for the
// user to have joined since.
// For initial syncs always return false, since there's no "last sync"
// for the user to have joined since.
return Ok(false);
};
@@ -703,8 +707,8 @@ async fn check_joined_since_last_sync(
// TODO: If the requesting user got state-reset out of the room, this
// will be `true` when it shouldn't be. this function should never be called
// in that situation, but it may be if the membership cache didn't get updated.
// the root cause of this needs to be addressed
// in that situation, but it may be if the membership cache didn't get
// updated. the root cause of this needs to be addressed
let joined_since_last_sync =
membership_during_previous_sync.is_none_or(|content: RoomMemberEventContent| {
content.membership != MembershipState::Join
@@ -729,7 +733,8 @@ async fn build_room_summary(
state_events: &[PduEvent],
joined_since_last_sync: bool,
) -> Result<Option<RoomSummary>> {
// determine whether any events in the state or timeline are membership events.
// determine whether any events in the state or timeline are membership
// events.
let are_syncing_membership_events = timeline
.pdus
.iter()
@@ -863,8 +868,8 @@ async fn build_device_list_updates(
.state_get(current_shortstatehash, &StateEventType::RoomEncryption, "")
.is_ok();
// initial syncs don't include device updates, and rooms which aren't encrypted
// don't affect them, so return early in either of those cases
// initial syncs don't include device updates, and rooms which aren't
// encrypted don't affect them, so return early in either of those cases
if last_sync_end_count.is_none() || !(is_encrypted_room.await) {
return Ok(DeviceListUpdates::new());
}
+16 -14
View File
@@ -59,22 +59,23 @@ pub(super) async fn load_left_room(
.await
.ok()
else {
// if we get here, the membership cache is incorrect, likely due to a state
// reset
// if we get here, the membership cache is incorrect, likely due to a
// state reset
debug_warn!("attempting to sync left room but no left count exists");
return Ok(None);
};
// return early if we haven't gotten to this leave yet.
// this can happen if the user leaves while a sync response is being generated
// this can happen if the user leaves while a sync response is being
// generated
if current_count < left_count {
return Ok(None);
}
// return early if:
// - this is an initial sync and the room filter doesn't include leaves, or
// - this is an incremental sync, and we've already synced the leave, and the
// room filter doesn't include leaves
// - this is an incremental sync, and we've already synced the leave, and
// the room filter doesn't include leaves
if last_sync_end_count.is_none_or(|last_sync_end_count| last_sync_end_count >= left_count)
&& !filter.room.include_leave
{
@@ -110,8 +111,8 @@ pub(super) async fn load_left_room(
(TimelinePdus::default(), vec![leave_membership_event])
},
| Some(leave_membership_event) => {
// we have this room in our DB, and can fetch the state and timeline from when
// the user left.
// we have this room in our DB, and can fetch the state and timeline
// from when the user left.
let leave_state_key = syncing_user;
debug_assert_eq!(
@@ -120,9 +121,9 @@ pub(super) async fn load_left_room(
"leave PDU should be for the user requesting the sync"
);
// the shortstatehash of the state _immediately before_ the syncing user left
// this room. the state represented here _does not_ include
// `leave_membership_event`.
// the shortstatehash of the state _immediately before_ the syncing
// user left this room. the state represented here _does not_
// include `leave_membership_event`.
let leave_shortstatehash = services
.rooms
.state_accessor
@@ -246,9 +247,9 @@ async fn build_left_state_and_timeline(
)
.await?;
// the timeline index can lag behind the leave PDU, so `load_timeline` may omit
// it. we already hold the leave event, so ensure it's always synced to the
// client.
// the timeline index can lag behind the leave PDU, so `load_timeline` may
// omit it. we already hold the leave event, so ensure it's always synced
// to the client.
let leave_synced = timeline
.pdus
.iter()
@@ -294,7 +295,8 @@ async fn build_left_state_and_timeline(
[1]: https://github.com/matrix-org/matrix-js-sdk/issues/5071
*/
// `state` should only ever include one membership event for the syncing user
// `state` should only ever include one membership event for the syncing
// user
let membership_event_index = state.iter().position(|pdu| {
*pdu.event_type() == TimelineEventType::RoomMember
&& pdu.state_key() == Some(syncing_user.as_str())
+7 -6
View File
@@ -41,7 +41,8 @@ pub(super) async fn build_state_initial(
let event_ids_in_timeline: HashSet<_> =
timeline.pdus.iter().map(|pdu| &pdu.1.event_id).collect();
// load the keys and event IDs of the state events at the start of the timeline
// load the keys and event IDs of the state events at the start of the
// timeline
let (shortstatekeys, event_ids): (Vec<_>, Vec<_>) = services
.rooms
.state_accessor
@@ -167,11 +168,11 @@ pub(super) async fn build_state_incremental<'a>(
.await;
if !use_state_after {
// If state_after isn't enabled, filter out state events which also exist
// in the timeline. If splits exist in the DAG, this may not be exactly the same
// thing as the state diff ending at the start of the timeline, but Synapse
// also does this and it's technically more useful behavior anyway.
// See: https://github.com/element-hq/synapse/issues/16941
// If state_after isn't enabled, filter out state events which also
// exist in the timeline. If splits exist in the DAG, this may not be
// exactly the same thing as the state diff ending at the start of the
// timeline, but Synapse also does this and it's technically more
// useful behavior anyway. See: https://github.com/element-hq/synapse/issues/16941
for (_, pdu) in &timeline.pdus {
state_event_ids.remove(pdu.event_id());
+86 -41
View File
@@ -124,7 +124,12 @@ pub(crate) async fn sync_events_v5_route(
let snake_key = into_snake_key(sender_user, sender_device.as_str(), conn_id);
if globalsince != 0 && !services.sync.snake_connection_cached(&snake_key) {
if globalsince != 0
&& (!services.sync.snake_connection_cached(&snake_key)
|| !services
.sync
.snake_connection_accepts_pos(&snake_key, globalsince))
{
return Err!(Request(UnknownPos(
"Connection data unknown to server; restarting sync stream."
)));
@@ -136,9 +141,10 @@ pub(crate) async fn sync_events_v5_route(
}
// Get sticky parameters from cache
let known_rooms = services
.sync
.update_snake_sync_request_with_cache(&snake_key, &mut body);
let known_rooms =
services
.sync
.update_snake_sync_request_with_cache(&snake_key, globalsince, &mut body);
let mut wake_receiver = services.sync.subscribe_to_wake(sender_user).await;
let mut collection = collect_sync_response(
@@ -178,7 +184,7 @@ pub(crate) async fn sync_events_v5_route(
&body,
globalsince,
&snake_key,
&collection.known_room_updates,
&collection,
)
.await;
@@ -199,8 +205,8 @@ async fn collect_sync_response(
globalsince: u64,
known_rooms: &KnownRooms,
) -> Result<SyncCollection> {
// Bounds every read below and becomes the `pos` returned to the client. Zero
// would be echoed back as a request for an initial sync.
// Bounds every read below and becomes the `pos` returned to the client.
// Zero would be echoed back as a request for an initial sync.
let next_batch = services.globals.current_count()?.max(1);
let all_joined_rooms = services
@@ -391,20 +397,17 @@ async fn commit_sync_collection(
body: &sync_events::v5::Request,
globalsince: u64,
snake_key: &SnakeConnectionsKey,
known_room_updates: &KnownRoomUpdates,
collection: &SyncCollection,
) {
let (.., conn_id) = snake_key;
if conn_id.is_some() {
for (list_id, rooms) in known_room_updates {
services.sync.update_snake_sync_known_rooms(
snake_key,
list_id.clone(),
rooms.clone(),
globalsince,
);
}
}
services.sync.store_snake_sync_pending(
snake_key,
collection
.response
.pos
.parse()
.expect("generated sync position"),
collection.known_room_updates.clone(),
);
if body.extensions.to_device.enabled.unwrap_or(false) {
services
@@ -559,6 +562,22 @@ where
active_rooms.push(room_id);
}
let mut active_rooms: Vec<_> = active_rooms
.into_iter()
.stream()
.wide_then(|room_id| async move {
let activity = services
.rooms
.timeline
.room_activity(room_id)
.await
.unwrap_or(0);
(room_id, activity)
})
.collect()
.await;
sort_rooms_by_activity(&mut active_rooms);
let active_rooms: Vec<_> = active_rooms.into_iter().map(at!(0)).collect();
sticky_rooms.extend(active_rooms.iter().map(|room_id| (*room_id).to_owned()));
let mut new_known_rooms: BTreeSet<OwnedRoomId> = BTreeSet::new();
@@ -626,6 +645,17 @@ fn matches_bool_filter(value: bool, filter: Option<bool>) -> bool {
filter.is_none_or(|expected| value == expected)
}
fn sort_rooms_by_activity<Room>(rooms: &mut [(Room, u64)])
where
Room: Ord,
{
rooms.sort_unstable_by(|(left_room, left_activity), (right_room, right_activity)| {
right_activity
.cmp(left_activity)
.then_with(|| left_room.cmp(right_room))
});
}
/// Rooms we are only invited to have no state locally, so their stripped
/// invite state answers for them instead.
async fn room_is_encrypted(
@@ -825,15 +855,21 @@ where
};
if body.extensions.account_data.enabled == Some(true) {
response.extensions.account_data.rooms.insert(
room_id.to_owned(),
services
let room_account_data: Vec<_> = services
.account_data
.changes_since(Some(room_id), sender_user, Some(*roomsince), Some(next_batch))
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Room))
.collect()
.await;
// An empty entry makes clients treat the room as updated.
if !room_account_data.is_empty() {
response
.extensions
.account_data
.changes_since(Some(room_id), sender_user, Some(*roomsince), Some(next_batch))
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Room))
.collect()
.await,
);
.rooms
.insert(room_id.to_owned(), room_account_data);
}
}
let last_privateread_update = services
@@ -1102,8 +1138,8 @@ async fn collect_sticky_events(
.iter()
.filter(|room_id| joined_room_ids.contains(*room_id))
{
// a room the client has not seen before needs its whole backlog, which a
// single stream position cannot express
// a room the client has not seen before needs its whole backlog, which
// a single stream position cannot express
let initial = todo_rooms
.get(room_id)
.is_some_and(|&(_, _, roomsince)| roomsince == 0);
@@ -1432,12 +1468,11 @@ where
.await
.is_ok();
if let Some(since_shortstatehash) = since_shortstatehash {
// Skip if there are only timeline changes
if since_shortstatehash == current_shortstatehash {
continue;
}
// Skip the state diff only: `room_keys_changed` below must run for
// every room.
if let Some(since_shortstatehash) =
since_shortstatehash.filter(|since| *since != current_shortstatehash)
{
let since_encryption = services
.rooms
.state_accessor
@@ -1505,8 +1540,8 @@ where
}
},
| MembershipState::Leave => {
// Write down users that have left encrypted rooms we
// are in
// Write down users that have left
// encrypted rooms we are in
left_encrypted_users.insert(user_id.clone());
},
| _ => {},
@@ -1516,7 +1551,8 @@ where
}
}
if joined_since_last_sync || new_encrypted_room {
// If the user is in a new encrypted room, give them all joined users
// If the user is in a new encrypted room, give them all
// joined users
device_list_changes.extend(
services
.rooms
@@ -1552,8 +1588,8 @@ where
let dont_share_encrypted_room =
!share_encrypted_room(services, sender_user, &user_id, None).await;
// If the user doesn't share an encrypted room with the target anymore, we need
// to tell them
// If the user doesn't share an encrypted room with the target anymore,
// we need to tell them
if dont_share_encrypted_room {
device_list_left.insert(user_id);
}
@@ -1658,6 +1694,15 @@ mod tests {
assert!(!matches_bool_filter(true, Some(false)));
}
#[test]
fn room_activity_orders_newest_first_with_a_stable_tie_break() {
let mut rooms = [("!b", 3), ("!c", 1), ("!a", 3)];
sort_rooms_by_activity(&mut rooms);
assert_eq!(rooms, [("!a", 3), ("!b", 3), ("!c", 1)]);
}
#[test]
fn absent_room_type_filters_match_every_type() {
assert!(matches_room_type(&custom_room_type(), &[], &[]));
+6 -3
View File
@@ -104,12 +104,15 @@ where
{
type Rejection = ClientIpError;
async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection> {
Self::for_config(
fn from_request_parts(
parts: &mut Parts,
state: &S,
) -> impl Future<Output = Result<Self, Self::Rejection>> {
std::future::ready(Self::for_config(
parts,
&state.config.accepted_ip_sources,
state.config.request_ip_source.as_ref(),
)
))
}
}
+10 -7
View File
@@ -6,7 +6,10 @@ use axum::{
extract::{FromRequest, Path, Query},
};
use conduwuit::{Error, Result, err};
use ruma::{CanonicalJsonObject, api::IncomingRequest};
use ruma::{
CanonicalJsonObject,
api::{IncomingRequest, IncomingRequestExt},
};
use serde::Deserialize;
use crate::{State, router::auth::CheckAuth};
@@ -59,8 +62,8 @@ where
let body = {
let max_body_size = services.server.config.max_request_size;
// Check if the Content-Length header is present and valid, saves us streaming
// the response into memory
// Check if the Content-Length header is present and valid, saves us
// streaming the response into memory
if let Some(content_length) = parts.headers.get(http::header::CONTENT_LENGTH) {
if let Ok(content_length) = content_length
.to_str()
@@ -82,18 +85,18 @@ where
// Extract the query parameters and path
let Path(path): Path<Vec<String>> = parts.extract().await?;
let borrowed_path: Vec<_> = path.iter().map(String::as_str).collect();
let Query(auth_query): Query<AuthQueryParams> = parts.extract().await?;
// Assemble a new request from the read body and parts
let request = hyper::Request::from_parts(parts, body);
let request = hyper::Request::from_parts(parts, body.as_ref());
// Check authentication
let auth =
R::Authentication::authenticate::<R, bytes::Bytes>(services, &request, auth_query)
.await?;
R::Authentication::authenticate::<R, &[u8]>(services, &request, auth_query).await?;
// Deserialize the body
let body = R::try_from_http_request(request, &path)
let body = R::try_from_http_request(request, &borrowed_path)
.map_err(|e| err!(Request(BadJson(debug_warn!("{e}")))))?;
Ok(Self { body, json_body, identity: auth })
+3 -3
View File
@@ -331,14 +331,14 @@ impl CheckAuth for AppserviceTokenOptional {
impl CheckAuth for NoAuthentication {
type Identity = ();
async fn verify<B: AsRef<[u8]> + Sync>(
fn verify<B: AsRef<[u8]> + Sync>(
_services: &Services,
_output: Self::Output,
_request: &hyper::Request<B>,
_query: AuthQueryParams,
_route: TypeId,
) -> Result<Self::Identity> {
Ok(())
) -> impl Future<Output = Result<Self::Identity>> {
std::future::ready(Ok(()))
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ use bytes::BytesMut;
use conduwuit::{Error, error};
use http::StatusCode;
use http_body_util::Full;
use ruma::api::{OutgoingResponse, client::uiaa::UiaaResponse};
use ruma::api::{OutgoingResponse, OutgoingResponseExt, client::uiaa::UiaaResponse};
pub(crate) struct RumaResponse<T>(pub(crate) T)
where
+2 -2
View File
@@ -85,8 +85,8 @@ pub(crate) async fn get_backfill_route(
pdu.remove_transaction_id().log_err().ok();
// Add age, as this is specified
pdu.add_age().log_err().ok();
// It's not clear if we should strip or add any more data, leave as is.
// In particular: Redaction?
// It's not clear if we should strip or add any more data, leave as
// is. In particular: Redaction?
Ok(pdu)
})
.try_filter_map(|pdu| async move {
+11 -11
View File
@@ -75,8 +75,8 @@ pub(crate) async fn create_invite_route(
.expect("must have create event in invite state by this point");
// We can now perform the banned remote server check with the create event.
// N.B. this checks the sender field, which is technically incorrect for rooms
// v10 and below. This usually isn't the case though so sue me
// N.B. this checks the sender field, which is technically incorrect for
// rooms v10 and below. This usually isn't the case though so sue me
let creator = create_event_json
.get("sender")
.and_then(|v| v.as_str())
@@ -122,8 +122,8 @@ pub(crate) async fn create_invite_route(
return Err!(Request(Forbidden("Invite rejected by antispam service.")));
}
// If we're already in the room, ensure that neither the origin nor ourselves
// are ACL'd.
// If we're already in the room, ensure that neither the origin nor
// ourselves are ACL'd.
let resident = services
.rooms
.state_cache
@@ -159,15 +159,15 @@ pub(crate) async fn create_invite_route(
// If we are active in the room, the remote server will notify us about the
// join/invite through /send. If we are not in the room, we need to manually
// record the invited state for client /sync through update_membership(), and
// send the invite PDU to the relevant appservices.
// record the invited state for client /sync through update_membership(),
// and send the invite PDU to the relevant appservices.
if !resident {
// We will start by recording the room's create event as an outlier.
// This will allow us to recognise it later in case the sender revokes the
// invite over federation later. We could store more state from the invite
// request, but we will get that during send_join anyway.
// This is safe to just add directly as an outlier as we already auth checked it
// during validation.
// This will allow us to recognise it later in case the sender revokes
// the invite over federation later. We could store more state from
// the invite request, but we will get that during send_join anyway.
// This is safe to just add directly as an outlier as we already auth
// checked it during validation.
services
.rooms
.outlier
+1 -1
View File
@@ -8,7 +8,7 @@ use conduwuit::{Result, utils::timepoint_from_now};
use ruma::{
MilliSecondsSinceUnixEpoch,
api::{
OutgoingResponse,
OutgoingResponseExt,
federation::discovery::{OldVerifyKey, ServerSigningKeys, get_server_keys},
},
assign,
+13 -11
View File
@@ -99,8 +99,8 @@ pub(crate) async fn create_join_event_template_route(
);
let join_authorized_via_users_server: Option<OwnedUserId> = {
if is_joined || is_invited {
// User is already joined or invited and consequently does not need an
// authorising user
// User is already joined or invited and consequently does not need
// an authorising user
None
} else if !room_version_rules.authorization.restricted_join_rule {
// room version does not support restricted join rules
@@ -223,8 +223,9 @@ pub(crate) async fn user_can_perform_restricted_join(
.server_in_room(services.globals.server_name(), &membership.room_id)
.await
{
// Since we can't check this room, mark could_satisfy as false
// so that we can return M_UNABLE_TO_AUTHORIZE_JOIN later.
// Since we can't check this room, mark could_satisfy as
// false so that we can return
// M_UNABLE_TO_AUTHORIZE_JOIN later.
could_satisfy = false;
continue;
}
@@ -252,7 +253,8 @@ pub(crate) async fn user_can_perform_restricted_join(
| Err(_) => Err!(Request(Forbidden("Antispam rejected join request."))),
},
| _ => {
// We don't recognise this join rule, so we cannot satisfy the request.
// We don't recognise this join rule, so we cannot satisfy the
// request.
could_satisfy = false;
debug_info!(
"Unsupported allow rule in restricted join for room {}: {:?}",
@@ -264,16 +266,16 @@ pub(crate) async fn user_can_perform_restricted_join(
}
if could_satisfy {
// We were able to check all the restrictions and can be certain that the
// prospective member is not permitted to join.
// We were able to check all the restrictions and can be certain that
// the prospective member is not permitted to join.
Err!(Request(Forbidden(
"You do not belong to any of the rooms or spaces required to join this room."
)))
} else {
// We were unable to check all the restrictions. This usually means we aren't in
// one of the rooms this one is restricted to, ergo can't check its state for
// the user's membership, and consequently the user *might* be able to join if
// they ask another server.
// We were unable to check all the restrictions. This usually means we
// aren't in one of the rooms this one is restricted to, ergo can't
// check its state for the user's membership, and consequently the
// user *might* be able to join if they ask another server.
Err!(Request(UnableToAuthorizeJoin(
"You do not belong to any of the recognised rooms or spaces required to join this \
room, but this server is unable to verify every requirement. You may be able to \
+9 -9
View File
@@ -151,11 +151,11 @@ async fn process_inbound_transaction(
{
| Ok(pdu) => Some(pdu),
| Err(error) => {
if !services
let queued = services
.rooms
.event_handler
.queue_pending_join_pdu(&body.identity, pdu.clone())
{
.queue_pending_join_pdu(&body.identity, pdu.clone());
if !queued && !error.is_not_found() {
warn!("Could not parse incoming PDU: {error}");
}
None
@@ -173,9 +173,9 @@ async fn process_inbound_transaction(
debug!(pdus = body.pdus.len(), edus = body.edus.len(), "Processing transaction",);
// We have an additional panic catch here because if there's a panic in the
// handle, the sender will effectively become defederated until restart after
// never being removed from the tracking map. Ideally the handle function
// doesn't panic, but when has "ideally" ever worked for us.
// handle, the sender will effectively become defederated until restart
// after never being removed from the tracking map. Ideally the handle
// function doesn't panic, but when has "ideally" ever worked for us.
let handle_result =
std::panic::AssertUnwindSafe(handle(&services, &body.identity, pdus, edus))
.catch_unwind()
@@ -319,9 +319,9 @@ async fn handle_room(
.into_iter()
.map(|(_, event_id, value)| (event_id, value))
.collect();
// Try to sort PDUs by their dependencies, but fall back to arbitrary order on
// failure (e.g., cycles). This is best-effort; proper ordering is the sender's
// responsibility.
// Try to sort PDUs by their dependencies, but fall back to arbitrary order
// on failure (e.g., cycles). This is best-effort; proper ordering is the
// sender's responsibility.
let sorted_event_ids = build_local_dag(&pdu_map, DagBuilderTree::PrevEvents)
.await
.unwrap_or_else(|e| {
+2 -2
View File
@@ -58,8 +58,8 @@ async fn create_join_event(
.acl_check(origin, room_id)
.await?;
// We need to return the state prior to joining, let's keep a reference to that
// here
// We need to return the state prior to joining, let's keep a reference to
// that here
let shortstatehash = services
.rooms
.state
+6 -6
View File
@@ -69,8 +69,8 @@ fn main() {
.write_all(format!("{workspace_packages:?}").as_bytes())
.unwrap();
// built gets the default crate from the workspace. Not sure if this is intended
// behavior, but it's what we want.
// built gets the default crate from the workspace. Not sure if this is
// intended behavior, but it's what we want.
built::write_built_file().expect("Failed to acquire build-time information");
// --- Git Information ---
@@ -133,10 +133,10 @@ fn main() {
// TODO: The git rerun triggers seem to always run
// // Rerun if the git HEAD changes
// println!("cargo:rerun-if-changed=.git/HEAD");
// // Rerun if the ref pointed to by HEAD changes (e.g., new commit on branch)
// if let Some(ref_path) = run_git_command(&["symbolic-ref", "--quiet", "HEAD"])
// { println!("cargo:rerun-if-changed=.git/{ref_path}");
// }
// // Rerun if the ref pointed to by HEAD changes (e.g., new commit on
// branch) if let Some(ref_path) = run_git_command(&["symbolic-ref",
// "--quiet", "HEAD"]) { println!("cargo:rerun-if-changed=.git/{ref_path}"
// ); }
println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH");
println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH_SHORT");
+14 -17
View File
@@ -12,31 +12,31 @@ version.workspace = true
doctest = false
path = "mod.rs"
crate-type = [
"rlib",
# "dylib",
"rlib",
# "dylib",
]
[features]
brotli_compression = [
"reqwest/brotli",
"reqwest/brotli",
]
conduwuit_mods = [
"dep:libloading"
]
gzip_compression = [
"reqwest/gzip",
"reqwest/gzip",
]
hardened_malloc = [
"dep:hardened_malloc-rs"
"dep:hardened_malloc-rs"
]
jemalloc = [
"dep:tikv-jemalloc-sys",
"dep:tikv-jemalloc-ctl",
"dep:tikv-jemallocator",
"dep:tikv-jemalloc-sys",
"dep:tikv-jemalloc-ctl",
"dep:tikv-jemallocator",
]
jemalloc_conf = []
jemalloc_prof = [
"tikv-jemalloc-sys/profiling",
"tikv-jemalloc-sys/profiling",
]
jemalloc_stats = [
"tikv-jemalloc-sys/stats",
@@ -45,15 +45,16 @@ jemalloc_stats = [
]
perf_measurements = []
release_max_log_level = [
"tracing/max_level_trace",
"tracing/release_max_level_info",
"log/max_level_trace",
"log/release_max_level_info",
"tracing/max_level_trace",
"tracing/release_max_level_info",
"log/max_level_trace",
"log/release_max_level_info",
]
sentry_telemetry = []
zstd_compression = [
"reqwest/zstd",
]
openreg = []
[dependencies]
argon2.workspace = true
@@ -79,7 +80,6 @@ futures.workspace = true
http-body-util.workspace = true
http.workspace = true
ipaddress.workspace = true
itertools.workspace = true
libc.workspace = true
libloading.workspace = true
libloading.optional = true
@@ -87,12 +87,9 @@ log.workspace = true
lettre.workspace = true
num-traits.workspace = true
rand.workspace = true
# tied to passwordhash 0.5.0
rand_core = { version = "0.6.4", features = ["getrandom"] }
regex.workspace = true
reqwest.workspace = true
sha2.workspace = true
assign.workspace = true
ruma.workspace = true
sanitize-filename.workspace = true
serde_json.workspace = true
+8 -6
View File
@@ -99,8 +99,8 @@ pub fn memory_stats(opts: &str) -> Option<String> {
// Acquire the epoch; ensure latest stats are pulled in
acq_epoch().ok()?;
// SAFETY: calls malloc_stats_print() with our string instance which must remain
// in this frame. https://docs.rs/tikv-jemalloc-sys/latest/tikv_jemalloc_sys/fn.malloc_stats_print.html
// SAFETY: calls malloc_stats_print() with our string instance which must
// remain in this frame. https://docs.rs/tikv-jemalloc-sys/latest/tikv_jemalloc_sys/fn.malloc_stats_print.html
unsafe { ffi::malloc_stats_print(Some(malloc_stats_cb), opaque, opts_p) };
str.truncate(MAX_LENGTH);
@@ -227,7 +227,8 @@ pub mod this_thread {
cell.get_or_init(|| {
let ptr: *const u64 = super::get(&mallctl!(name)).expect("failed to obtain pointer");
// SAFETY: ptr points directly to the internal state of jemalloc for this thread
// SAFETY: ptr points directly to the internal state of jemalloc for
// this thread
unsafe { ptr.as_ref() }.expect("pointer must not be null")
})
}
@@ -291,7 +292,8 @@ pub fn is_phycpu_arena() -> bool { percpu_arenas().is_ok_and(is_equal_to!("phycp
pub fn percpu_arenas() -> Result<&'static str> {
let ptr = get::<*const c_char>(&mallctl!("opt.percpu_arena"))?;
//SAFETY: ptr points to a null-terminated string returned for opt.percpu_arena.
//SAFETY: ptr points to a null-terminated string returned for
// opt.percpu_arena.
let cstr = unsafe { CStr::from_ptr(ptr) };
cstr.to_str().map_err(Into::into)
}
@@ -370,8 +372,8 @@ where
}
fn key(name: &str) -> Result<Key> {
// tikv asserts the output buffer length is tight to the number of required mibs
// so we slice that down here.
// tikv asserts the output buffer length is tight to the number of required
// mibs so we slice that down here.
let segs = name.chars().filter(is_equal_to!(&'.')).count().try_add(1)?;
let name = self::name(name)?;
+15 -2
View File
@@ -122,7 +122,8 @@ pub fn check(config: &Config) -> Result {
));
}
// yeah, unless the user built a debug build hopefully for local testing only
// yeah, unless the user built a debug build hopefully for local testing
// only
if cfg!(not(debug_assertions)) && config.server_name == "your.server.name" {
return Err!(Config(
"server_name",
@@ -180,7 +181,7 @@ pub fn check(config: &Config) -> Result {
}
if config.allow_registration
&& config.yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse
&& config.enable_challengeless_registration()
&& config.registration_token.is_none()
&& config.registration_token_file.is_none()
{
@@ -262,6 +263,18 @@ pub fn check(config: &Config) -> Result {
));
}
if config.smtp.as_ref().is_some_and(|f| {
f.connection_uri.as_ref().is_none_or(String::is_empty)
&& f.connection_uri_file
.as_ref()
.is_none_or(|f| f.as_os_str().is_empty())
}) {
return Err!(Config(
"connection_uri",
"If smtp is enabled, either connection_uri or connection_uri_file has to be defined."
));
}
match (&config.default_room_acl_allow, &config.default_room_acl_deny) {
| (Some(_), Some(_)) => {
return Err!(Config(
+19 -17
View File
@@ -47,8 +47,8 @@ impl Manager {
let new = Arc::into_raw(config);
let old = self.active.swap(new.cast_mut(), Ordering::AcqRel);
// SAFETY: The old active pointer was set using an Arc::into_raw(). We're
// obliged to reconstitute that into Arc otherwise it will leak.
// SAFETY: The old active pointer was set using an Arc::into_raw().
// We're obliged to reconstitute that into Arc otherwise it will leak.
Ok(unsafe { Arc::from_raw(old) })
}
@@ -68,17 +68,18 @@ impl Manager {
.as_ref()
.expect("handle was already cached for this thread");
// SAFETY: The caller should not hold multiple references at a time directly
// into Config, as a subsequent reference might invalidate the thread's cache
// causing another reference to dangle.
// SAFETY: The caller should not hold multiple references at a time
// directly into Config, as a subsequent reference might invalidate
// the thread's cache causing another reference to dangle.
//
// This is a highly unusual pattern as most config values are copied by value or
// used immediately without running overlap with another value. Even if it does
// actually occur somewhere, the window of danger is limited to the config being
// reloaded while the reference is held and another access is made by the same
// thread into a different config value. This is mitigated by creating a buffer
// of old configs rather than discarding at the earliest opportunity; the odds
// of this scenario are thus astronomical.
// This is a highly unusual pattern as most config values are copied by
// value or used immediately without running overlap with another
// value. Even if it does actually occur somewhere, the window of
// danger is limited to the config being reloaded while the reference
// is held and another access is made by the same thread into a
// different config value. This is mitigated by creating a buffer
// of old configs rather than discarding at the earliest opportunity;
// the odds of this scenario are thus astronomical.
unsafe { std::mem::transmute(config) }
}
}
@@ -87,8 +88,8 @@ impl Drop for Manager {
fn drop(&mut self) {
let config = self.active.swap(null_mut(), Ordering::AcqRel);
// SAFETY: The active pointer was set using an Arc::into_raw(). We're obliged to
// reconstitute that into Arc otherwise it will leak.
// SAFETY: The active pointer was set using an Arc::into_raw(). We're
// obliged to reconstitute that into Arc otherwise it will leak.
unsafe { Arc::from_raw(config) };
}
}
@@ -119,8 +120,9 @@ fn load_miss(
Arc::from_raw(config)
};
// SAFETY: See the note on the transmute above. The caller should not hold more
// than one reference at a time directly into Config, as the second access
// might invalidate the thread's cache, dangling the reference to the first.
// SAFETY: See the note on the transmute above. The caller should not hold
// more than one reference at a time directly into Config, as the second
// access might invalidate the thread's cache, dangling the reference to
// the first.
unsafe { std::mem::transmute(handle[index].insert(config)) }
}
+42 -6
View File
@@ -806,6 +806,9 @@ pub struct Config {
/// Enabling this setting opens registration to anyone without restrictions.
/// This makes your server vulnerable to abuse
///
/// Only works if continuwuity was compiled from source with the
/// "openreg" compile-time feature.
#[serde(default)]
pub yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse: bool,
@@ -1755,11 +1758,10 @@ pub struct Config {
///
/// The authenticated equivalent endpoints are always enabled.
///
/// Defaults to true for now, but this is highly subject to change, likely
/// in the next release.
/// Defaults to false, as unauthenticated media has been sunsetted.
///
/// default: true
#[serde(default = "true_fn")]
/// default: false
#[serde(default)]
pub allow_legacy_media: bool,
/// If set to true, prevents fetching new legacy remote media.
@@ -2587,7 +2589,15 @@ pub struct SmtpConfig {
///
/// For a guide on the accepted URI syntax, consult Lettre's documentation:
/// https://docs.rs/lettre/latest/lettre/transport/smtp/struct.AsyncSmtpTransport.html#method.from_url
pub connection_uri: String,
pub connection_uri: Option<String>,
/// Same as `connection_uri`, except loaded from a file. If `connection_uri`
/// is defined, it is prioritized and `connection_uri_file` is ignored.
///
/// The file will be read once, when Continuwuity starts. It is not
/// currently reread when the server configuration is reloaded. If the file
/// cannot be read, Continuwuity will fail to start.
pub connection_uri_file: Option<PathBuf>,
/// The outgoing address which will be used for sending emails.
///
@@ -2746,6 +2756,18 @@ pub struct OidcConfig {
#[serde(default)]
pub additional_scopes: Vec<Scope>,
/// The name of the identity provider. If this is set, the login page's
/// button reads "Continue with <name>" instead of just "Continue".
///
/// example: "Kanidm"
pub provider_name: Option<String>,
/// The URL of an icon for the identity provider, shown on the login page
/// next to its name.
///
/// example: "https://idm.example.com/pkg/img/logo-square.svg"
pub provider_icon: Option<Url>,
/// Whether the user should be prompted to choose a localpart
/// when signing in for the first time. If this is `false`, Continuwuity
/// will attempt to use the value of the `preferred_username_claim`
@@ -2859,7 +2881,8 @@ impl Config {
.extract::<Self>()
.map_err(|e| err!("There was a problem with your configuration file: {e}"))?;
// don't start if we're listening on both UNIX sockets and TCP at same time
// don't start if we're listening on both UNIX sockets and TCP at same
// time
check::is_dual_listening(raw_config)?;
Ok(config)
@@ -2896,6 +2919,19 @@ impl Config {
}
pub fn check(&self) -> Result<(), Error> { check(self) }
#[cfg(debug_assertions)]
#[inline]
#[must_use]
pub fn enable_challengeless_registration(&self) -> bool {
cfg!(feature = "openreg")
&& self.yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse
}
#[cfg(not(debug_assertions))]
#[inline(always)]
#[must_use]
pub fn enable_challengeless_registration(&self) -> bool { false }
}
fn true_fn() -> bool { true }
+1 -1
View File
@@ -2,7 +2,7 @@ use bytes::BytesMut;
use http::StatusCode;
use http_body_util::Full;
use ruma::api::{
OutgoingResponse,
OutgoingResponseExt,
client::uiaa::UiaaResponse,
error::{ErrorBody, ErrorKind, StandardErrorBody},
};
+3 -2
View File
@@ -221,8 +221,9 @@ impl<E: Event + Clone> TestStore<E> {
) -> Result<Vec<OwnedEventId>> {
let mut auth_chain_sets = vec![];
for ids in event_ids {
// TODO state store `auth_event_ids` returns self in the event ids list
// when an event returns `auth_event_ids` self is not contained
// TODO state store `auth_event_ids` returns self in the event ids
// list when an event returns `auth_event_ids` self is not
// contained
let chain = self
.auth_event_ids(room_id, ids)?
.into_iter()
+75 -64
View File
@@ -195,9 +195,11 @@ where
"auth_check beginning"
);
// [synapse] check that all the events are in the same room as `incoming_event`
// [synapse] check that all the events are in the same room as
// `incoming_event`
// [synapse] do_sig_check check the event has valid signatures for member events
// [synapse] do_sig_check check the event has valid signatures for member
// events
let sender = incoming_event.sender();
@@ -213,7 +215,8 @@ where
return Ok(false);
}
// If the domain of the room_id does not match the domain of the sender, reject
// If the domain of the room_id does not match the domain of the sender,
// reject
if incoming_event.room_id().is_some() {
let Some(room_id_server_name) = incoming_event.room_id().unwrap().server_name()
else {
@@ -230,7 +233,8 @@ where
}
}
// If content.room_version is present and is not a recognized version, reject
// If content.room_version is present and is not a recognized version,
// reject
let content: RoomCreateContentFields = from_json_str(incoming_event.content().get())?;
if content
.room_version
@@ -326,8 +330,8 @@ where
return Ok(false);
}
// If the create event is referenced in the event's auth events, and this is a
// v12 room, reject
// If the create event is referenced in the event's auth events, and this is
// a v12 room, reject
let claims_create_event = incoming_event
.auth_events()
.any(|id| id == room_create_event.event_id());
@@ -335,8 +339,8 @@ where
warn!("event incorrectly references m.room.create event in auth events");
return Ok(false);
} else if !(room_version.room_id_format == RoomIdFormatVersion::V2) && !claims_create_event {
// If the create event is not referenced in the event's auth events, and this is
// a v11 room, reject
// If the create event is not referenced in the event's auth events, and
// this is a v11 room, reject
warn!(
missing = %room_create_event.event_id(),
"event incorrectly did not reference an m.room.create in its auth events"
@@ -545,9 +549,9 @@ where
return Ok(true);
}
// If the event type's required power level is greater than the sender's power
// level, reject If the event has a state_key that starts with an @ and does
// not match the sender, reject.
// If the event type's required power level is greater than the sender's
// power level, reject If the event has a state_key that starts with an @
// and does not match the sender, reject.
if !can_send_event(incoming_event, power_levels_event.as_ref(), sender_power_level) {
warn!(
%sender,
@@ -590,13 +594,13 @@ where
debug!("m.room.power_levels event allowed");
}
// Room version 3: Redaction events are always accepted (provided the event is
// allowed by `events` and `events_default` in the power levels). However,
// servers should not apply or send redaction's to clients until both the
// redaction event and original event have been seen, and are valid. Servers
// should only apply redaction's to events where the sender's domains match, or
// the sender of the redaction has the appropriate permissions per the
// power levels.
// Room version 3: Redaction events are always accepted (provided the event
// is allowed by `events` and `events_default` in the power levels).
// However, servers should not apply or send redaction's to clients until
// both the redaction event and original event have been seen, and are
// valid. Servers should only apply redaction's to events where the
// sender's domains match, or the sender of the redaction has the
// appropriate permissions per the power levels.
if room_version.authorization.special_case_room_redaction
&& *incoming_event.event_type() == TimelineEventType::RoomRedaction
@@ -759,8 +763,8 @@ where
Ok(match target_membership {
| MembershipState::Join => {
trace!("starting target_membership=join check");
// 1. If the only previous event is an m.room.create and the state_key is the
// creator,
// 1. If the only previous event is an m.room.create and the
// state_key is the creator,
// allow
let mut prev_events = current_event.prev_events();
@@ -935,32 +939,33 @@ where
false
} else {
let allow = sender_power >= effective_power_levels.invite;
if allow {
if !allow {
warn!(
%sender,
has=?sender_power,
required=?effective_power_levels.invite,
"sender does not have enough power to produce invites",
);
} else {
trace!(
%sender,
?sender_membership_event_id,
?sender_membership,
?target_user_membership_event_id,
?target_user_current_membership,
sender_pl=?sender_power,
required_pl=?effective_power_levels.invite,
"allowing invite"
);
}
trace!(
%sender,
?sender_membership_event_id,
?sender_membership,
?target_user_membership_event_id,
?target_user_current_membership,
sender_pl=?sender_power,
required_pl=?effective_power_levels.invite,
"allowing invite"
);
allow
},
}
},
| MembershipState::Leave => {
if sender == target_user {
// If the sender matches state_key, allow if that user's current membership
// state is invite, join, or knock.
// If the sender matches state_key, allow if that user's current
// membership state is invite, join, or knock.
let allow = matches!(
target_user_current_membership,
MembershipState::Join | MembershipState::Invite | MembershipState::Knock
@@ -984,10 +989,11 @@ where
);
false
} else {
// If the target user's current membership state is ban, and the sender's power
// level is less than the ban level, reject. If the sender's power level is
// greater than or equal to the kick level, and the target user's power level is
// less than the sender's power level, allow.
// If the target user's current membership state is ban, and the
// sender's power level is less than the ban level, reject.
// If the sender's power level is greater than or equal to
// the kick level, and the target user's power level is less
// than the sender's power level, allow.
let cannot_unban = target_user_current_membership == MembershipState::Ban
&& sender_power < effective_power_levels.ban;
let can_kick =
@@ -1029,9 +1035,9 @@ where
);
false
} else {
// If the sender's power level is greater than or equal to the ban level, and
// the target user's power level is less than the sender's power level, allow.
// Otherwise, reject.
// If the sender's power level is greater than or equal to the
// ban level, and the target user's power level is less than
// the sender's power level, allow. Otherwise, reject.
let allow =
sender_power >= effective_power_levels.ban && target_power < sender_power;
if !allow {
@@ -1046,8 +1052,8 @@ where
allow
},
| MembershipState::Knock if room_version.authorization.knocking => {
// 1. If the `join_rule` is anything other than `knock` or `knock_restricted`,
// reject.
// 1. If the `join_rule` is anything other than `knock` or
// `knock_restricted`, reject.
if !matches!(join_rules, JoinRule::KnockRestricted(_) | JoinRule::Knock) {
warn!(
"Join rule is not set to knock or knock_restricted, knocking is not allowed"
@@ -1056,8 +1062,8 @@ where
} else if matches!(join_rules, JoinRule::KnockRestricted(_))
&& !room_version.authorization.knock_restricted_join_rule
{
// 2. If the `join_rule` is `knock_restricted`, but the room does not support
// `knock_restricted`, reject.
// 2. If the `join_rule` is `knock_restricted`, but the room
// does not support `knock_restricted`, reject.
warn!(
"Join rule is set to knock_restricted but room version does not support \
knock_restricted, knocking is not allowed"
@@ -1075,8 +1081,8 @@ where
sender_membership,
MembershipState::Ban | MembershipState::Invite | MembershipState::Join
) {
// 4. If the `sender`'s current membership is not `ban`, `invite`, or `join`,
// allow.
// 4. If the `sender`'s current membership is not `ban`,
// `invite`, or `join`, allow.
// 5. Otherwise, reject.
warn!(
?target_user_membership_event_id,
@@ -1169,16 +1175,17 @@ fn check_power_levels(
}
// - If any of the keys users_default, events_default, state_default, ban,
// redact, kick, or invite in content are present and not an integer, reject.
// - If either of the keys events or notifications in content are present and
// not a dictionary with values that are integers, reject.
// - If users key in content is not a dictionary with keys that are valid user
// IDs with values that are integers, reject.
// redact, kick, or invite in content are present and not an integer,
// reject.
// - If either of the keys events or notifications in content are present
// and not a dictionary with values that are integers, reject.
// - If users key in content is not a dictionary with keys that are valid
// user IDs with values that are integers, reject.
let user_content: RoomPowerLevelsEventContent =
deserialize_power_levels(power_event.content().get(), room_version)?;
// Validation of users is done in Ruma, synapse for loops validating user_ids
// and integers here
// Validation of users is done in Ruma, synapse for loops validating
// user_ids and integers here
debug!("validation of power event finished");
#[allow(clippy::manual_let_else)]
@@ -1213,8 +1220,8 @@ fn check_power_levels(
let old_state = &current_content;
let new_state = &user_content;
// synapse does not have to split up these checks since we can't combine UserIds
// and EventTypes we do 2 loops
// synapse does not have to split up these checks since we can't combine
// UserIds and EventTypes we do 2 loops
// UserId loop
for user in user_levels_to_check {
@@ -1228,7 +1235,8 @@ fn check_power_levels(
continue;
}
// If the current value is equal to the sender's current power level, reject
// If the current value is equal to the sender's current power level,
// reject
if user != power_event.sender()
&& old_level.map(|i| UserPowerLevel::Int(*i)) == Some(user_level)
{
@@ -1243,8 +1251,9 @@ fn check_power_levels(
return Some(false); // cannot remove ops level == to own
}
// If the current value is higher than the sender's current power level, reject
// If the new value is higher than the sender's current power level, reject
// If the current value is higher than the sender's current power level,
// reject If the new value is higher than the sender's current power
// level, reject
let old_level_too_big = old_level.map(|i| UserPowerLevel::Int(*i)) > Some(user_level);
let new_level_too_big = new_level.map(|i| UserPowerLevel::Int(*i)) > Some(user_level);
if old_level_too_big {
@@ -1279,8 +1288,9 @@ fn check_power_levels(
continue;
}
// If the current value is higher than the sender's current power level, reject
// If the new value is higher than the sender's current power level, reject
// If the current value is higher than the sender's current power level,
// reject If the new value is higher than the sender's current power
// level, reject
let old_level_too_big = old_level.map(|i| UserPowerLevel::Int(*i)) > Some(user_level);
let new_level_too_big = new_level.map(|i| UserPowerLevel::Int(*i)) > Some(user_level);
if old_level_too_big {
@@ -1312,8 +1322,9 @@ fn check_power_levels(
let old_level = old_state.notifications.room;
let new_level = new_state.notifications.room;
if old_level != new_level {
// If the current value is higher than the sender's current power level, reject
// If the new value is higher than the sender's current power level, reject
// If the current value is higher than the sender's current power
// level, reject If the new value is higher than the sender's
// current power level, reject
let old_level_too_big = old_level > user_level;
let new_level_too_big = new_level > user_level;
if old_level_too_big || new_level_too_big {
@@ -1387,8 +1398,8 @@ fn check_redaction(
return Ok(true);
}
// If the domain of the event_id of the event being redacted is the same as the
// domain of the event_id of the m.room.redaction, allow
// If the domain of the event_id of the event being redacted is the same as
// the domain of the event_id of the m.room.redaction, allow
if redaction_event.event_id().server_name()
== redaction_event
.redacts()
+40 -23
View File
@@ -142,8 +142,8 @@ where
// We used to check that all events are events from the correct room
// this is now a check the caller of `resolve` must make.
// Get only the control events with a state_key: "" or ban/kick event (sender !=
// state_key)
// Get only the control events with a state_key: "" or ban/kick event
// (sender != state_key)
let control_events: Vec<_> = all_conflicted
.iter()
.stream()
@@ -187,8 +187,8 @@ where
debug!(count = deduped_power_ev.len(), "deduped power events");
trace!(set = ?deduped_power_ev, "deduped power events");
// This removes the control events that passed auth and more importantly those
// that failed auth
// This removes the control events that passed auth and more importantly
// those that failed auth
let events_to_resolve: Vec<_> = all_conflicted
.iter()
.filter(|&id| !deduped_power_ev.contains(id))
@@ -490,8 +490,8 @@ where
for (node, edges) in graph {
if edges.is_empty() {
let (power_level, origin_server_ts) = key_fn(node.clone()).await?;
// The `Reverse` is because rusts `BinaryHeap` sorts largest -> smallest we need
// smallest -> largest
// The `Reverse` is because rusts `BinaryHeap` sorts largest ->
// smallest we need smallest -> largest
zero_outdegree.push(Reverse(TieBreaker {
power_level,
origin_server_ts,
@@ -507,7 +507,8 @@ where
let mut heap = BinaryHeap::from(zero_outdegree);
// We remove the oldest node (most incoming edges) and check against all other
// We remove the oldest node (most incoming edges) and check against all
// other
let mut sorted = vec![];
// Destructure the `Reverse` and take the smallest `node` each time
while let Some(Reverse(item)) = heap.pop() {
@@ -574,8 +575,8 @@ where
let sender_is_creator =
sender_is_creator(&event, room_version, &auth_events, fetch_event).await?;
// Since v12 the room creators outrank any m.room.power_levels event, so their
// ordering position does not depend on one being in scope.
// Since v12 the room creators outrank any m.room.power_levels event, so
// their ordering position does not depend on one being in scope.
if sender_is_creator
&& room_version
.authorization
@@ -628,8 +629,8 @@ where
.find(|aev| is_type_and_key(*aev, &TimelineEventType::RoomCreate, ""))
.cloned();
// Since v12 the create event is no longer listed in auth_events; the room ID
// is its event ID.
// Since v12 the create event is no longer listed in auth_events; the room
// ID is its event ID.
let create_event = match create_event {
| Some(create_event) => Some(create_event),
| None =>
@@ -738,10 +739,11 @@ where
trace!(map = ?auth_events.keys().collect::<Vec<_>>(), "fetched auth events");
let auth_events = &auth_events;
// NOTE: in state resolution v2.1, auth checks should start with an empty state
// map. It is the caller's job to do this. Previously, this function would
// force an empty state map in this case, and this resulted in power events
// going missing from the resolved state as they'd be discarded here.
// NOTE: in state resolution v2.1, auth checks should start with an empty
// state map. It is the caller's job to do this. Previously, this function
// would force an empty state map in this case, and this resulted in power
// events going missing from the resolved state as they'd be discarded
// here.
let mut resolved_state = unconflicted_state;
for event in events_to_check {
trace!(event_id = event.event_id().as_str(), "checking event");
@@ -774,8 +776,8 @@ where
}
for aid in event.auth_events() {
if let Some(ev) = auth_events.get(aid) {
//TODO: synapse checks "rejected_reason" which is most likely related to
// soft-failing
//TODO: synapse checks "rejected_reason" which is most likely
// related to soft-failing
trace!(event_id = aid.as_str(), "found auth event");
auth_state.insert(
ev.event_type()
@@ -807,10 +809,23 @@ where
.await;
trace!(map = ?auth_state.keys().collect::<Vec<_>>(), event_id = event.event_id().as_str(), "auth state for event");
// If this is not a create event, we must have the room create event in
// the auth state by now.
if *event.event_type() != StateEventType::RoomCreate.into()
|| event.state_key().is_none_or(|k| !k.is_empty())
{
if !auth_state.contains_key(&StateEventType::RoomCreate.with_state_key("")) {
return Err(Error::NotFound(format!(
"m.room.create did not appear in the auth state for {}",
event.event_id()
)));
}
}
debug!(event_id = event.event_id().as_str(), "Running auth checks");
// The key for this is (eventType + a state_key of the signed token not sender)
// so search for it
// The key for this is (eventType + a state_key of the signed token not
// sender) so search for it
let current_third_party = auth_state.iter().find_map(|(_, pdu)| {
(*pdu.event_type() == TimelineEventType::RoomThirdPartyInvite).then_some(pdu)
});
@@ -848,7 +863,8 @@ where
trace!(map = ?resolved_state, "new resolved state");
},
| Ok(false) => {
// synapse passes here on AuthError. We do not add this event to resolved_state.
// synapse passes here on AuthError. We do not add this event to
// resolved_state.
warn!("event {} failed the authentication check", event.event_id());
},
| Err(e) => {
@@ -1276,8 +1292,8 @@ mod tests {
// #[tokio::test]
async fn test_sort() {
for _ in 0..20 {
// since we shuffle the eventIds before we sort them introducing randomness
// seems like we should test this a few times
// since we shuffle the eventIds before we sort them introducing
// randomness seems like we should test this a few times
test_event_sort().await;
}
}
@@ -1917,7 +1933,8 @@ mod tests {
.iter(),
);
// HashMap iteration order is random, so sort this before asserting on it
// HashMap iteration order is random, so sort this before asserting on
// it
for v in conflicted.values_mut() {
v.sort_unstable();
}
+5 -4
View File
@@ -86,8 +86,8 @@ pub(crate) async fn do_check(
// event_id -> StateMap<OwnedEventId>
let mut state_at_event: HashMap<OwnedEventId, StateMap<OwnedEventId>> = HashMap::new();
// Resolve the current state and add it to the state_at_event map then continue
// on in "time"
// Resolve the current state and add it to the state_at_event map then
// continue on in "time"
for node in super::lexicographical_topological_sort(&graph, &|_id| async {
Ok((int!(0), MilliSecondsSinceUnixEpoch(uint!(0))))
})
@@ -172,8 +172,9 @@ pub(crate) async fn do_check(
}
}
// TODO The event is just remade, adding the auth_events and prev_events here
// the `to_pdu_event` was split into `init` and the fn below, could be better
// TODO The event is just remade, adding the auth_events and prev_events
// here the `to_pdu_event` was split into `init` and the fn below,
// could be better
let e = fake_event;
let ev_id = e.event_id();
let event = to_pdu_event(
+2
View File
@@ -31,6 +31,8 @@ pub fn versions() -> Vec<String> {
#[must_use]
pub fn unstable_features() -> BTreeMap<String, bool> {
BTreeMap::from_iter([
// MatrixRTC (https://github.com/matrix-org/matrix-spec-proposals/pull/4143)
("org.matrix.msc4143".to_owned(), true),
// query mutual rooms (https://github.com/matrix-org/matrix-spec-proposals/pull/2666)
// Expected for spec v1.19
("uk.half-shot.msc2666.query_mutual_rooms".to_owned(), true),
+2 -2
View File
@@ -45,8 +45,8 @@ impl Module {
.as_ref()
.expect("backing library loaded by this instance");
// SAFETY: Calls dlsym(3) on unix platforms. This might not have to be unsafe
// if wrapped in libloading with_dlerror().
// SAFETY: Calls dlsym(3) on unix platforms. This might not have to be
// unsafe if wrapped in libloading with_dlerror().
let sym = unsafe { handle.get::<Prototype>(cname.as_bytes()) };
let sym = sym.expect("symbol found; binding successful");
+2 -2
View File
@@ -11,8 +11,8 @@ pub fn from_name(name: &str) -> Result<Library> {
}
pub fn from_path(path: &OsStr) -> Result<Library> {
//SAFETY: Calls dlopen(3) on unix platforms. This might not have to be unsafe
// if wrapped in with_dlerror.
//SAFETY: Calls dlopen(3) on unix platforms. This might not have to be
// unsafe if wrapped in with_dlerror.
let lib = unsafe { Library::open(Some(path), OPEN_FLAGS) };
if let Err(e) = lib {
let name = path::to_name(path)?;
+3 -4
View File
@@ -2,7 +2,7 @@ use std::sync::OnceLock;
use argon2::{
Algorithm, Argon2, Params, PasswordHash, PasswordHasher, PasswordVerifier, Version,
password_hash, password_hash::SaltString,
password_hash,
};
use crate::{Error, Result, err};
@@ -28,16 +28,15 @@ fn init_argon() -> Argon2<'static> {
}
pub(super) fn password(password: &str) -> Result<String> {
let salt = SaltString::generate(rand_core::OsRng);
ARGON
.get_or_init(init_argon)
.hash_password(password.as_bytes(), &salt)
.hash_password(password.as_bytes())
.map(|it| it.to_string())
.map_err(map_err)
}
pub(super) fn verify_password(password: &str, password_hash: &str) -> Result<()> {
let password_hash = PasswordHash::new(password_hash).map_err(map_err)?;
let password_hash = PasswordHash::new(password_hash).map_err(|e| map_err(e.into()))?;
ARGON
.get_or_init(init_argon)
.verify_password(password.as_bytes(), &password_hash)
+2 -2
View File
@@ -27,8 +27,8 @@ impl fmt::Display for Escape<'_> {
fmt.write_str(&pile_o_bits[last..i])?;
fmt.write_str(s)?;
// NOTE: we only expect single byte characters here - which is fine as long as
// we only match single byte characters
// NOTE: we only expect single byte characters here - which is fine
// as long as we only match single byte characters
last = i.saturating_add(1);
}
+2 -2
View File
@@ -32,8 +32,8 @@ impl<'a> From<&'a str> for &'a Unquoted {
fn from(s: &'a str) -> &'a Unquoted {
let s: &'a str = s.unquote_infallible();
//SAFETY: This is a pattern I lifted from ruma-identifiers for strong-type strs
// by wrapping in a tuple-struct.
//SAFETY: This is a pattern I lifted from ruma-identifiers for
// strong-type strs by wrapping in a tuple-struct.
#[allow(clippy::transmute_ptr_to_ptr)]
unsafe {
std::mem::transmute(s)
+5 -4
View File
@@ -120,10 +120,11 @@ pub fn cores_available() -> impl Iterator<Item = Id> { from_mask(*CORES_AVAILABL
pub fn getcpu() -> Result<usize> {
use crate::{Error, utils::math};
// SAFETY: This is part of an interface with many low-level calls taking many
// raw params, but it's unclear why this specific call is unsafe. Nevertheless
// the value obtained here is semantically unsafe because it can change on the
// instruction boundary trailing its own acquisition and also any other time.
// SAFETY: This is part of an interface with many low-level calls taking
// many raw params, but it's unclear why this specific call is unsafe.
// Nevertheless the value obtained here is semantically unsafe because it
// can change on the instruction boundary trailing its own acquisition and
// also any other time.
let ret: i32 = unsafe { libc::sched_getcpu() };
#[cfg(target_os = "linux")]
+4 -3
View File
@@ -404,7 +404,8 @@ impl<'a, 'de: 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
unhandled!("deserialize Unit not implemented")
}
// this only used for $serde_json::private::RawValue at this time; see MapAccess
// this only used for $serde_json::private::RawValue at this time; see
// MapAccess
#[cfg_attr(unabridged, tracing::instrument(level = "trace", skip_all))]
fn deserialize_identifier<V: Visitor<'de>>(self, visitor: V) -> Result<V::Value> {
let input = "$serde_json::private::RawValue";
@@ -480,8 +481,8 @@ fn deserialize_str(input: &[u8]) -> Result<&str> { string::str_from_bytes(input)
#[cfg(disable)]
#[inline]
fn deserialize_str(input: &[u8]) -> Result<&str> {
// SAFETY: Strings were written by the serializer to the database. Assuming no
// database corruption, the string will be valid. Database corruption is
// SAFETY: Strings were written by the serializer to the database. Assuming
// no database corruption, the string will be valid. Database corruption is
// detected via rocksdb checksums.
unsafe { std::str::from_utf8_unchecked(input) }
}
+2 -2
View File
@@ -109,8 +109,8 @@ pub(crate) fn db_options(config: &Config, env: &Env, row_cache: &Cache) -> Resul
// <https://github.com/facebook/rocksdb/wiki/Track-WAL-in-MANIFEST>
// "We recommend to set track_and_verify_wals_in_manifest to true for
// production, it has been enabled in production for the entire database cluster
// serving the social graph for all Meta apps."
// production, it has been enabled in production for the entire database
// cluster serving the social graph for all Meta apps."
opts.set_track_and_verify_wals_in_manifest(true);
opts.set_paranoid_checks(config.rocksdb_paranoid_file_checks);
+2 -2
View File
@@ -80,8 +80,8 @@ impl super::Map {
I: Iterator<Item = &'a K> + ExactSizeIterator + Send,
K: AsRef<[u8]> + Send + ?Sized + Sync + 'a,
{
// Optimization can be `true` if key vector is pre-sorted **by the column
// comparator**.
// Optimization can be `true` if key vector is pre-sorted **by the
// column comparator**.
const SORTED: bool = false;
self.db
+16 -16
View File
@@ -10,25 +10,25 @@ pub(super) fn open(db: &Arc<Engine>, name: &str) -> Arc<ColumnFamily> {
let cf_ptr = bounded_ptr.cast::<ColumnFamily>();
// SAFETY: Column family handles out of RocksDB are basic pointers and can
// be invalidated: 1. when the database closes. 2. when the column is dropped or
// closed. rust_rocksdb wraps this for us by storing handles in their own
// `RwLock<BTreeMap>` map and returning an Arc<BoundColumnFamily<'_>>` to
// provide expected safety. Similarly in "single-threaded mode" we would
// receive `&'_ ColumnFamily`.
// be invalidated: 1. when the database closes. 2. when the column is
// dropped or closed. rust_rocksdb wraps this for us by storing handles in
// their own `RwLock<BTreeMap>` map and returning an
// Arc<BoundColumnFamily<'_>>` to provide expected safety. Similarly in
// "single-threaded mode" we would receive `&'_ ColumnFamily`.
//
// PROBLEM: We need to hold these handles in a field, otherwise we have to take
// a lock and get them by name from this map for every query, which is what
// conduit was doing, but we're not going to make a query for every query so we
// need to be holding it right. The lifetime parameter on these references makes
// that complicated. If this can be done without polluting the userspace
// with lifetimes on every instance of `Map` then this `unsafe` might not be
// necessary.
// PROBLEM: We need to hold these handles in a field, otherwise we have to
// take a lock and get them by name from this map for every query, which is
// what conduit was doing, but we're not going to make a query for every
// query so we need to be holding it right. The lifetime parameter on these
// references makes that complicated. If this can be done without polluting
// the userspace with lifetimes on every instance of `Map` then this
// `unsafe` might not be necessary.
//
// SOLUTION: After investigating the underlying types it appears valid to
// Arc-swap `BoundColumnFamily<'_>` for `ColumnFamily`. They have the
// same inner data, the same Drop behavior, Deref, etc. We're just losing the
// lifetime parameter. We should not hold this handle, even in its Arc, after
// closing the database (dropping `Engine`). Since `Arc<Engine>` is a sibling
// member along with this handle in `Map`, that is prevented.
// same inner data, the same Drop behavior, Deref, etc. We're just losing
// the lifetime parameter. We should not hold this handle, even in its Arc,
// after closing the database (dropping `Engine`). Since `Arc<Engine>` is a
// sibling member along with this handle in `Map`, that is prevented.
unsafe { Arc::from_raw(cf_ptr) }
}
+4
View File
@@ -193,6 +193,10 @@ pub(super) static MAPS: &[Descriptor] = &[
name: "roomid_joinedcount",
..descriptor::RANDOM_SMALL
},
Descriptor {
name: "roomid_lasttimelinecount",
..descriptor::RANDOM_SMALL
},
Descriptor {
name: "roomid_pduleaves",
..descriptor::RANDOM_SMALL
+9 -9
View File
@@ -381,15 +381,15 @@ impl Pool {
// Obtain the result channel.
let chan = cmd.res.take().expect("missing result channel");
// It is worth checking if the future was dropped while the command was queued
// so we can bail without paying for any query.
// It is worth checking if the future was dropped while the command was
// queued so we can bail without paying for any query.
if chan.is_canceled() {
return;
}
// Perform the actual database query. We reuse our database::Map interface but
// limited to the blocking calls, rather than creating another surface directly
// with rocksdb here.
// Perform the actual database query. We reuse our database::Map
// interface but limited to the blocking calls, rather than creating
// another surface directly with rocksdb here.
let result = cmd.map.get_blocking(&cmd.key[0]);
// Send the result back to the submitter.
@@ -416,10 +416,10 @@ impl Drop for Pool {
}
fn into_send_get(result: BatchResult<'_>) -> BatchResult<'static> {
// SAFETY: Necessary to send the Handle (rust_rocksdb::PinnableSlice) through
// the channel. The lifetime on the handle is a device by rust-rocksdb to
// associate a database lifetime with its assets. The Handle must be dropped
// before the database is dropped.
// SAFETY: Necessary to send the Handle (rust_rocksdb::PinnableSlice)
// through the channel. The lifetime on the handle is a device by
// rust-rocksdb to associate a database lifetime with its assets. The
// Handle must be dropped before the database is dropped.
unsafe { std::mem::transmute(result) }
}
Loaded 100 of 192 files, more files were not shown because too many files have changed in this diff. Show more