mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-26 10:27:32 +00:00
Compare commits
192
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca5cb21dc6 | ||
|
|
18c1ce48e2 | ||
|
|
74338f939a | ||
|
|
fcd56abbcf | ||
|
|
09397a157b | ||
|
|
515758955c | ||
|
|
8205455ec5 | ||
|
|
70d16a3fdf | ||
|
|
9761fe7b2d | ||
|
|
ff8bf9b260 | ||
|
|
2c79a67130 | ||
|
|
8b9000cdf4 | ||
|
|
370fa43b5a | ||
|
|
bf5f77a94a | ||
|
|
506c4a0376 | ||
|
|
d9b94b98ad | ||
|
|
26cdaeec99 | ||
|
|
73fbdd6056 | ||
|
|
d591385bed | ||
|
|
cbb1b70c99 | ||
|
|
748603549c | ||
|
|
6115693193 | ||
|
|
e9974043f2 | ||
|
|
415b3dd671 | ||
|
|
3774f3e7e4 | ||
|
|
2408ded7b4 | ||
|
|
a3cc73bc08 | ||
|
|
20bc28cd2f | ||
|
|
9877464857 | ||
|
|
a6e051fa3b | ||
|
|
cdda575d4a | ||
|
|
c82aba6f5a | ||
|
|
14739ffaf7 | ||
|
|
733c25ce5a | ||
|
|
8c4a2d0ce9 | ||
|
|
c0f69f23dd | ||
|
|
c6b87fb033 | ||
|
|
635fccf11f | ||
|
|
def987f935 | ||
|
|
137805693e | ||
|
|
bd7450f52a | ||
|
|
66be5efeec | ||
|
|
33ed0a2e75 | ||
|
|
16f18f8516 | ||
|
|
4710c227db | ||
|
|
f5bd8d0a7c | ||
|
|
5ad6c35f0b | ||
|
|
17af942cbf | ||
|
|
9f7fb54bd4 | ||
|
|
21f3f0c1eb | ||
|
|
613bb1b2a8 | ||
|
|
a0d9e71eac | ||
|
|
d477417909 | ||
|
|
cd7910009a | ||
|
|
793c06c17b | ||
|
|
cf45dcffbb | ||
|
|
919fea9b97 | ||
|
|
5687847fe3 | ||
|
|
251086670f | ||
|
|
3379badbd4 | ||
|
|
cc28a01e49 | ||
|
|
95392ccc46 | ||
|
|
f3289f150c | ||
|
|
cbc089df1b | ||
|
|
0b738e835b | ||
|
|
5ad36c0914 | ||
|
|
7e678869ec | ||
|
|
9744a6e332 | ||
|
|
306be392ba | ||
|
|
66dd3e8e3e | ||
|
|
1dd572416b | ||
|
|
d74275bda1 | ||
|
|
65d25c77e8 | ||
|
|
95f925eaee | ||
|
|
becfc2454f | ||
|
|
b617e9fd5c | ||
|
|
ece207286a | ||
|
|
fda99bcda2 | ||
|
|
5d66476126 | ||
|
|
798bef5bc7 | ||
|
|
7408d53977 | ||
|
|
973cfd5746 | ||
|
|
cb9b3e65d0 | ||
|
|
d4aec6ca5c | ||
|
|
43cf8cccdf | ||
|
|
c6b9854c49 | ||
|
|
6df7dda329 | ||
|
|
8a20a5c349 | ||
|
|
a27a5bed29 | ||
|
|
d4ac77a023 | ||
|
|
68068574d3 | ||
|
|
61d77278f6 | ||
|
|
094d24f82e | ||
|
|
8375eb5a36 | ||
|
|
f2a9e1f993 | ||
|
|
318a0205b0 | ||
|
|
f46c87a40d | ||
|
|
e0b9bfdb73 | ||
|
|
180869ecff | ||
|
|
b9ceb008ba | ||
|
|
3118183bd8 | ||
|
|
45b0a30155 | ||
|
|
5169496cb6 | ||
|
|
c1b3c15034 | ||
|
|
bd26b2d596 | ||
|
|
6cd38e4278 | ||
|
|
aa077b4bec | ||
|
|
58026816f2 | ||
|
|
9d2e53af99 | ||
|
|
6d96936d3a | ||
|
|
48e83f6dfa | ||
|
|
4c49a20255 | ||
|
|
330797f4fb | ||
|
|
580fcf2365 | ||
|
|
3d2975209e | ||
|
|
2944026572 | ||
|
|
8004e962c3 | ||
|
|
a4ef1ecfa2 | ||
|
|
6f6e8c4eb5 | ||
|
|
38433deba7 | ||
|
|
67c4111046 | ||
|
|
50665f4726 | ||
|
|
a9728fab80 | ||
|
|
49207a42f8 | ||
|
|
62fc507798 | ||
|
|
8f10378bff | ||
|
|
52a6bf0003 | ||
|
|
fcddfb5f35 | ||
|
|
94ba3b2b83 | ||
|
|
4e7493604a | ||
|
|
cebeee6bae | ||
|
|
f3cbfed721 | ||
|
|
9bdbaf3300 | ||
|
|
06c63e8de3 | ||
|
|
8ffa3e5367 | ||
|
|
cec1f85f88 | ||
|
|
ad50b9a3b3 | ||
|
|
ceafc6f58d | ||
|
|
467e335c90 | ||
|
|
902e54b525 | ||
|
|
4ef487f40e | ||
|
|
32bfe5f129 | ||
|
|
07d4c6f304 | ||
|
|
b3d099a52a | ||
|
|
92f9531def | ||
|
|
a3d23c3718 | ||
|
|
055c430e77 | ||
|
|
df5e03f3b4 | ||
|
|
6e7ebe66c9 | ||
|
|
24e962a656 | ||
|
|
c5cd82a6a3 | ||
|
|
add66bd0b7 | ||
|
|
700c11d758 | ||
|
|
559f76908e | ||
|
|
7ade8c4899 | ||
|
|
20943c6210 | ||
|
|
4811ad831d | ||
|
|
bfb611d9e4 | ||
|
|
d4c6decdd6 | ||
|
|
82e42696aa | ||
|
|
f6c9b53e17 | ||
|
|
39035d735e | ||
|
|
b34dfe343a | ||
|
|
26ec038418 | ||
|
|
7afe5885e9 | ||
|
|
77e8a6b41b | ||
|
|
4ebcf299e2 | ||
|
|
c72156cb04 | ||
|
|
b5594c3061 | ||
|
|
ae0a2d1797 | ||
|
|
5d0dc8b137 | ||
|
|
4d271a5621 | ||
|
|
23a51bcf96 | ||
|
|
326348ec1a | ||
|
|
4f63edac33 | ||
|
|
79a2cbc7be | ||
|
|
c8d87b3a0d | ||
|
|
49171ec1ed | ||
|
|
ea3beb628a | ||
|
|
8603ae21cc | ||
|
|
f154ecb542 | ||
|
|
98fe280de4 | ||
|
|
2c605151eb | ||
|
|
4bd09a6d88 | ||
|
|
cb37a9cf0b | ||
|
|
aefededfc8 | ||
|
|
9be45212f1 | ||
|
|
fca19a983d | ||
|
|
4ebf44412c | ||
|
|
cacf6ff912 | ||
|
|
aef031c9d7 | ||
|
|
7b927196a2 |
No files matched your search
@@ -71,7 +71,7 @@ runs:
|
|||||||
|
|
||||||
- name: Install timelord-cli and git-warp-time
|
- name: Install timelord-cli and git-warp-time
|
||||||
if: steps.check-binaries.outputs.need-install == 'true'
|
if: steps.check-binaries.outputs.need-install == 'true'
|
||||||
uses: https://github.com/taiki-e/install-action@cfdb7ed4ccc7c7dce37759eae89dc5674b469b39 # v2
|
uses: https://github.com/taiki-e/install-action@fe3acb53a98b62c772db35de75ce0e4595e7ca8c # v2
|
||||||
with:
|
with:
|
||||||
tool: git-warp-time,timelord-cli@3.0.1
|
tool: git-warp-time,timelord-cli@3.0.1
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ jobs:
|
|||||||
docs:
|
docs:
|
||||||
name: Build and Deploy Documentation
|
name: Build and Deploy Documentation
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: secrets.CLOUDFLARE_API_TOKEN != ''
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Sync repository
|
- name: Sync repository
|
||||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||||
@@ -30,6 +28,14 @@ jobs:
|
|||||||
id: runner-env
|
id: runner-env
|
||||||
uses: https://forgejo.ellis.link/continuwuation/detect-versions@d39555789fed25b8eb8e086d9f199c514dfa311e # v1
|
uses: https://forgejo.ellis.link/continuwuation/detect-versions@d39555789fed25b8eb8e086d9f199c514dfa311e # v1
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
if: steps.runner-env.outputs.go_minor == '' || steps.runner-env.outputs.go_minor < '27'
|
||||||
|
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7
|
||||||
|
with:
|
||||||
|
go-version: '1.27'
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
cache-dependency-path: 'go.sum'
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
if: steps.runner-env.outputs.node_major == '' || steps.runner-env.outputs.node_major < '20'
|
if: steps.runner-env.outputs.node_major == '' || steps.runner-env.outputs.node_major < '20'
|
||||||
uses: https://github.com/actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
|
uses: https://github.com/actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
|
||||||
@@ -45,27 +51,33 @@ jobs:
|
|||||||
continuwuity-rspress-${{ steps.runner-env.outputs.slug }}-${{ steps.runner-env.outputs.arch }}-node-${{ steps.runner-env.outputs.node_version }}-
|
continuwuity-rspress-${{ steps.runner-env.outputs.slug }}-${{ steps.runner-env.outputs.arch }}-node-${{ steps.runner-env.outputs.node_version }}-
|
||||||
continuwuity-rspress-${{ steps.runner-env.outputs.slug }}-${{ steps.runner-env.outputs.arch }}-node-
|
continuwuity-rspress-${{ steps.runner-env.outputs.slug }}-${{ steps.runner-env.outputs.arch }}-node-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install Rspress and dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Build Rspress documentation
|
- name: Build documentation with Rspress
|
||||||
|
env:
|
||||||
|
SITE_PATH: ${{ github.ref != 'refs/heads/main' && format('/@{0}/', forgejo.event.number) || '/' }}
|
||||||
run: npm run docs:build
|
run: npm run docs:build
|
||||||
|
|
||||||
- name: Install Wrangler
|
- name: Deploy to Grebedoc (Production)
|
||||||
run: npm install --save-dev wrangler@latest
|
if: github.ref == 'refs/heads/main'
|
||||||
|
run: |
|
||||||
|
go tool git-pages-cli https://continuwuity.org \
|
||||||
|
--server grebedoc.dev \
|
||||||
|
--token "${{ forgejo.token }}" \
|
||||||
|
--upload-dir doc_build \
|
||||||
|
--pretty-urls \
|
||||||
|
--comment "${{ forgejo.sha }}" \
|
||||||
|
--verbose
|
||||||
|
|
||||||
- name: Deploy to Cloudflare Pages (Production)
|
- name: Deploy to Grebedoc (Preview)
|
||||||
if: github.ref == 'refs/heads/main' && vars.CLOUDFLARE_PROJECT_NAME != ''
|
if: github.ref != 'refs/heads/main'
|
||||||
uses: https://github.com/cloudflare/wrangler-action@953926a2e2182532811c01a25e53647d93bf07c0 # v4
|
run: |
|
||||||
with:
|
go tool git-pages-cli https://preview.continuwuity.org/@${{ forgejo.event.number }} \
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
--server grebedoc.dev \
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
--token "${{ forgejo.token }}" \
|
||||||
command: pages deploy ./doc_build --branch="main" --commit-dirty=true --project-name="${{ vars.CLOUDFLARE_PROJECT_NAME }}"
|
--upload-dir doc_build \
|
||||||
|
--pretty-urls \
|
||||||
- name: Deploy to Cloudflare Pages (Preview)
|
--expires 14 \
|
||||||
if: github.ref != 'refs/heads/main' && vars.CLOUDFLARE_PROJECT_NAME != ''
|
--comment "${{ forgejo.sha }}" \
|
||||||
uses: https://github.com/cloudflare/wrangler-action@953926a2e2182532811c01a25e53647d93bf07c0 # v4
|
--verbose
|
||||||
with:
|
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
||||||
command: pages deploy ./doc_build --branch="${{ github.head_ref || github.ref_name }}" --commit-dirty=true --project-name="${{ vars.CLOUDFLARE_PROJECT_NAME }}"
|
|
||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
name: Renovate
|
name: Renovate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/renovatebot/renovate:44.210.1@sha256:45cc73346c44a9afe037f2d19766f2b545b59b2ed31b937b5b09017d2958e45f
|
image: ghcr.io/renovatebot/renovate:44.257.9@sha256:578179439fceea89646662dd583b27efdad8d1429e0cbd90681c40dde068589e
|
||||||
options: --tmpfs /tmp:exec
|
options: --tmpfs /tmp:exec
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: committed
|
- id: committed
|
||||||
|
|
||||||
|
- repo: https://github.com/twisted/towncrier
|
||||||
|
rev: 26.9.0
|
||||||
|
hooks:
|
||||||
|
- id: towncrier-check
|
||||||
|
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: cargo-fmt
|
- id: cargo-fmt
|
||||||
|
|||||||
@@ -1,3 +1,84 @@
|
|||||||
|
# Continuwuity v26.11.0-alpha.2 (2026-11-14)
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added opt-in OpenTelemetry metrics, exported over OTLP or scraped by Prometheus from `/_continuwuity/metrics`, and a Grafana dashboard. Contributed by @eleboucher. (prometheus-metrics)
|
||||||
|
- Add support for using custom DNS servers instead of using /etc/resolv.conf. Contributed by @s1lv3r. ([#2056](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2056))
|
||||||
|
- Continuwuity now supports configuring additional trusted audience values for deployments using OIDC with an IDP that sends them. Contributed by @ginger ([#2226](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2226))
|
||||||
|
- "!admin users list" now hides deactivated users by default, but can display them with the optional "--show-deactivated" flag. "--hide-suspended" and "--hide-locked" have been added as well, which stop suspended and locked users from being displayed respectively. Contributed by @Clubs. ([#2292](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2292))
|
||||||
|
- Added support for [MSC4494: Membership-based invite blocking](https://github.com/matrix-org/matrix-spec-proposals/pull/4494) ([#2297](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2297))
|
||||||
|
- Appservices now receive typing indicators and read receipts. Contributed by @Jade ([#2327](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2327))
|
||||||
|
- Added support for servers returning 410 gone to indicate they are no longer serving a Matrix server ([MSC4188](https://github.com/matrix-org/matrix-spec-proposals/pull/4188)). Contributed by @nex and @silversys ([#2355](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2355))
|
||||||
|
- Changed the policy on unstable features, disabling most by default and making them configurable in a tidy little `experiments` configuration. See also: #1884. ([#2517](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2517))
|
||||||
|
- Added support for [MSC4363](https://github.com/matrix-org/matrix-spec-proposals/pull/4363) (OAuth step-up authentication). Contributed by @ginger.
|
||||||
|
- Added support for [MSC2815](https://github.com/matrix-org/matrix-spec-proposals/pull/2815), allowing room moderators to fetch the original content of redacted events, behind the `allow_moderators_to_view_redacted_content` config option. Contributed by @eleboucher.
|
||||||
|
- Added support for [MSC4484](https://github.com/matrix-org/matrix-spec-proposals/pull/4484). Clients which use the built-in Matrix server administration APIs will need to ask for the appropriate scope when signing in with OAuth. Contributed by @ginger.
|
||||||
|
- Check content-type header on federation responses, ignoring any that don't match (spec compliance)
|
||||||
|
- Implemented unstable support for [MSC4560] (Stripped state requests over federation). Contributed by @ginger.
|
||||||
|
|
||||||
|
[MSC4560]: https://github.com/matrix-org/matrix-spec-proposals/pull/4560
|
||||||
|
- Profile banners are now treated as images when imported from OIDC claims, like avatars already were.
|
||||||
|
- Remove support for legacy, unauthenticated media, including the `allow_legacy_media` and `freeze_legacy_media` options.
|
||||||
|
- The first-run version of the web UI now includes a link to the registration page. Contributed by @ginger
|
||||||
|
|
||||||
|
## Bugfixes
|
||||||
|
|
||||||
|
- Fixed `/get_missing_events` rejecting requests with more `earliest_events` than the `limit`. Contributed by @eleboucher. (get-missing-events-earliest-limit)
|
||||||
|
- Invitees are now added as room creators when creating a v12+ trusted private chat. Contributed by @ginger. ([#2162](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2162))
|
||||||
|
- Fixed push gateway URLs containing the configured notification path outside of their suffix. Contributed by @eleboucher. ([#2261](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2261))
|
||||||
|
- "!admin users change-email" now verifies a user exists before attempting to change their email. Contributed by @Clubs. ([#2298](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2298))
|
||||||
|
- Fixed URL preview image MIME types and rejected failed downloads. Contributed by @eleboucher. ([#2308](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2308))
|
||||||
|
- Correctly set RocksDB column options, including enabling block caches. Contributed by @Jade ([#2345](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2345))
|
||||||
|
- Fix some possible deadlocks/freezes and reduce lock contention (improving performance). Contributed by @Jade ([#2351](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2351))
|
||||||
|
- Once again fixed how room extremities are handled, fixing a problem that made continuwuity gradually make rooms needlessly complex, which also caused more frequent state resets. ([#2356](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2356))
|
||||||
|
- The OAuth identity reset page is no longer linked from the account management UI to reduce confusion. Contributed by @ginger. ([#2383](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2383))
|
||||||
|
- Fixed a worker panic when knocking on a room over federation. Contributed by @eleboucher. ([#2387](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2387))
|
||||||
|
- Perform more validation on events received during atomic gapfill from remote servers, fixing a panic if bad data was persisted by another server and later lazily fetched by us. ([#2400](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2400))
|
||||||
|
- Redirect URIs in OAuth clients' metadata are now properly validated to be on a subdomain of the OAuth issuer URL domain. Contributed by @ginger. ([#2421](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2421))
|
||||||
|
- Fix v12 rooms created by the same user in the same millisecond ending up as the same room. Contributed by @eleboucher. ([#2424](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2424))
|
||||||
|
- Client-server API endpoints are now properly ratelimited for unauthenticated requests. Contributed by @ginger. ([#2444](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2444))
|
||||||
|
- Setting a profile key longer than 255 bytes now returns 400 `M_KEY_TOO_LARGE` as required by the spec, instead of 413 `M_TOO_LARGE`. ([#2451](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2451))
|
||||||
|
- Setting `m.fully_read` via the account data endpoints now returns 405 `M_BAD_JSON` as required by the spec, instead of 400. ([#2451](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2451))
|
||||||
|
- Appservices masquerading as a device that does not exist now receive 400 `M_UNKNOWN_DEVICE` as required by the spec, instead of 403 `M_FORBIDDEN`. ([#2451](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2451))
|
||||||
|
- Setting profile data that would make the profile exceed 64 KiB now returns 400 `M_PROFILE_TOO_LARGE` as required by the spec, instead of a 500 error. ([#2451](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2451))
|
||||||
|
- The `m.forget_forced_upon_leave` capability now reflects the `forget_forced_upon_leave` config option instead of always being advertised as enabled. ([#2452](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2452))
|
||||||
|
- Fixed push notifications for membership events setting `user_is_target` based on the sender rather than the user being notified. ([#2454](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2454))
|
||||||
|
- Ensure HTTP clients actually follow the `dns_servers` config option. Contributed by @silversys ([#2460](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2460))
|
||||||
|
- Reworked event relations to follow the spec more closely. Pagination of `/relations` now returns the correct pages and `next_batch` tokens, recursive relations are returned in the right order without duplicates, and bundled `m.reference` aggregations now include every reference. Contributed by @Henry-Hiles (QuadRadical). ([#2465](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2465))
|
||||||
|
- Read receipts are now more spec compliant, will work better in threads and are less likely to end up causing loops with other software. Contributed by @Jade ([#2481](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2481))
|
||||||
|
- Fix the DNS resolver failing to start without `/etc/resolv.conf` when `dns_servers` is configured. Contributed by @eleboucher. ([#2495](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2495))
|
||||||
|
- Fixed OIDC logins failing after the identity provider rotates its signing keys. Contributed by @eleboucher. ([#2497](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2497))
|
||||||
|
- Creating a room with valid but non-canonical JSON now returns `400 M_BAD_JSON` instead of panicking the worker and returning `500 M_UNKNOWN`.
|
||||||
|
- Fix account data updates sent at the same time leaving old copies behind, which every initial sync then returned. Existing copies are removed on startup. Contributed by @eleboucher.
|
||||||
|
- Fix gap filling skipping outlier events that are missing their previous events. Contributed by @eleboucher.
|
||||||
|
- Fix incoming federation events losing state changes when predecessors share the same state-before snapshot. Contributed by @eleboucher.
|
||||||
|
- Fix new devices sometimes never reaching other users' device lists. Contributed by @eleboucher.
|
||||||
|
- Fix state resolution applying events out of order, which could undo room joins. Contributed by @eleboucher.
|
||||||
|
- Fix to-device messages, including room keys, sometimes being lost before delivery. Contributed by @eleboucher.
|
||||||
|
- For deployments using OIDC with `profile_key_import_mode` set to `on_login`, users' avatars will no longer be clobbered if they didn't change their avatar since their last login.
|
||||||
|
- Joining a local room the user is not allowed to join now returns `403 M_FORBIDDEN` instead of `500 M_UNKNOWN` when there are no other servers to try.
|
||||||
|
- Room summary visibility checks are no longer incorrectly applied for remote rooms. Contributed by @ginger.
|
||||||
|
- The userinfo endpoint is now accessible even if federation is disabled, allowing LiveKit to be used on servers with federation disabled without using the server name whitelist.
|
||||||
|
- `!admin token issue` can no longer issue registration tokens when `allow_registration` is false. Contributed by @Clubs.
|
||||||
|
|
||||||
|
## Improved Documentation
|
||||||
|
|
||||||
|
- Add the Authentication section to document available auth methods for Continuwuity. The "delegated authentication" guide has also been migrated to here. Contributed by @stratself. ([#2234](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2234))
|
||||||
|
- Add a guide for push notifications, detailing how it works, push gateway specifics, troubleshooting common issues, and pointing to external guides for UnifiedPush backends. Contributed by @stratself ([#2244](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2244))
|
||||||
|
- The deploying page now includes vital general information about installing Continuwuity: release tracks, update steps, and post-installation recommendations. Contributed by @stratself ([#2252](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2252))
|
||||||
|
- Add some missing instructions on configuring Continuwuity on the RPM page. Users are encouraged to use the [generic deploying docs](https://continuwuity.org/deploying/generic) for the bulk of guidance anyhow. Contributed by @stratself ([#2275](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2275))
|
||||||
|
- Better, more succinct [introduction page](https://continuwuity.org/introduction.html). Contributed by @stratself ([#2279](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2279))
|
||||||
|
- Add a section on [troubleshooting Docker issues](https://continuwuity.org/troubleshooting#docker-issues). Contributed by @stratself. ([#2324](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2324))
|
||||||
|
- Instructions for Authelia added to the [OIDC guide](https://continuwuity.org/authentication/oidc.html). Contributed by @fhoekstra ([#2341](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2341))
|
||||||
|
- Docker compose examples now use bind mounts by default, instead of Docker volumes, as they are easier to work with esp. for backup/restore. Contributed by @stratself. ([#2353](https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2353))
|
||||||
|
- The documentation now refers to the Continuwuity Docker service as `continuwuity` instead of `homeserver`.
|
||||||
|
|
||||||
|
## Misc
|
||||||
|
|
||||||
|
- Updated internal Sentry integration setup to the new pattern required by the SDK. #2423
|
||||||
|
- Upgraded rocksdb from 11.1.1 to 11.12.0 and jemalloc to 5.4.0.
|
||||||
|
|
||||||
|
|
||||||
# Continuwuity v26.11.0-alpha.1 (2026-11-10)
|
# Continuwuity v26.11.0-alpha.1 (2026-11-10)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|||||||
Generated
+181
-164
File diff suppressed because it is too large.
Load diff
+24
-71
@@ -12,7 +12,7 @@ license = "Apache-2.0"
|
|||||||
# See also `rust-toolchain.toml`
|
# See also `rust-toolchain.toml`
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://forgejo.ellis.link/continuwuation/continuwuity"
|
repository = "https://forgejo.ellis.link/continuwuation/continuwuity"
|
||||||
version = "26.11.0-alpha.1"
|
version = "26.11.0-alpha.2"
|
||||||
|
|
||||||
[workspace.metadata.crane]
|
[workspace.metadata.crane]
|
||||||
name = "conduwuit"
|
name = "conduwuit"
|
||||||
@@ -269,8 +269,8 @@ features = [
|
|||||||
[workspace.dependencies.tokio-metrics]
|
[workspace.dependencies.tokio-metrics]
|
||||||
version = "0.5.2"
|
version = "0.5.2"
|
||||||
|
|
||||||
[workspace.dependencies.libloading]
|
[workspace.dependencies.wildmatch]
|
||||||
version = "0.9.0"
|
version = "2.7.0"
|
||||||
|
|
||||||
# Validating urls in config, was already a transitive dependency
|
# Validating urls in config, was already a transitive dependency
|
||||||
[workspace.dependencies.url]
|
[workspace.dependencies.url]
|
||||||
@@ -357,7 +357,7 @@ version = "1.1.1"
|
|||||||
# Used for matrix spec type definitions and helpers
|
# Used for matrix spec type definitions and helpers
|
||||||
[workspace.dependencies.ruma]
|
[workspace.dependencies.ruma]
|
||||||
git = "https://github.com/ruma/ruma.git"
|
git = "https://github.com/ruma/ruma.git"
|
||||||
rev = "0ed7fba34213f18a628a56f527c6cc795cd7eef5"
|
rev = "decdf3f6c5160e1db595d4edb4d65d5de935e13c"
|
||||||
features = [
|
features = [
|
||||||
"appservice-api-c",
|
"appservice-api-c",
|
||||||
"client-api",
|
"client-api",
|
||||||
@@ -370,7 +370,6 @@ features = [
|
|||||||
"compat-upload-signatures",
|
"compat-upload-signatures",
|
||||||
"compat-optional-txn-pdus",
|
"compat-optional-txn-pdus",
|
||||||
"compat-get-3pids",
|
"compat-get-3pids",
|
||||||
"unstable-msc2867",
|
|
||||||
"unstable-msc2870",
|
"unstable-msc2870",
|
||||||
"unstable-msc3814",
|
"unstable-msc3814",
|
||||||
"unstable-msc3245",
|
"unstable-msc3245",
|
||||||
@@ -392,6 +391,7 @@ features = [
|
|||||||
"unstable-msc4406",
|
"unstable-msc4406",
|
||||||
"unstable-msc4439",
|
"unstable-msc4439",
|
||||||
"unstable-msc4354",
|
"unstable-msc4354",
|
||||||
|
"unstable-msc4388",
|
||||||
"unstable-msc4480",
|
"unstable-msc4480",
|
||||||
"unstable-msc4466",
|
"unstable-msc4466",
|
||||||
"unstable-msc4494",
|
"unstable-msc4494",
|
||||||
@@ -403,7 +403,7 @@ features = [
|
|||||||
|
|
||||||
[workspace.dependencies.rust-rocksdb]
|
[workspace.dependencies.rust-rocksdb]
|
||||||
git = "https://forgejo.ellis.link/continuwuation/rust-rocksdb-zaidoon1"
|
git = "https://forgejo.ellis.link/continuwuation/rust-rocksdb-zaidoon1"
|
||||||
rev = "6021299f3e0e9455dc3f2e39c65e1dc217be8903"
|
rev = "85ded20348e3dab902c239967075795e9c6d101b"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = [
|
features = [
|
||||||
"multi-threaded-cf",
|
"multi-threaded-cf",
|
||||||
@@ -431,7 +431,8 @@ features = ["reqwest"]
|
|||||||
version = "0.33.1"
|
version = "0.33.1"
|
||||||
|
|
||||||
[workspace.dependencies.opentelemetry-instrumentation-tower]
|
[workspace.dependencies.opentelemetry-instrumentation-tower]
|
||||||
version = "0.19.0"
|
git = "https://github.com/open-telemetry/opentelemetry-rust-contrib"
|
||||||
|
rev = "6bbbc337aab0bcf10d7799c3e5b5ced75920491a"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["axum"]
|
features = ["axum"]
|
||||||
|
|
||||||
@@ -486,7 +487,7 @@ version = "0.49.5"
|
|||||||
# jemalloc usage
|
# jemalloc usage
|
||||||
[workspace.dependencies.tikv-jemalloc-sys]
|
[workspace.dependencies.tikv-jemalloc-sys]
|
||||||
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
|
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
|
||||||
rev = "ac4d4861b335b199f812807996e8c9166961041a"
|
rev = "46e7821917b06636cdb5b203d312799970eaea92"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = [
|
features = [
|
||||||
"background_threads_runtime_support",
|
"background_threads_runtime_support",
|
||||||
@@ -494,7 +495,7 @@ features = [
|
|||||||
]
|
]
|
||||||
[workspace.dependencies.tikv-jemallocator]
|
[workspace.dependencies.tikv-jemallocator]
|
||||||
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
|
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
|
||||||
rev = "ac4d4861b335b199f812807996e8c9166961041a"
|
rev = "46e7821917b06636cdb5b203d312799970eaea92"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = [
|
features = [
|
||||||
"background_threads_runtime_support",
|
"background_threads_runtime_support",
|
||||||
@@ -502,7 +503,7 @@ features = [
|
|||||||
]
|
]
|
||||||
[workspace.dependencies.tikv-jemalloc-ctl]
|
[workspace.dependencies.tikv-jemalloc-ctl]
|
||||||
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
|
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
|
||||||
rev = "ac4d4861b335b199f812807996e8c9166961041a"
|
rev = "46e7821917b06636cdb5b203d312799970eaea92"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["use_std"]
|
features = ["use_std"]
|
||||||
|
|
||||||
@@ -518,15 +519,6 @@ features = ["resource"]
|
|||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|
||||||
[workspace.dependencies.hardened_malloc-rs]
|
|
||||||
version = "0.1.2"
|
|
||||||
default-features = false
|
|
||||||
features = [
|
|
||||||
"static",
|
|
||||||
"gcc",
|
|
||||||
"light",
|
|
||||||
]
|
|
||||||
|
|
||||||
[workspace.dependencies.rustyline-async]
|
[workspace.dependencies.rustyline-async]
|
||||||
version = "0.4.9"
|
version = "0.4.9"
|
||||||
default-features = false
|
default-features = false
|
||||||
@@ -596,15 +588,27 @@ version = "0.10.4"
|
|||||||
default-features = false
|
default-features = false
|
||||||
features = ["std"]
|
features = ["std"]
|
||||||
|
|
||||||
|
[workspace.dependencies.mime]
|
||||||
|
version = "0.3.18"
|
||||||
|
|
||||||
[workspace.dependencies.nonzero_ext]
|
[workspace.dependencies.nonzero_ext]
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
|
||||||
[workspace.dependencies.resolvematrix]
|
[workspace.dependencies.resolvematrix]
|
||||||
version = "1.4.0"
|
version = "1.5.0"
|
||||||
|
features = ["unstable-msc4188"]
|
||||||
|
|
||||||
[workspace.dependencies.serde_urlencoded]
|
[workspace.dependencies.serde_urlencoded]
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
|
|
||||||
|
[workspace.dependencies.mimalloc]
|
||||||
|
version = "0.1.52"
|
||||||
|
features = ["extended"]
|
||||||
|
|
||||||
|
[workspace.dependencies.libmimalloc-sys]
|
||||||
|
version = "0.1.49"
|
||||||
|
features = ["extended"]
|
||||||
|
|
||||||
#
|
#
|
||||||
# Patches
|
# Patches
|
||||||
#
|
#
|
||||||
@@ -748,74 +752,23 @@ inherits = "release"
|
|||||||
# Developer profile
|
# Developer profile
|
||||||
#
|
#
|
||||||
|
|
||||||
# To enable hot-reloading:
|
|
||||||
# 1. Uncomment all of the rustflags here.
|
|
||||||
# 2. Uncomment crate-type=dylib in src/*/Cargo.toml
|
|
||||||
#
|
|
||||||
# opt-level, mir-opt-level, validate-mir are not known to interfere with reloading
|
|
||||||
# and can be raised if build times are tolerable.
|
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
debug = "full"
|
debug = "full"
|
||||||
opt-level = 0
|
opt-level = 0
|
||||||
panic = "unwind"
|
panic = "unwind"
|
||||||
debug-assertions = true
|
debug-assertions = true
|
||||||
incremental = true
|
incremental = true
|
||||||
#rustflags = [
|
|
||||||
# '--cfg', 'conduwuit_mods',
|
|
||||||
# '-Ztime-passes',
|
|
||||||
# '-Zmir-opt-level=0',
|
|
||||||
# '-Zvalidate-mir=false',
|
|
||||||
# '-Ztls-model=global-dynamic',
|
|
||||||
# '-Cprefer-dynamic=true',
|
|
||||||
# '-Zstaticlib-prefer-dynamic=true',
|
|
||||||
# '-Zstaticlib-allow-rdylib-deps=true',
|
|
||||||
# '-Zpacked-bundled-libs=false',
|
|
||||||
# '-Zplt=true',
|
|
||||||
# '-Crpath=true',
|
|
||||||
# '-Clink-arg=-Wl,--as-needed',
|
|
||||||
# '-Clink-arg=-Wl,--allow-shlib-undefined',
|
|
||||||
# '-Clink-arg=-Wl,-z,keep-text-section-prefix',
|
|
||||||
# '-Clink-arg=-Wl,-z,lazy',
|
|
||||||
#]
|
|
||||||
|
|
||||||
[profile.dev.package.conduwuit_core]
|
[profile.dev.package.conduwuit_core]
|
||||||
inherits = "dev"
|
inherits = "dev"
|
||||||
[profile.dev.package.conduwuit]
|
[profile.dev.package.conduwuit]
|
||||||
inherits = "dev"
|
inherits = "dev"
|
||||||
#rustflags = [
|
|
||||||
# '--cfg', 'conduwuit_mods',
|
|
||||||
# '-Ztime-passes',
|
|
||||||
# '-Zmir-opt-level=0',
|
|
||||||
# '-Zvalidate-mir=false',
|
|
||||||
# '-Ztls-model=global-dynamic',
|
|
||||||
# '-Cprefer-dynamic=true',
|
|
||||||
# '-Zexport-executable-symbols=true',
|
|
||||||
# '-Zplt=true',
|
|
||||||
# '-Crpath=true',
|
|
||||||
# '-Clink-arg=-Wl,--as-needed',
|
|
||||||
# '-Clink-arg=-Wl,--allow-shlib-undefined',
|
|
||||||
# '-Clink-arg=-Wl,--export-dynamic',
|
|
||||||
# '-Clink-arg=-Wl,-z,lazy',
|
|
||||||
#]
|
|
||||||
|
|
||||||
[profile.dev.package.'*']
|
[profile.dev.package.'*']
|
||||||
inherits = "dev"
|
inherits = "dev"
|
||||||
debug = 'limited'
|
debug = 'limited'
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
opt-level = 'z'
|
opt-level = 'z'
|
||||||
#rustflags = [
|
|
||||||
# '--cfg', 'conduwuit_mods',
|
|
||||||
# '-Ztls-model=global-dynamic',
|
|
||||||
# '-Cprefer-dynamic=true',
|
|
||||||
# '-Zstaticlib-prefer-dynamic=true',
|
|
||||||
# '-Zstaticlib-allow-rdylib-deps=true',
|
|
||||||
# '-Zpacked-bundled-libs=true',
|
|
||||||
# '-Zplt=true',
|
|
||||||
# '-Clink-arg=-Wl,--as-needed',
|
|
||||||
# '-Clink-arg=-Wl,-z,lazy',
|
|
||||||
# '-Clink-arg=-Wl,-z,nodelete',
|
|
||||||
#]
|
|
||||||
|
|
||||||
# primarily used for CI
|
# primarily used for CI
|
||||||
[profile.test]
|
[profile.test]
|
||||||
|
|||||||
+8
-3
@@ -23,12 +23,15 @@ to encourage users to stay up-to-date with the latest release, and we have no co
|
|||||||
We appreciate the efforts of security researchers and the community in identifying and reporting vulnerabilities. To
|
We appreciate the efforts of security researchers and the community in identifying and reporting vulnerabilities. To
|
||||||
ensure that potential vulnerabilities are addressed properly, please follow these guidelines:
|
ensure that potential vulnerabilities are addressed properly, please follow these guidelines:
|
||||||
|
|
||||||
1. **Contact members of the team directly** over E2EE private message.
|
1. **Contact _all_ members of the team** over E2EE private message on Matrix.
|
||||||
|
Add each contact to the same encrypted room. **Do not message maintainers individually**.
|
||||||
|
If you cannot reach us from matrix.org, please try [another server][sl] (e.g. continuwuity.rocks).
|
||||||
- [@jade:ellis.link](https://matrix.to/#/@jade:ellis.link)
|
- [@jade:ellis.link](https://matrix.to/#/@jade:ellis.link)
|
||||||
- [@nex:nexy7574.co.uk](https://matrix.to/#/@nex:nexy7574.co.uk)
|
- [@nex:nexy7574.co.uk](https://matrix.to/#/@nex:nexy7574.co.uk)
|
||||||
- [@ginger:gingershaped.computer](https://matrix.to/#/@ginger:gingershaped.computer)
|
- [@ginger:gingershaped.computer](https://matrix.to/#/@ginger:gingershaped.computer)
|
||||||
2. **Email the security team** at [security@continuwuity.org](mailto:security@continuwuity.org). This is not E2EE, so
|
2. **Email the security team** at [security@continuwuity.org](mailto:security@continuwuity.org). This is not E2EE, so
|
||||||
don't include sensitive details.
|
don't include sensitive details. Do not ask where to send sensitive details either; that
|
||||||
|
information is included in this security policy. We may not respond to emails that do this.
|
||||||
3. **Do not disclose the vulnerability publicly** until a fix has been pushed to the main branch.
|
3. **Do not disclose the vulnerability publicly** until a fix has been pushed to the main branch.
|
||||||
4. **Provide detailed information** about the vulnerability, including:
|
4. **Provide detailed information** about the vulnerability, including:
|
||||||
- A clear description of the issue
|
- A clear description of the issue
|
||||||
@@ -42,6 +45,8 @@ ensure that potential vulnerabilities are addressed properly, please follow thes
|
|||||||
If you have any doubts about a potential security vulnerability, contact us via private channels first! We'd prefer that
|
If you have any doubts about a potential security vulnerability, contact us via private channels first! We'd prefer that
|
||||||
you bother us, instead of having a vulnerability disclosed without a fix.
|
you bother us, instead of having a vulnerability disclosed without a fix.
|
||||||
|
|
||||||
|
[sl]: https://servers.joinmatrix.org
|
||||||
|
|
||||||
### Terms for credit
|
### Terms for credit
|
||||||
|
|
||||||
Before reporting a vulnerability, please remember that we are a small team maintaining a large codebase depended upon by
|
Before reporting a vulnerability, please remember that we are a small team maintaining a large codebase depended upon by
|
||||||
@@ -105,4 +110,4 @@ When security vulnerabilities are identified:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
This security policy was last updated on May 25, 2025.
|
This security policy was last updated on November 17th, 2026.
|
||||||
+17
-3
@@ -52,8 +52,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# The base docker image to use for complement tests
|
# The base docker image to use for complement tests
|
||||||
# You can build the default with `docker build -t continuwuity:complement -f ./docker/complement.Dockerfile .`
|
# On Linux, you can build the default with `docker build -t continuwuity:complement -f ./docker/complement.Dockerfile .`
|
||||||
# after running `cargo build -p conduwuit --features openreg`. Only the debug binary is used.
|
# after running `cargo build -p conduwuit --features openreg`.
|
||||||
|
# On non-Linux platforms (or to use a container build), build `docker/Dockerfile` with debuginfo and openreg `--build-arg RUST_PROFILE=dev --build-arg CARGO_FEATURES=default,openreg`
|
||||||
|
# and then run `docker build -t continuwuity:complement --target container -f ./docker/complement.Dockerfile .`.
|
||||||
COMPLEMENT_BASE_IMAGE="${COMPLEMENT_BASE_IMAGE:-continuwuity:complement}"
|
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
|
# Complement tests that are skipped due to flakiness/reliability issues or we don't implement such features and won't for a long time
|
||||||
@@ -83,6 +85,13 @@ for command in docker go jq; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -z "${DOCKER_HOST:-}" ]; then
|
||||||
|
DOCKER_HOST="$(docker context inspect --format '{{.Endpoints.docker.Host}}' 2>/dev/null || true)"
|
||||||
|
if [ -n "$DOCKER_HOST" ]; then
|
||||||
|
export DOCKER_HOST
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$IMAGE_ARCHIVE" ]; then
|
if [ -n "$IMAGE_ARCHIVE" ]; then
|
||||||
if [ ! -f "$IMAGE_ARCHIVE" ]; then
|
if [ ! -f "$IMAGE_ARCHIVE" ]; then
|
||||||
echo "Docker image archive not found: $IMAGE_ARCHIVE"
|
echo "Docker image archive not found: $IMAGE_ARCHIVE"
|
||||||
@@ -99,7 +108,12 @@ fi
|
|||||||
|
|
||||||
if ! docker image inspect "$COMPLEMENT_BASE_IMAGE" > /dev/null 2>&1; then
|
if ! docker image inspect "$COMPLEMENT_BASE_IMAGE" > /dev/null 2>&1; then
|
||||||
echo "Complement base image not found: $COMPLEMENT_BASE_IMAGE"
|
echo "Complement base image not found: $COMPLEMENT_BASE_IMAGE"
|
||||||
echo "Build it with: cargo build -p conduwuit --features openreg && docker build -t $COMPLEMENT_BASE_IMAGE -f docker/complement.Dockerfile ."
|
if [ "$(uname -s)" != "Linux" ]; then
|
||||||
|
echo "Build it with: docker buildx build --load -t continuwuity:latest-openreg --build-arg RUST_PROFILE=dev --build-arg CARGO_FEATURES=default,openreg -f docker/Dockerfile . && docker build -t $COMPLEMENT_BASE_IMAGE --target container -f docker/complement.Dockerfile ."
|
||||||
|
else
|
||||||
|
echo "Build it with: cargo build -p conduwuit --features openreg && docker build -t $COMPLEMENT_BASE_IMAGE -f docker/complement.Dockerfile ."
|
||||||
|
echo "Or from a container build: docker buildx build --load -t continuwuity:latest-openreg --build-arg RUST_PROFILE=dev --build-arg CARGO_FEATURES=default,openreg -f docker/Dockerfile . && docker build -t $COMPLEMENT_BASE_IMAGE --target container -f docker/complement.Dockerfile ."
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
Check content-type header on federation responses, ignoring any that don't match (spec compliance)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Fix account data updates sent at the same time leaving old copies behind, which every initial sync then returned. Existing copies are removed on startup. Contributed by @eleboucher.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Creating a room with valid but non-canonical JSON now returns `400 M_BAD_JSON` instead of panicking the worker and returning `500 M_UNKNOWN`.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Joining a local room the user is not allowed to join now returns `403 M_FORBIDDEN` instead of `500 M_UNKNOWN` when there are no other servers to try.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Added support for [MSC2815](https://github.com/matrix-org/matrix-spec-proposals/pull/2815), allowing room moderators to fetch the original content of redacted events, behind the `allow_moderators_to_view_redacted_content` config option. Contributed by @eleboucher.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Remove support for legacy, unauthenticated media, including the `allow_legacy_media` and `freeze_legacy_media` options.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Added support for the stable MatrixRTC transports discovery endpoint (`GET /_matrix/client/v1/rtc/transports`) from the accepted MSC4143, advertised via the `org.matrix.msc4143.stable` unstable feature. The unstable endpoint remains available. Contributed by @Henry-Hiles (QuadRadical).
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Legacy `/sync` now honours the `room.rooms`, `room.not_rooms`, `account_data.types` and `account_data.not_types` filter fields instead of returning every room and all account data. Contributed by @eleboucher.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Added the `GET /_matrix/client/v1/rooms/{roomId}/timestamp_to_event` endpoint as per MSC3030, letting clients find the event closest to a given timestamp. Contributed by @eleboucher.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Fixed Prometheus accounting for in-flight requests, federation PDU lag, latency buckets, and thumbnail sizes. Contributed by @eleboucher.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Added support for servers returning 410 gone to indicate they are no longer serving a Matrix server (MSC4188). Contributed by @nex and @silversys
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Requests waiting on `/_matrix/client/v3/sync` can now be interrupted by the server shutdown, unblocking the 30-second shutdown delay imposed on a quiet server.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Fix remote server key signature verification when extra fields exist. Contributed by @hexchen
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Added support for MSC4388, allowing compatible Matrix clients to log in to Continuwuity by scanning a QR code on an already logged-in client. Contributed by @ginger.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
URL previews no longer completely fail if downloading auxiliary content (images/videos/audio) fails. Contributed by @nex.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
`/_matrix/client/v3/sync` no longer waits 30 seconds if the `timeout` parameter is omitted or set to zero, correctly reflecting the specification's rule that such requests should return immediately, even if they are empty.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Fix the DNS resolver failing to start without `/etc/resolv.conf` when `dns_servers` is configured. Contributed by @eleboucher.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Fixed OIDC logins failing after the identity provider rotates its signing keys. Contributed by @eleboucher.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Changed the policy on unstable features, disabling most by default and making them configurable in a tidy little `experiments` configuration. See also: #1884.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Fixed the experiments implementation in #2517 not properly disabling some functionality when associated experiments weren't enabled.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
The sticky events feature flag is correctly advertised in `/_matrix/client/versions` again after it was accidentally removed in #2517.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
The former configuration alias `allow_check_for_updates` is now explicitly deprecated in favor of `allow_announcements_check`. Additionally, `request_ip_source` is now deprecated in favor of `accepted_ip_sources`.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
A message is now sent to the admin room when a user logs in for the first time through an OIDC provider, if admin room notices are enabled. Contributed by @ginger.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Dropped support for `hardened_malloc` and add support for `mimalloc` instead. Contributed by @nex and @jade.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Fix soundness and correctness issues in the jemalloc interface, improving performance. Contributed by @Jade
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Modernised the room knocking helper functions to make them match the behaviour of our room join helpers, which are safer and more efficient. This also fixes a bug that caused an error when knocking on rooms not local to the server. Contributed by @nex.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Continuwuity will now request the `profile` OIDC scope from identity providers by default to improve compatibility with identity providers that require it to access users' profile claims, as recommended by the OIDC specification. Contributed by @ginger.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Attempting to start a UIAA session on a homeserver with UIAA disabled will now return `403 M_UNAUTHORIZED` instead of `404 M_UNSUPPORTED`. Contributed by @ginger.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Advertise support for Matrix v1.6. Contributed by @jade
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Moved the `jemalloc` feature out of `standard` (and `full`) into `default` so builders can more easily swap allocators. Builders using `--no-default-features` with the `full` or `standard` feature should now explicitly select an allocator (either `jemalloc` or `mimalloc`). Contributed by @Jade
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Fixed `/get_missing_events` rejecting requests with more `earliest_events` than the `limit`. Contributed by @eleboucher.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Fix outgoing federation stalling after a sender worker panics. Contributed by @eleboucher.
|
||||||
@@ -31,7 +31,6 @@ rocksdb_log_level = "info"
|
|||||||
rocksdb_max_log_files = 1
|
rocksdb_max_log_files = 1
|
||||||
rocksdb_recovery_mode = 0
|
rocksdb_recovery_mode = 0
|
||||||
rocksdb_paranoid_file_checks = true
|
rocksdb_paranoid_file_checks = true
|
||||||
allow_legacy_media = true
|
|
||||||
startup_netburst = true
|
startup_netburst = true
|
||||||
startup_netburst_keep = -1
|
startup_netburst_keep = -1
|
||||||
allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure = true
|
allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure = true
|
||||||
|
|||||||
+170
-39
@@ -412,7 +412,7 @@
|
|||||||
# env: CONTINUWUITY_IP_LOOKUP_STRATEGY
|
# env: CONTINUWUITY_IP_LOOKUP_STRATEGY
|
||||||
#ip_lookup_strategy = 5
|
#ip_lookup_strategy = 5
|
||||||
|
|
||||||
# The preferred source to use for getting the real client IP.
|
# DEPRECATED: The preferred source to use for getting the real client IP.
|
||||||
#
|
#
|
||||||
# Takes any of the following options:
|
# Takes any of the following options:
|
||||||
#
|
#
|
||||||
@@ -431,9 +431,10 @@
|
|||||||
# to set this header" check; if the header selected is present, it is
|
# to set this header" check; if the header selected is present, it is
|
||||||
# used.
|
# used.
|
||||||
#
|
#
|
||||||
# Ignored if `accepted_ip_sources` is set.
|
# Ignored if `accepted_ip_sources` is set. `accepted_ip_sources` is
|
||||||
|
# the preferred alternative.
|
||||||
#
|
#
|
||||||
# If not set set, `direct` is used. Additionally, `direct` is used
|
# If not set, `direct` is used. Additionally, `direct` is used
|
||||||
# as a fallback if the chosen header is not found.
|
# as a fallback if the chosen header is not found.
|
||||||
#
|
#
|
||||||
# env: CONTINUWUITY_REQUEST_IP_SOURCE
|
# env: CONTINUWUITY_REQUEST_IP_SOURCE
|
||||||
@@ -812,15 +813,32 @@
|
|||||||
# env: CONTINUWUITY_FORGET_FORCED_UPON_LEAVE
|
# env: CONTINUWUITY_FORGET_FORCED_UPON_LEAVE
|
||||||
#forget_forced_upon_leave = false
|
#forget_forced_upon_leave = false
|
||||||
|
|
||||||
# Set this to true to require authentication on the normally
|
# Set this to true to require authentication when looking up user profiles
|
||||||
# unauthenticated profile retrieval endpoints (GET)
|
# through this server.
|
||||||
# "/_matrix/client/v3/profile/{userId}".
|
|
||||||
#
|
#
|
||||||
# This can prevent profile scraping.
|
# By default this is false, allowing tools such as matrix.to to access
|
||||||
|
# profiles of users on this server and on other servers.
|
||||||
|
# Setting this to true will block those tools, and may block automated
|
||||||
|
# crawlers from scraping users' profiles, although it will not block
|
||||||
|
# other homeservers from accessing users' profiles.
|
||||||
#
|
#
|
||||||
# env: CONTINUWUITY_REQUIRE_AUTH_FOR_PROFILE_REQUESTS
|
# env: CONTINUWUITY_REQUIRE_AUTH_FOR_PROFILE_REQUESTS
|
||||||
#require_auth_for_profile_requests = false
|
#require_auth_for_profile_requests = false
|
||||||
|
|
||||||
|
# Set this to true to require authentication to create a rendezvous
|
||||||
|
# session. Rendezvous sessions are used for QR code login.
|
||||||
|
#
|
||||||
|
# For QR code login, the device that shows the QR code is the one that
|
||||||
|
# creates the rendezvous session. Therefore, this must be false to let
|
||||||
|
# a logged-out device show a QR code.
|
||||||
|
#
|
||||||
|
# By default this is false to allow logged-out desktop devices (which may
|
||||||
|
# not have a camera) to show a QR code. Setting this to true will
|
||||||
|
# require logged-out devices to scan the QR code instead.
|
||||||
|
#
|
||||||
|
# env: CONTINUWUITY_REQUIRE_AUTH_FOR_RENDEZVOUS
|
||||||
|
#require_auth_for_rendezvous = false
|
||||||
|
|
||||||
# Set this to true to allow your server's public room directory to be
|
# Set this to true to allow your server's public room directory to be
|
||||||
# federated. Set this to false to protect against /publicRooms spiders,
|
# federated. Set this to false to protect against /publicRooms spiders,
|
||||||
# but will forbid external users from viewing your server's public room
|
# but will forbid external users from viewing your server's public room
|
||||||
@@ -1657,13 +1675,6 @@
|
|||||||
# env: CONTINUWUITY_ALLOW_INCOMING_TYPING
|
# env: CONTINUWUITY_ALLOW_INCOMING_TYPING
|
||||||
#allow_incoming_typing = true
|
#allow_incoming_typing = true
|
||||||
|
|
||||||
# Allow the use of unstable persistent "sticky events" ([MSC4354])
|
|
||||||
#
|
|
||||||
# MSC4354: https://c10y.cc/MSC4354
|
|
||||||
#
|
|
||||||
# env: CONTINUWUITY_ALLOW_STICKY_EVENTS
|
|
||||||
#allow_sticky_events = false
|
|
||||||
|
|
||||||
# Maximum time federation user can indicate typing.
|
# Maximum time federation user can indicate typing.
|
||||||
#
|
#
|
||||||
# env: CONTINUWUITY_TYPING_FEDERATION_TIMEOUT_S
|
# env: CONTINUWUITY_TYPING_FEDERATION_TIMEOUT_S
|
||||||
@@ -1714,29 +1725,6 @@
|
|||||||
# env: CONTINUWUITY_BROTLI_COMPRESSION
|
# env: CONTINUWUITY_BROTLI_COMPRESSION
|
||||||
#brotli_compression = false
|
#brotli_compression = false
|
||||||
|
|
||||||
# Enable the legacy unauthenticated Matrix media repository endpoints.
|
|
||||||
# These endpoints consist of:
|
|
||||||
# - /_matrix/media/*/config
|
|
||||||
# - /_matrix/media/*/upload
|
|
||||||
# - /_matrix/media/*/preview_url
|
|
||||||
# - /_matrix/media/*/download/*
|
|
||||||
# - /_matrix/media/*/thumbnail/*
|
|
||||||
#
|
|
||||||
# The authenticated equivalent endpoints are always enabled.
|
|
||||||
#
|
|
||||||
# Defaults to false, as unauthenticated media has been sunsetted.
|
|
||||||
#
|
|
||||||
# env: CONTINUWUITY_ALLOW_LEGACY_MEDIA
|
|
||||||
#allow_legacy_media = false
|
|
||||||
|
|
||||||
# If set to true, prevents fetching new legacy remote media.
|
|
||||||
#
|
|
||||||
# Legacy media may still be accessible if it was already fetched
|
|
||||||
# previously and allow_legacy_media is true.
|
|
||||||
#
|
|
||||||
# env: CONTINUWUITY_FREEZE_LEGACY_MEDIA
|
|
||||||
#freeze_legacy_media = true
|
|
||||||
|
|
||||||
# Check consistency of the media directory at startup:
|
# Check consistency of the media directory at startup:
|
||||||
# 1. When `media_compat_file_link` is enabled, this check will upgrade
|
# 1. When `media_compat_file_link` is enabled, this check will upgrade
|
||||||
# media when switching back and forth between Conduit and conduwuit.
|
# media when switching back and forth between Conduit and conduwuit.
|
||||||
@@ -2594,10 +2582,12 @@
|
|||||||
|
|
||||||
# Additional scopes Continuwuity should request from the IDP. This may be
|
# Additional scopes Continuwuity should request from the IDP. This may be
|
||||||
# necessary to access certain claims. Continuwuity always requests the
|
# necessary to access certain claims. Continuwuity always requests the
|
||||||
# `openid` scope.
|
# `openid` scope, regardless of the contents of this option,
|
||||||
|
# and will also request the `profile` scope by default if this option is
|
||||||
|
# not set.
|
||||||
#
|
#
|
||||||
# env: CONTINUWUITY_OAUTH__OIDC__ADDITIONAL_SCOPES
|
# env: CONTINUWUITY_OAUTH__OIDC__ADDITIONAL_SCOPES
|
||||||
#additional_scopes = []
|
#additional_scopes = ["profile"]
|
||||||
|
|
||||||
# Additional trusted audiences that Continuwuity will accept in the `aud`
|
# Additional trusted audiences that Continuwuity will accept in the `aud`
|
||||||
# claim of the OIDC token returned by the IDP. If your identity
|
# claim of the OIDC token returned by the IDP. If your identity
|
||||||
@@ -2687,3 +2677,144 @@
|
|||||||
#
|
#
|
||||||
# env: CONTINUWUITY_OAUTH__OIDC__PROFILE_KEY_IMPORT_MODE
|
# env: CONTINUWUITY_OAUTH__OIDC__PROFILE_KEY_IMPORT_MODE
|
||||||
#profile_key_import_mode = "on_registration"
|
#profile_key_import_mode = "on_registration"
|
||||||
|
|
||||||
|
[global.experiments]
|
||||||
|
# Continuwuity's experimental features are frequently updated.
|
||||||
|
# If you got this configuration via a package manager, chances are it's outdated.
|
||||||
|
# Check out the configuration reference online to see a fresh version:
|
||||||
|
# https://continuwuity.org/reference/config.html#:~:text=global.experiments
|
||||||
|
#
|
||||||
|
# Please keep in mind that experiments are used to enable unstable features.
|
||||||
|
# You probably don't need to enable any of these unless you know what they are,
|
||||||
|
# and consequently know why you should enable them.
|
||||||
|
|
||||||
|
|
||||||
|
# MSC3814: Dehydrated devices with SSSS
|
||||||
|
#
|
||||||
|
# Enables server-side support for "dehydrated devices", which are
|
||||||
|
# server-side devices (created by supporting clients) that can collect
|
||||||
|
# encryption keys when there are no online devices, which supporting
|
||||||
|
# clients can then "hydrate" to download any encryption keys that were
|
||||||
|
# sent while they were offline.
|
||||||
|
#
|
||||||
|
# Important: this is NOT required to receive encrypted messages while you
|
||||||
|
# are offline. Devices can still receive encrypted messages while they are
|
||||||
|
# offline, but to share those keys with new devices, they have to be
|
||||||
|
# online. Dehydrated devices work around this by providing a "shared"
|
||||||
|
# device new sessions can bootstrap from, to receive keys from before they
|
||||||
|
# logged in that haven't been uploaded to the server-side key backup yet.
|
||||||
|
#
|
||||||
|
# https://github.com/matrix-org/matrix-spec-proposals/pull/3814
|
||||||
|
#
|
||||||
|
# env: CONTINUWUITY_EXPERIMENTS__MSC3814
|
||||||
|
#msc3814 = false
|
||||||
|
|
||||||
|
# MSC4155: Invite filtering
|
||||||
|
#
|
||||||
|
# Provides advanced invite filtering rules for users, allowing complex
|
||||||
|
# configurations that can allow, ignore, and reject invites from users and
|
||||||
|
# servers broadly.
|
||||||
|
#
|
||||||
|
# Requires a supporting client to set up on an account.
|
||||||
|
#
|
||||||
|
# https://github.com/matrix-org/matrix-spec-proposals/pull/4155
|
||||||
|
#
|
||||||
|
# env: CONTINUWUITY_EXPERIMENTS__MSC4155
|
||||||
|
#msc4155 = false
|
||||||
|
|
||||||
|
# MSC4174: Web push
|
||||||
|
#
|
||||||
|
# Adds server-side support for web push, allowing web clients to receive
|
||||||
|
# push notifications directly without the need for an intermediary push
|
||||||
|
# gateway like Sygnal.
|
||||||
|
#
|
||||||
|
# https://github.com/matrix-org/matrix-spec-proposals/pull/4174
|
||||||
|
#
|
||||||
|
# env: CONTINUWUITY_EXPERIMENTS__MSC4174
|
||||||
|
#msc4174 = false
|
||||||
|
|
||||||
|
# MSC4406: `M_SENDER_IGNORED` error code
|
||||||
|
#
|
||||||
|
# Introduces a new error code that explicitly informs clients the reason
|
||||||
|
# they cannot access an event if it is sent by an ignored user. Without
|
||||||
|
# this proposal, clients will simply get a "not found" or "forbidden"
|
||||||
|
# error when requesting events sent by users that have been ignored, which
|
||||||
|
# leads to replies being shown as "this message could not be found".
|
||||||
|
# The new error code allows clients to distinguish unknown/forbidden
|
||||||
|
# events from ignored senders, allowing them to display an error message
|
||||||
|
# like "you have blocked this sender" instead.
|
||||||
|
#
|
||||||
|
# Requires a supporting client to be useful.
|
||||||
|
#
|
||||||
|
# https://github.com/matrix-org/matrix-spec-proposals/pull/4406
|
||||||
|
#
|
||||||
|
# env: CONTINUWUITY_EXPERIMENTS__MSC4406
|
||||||
|
#msc4406 = false
|
||||||
|
|
||||||
|
# MSC4484: Server Administration OAuth Scope
|
||||||
|
#
|
||||||
|
# Adds a new OAuth2 scope that explicitly grants a token temporary
|
||||||
|
# homeserver administrator privileges, granting temporary token access
|
||||||
|
# to administrator endpoints like locking & suspension.
|
||||||
|
#
|
||||||
|
# https://github.com/matrix-org/matrix-spec-proposals/pull/4484
|
||||||
|
#
|
||||||
|
# env: CONTINUWUITY_EXPERIMENTS__MSC4484
|
||||||
|
#msc4484 = false
|
||||||
|
|
||||||
|
# MSC4494: Membership-based invite blocking
|
||||||
|
#
|
||||||
|
# Adds a new invite blocking action that will reject all invites coming
|
||||||
|
# from users who do not share a room with the invitee that is not `public`
|
||||||
|
# (the join rule).
|
||||||
|
#
|
||||||
|
# This is not related to MSC4155, this proposal instead builds on the
|
||||||
|
# "invite blocking" proposal that landed in the specification in v1.17,
|
||||||
|
# which simply allows enabling or disabling invites altogether.
|
||||||
|
#
|
||||||
|
# MSC4494 is a good middle-ground between the allowlisting possible with
|
||||||
|
# MSC4155, and the general desire to block invites from users you may not
|
||||||
|
# know.
|
||||||
|
#
|
||||||
|
# Requires a supporting client to enable on an account.
|
||||||
|
#
|
||||||
|
# https://github.com/matrix-org/matrix-spec-proposals/pull/4494
|
||||||
|
#
|
||||||
|
# env: CONTINUWUITY_EXPERIMENTS__MSC4494
|
||||||
|
#msc4494 = false
|
||||||
|
|
||||||
|
# MSC4560: Stripped state requests over federation
|
||||||
|
#
|
||||||
|
# Implements a more efficient way for servers to acquire and serve
|
||||||
|
# "stripped state" to clients, which is typically only used for displaying
|
||||||
|
# rooms. The display of space hierarchies and room summaries is
|
||||||
|
# significantly faster when this proposal is enabled and used.
|
||||||
|
#
|
||||||
|
# https://github.com/matrix-org/matrix-spec-proposals/pull/4560
|
||||||
|
#
|
||||||
|
# env: CONTINUWUITY_EXPERIMENTS__MSC4560
|
||||||
|
#msc4560 = false
|
||||||
|
|
||||||
|
#[global.experiments.msc2815]
|
||||||
|
# MSC2815: Proposal to allow room moderators to view redacted event content
|
||||||
|
#
|
||||||
|
# Allows the server to retain unredacted copies of events that have been
|
||||||
|
# redacted for a limited period of time, which allows room moderators and
|
||||||
|
# server administrators to reveal redacted contents. Useful for moderation
|
||||||
|
# and investigating reports.
|
||||||
|
#
|
||||||
|
# Requires a supporting client to use.
|
||||||
|
#
|
||||||
|
# https://github.com/matrix-org/matrix-spec-proposals/pull/2815
|
||||||
|
|
||||||
|
|
||||||
|
# Whether to enable MSC2815.
|
||||||
|
#
|
||||||
|
# env: CONTINUWUITY_EXPERIMENTS__MSC2815__ENABLED
|
||||||
|
#enabled = false
|
||||||
|
|
||||||
|
# How long, in seconds, to retain the original content of redacted
|
||||||
|
# events before it is permanently erased. Defaults to 90 days.
|
||||||
|
#
|
||||||
|
# env: CONTINUWUITY_EXPERIMENTS__MSC2815__UNREDACTED_CONTENT_MAX_AGE_SECS
|
||||||
|
#unredacted_content_max_age_secs = 7776000
|
||||||
+5
-5
@@ -50,7 +50,7 @@ EOF
|
|||||||
|
|
||||||
# Developer tool versions
|
# Developer tool versions
|
||||||
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
|
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
|
||||||
ENV BINSTALL_VERSION=1.26.2
|
ENV BINSTALL_VERSION=1.28.0
|
||||||
# renovate: datasource=github-releases depName=psastras/sbom-rs
|
# renovate: datasource=github-releases depName=psastras/sbom-rs
|
||||||
ENV CARGO_SBOM_VERSION=0.9.1
|
ENV CARGO_SBOM_VERSION=0.9.1
|
||||||
# renovate: datasource=crate depName=lddtree
|
# renovate: datasource=crate depName=lddtree
|
||||||
@@ -167,8 +167,8 @@ ARG RUST_PROFILE=release
|
|||||||
ARG CARGO_FEATURES="default"
|
ARG CARGO_FEATURES="default"
|
||||||
|
|
||||||
# Build the binary
|
# Build the binary
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git/db \
|
--mount=type=cache,target=/usr/local/cargo/git/db,sharing=locked \
|
||||||
--mount=type=cache,target=/app/target,id=continuwuity-cargo-target-${TARGET_CPU}-${TARGETPLATFORM}-${RUST_PROFILE} \
|
--mount=type=cache,target=/app/target,id=continuwuity-cargo-target-${TARGET_CPU}-${TARGETPLATFORM}-${RUST_PROFILE} \
|
||||||
bash <<'EOF'
|
bash <<'EOF'
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -205,8 +205,8 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Generate Software Bill of Materials (SBOM)
|
# Generate Software Bill of Materials (SBOM)
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git/db \
|
--mount=type=cache,target=/usr/local/cargo/git/db,sharing=locked \
|
||||||
bash <<'EOF'
|
bash <<'EOF'
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
|||||||
@@ -1,11 +1,29 @@
|
|||||||
FROM ubuntu:latest
|
ARG CONTINUWUITY_IMAGE=continuwuity:latest-openreg
|
||||||
|
ARG BINARY_SOURCE=host
|
||||||
|
|
||||||
|
FROM ${CONTINUWUITY_IMAGE} AS container-binary
|
||||||
|
|
||||||
|
FROM scratch AS host-binary
|
||||||
|
ARG BINARY_PATH=target/debug/conduwuit
|
||||||
|
COPY ${BINARY_PATH} /sbin/conduwuit
|
||||||
|
|
||||||
|
FROM ubuntu:latest AS base
|
||||||
EXPOSE 8008
|
EXPOSE 8008
|
||||||
EXPOSE 8448
|
EXPOSE 8448
|
||||||
RUN apt-get update && apt-get install -y ca-certificates liburing2 && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y ca-certificates liburing2 && rm -rf /var/lib/apt/lists/*
|
||||||
RUN mkdir -p /etc/continuwuity /var/lib/continuwuity /usr/local/bin/
|
RUN mkdir -p /etc/continuwuity /var/lib/continuwuity /usr/local/bin/
|
||||||
COPY complement/complement-entrypoint.sh /usr/local/bin/complement-entrypoint.sh
|
COPY complement/complement-entrypoint.sh /usr/local/bin/complement-entrypoint.sh
|
||||||
COPY complement/complement.config.toml /etc/continuwuity/config.toml
|
COPY complement/complement.config.toml /etc/continuwuity/config.toml
|
||||||
COPY target/debug/conduwuit /usr/local/bin/conduwuit
|
RUN chmod +x /usr/local/bin/complement-entrypoint.sh
|
||||||
RUN chmod +x /usr/local/bin/conduwuit /usr/local/bin/complement-entrypoint.sh
|
|
||||||
#HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://localhost:8008/_continuwuity/server_version || exit 1
|
#HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://localhost:8008/_continuwuity/server_version || exit 1
|
||||||
ENTRYPOINT ["/usr/local/bin/complement-entrypoint.sh"]
|
ENTRYPOINT ["/usr/local/bin/complement-entrypoint.sh"]
|
||||||
|
|
||||||
|
FROM base AS container
|
||||||
|
COPY --from=container-binary /sbin/conduwuit /usr/local/bin/conduwuit
|
||||||
|
RUN chmod +x /usr/local/bin/conduwuit
|
||||||
|
|
||||||
|
FROM base AS host
|
||||||
|
COPY --from=host-binary /sbin/conduwuit /usr/local/bin/conduwuit
|
||||||
|
RUN chmod +x /usr/local/bin/conduwuit
|
||||||
|
|
||||||
|
FROM ${BINARY_SOURCE}
|
||||||
@@ -18,7 +18,7 @@ RUN --mount=type=cache,target=/etc/apk/cache apk add \
|
|||||||
|
|
||||||
# Developer tool versions
|
# Developer tool versions
|
||||||
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
|
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
|
||||||
ENV BINSTALL_VERSION=1.26.2
|
ENV BINSTALL_VERSION=1.28.0
|
||||||
# renovate: datasource=github-releases depName=psastras/sbom-rs
|
# renovate: datasource=github-releases depName=psastras/sbom-rs
|
||||||
ENV CARGO_SBOM_VERSION=0.9.1
|
ENV CARGO_SBOM_VERSION=0.9.1
|
||||||
# renovate: datasource=crate depName=lddtree
|
# renovate: datasource=crate depName=lddtree
|
||||||
@@ -120,8 +120,8 @@ ENV CONTINUWUITY_VERSION_EXTRA=$CONTINUWUITY_VERSION_EXTRA
|
|||||||
ARG RUST_PROFILE=release
|
ARG RUST_PROFILE=release
|
||||||
|
|
||||||
# Build the binary
|
# Build the binary
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git/db \
|
--mount=type=cache,target=/usr/local/cargo/git/db,sharing=locked \
|
||||||
--mount=type=cache,target=/app/target,id=continuwuity-cargo-target-${TARGET_CPU}-${TARGETPLATFORM}-musl-${RUST_PROFILE} \
|
--mount=type=cache,target=/app/target,id=continuwuity-cargo-target-${TARGET_CPU}-${TARGETPLATFORM}-musl-${RUST_PROFILE} \
|
||||||
bash <<'EOF'
|
bash <<'EOF'
|
||||||
set -o allexport
|
set -o allexport
|
||||||
@@ -143,8 +143,8 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Generate Software Bill of Materials (SBOM)
|
# Generate Software Bill of Materials (SBOM)
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git/db \
|
--mount=type=cache,target=/usr/local/cargo/git/db,sharing=locked \
|
||||||
bash <<'EOF'
|
bash <<'EOF'
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
mkdir /out/sbom
|
mkdir /out/sbom
|
||||||
|
|||||||
@@ -18,10 +18,5 @@
|
|||||||
"type": "file",
|
"type": "file",
|
||||||
"name": "testing",
|
"name": "testing",
|
||||||
"label": "Testing"
|
"label": "Testing"
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "file",
|
|
||||||
"name": "hot_reload",
|
|
||||||
"label": "Hot Reloading"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
# Hot Reloading ("Live" Development)
|
|
||||||
|
|
||||||
Note that hot reloading has not been refactored in quite a while and is not
|
|
||||||
guaranteed to work at this time.
|
|
||||||
|
|
||||||
### Summary
|
|
||||||
|
|
||||||
When developing in debug-builds with the nightly toolchain, Continuwuity is modular
|
|
||||||
using dynamic libraries and various parts of the application are hot-reloadable
|
|
||||||
while the server is running: http api handlers, admin commands, services,
|
|
||||||
database, etc. These are all split up into individual workspace crates as seen
|
|
||||||
in the `src/` directory. Changes to sourcecode in a crate rebuild that crate and
|
|
||||||
subsequent crates depending on it. Reloading then occurs for the changed crates.
|
|
||||||
|
|
||||||
Release builds still produce static binaries which are unaffected. Rust's
|
|
||||||
soundness guarantees are in full force. Thus you cannot hot-reload release
|
|
||||||
binaries.
|
|
||||||
|
|
||||||
### Requirements
|
|
||||||
|
|
||||||
Currently, this development setup only works on x86_64 and aarch64 Linux glibc.
|
|
||||||
[musl explicitly does not support hot reloadable libraries, and does not
|
|
||||||
implement `dlclose`][2]. macOS does not fully support our usage of `RTLD_GLOBAL`
|
|
||||||
possibly due to some thread-local issues. [This Rust issue][3] may be of
|
|
||||||
relevance, specifically [this comment][4]. It may be possible to get it working
|
|
||||||
on only very modern macOS versions such as at least Sonoma, as currently loading
|
|
||||||
dylibs is supported, but not unloading them in our setup, and the cited comment
|
|
||||||
mentions an Apple WWDC confirming there have been TLS changes to somewhat make
|
|
||||||
this possible.
|
|
||||||
|
|
||||||
As mentioned above this requires the nightly toolchain. This is due to reliance
|
|
||||||
on various Cargo.toml features that are only available on nightly, most
|
|
||||||
specifically `RUSTFLAGS` in Cargo.toml. Some of the implementation could also be
|
|
||||||
simpler based on other various nightly features. We hope lots of nightly
|
|
||||||
features start making it out of nightly sooner as there have been dozens of very
|
|
||||||
helpful features that have been stuck in nightly ("unstable") for at least 5+
|
|
||||||
years that would make this simpler. We encourage greater community consensus to
|
|
||||||
move these features into stability.
|
|
||||||
|
|
||||||
This currently only works on x86_64/aarch64 Linux with a glibc C library. musl C
|
|
||||||
library, macOS, and likely other host architectures are not supported (if other
|
|
||||||
architectures work, feel free to let us know and/or make a PR updating this).
|
|
||||||
This should work on GNU ld and lld (rust-lld) and gcc/clang, however if you
|
|
||||||
happen to have linker issues it's recommended to try using `mold` or `gold`
|
|
||||||
linkers, and please let us know in the [Continuwuity Matrix room][7] the linker
|
|
||||||
error and what linker solved this issue so we can figure out a solution. Ideally
|
|
||||||
there should be minimal friction to using this, and in the future a build script
|
|
||||||
(`build.rs`) may be suitable to making this easier to use if the capabilities
|
|
||||||
allow us.
|
|
||||||
|
|
||||||
### Usage
|
|
||||||
|
|
||||||
As of 19 May 2024, the instructions for using this are:
|
|
||||||
|
|
||||||
0. Have patience. Don't hesitate to join the [Continuwuity Matrix room][7] to
|
|
||||||
receive help using this. As indicated by the various rustflags used and some
|
|
||||||
of the interesting issues linked at the bottom, this is definitely not something
|
|
||||||
the Rust ecosystem or toolchain is used to doing.
|
|
||||||
|
|
||||||
1. Install the nightly toolchain using rustup. You may need to use `rustup
|
|
||||||
override set nightly` in your local Continuwuity directory, or use `cargo
|
|
||||||
+nightly` for all actions.
|
|
||||||
|
|
||||||
2. Uncomment `cargo-features` at the top level / root Cargo.toml
|
|
||||||
|
|
||||||
3. Scroll down to the `# Developer profile` section and uncomment ALL the
|
|
||||||
rustflags for each dev profile and their respective packages.
|
|
||||||
|
|
||||||
4. In each workspace crate's Cargo.toml (everything under `src/*` AND
|
|
||||||
`deps/rust-rocksdb/Cargo.toml`), uncomment the `dylib` crate type under
|
|
||||||
`[lib]`.
|
|
||||||
|
|
||||||
5. Due to [this rpath issue][5], you must export the `LD_LIBRARY_PATH`
|
|
||||||
environment variable to your nightly Rust toolchain library directory. If
|
|
||||||
using rustup (hopefully), use this: `export
|
|
||||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/`
|
|
||||||
|
|
||||||
6. Start the server. You can use `cargo +nightly run` for this along with the
|
|
||||||
standard.
|
|
||||||
|
|
||||||
7. Make some changes where you need to.
|
|
||||||
|
|
||||||
8. In a separate terminal window in the same directory (or using a terminal
|
|
||||||
multiplexer like tmux), run the *build* Cargo command `cargo +nightly build`.
|
|
||||||
Cargo should only rebuild what was changed / what's necessary, so it should
|
|
||||||
not be rebuilding all the crates.
|
|
||||||
|
|
||||||
9. In your Continuwuity server terminal, hit/send `CTRL+C` signal. This will tell
|
|
||||||
Continuwuity to find which libraries need to be reloaded, and reloads them as
|
|
||||||
necessary.
|
|
||||||
|
|
||||||
10. If there were no errors, it will tell you it successfully reloaded `#`
|
|
||||||
modules, and your changes should now be visible. Repeat 7 - 9 as needed.
|
|
||||||
|
|
||||||
To shutdown Continuwuity in this setup, hit/send `CTRL+\`. Normal builds still
|
|
||||||
shutdown with `CTRL+C` as usual.
|
|
||||||
|
|
||||||
Steps 1 - 5 are the initial first-time steps for using this. To remove the hot
|
|
||||||
reload setup, revert/comment all the Cargo.toml changes.
|
|
||||||
|
|
||||||
As mentioned in the requirements section, if you happen to have some linker
|
|
||||||
issues, try using the `-fuse-ld=` rustflag and specify mold or gold in all the
|
|
||||||
`rustflags` definitions in the top level Cargo.toml, and please let us know in
|
|
||||||
the [Continuwuity Matrix room][7] the problem. mold can be installed typically
|
|
||||||
through your distro, and gold is provided by the binutils package.
|
|
||||||
|
|
||||||
It's possible a helper script can be made to do all of this, or most preferably
|
|
||||||
a specially made build script (build.rs). `cargo watch` support will be
|
|
||||||
implemented soon which will eliminate the need to manually run `cargo build` all
|
|
||||||
together.
|
|
||||||
|
|
||||||
### Addendum
|
|
||||||
|
|
||||||
Conduit was inherited as a single crate without modularity or reloading in its
|
|
||||||
design. Reasonable partitioning and abstraction allowed a split into several
|
|
||||||
crates, though many circular dependencies had to be corrected. The resulting
|
|
||||||
crates now form a directed graph as depicted in figures below. The interfacing
|
|
||||||
between these crates is still extremely broad which is not mitigable.
|
|
||||||
|
|
||||||
Initially [hot_lib_reload][6] was investigated but found appropriate for a
|
|
||||||
project designed with modularity through limited interfaces, not a large and
|
|
||||||
complex existing codebase. Instead a bespoke solution built directly on
|
|
||||||
[libloading][8] satisfied our constraints. This required relatively minimal
|
|
||||||
modifications and zero maintenance burden compared to what would be required
|
|
||||||
otherwise. The technical difference lies with relocation processing: we leverage
|
|
||||||
global bindings (`RTLD_GLOBAL`) in a very intentional way. Most libraries and
|
|
||||||
off-the-shelf module systems (such as [hot_lib_reload][6]) restrict themselves
|
|
||||||
to local bindings (`RTLD_LOCAL`). This allows them to release software to
|
|
||||||
multiple platforms with much greater consistency, but at the cost of burdening
|
|
||||||
applications to explicitly manage these bindings. In our case with an optional
|
|
||||||
feature for developers, we shrug any such requirement to enjoy the cost/benefit
|
|
||||||
on platforms where global relocations are properly cooperative.
|
|
||||||
|
|
||||||
To make use of `RTLD_GLOBAL` the application has to be oriented as a directed
|
|
||||||
acyclic graph. The primary rule is simple and illustrated in the figure below:
|
|
||||||
**no crate is allowed to call a function or use a variable from a crate below
|
|
||||||
it.**
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
When a symbol is referenced between crates they become bound: **crates cannot be
|
|
||||||
unloaded until their calling crates are first unloaded.** Thus we start the
|
|
||||||
reloading process from the crate which has no callers. There is a small problem
|
|
||||||
though: the first crate is called by the base executable itself! This is solved
|
|
||||||
by using an `RTLD_LOCAL` binding for just one link between the main executable
|
|
||||||
and the first crate, freeing the executable from all modules as no global
|
|
||||||
binding ever occurs between them.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Proper resource management is essential for reliable reloading to occur. This is
|
|
||||||
a very basic ask in RAII-idiomatic Rust and the exposure to reloading hazards is
|
|
||||||
remarkably low, generally stemming from poor patterns and practices.
|
|
||||||
Unfortunately static analysis doesn't enforce reload-safety programmatically
|
|
||||||
(though it could one day), for now hazards can be avoided by knowing a few basic
|
|
||||||
do's and dont's:
|
|
||||||
|
|
||||||
1. Understand that code is memory. Just like one is forbidden from referencing
|
|
||||||
free'd memory, one must not transfer control to free'd code. Exposure to this
|
|
||||||
is primarily from two things:
|
|
||||||
|
|
||||||
- Callbacks, which this project makes very little use of.
|
|
||||||
- Async tasks, which are addressed below.
|
|
||||||
|
|
||||||
2. Tie all resources to a scope or object lifetime with greatest possible
|
|
||||||
symmetry (locality). For our purposes this applies to code resources, which
|
|
||||||
means async blocks and tokio tasks.
|
|
||||||
|
|
||||||
- **Never spawn a task without receiving and storing its JoinHandle**.
|
|
||||||
- **Always wait on join handles** before leaving a scope or in another cleanup
|
|
||||||
function called by an owning scope.
|
|
||||||
|
|
||||||
3. Know any minor specific quirks documented in code or here:
|
|
||||||
|
|
||||||
- Don't use `tokio::spawn`, instead use our `Handle` in `core/server.rs`, which
|
|
||||||
is reachable in most of the codebase via `services()` or other state. This is
|
|
||||||
due to some bugs or assumptions made in tokio, as it happens in `unsafe {}`
|
|
||||||
blocks, which are mitigated by circumventing some thread-local variables. Using
|
|
||||||
runtime handles is good practice in any case.
|
|
||||||
|
|
||||||
The initial implementation PR is available [here][1].
|
|
||||||
|
|
||||||
### Interesting related issues/bugs
|
|
||||||
|
|
||||||
- [DT_RUNPATH produced in binary with rpath = true is wrong (cargo)][5]
|
|
||||||
- [Disabling MIR Optimization in Rust Compilation
|
|
||||||
(cargo)](https://internals.rust-lang.org/t/disabling-mir-optimization-in-rust-compilation/19066/5)
|
|
||||||
- [Workspace-level metadata
|
|
||||||
(cargo-deb)](https://github.com/kornelski/cargo-deb/issues/68)
|
|
||||||
|
|
||||||
[1]: https://forgejo.ellis.link/continuwuation/continuwuity/pulls/387
|
|
||||||
[2]: https://wiki.musl-libc.org/functional-differences-from-glibc.html#Unloading-libraries
|
|
||||||
[3]: https://github.com/rust-lang/rust/issues/28794
|
|
||||||
[4]: https://github.com/rust-lang/rust/issues/28794#issuecomment-368693049
|
|
||||||
[5]: https://github.com/rust-lang/cargo/issues/12746
|
|
||||||
[6]: https://crates.io/crates/hot-lib-reloader/
|
|
||||||
[7]: https://matrix.to/#/#continuwuity:continuwuity.org?via=continuwuity.org&via=ellis.link&via=explodie.org&via=matrix.org
|
|
||||||
[8]: https://crates.io/crates/libloading
|
|
||||||
@@ -37,13 +37,6 @@ It is highly unlikely you will ever need to add a new workspace member, but if
|
|||||||
you truly find yourself needing to, we recommend reaching out to us in the
|
you truly find yourself needing to, we recommend reaching out to us in the
|
||||||
Matrix room for discussions about it beforehand.
|
Matrix room for discussions about it beforehand.
|
||||||
|
|
||||||
The primary inspiration for this design was apart of hot reloadable development,
|
|
||||||
to support "Continuwuity as a library" where specific parts can simply be
|
|
||||||
swapped out. There is evidence Conduit wanted to go this route too as `axum` is
|
|
||||||
technically an optional feature in Conduit, and can be compiled without the
|
|
||||||
binary or axum library for handling inbound web requests; but it was never
|
|
||||||
completed or worked.
|
|
||||||
|
|
||||||
See the Rust documentation on [Workspaces][workspaces] for general questions and
|
See the Rust documentation on [Workspaces][workspaces] for general questions and
|
||||||
information on Cargo workspaces.
|
information on Cargo workspaces.
|
||||||
|
|
||||||
@@ -84,8 +77,9 @@ All forked dependencies are maintained under the
|
|||||||
- [rocksdb][continuwuation-rocksdb] - Fork of [facebook/rocksdb][rocksdb] via
|
- [rocksdb][continuwuation-rocksdb] - Fork of [facebook/rocksdb][rocksdb] via
|
||||||
[`@zaidoon1`][8] with liburing build fixes and GCC debug build fixes
|
[`@zaidoon1`][8] with liburing build fixes and GCC debug build fixes
|
||||||
- [jemallocator][continuwuation-jemallocator] - Fork of
|
- [jemallocator][continuwuation-jemallocator] - Fork of
|
||||||
[tikv/jemallocator][jemallocator] fixing musl builds, suspicious code, and
|
[tikv/jemallocator][jemallocator] fixing musl builds and using jemalloc's
|
||||||
adding support for redzones in Valgrind
|
`*x` APIs consistently in `GlobalAlloc` to avoid interposer/Valgrind
|
||||||
|
mismatches
|
||||||
- [rustyline-async][continuwuation-rustyline-async] - Fork of
|
- [rustyline-async][continuwuation-rustyline-async] - Fork of
|
||||||
[zyansheep/rustyline-async][rustyline-async] with tab completion callback and
|
[zyansheep/rustyline-async][rustyline-async] with tab completion callback and
|
||||||
`CTRL+\` signal quit event for Continuwuity console CLI
|
`CTRL+\` signal quit event for Continuwuity console CLI
|
||||||
|
|||||||
@@ -20,6 +20,20 @@ docker build -t continuwuity:complement -f docker/complement.Dockerfile .
|
|||||||
The `openreg` feature is required: without it the server refuses the open
|
The `openreg` feature is required: without it the server refuses the open
|
||||||
registrations Complement uses to create test users, and almost every test fails.
|
registrations Complement uses to create test users, and almost every test fails.
|
||||||
|
|
||||||
|
On non-Linux (or to build inside a container instead of on the host), build the Continuwuity image with the `openreg` feature and `RUST_PROFILE=dev` first (open
|
||||||
|
registration is only enabled when `debug_assertions` are active), then build
|
||||||
|
the Complement image using the `container` target:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker buildx build --load -t continuwuity:latest-openreg --build-arg RUST_PROFILE=dev --build-arg CARGO_FEATURES=default,openreg -f docker/Dockerfile .
|
||||||
|
docker build -t continuwuity:complement --target container -f docker/complement.Dockerfile .
|
||||||
|
./bin/complement
|
||||||
|
```
|
||||||
|
|
||||||
|
Pass `--build-arg CONTINUWUITY_IMAGE=your-image:tag` when building
|
||||||
|
`docker/complement.Dockerfile` if your Continuwuity container image uses a
|
||||||
|
different tag.
|
||||||
|
|
||||||
The run can take up to an hour. The runner writes the full Go test stream to
|
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
|
`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
|
summary to `tests/test_results/complement/test_results.jsonl`. It exits nonzero
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
# Unstable features policy
|
||||||
|
|
||||||
|
Like several other homeservers in the Matrix ecosystem, Continuwuity adopts a "disable by default"
|
||||||
|
approach to experimental features. This ensures every deployment gets the same baseline stability,
|
||||||
|
allowing users to opt in to potentially unstable features.
|
||||||
|
|
||||||
|
Historically, Continuwuity used maintainer discretion to decide whether an unstable feature should
|
||||||
|
be enabled by default. However, as the project has grown, and the pace of spec development has
|
||||||
|
increased, keeping up with unstable proposals becomes less and less feasible by the day, and this
|
||||||
|
causes the implementation of unstable proposals to gradually drift. This can lead to implementations
|
||||||
|
becoming so stale they're incompatible, with no bandwidth to get them fixed up.
|
||||||
|
|
||||||
|
Continuwuity is already selective about which unstable features it implements: the maintainer team
|
||||||
|
typically only accept implementations of proposals that seem like they are a net positive for a
|
||||||
|
large portion of the Matrix ecosystem, rather than aiming to "implement everything". As such, the
|
||||||
|
unstable feature list should typically be small and manageable.
|
||||||
|
|
||||||
|
**All** unstable proposals require an experiment before their implementation can be accepted.
|
||||||
|
Likewise, all experiments should default to being disabled, requiring explicit configuration to
|
||||||
|
enable.
|
||||||
|
|
||||||
|
**Draft proposals** will not be merged until their proposal is undrafted. Likewise, the pull request
|
||||||
|
that implements the draft proposal should itself be marked "WIP", to avoid being merged or
|
||||||
|
prioritised for review. Review is still possible for WIP PRs, so feel free to request a round of
|
||||||
|
feedback.
|
||||||
|
|
||||||
|
## Adding an unstable feature
|
||||||
|
|
||||||
|
First, navigate to `src/core/config/experiments.rs`. There, you have two options for adding an
|
||||||
|
experiment to the `Experiments` struct:
|
||||||
|
|
||||||
|
1. Use `SimpleExperiment` if the experiment only requires enabling with no further configuration.
|
||||||
|
2. Define a new struct that implements the `ToggledExperiment` trait.
|
||||||
|
|
||||||
|
All experiments must be optional and default to off (i.e. `is_enabled()` returns `false`).
|
||||||
|
`SimpleExperiment` is actually a wrapper around `Option<bool>`, and the omission of the
|
||||||
|
configuration OR setting it to `false` disables the experiment. `ToggledExperiment` impls should
|
||||||
|
copy similar behaviour.
|
||||||
|
|
||||||
|
Then, add a public field to the `Experiments` struct that is named the MSC's ID in lowercase.
|
||||||
|
Add a docstring to it, starting with the proposal title (including ID), then a brief paragraph or
|
||||||
|
so explaining what the proposal does in simple terms, and then finally end the docstring with a link
|
||||||
|
to the proposal.
|
||||||
|
|
||||||
|
### Advertising support for unstable features
|
||||||
|
|
||||||
|
If the proposal requires advertising an unstable feature flag, that flag must be added to
|
||||||
|
`unstable_features` in `src/core/matrix/versions.rs`. For example:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
pub fn unstable_features(experiments: &Experiments) -> BTreeMap<String, bool> {
|
||||||
|
BTreeMap::from_iter([
|
||||||
|
// Always enabled feature (https://github.com/matrix-org/matrix-spec-proposals/pull/0000)
|
||||||
|
// Expected for spec v1.20
|
||||||
|
("org.matrix.msc0000".to_owned(), true),
|
||||||
|
+ // MSC9999: My Cool Feature (https://github.com/matrix-org/matrix-spec-proposals/pull/9999)
|
||||||
|
+ ("example.matrix.msc9999".to_owned(), experiments.msc9999.is_enabled())
|
||||||
|
])
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This will allow the `/_matrix/client/versions` endpoint to dynamically advertise whether the unstable
|
||||||
|
feature is enabled on the current server.
|
||||||
|
|
||||||
|
## Removing unstable features
|
||||||
|
|
||||||
|
If a proposal is abandoned, becomes obsolete, or is accepted into the specification, the unstable
|
||||||
|
configuration should be removed (and possibly migrated) as soon as possible.
|
||||||
|
|
||||||
|
After removing a field from `experiments`, the key should be added to the `DEPRECATED_KEYS` slice in
|
||||||
|
`src/core/config/mod.rs` (really far down). This will ensure that a warning is printed on startup
|
||||||
|
when a configuration is using a now-removed config key. For example:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
pub struct Experiments {
|
||||||
|
- pub msc9999: SimpleExperiment,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
```diff
|
||||||
|
const DEPRECATED_KEYS: &[&str] = [
|
||||||
|
"foo",
|
||||||
|
+ "experiments.msc9999",
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
## Always-on experiments
|
||||||
|
|
||||||
|
Some experiments can be forcefully enabled (i.e. always-on), or enabled by default. This should only
|
||||||
|
be the case in exceptional circumstances, and must be adequately well documented. Some examples of
|
||||||
|
situations that may warrant an experiment being always-enabled:
|
||||||
|
|
||||||
|
* A proposal was implemented AFTER it was merged, but BEFORE it had a merged spec PR.
|
||||||
|
These proposals are typically as stable as they'll get, as major changes post-factum of an MSC
|
||||||
|
merge requires another MSC, so only minor changes can be made in the spec PR phase.
|
||||||
|
* The daily experience of users would be at a great detriment without the experiment being enabled.
|
||||||
|
* A proposal is so simple that making it opt-in would be pointless. This is *incredibly* rare.
|
||||||
|
|
||||||
|
The latter two require explicit maintainer approval, so discuss those with the maintainer team
|
||||||
|
first. You can exercise your own judgement for the first.
|
||||||
|
|
||||||
|
Always-on or enabled-by-default experiments must explain in detail why they're exempt from the
|
||||||
|
standard experiments policy via comments in surrounding areas, like
|
||||||
|
`src/core/config/experiments.rs` and `src/core/matrix/versions.rs`. Ideally, these features are not
|
||||||
|
unstable for too long, so explaining a timescale for how long before the feature is stabilised is
|
||||||
|
also helpful.
|
||||||
@@ -71,6 +71,9 @@ Names below are as they appear in Prometheus. OTLP uses the dotted OpenTelemetry
|
|||||||
| `continuwuity_sender_events_total` | counter | `destination`, `kind`, `outcome` | PDUs and EDUs sent in outgoing transactions |
|
| `continuwuity_sender_events_total` | counter | `destination`, `kind`, `outcome` | PDUs and EDUs sent in outgoing transactions |
|
||||||
| `continuwuity_sender_events_queued_total` | counter | `destination`, `kind` | PDUs and EDUs queued for sending |
|
| `continuwuity_sender_events_queued_total` | counter | `destination`, `kind` | PDUs and EDUs queued for sending |
|
||||||
| `continuwuity_sender_queue_depth` | gauge | | Messages waiting for the sender workers |
|
| `continuwuity_sender_queue_depth` | gauge | | Messages waiting for the sender workers |
|
||||||
|
| `continuwuity_sender_requests` | gauge | `state` | Estimated outgoing requests stored as `queued` or `active` (in flight) |
|
||||||
|
| `continuwuity_sender_workers` | gauge | | Running sender workers; below the configured count means a worker is restarting |
|
||||||
|
| `continuwuity_sender_panics_total` | counter | `scope` | Panics caught in a single outgoing `transaction` or a whole sender `worker` |
|
||||||
| `continuwuity_users` | gauge | `origin` | Known `local` users, including deactivated, and `remote` users |
|
| `continuwuity_users` | gauge | `origin` | Known `local` users, including deactivated, and `remote` users |
|
||||||
| `continuwuity_invites_total` | counter | `direction`, `destination`, `outcome` | Invites sent by local users or received over federation |
|
| `continuwuity_invites_total` | counter | `direction`, `destination`, `outcome` | Invites sent by local users or received over federation |
|
||||||
| `continuwuity_media_write_size_bytes` | histogram | `origin` | Media files written, from local uploads or cached remote media |
|
| `continuwuity_media_write_size_bytes` | histogram | `origin` | Media files written, from local uploads or cached remote media |
|
||||||
@@ -82,6 +85,7 @@ Names below are as they appear in Prometheus. OTLP uses the dotted OpenTelemetry
|
|||||||
| `continuwuity_database_block_cache_bytes` | gauge | `column` | RocksDB block cache usage |
|
| `continuwuity_database_block_cache_bytes` | gauge | `column` | RocksDB block cache usage |
|
||||||
| `continuwuity_cache_entries` | gauge | `name` | Entries in the auth chain and state info caches |
|
| `continuwuity_cache_entries` | gauge | `name` | Entries in the auth chain and state info caches |
|
||||||
| `continuwuity_jemalloc_memory_bytes` | gauge | `kind` | jemalloc statistics, only with the `jemalloc_stats` feature |
|
| `continuwuity_jemalloc_memory_bytes` | gauge | `kind` | jemalloc statistics, only with the `jemalloc_stats` feature |
|
||||||
|
| `continuwuity_mimalloc_memory_bytes` | gauge | `kind` | mimalloc statistics, only with the `mimalloc` feature |
|
||||||
| `process_uptime_seconds` | gauge | | Time since the server started |
|
| `process_uptime_seconds` | gauge | | Time since the server started |
|
||||||
| `process_cpu_time_seconds_total` | counter | `cpu_mode` | CPU time used by the process |
|
| `process_cpu_time_seconds_total` | counter | `cpu_mode` | CPU time used by the process |
|
||||||
| `process_memory_usage_bytes` | gauge | | Resident memory (Linux) |
|
| `process_memory_usage_bytes` | gauge | | Resident memory (Linux) |
|
||||||
|
|||||||
@@ -90,6 +90,13 @@ Our source code and mirrors can be accessed through these buttons:
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Our documentation is proudly hosted on Grebedoc.
|
||||||
|
<div className="no-zoom" align="center">
|
||||||
|
<a href="https://grebedoc.dev">
|
||||||
|
<img src="https://grebedoc.dev/88x31-homu.gif" alt="served by Grebedoc" style={{imageRendering:"pixelated"}}/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
[forge-badge]: https://img.shields.io/badge/Ellis%20Git-main+packages-green?style=flat&logo=forgejo&labelColor=fff
|
[forge-badge]: https://img.shields.io/badge/Ellis%20Git-main+packages-green?style=flat&logo=forgejo&labelColor=fff
|
||||||
[forge-link]: https://forgejo.ellis.link/continuwuation/continuwuity
|
[forge-link]: https://forgejo.ellis.link/continuwuation/continuwuity
|
||||||
[forge-releases-badge]: https://forgejo.ellis.link/continuwuation/continuwuity/badges/release.svg?style=flat&label=Latest%20release&labelColor=fff&color=green
|
[forge-releases-badge]: https://forgejo.ellis.link/continuwuation/continuwuity/badges/release.svg?style=flat&label=Latest%20release&labelColor=fff&color=green
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
/.well-known/matrix/*
|
/.well-known/matrix/*
|
||||||
Access-Control-Allow-Origin: *
|
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
/.well-known/continuwuity/*
|
/.well-known/continuwuity/*
|
||||||
Access-Control-Allow-Origin: *
|
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
@@ -302,7 +302,7 @@
|
|||||||
"type": "prometheus",
|
"type": "prometheus",
|
||||||
"uid": "${datasource}"
|
"uid": "${datasource}"
|
||||||
},
|
},
|
||||||
"expr": "histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval])))",
|
"expr": "histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{instance=~\"$instance\",http_route!~\".*/sync\"}[$__rate_interval])))",
|
||||||
"legendFormat": "",
|
"legendFormat": "",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
"range": true
|
"range": true
|
||||||
@@ -496,7 +496,7 @@
|
|||||||
"type": "prometheus",
|
"type": "prometheus",
|
||||||
"uid": "${datasource}"
|
"uid": "${datasource}"
|
||||||
},
|
},
|
||||||
"expr": "histogram_quantile(0.5, sum by (le) (rate(http_server_request_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval])))",
|
"expr": "histogram_quantile(0.5, sum by (le) (rate(http_server_request_duration_seconds_bucket{instance=~\"$instance\",http_route!~\".*/sync\"}[$__rate_interval])))",
|
||||||
"legendFormat": "p50",
|
"legendFormat": "p50",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
"range": true
|
"range": true
|
||||||
@@ -506,7 +506,7 @@
|
|||||||
"type": "prometheus",
|
"type": "prometheus",
|
||||||
"uid": "${datasource}"
|
"uid": "${datasource}"
|
||||||
},
|
},
|
||||||
"expr": "histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval])))",
|
"expr": "histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{instance=~\"$instance\",http_route!~\".*/sync\"}[$__rate_interval])))",
|
||||||
"legendFormat": "p95",
|
"legendFormat": "p95",
|
||||||
"refId": "B",
|
"refId": "B",
|
||||||
"range": true
|
"range": true
|
||||||
@@ -516,7 +516,7 @@
|
|||||||
"type": "prometheus",
|
"type": "prometheus",
|
||||||
"uid": "${datasource}"
|
"uid": "${datasource}"
|
||||||
},
|
},
|
||||||
"expr": "histogram_quantile(0.99, sum by (le) (rate(http_server_request_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval])))",
|
"expr": "histogram_quantile(0.99, sum by (le) (rate(http_server_request_duration_seconds_bucket{instance=~\"$instance\",http_route!~\".*/sync\"}[$__rate_interval])))",
|
||||||
"legendFormat": "p99",
|
"legendFormat": "p99",
|
||||||
"refId": "C",
|
"refId": "C",
|
||||||
"range": true
|
"range": true
|
||||||
@@ -1228,7 +1228,7 @@
|
|||||||
{
|
{
|
||||||
"type": "timeseries",
|
"type": "timeseries",
|
||||||
"title": "PDU lag",
|
"title": "PDU lag",
|
||||||
"description": "Time between an accepted PDU's origin_server_ts and its arrival; affected by clock skew",
|
"description": "Time between an accepted PDU's origin_server_ts and its transaction arriving; affected by clock skew",
|
||||||
"id": 21,
|
"id": 21,
|
||||||
"datasource": {
|
"datasource": {
|
||||||
"type": "prometheus",
|
"type": "prometheus",
|
||||||
|
|||||||
@@ -36,10 +36,6 @@ List database backups
|
|||||||
|
|
||||||
Send a message to the admin room
|
Send a message to the admin room
|
||||||
|
|
||||||
## `!admin server reload`
|
|
||||||
|
|
||||||
Hot-reload the server
|
|
||||||
|
|
||||||
## `!admin server restart`
|
## `!admin server restart`
|
||||||
|
|
||||||
Restart the server
|
Restart the server
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
module forgejo.ellis.link/continuwuation/continuwuity
|
||||||
|
|
||||||
|
go 1.27
|
||||||
|
|
||||||
|
toolchain go1.27.4
|
||||||
|
|
||||||
|
tool codeberg.org/git-pages/git-pages-cli
|
||||||
|
|
||||||
|
require (
|
||||||
|
codeberg.org/git-pages/git-pages-cli v1.13.2 // indirect
|
||||||
|
codeberg.org/git-pages/go-redirects v1.0.0 // indirect
|
||||||
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
|
github.com/klauspost/compress v1.20.4 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/spf13/pflag v1.1.0 // indirect
|
||||||
|
golang.org/x/net v0.62.0 // indirect
|
||||||
|
golang.org/x/text v0.43.0 // indirect
|
||||||
|
)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
codeberg.org/git-pages/git-pages-cli v1.13.2 h1:ZEp6q939eTmB4GcZgnPQVm4Ml2BFaF2GOJgpCNhSha8=
|
||||||
|
codeberg.org/git-pages/git-pages-cli v1.13.2/go.mod h1:hWoewK332MgUQuOMt5O07lFTjs3l3kUywxIFs90W3IY=
|
||||||
|
codeberg.org/git-pages/go-redirects v1.0.0 h1:RfrPwtk60ii5JyQgH1XkUmsUrTqPjwvbqy3CGapPVwA=
|
||||||
|
codeberg.org/git-pages/go-redirects v1.0.0/go.mod h1:0zdliclTux3tFONB7E6ZWV7WoWrK7cXHIi2hrMcLf8g=
|
||||||
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/klauspost/compress v1.20.4 h1:dD0v/bvxtjCBqQu6sx1TNWkalEY5lNTIe+HY9w8TeNI=
|
||||||
|
github.com/klauspost/compress v1.20.4/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
|
||||||
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/spf13/pflag v1.1.0 h1:6W6MbVUrnMb8PEhjkqwsVLY7ryuzRfFHF4mQd7L94ag=
|
||||||
|
github.com/spf13/pflag v1.1.0/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||||
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk=
|
||||||
|
github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk=
|
||||||
|
golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY=
|
||||||
|
golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI=
|
||||||
|
golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc=
|
||||||
|
golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
LD_LIBRARY_PATH = lib.makeLibraryPath (
|
LD_LIBRARY_PATH = lib.makeLibraryPath (
|
||||||
[
|
[
|
||||||
pkgs.stdenv.cc.cc.lib
|
pkgs.stdenv.cc.cc.lib
|
||||||
|
pkgs.llvmPackages.libclang.lib
|
||||||
]
|
]
|
||||||
++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [
|
++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [
|
||||||
pkgs.liburing
|
pkgs.liburing
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@
|
|||||||
target:
|
target:
|
||||||
target.fromToolchainName {
|
target.fromToolchainName {
|
||||||
name = (lib.importTOML "${inputs.self}/rust-toolchain.toml").toolchain.channel;
|
name = (lib.importTOML "${inputs.self}/rust-toolchain.toml").toolchain.channel;
|
||||||
sha256 = "sha256-+xUr6Al1wZSqX8aEsq7DpuFOK4Ve/i+qTl+K5uWQ9GM=";
|
sha256 = "sha256-MFHoWVcPZKjFrLnQnodCXbUsfZcofGfo9tV9fTTvklg=";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
Generated
+256
-194
@@ -11,26 +11,26 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rspress/core": "^2.0.0",
|
"@rspress/core": "^2.0.0",
|
||||||
"@rspress/plugin-client-redirects": "^2.0.0",
|
"@rspress/plugin-client-redirects": "^2.0.0",
|
||||||
"@rspress/plugin-sitemap": "^2.0.0",
|
"@types/node": "^26.6.7",
|
||||||
"typescript": "^7.0.0"
|
"typescript": "^7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/core": {
|
"node_modules/@emnapi/core": {
|
||||||
"version": "1.11.3",
|
"version": "2.0.0-beta.3",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.3.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-beta.3.tgz",
|
||||||
"integrity": "sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg==",
|
"integrity": "sha512-KA+gOBtbifRATmUa/Gpf5C2B2EJ0r4brHUT3XSgACeHREcuiObXH56xd+B3fFsEFbUT04VBEe6MuZiCtMp0tQg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emnapi/wasi-threads": "1.2.3",
|
"@emnapi/wasi-threads": "2.2.0",
|
||||||
"tslib": "^2.4.0"
|
"tslib": "^2.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/runtime": {
|
"node_modules/@emnapi/runtime": {
|
||||||
"version": "1.11.3",
|
"version": "2.0.0-beta.3",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-beta.3.tgz",
|
||||||
"integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==",
|
"integrity": "sha512-ayb/PyyLzpwRyFVxeC0uoEHu59QlB1iWGcGsOpXQcaB/Dc+uGfBmNmpCHp3HmTT0t8lSsMmg3j7+tdJW/TlHjQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/wasi-threads": {
|
"node_modules/@emnapi/wasi-threads": {
|
||||||
"version": "1.2.3",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.2.0.tgz",
|
||||||
"integrity": "sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g==",
|
"integrity": "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
@@ -106,33 +106,36 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@napi-rs/wasm-runtime": {
|
"node_modules/@napi-rs/wasm-runtime": {
|
||||||
"version": "1.1.6",
|
"version": "1.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.7.tgz",
|
||||||
"integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==",
|
"integrity": "sha512-zJccwplOAbgfZju95IUHazLnx9RAPtPN2YGJXI6UbrgeaR9QfPjGrQL6ERkSAtnVCA4Q+83ApGyaX5zdpCaKkQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tybys/wasm-util": "^0.10.3"
|
"@tybys/wasm-util": "^0.10.3"
|
||||||
},
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^20.19.0 || ^22.13.0 || >=23.5.0"
|
||||||
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@emnapi/core": "^1.7.1",
|
"@emnapi/core": "^1.7.1 || 2.0.0-beta.2 || 2.0.0-beta.3",
|
||||||
"@emnapi/runtime": "^1.7.1"
|
"@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2 || 2.0.0-beta.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rsbuild/core": {
|
"node_modules/@rsbuild/core": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rsbuild/core/-/core-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rsbuild/core/-/core-2.3.4.tgz",
|
||||||
"integrity": "sha512-dv5tL7djb8ex5z4sqnDmUbd5PnGNr/CXuFfiMD4RkUsF1JEZZkGH8lc+QW4fqYQIHM7RTvcMUakgvwVU/O9WMw==",
|
"integrity": "sha512-1P3nLh/uXOcNTJZxvymRzAmuz8SBiCqY2InliNxQTlS0mWtoXbrRBC/W7zfv3MATk/vPmzODAYoZ5oIULk3Ilg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rspack/core": "~2.3.1",
|
"@rspack/core": "~2.3.4",
|
||||||
"@swc/helpers": "^0.5.23"
|
"@swc/helpers": "^0.5.24"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"rsbuild": "bin/rsbuild.js"
|
"rsbuild": "bin/rsbuild.js"
|
||||||
@@ -169,32 +172,32 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding": {
|
"node_modules/@rspack/binding": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-2.3.4.tgz",
|
||||||
"integrity": "sha512-pfCJGBFNK2tnNnoDP6ZoTbOjxbKr1U2eGFDJ8bIuZQai4FBNhWQlKFmNup+X5K935XYRulZBomIBAL6GL6W2YQ==",
|
"integrity": "sha512-wSOT16LVITL/IKeIiLXgN5Q5jZIDqnQ7Gmk+wzKOSZ6OHYNfEBXAKhSJuYtCBq8ovJuGl8cJjdqatAlHE5XKIA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@rspack/binding-darwin-arm64": "2.3.1",
|
"@rspack/binding-darwin-arm64": "2.3.4",
|
||||||
"@rspack/binding-darwin-x64": "2.3.1",
|
"@rspack/binding-darwin-x64": "2.3.4",
|
||||||
"@rspack/binding-linux-arm64-gnu": "2.3.1",
|
"@rspack/binding-linux-arm64-gnu": "2.3.4",
|
||||||
"@rspack/binding-linux-arm64-musl": "2.3.1",
|
"@rspack/binding-linux-arm64-musl": "2.3.4",
|
||||||
"@rspack/binding-linux-ppc64-gnu": "2.3.1",
|
"@rspack/binding-linux-ppc64-gnu": "2.3.4",
|
||||||
"@rspack/binding-linux-riscv64-gnu": "2.3.1",
|
"@rspack/binding-linux-riscv64-gnu": "2.3.4",
|
||||||
"@rspack/binding-linux-riscv64-musl": "2.3.1",
|
"@rspack/binding-linux-riscv64-musl": "2.3.4",
|
||||||
"@rspack/binding-linux-s390x-gnu": "2.3.1",
|
"@rspack/binding-linux-s390x-gnu": "2.3.4",
|
||||||
"@rspack/binding-linux-x64-gnu": "2.3.1",
|
"@rspack/binding-linux-x64-gnu": "2.3.4",
|
||||||
"@rspack/binding-linux-x64-musl": "2.3.1",
|
"@rspack/binding-linux-x64-musl": "2.3.4",
|
||||||
"@rspack/binding-wasm32-wasi": "2.3.1",
|
"@rspack/binding-wasm32-wasi": "2.3.4",
|
||||||
"@rspack/binding-win32-arm64-msvc": "2.3.1",
|
"@rspack/binding-win32-arm64-msvc": "2.3.4",
|
||||||
"@rspack/binding-win32-ia32-msvc": "2.3.1",
|
"@rspack/binding-win32-ia32-msvc": "2.3.4",
|
||||||
"@rspack/binding-win32-x64-msvc": "2.3.1"
|
"@rspack/binding-win32-x64-msvc": "2.3.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-darwin-arm64": {
|
"node_modules/@rspack/binding-darwin-arm64": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-2.3.4.tgz",
|
||||||
"integrity": "sha512-koLyL2r8PUcLD0StjuZ/n5XM6GJ0C8dzJN0IuIV9d7nQcibJxwjjSAWEPGVz6bm8WuzypvuVKNoa1+GGAHeMQA==",
|
"integrity": "sha512-eBD71fbmoJKnxcHD03bukbAIOP5r7nD0Ehs+mUrUQlZ6N53EhuJsTeJ1oYdg5L4GoSeQ+KecCqME81Nm0COLrA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -206,9 +209,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-darwin-x64": {
|
"node_modules/@rspack/binding-darwin-x64": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-2.3.4.tgz",
|
||||||
"integrity": "sha512-YK39JLiu1YC6+3BMxkP7e848pHD7e2T/0OSNogDi7whfiZNg95wa9Ncd7I5ppAf0nhmV+FNew/sCBIFp5h67Jw==",
|
"integrity": "sha512-CqdfzTLPVFQCniOy/GDVWbg+rqg31qfdzbFf8NYCzdDkCQg+p15hU2HsckD/1sLsaNB8Y55EjGz4ZyGDny0cHg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -220,13 +223,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-linux-arm64-gnu": {
|
"node_modules/@rspack/binding-linux-arm64-gnu": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-2.3.4.tgz",
|
||||||
"integrity": "sha512-Q+RCA/KM2tn6m6R5U4lktXDs5cCRm3SyleQk86iqqUFX7wKzVRUvr5BTsreg6K9of3gpYmQ6+g1PGT5cwo0rLA==",
|
"integrity": "sha512-T/Y1FYiSegcNc+oHuDOLRGIcc+eSdBnfbS70d51EWQj4+0TG/tlfuqFKeAIL3mnKUV5lDLaTz3vsoD0Sws5Fxw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"libc": [
|
||||||
|
"glibc"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -234,13 +240,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-linux-arm64-musl": {
|
"node_modules/@rspack/binding-linux-arm64-musl": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-2.3.4.tgz",
|
||||||
"integrity": "sha512-He+muVDON1fohGtdYamh3zHVwf6/E6fZu/+iEAkxjclE0P94bsCfYVcZW/a4/l1tJ2zvLZtB4jD7Qr6r4vG/WA==",
|
"integrity": "sha512-WZHCzZ532UfXFXNU8XyM8jb+I6wddegbs/7IXsyw7xiPwwZX1D/M6iKFVpBYdvKcupUM8bS8Uw2REirR/cERVw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"libc": [
|
||||||
|
"musl"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -248,13 +257,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-linux-ppc64-gnu": {
|
"node_modules/@rspack/binding-linux-ppc64-gnu": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-2.3.4.tgz",
|
||||||
"integrity": "sha512-blIZUgyPt4FcSHkZL6sJ2xbzc7ACgDeU49An4mXLSebwdgnlhTzxeSFnh2VeJDlGza8CUaZYB/zS/6oZ2kCDcw==",
|
"integrity": "sha512-WeizqeI6HIh7Ax9w2tlmpTtipJWxXcdgt3QqI3N9LOixymlMD5yMBMZNPqwZ6cHXT9gOQ69SvPcVgMwxsdmceQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"libc": [
|
||||||
|
"glibc"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -262,13 +274,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-linux-riscv64-gnu": {
|
"node_modules/@rspack/binding-linux-riscv64-gnu": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-2.3.4.tgz",
|
||||||
"integrity": "sha512-3FtW2DUFmXxhBORUA3zSc+ot4d6R/1/U6z/48TDN4jeIYDUG9VqYBF6LUohX4vBY6IP0DCyXb2N9WayD/9QXoA==",
|
"integrity": "sha512-h+001Vbq8LyGwPMNkeRWidPOVKwlAbwNPskY3CjNlSw3euHkVchfhM3uo6+1h0GyTtb3rzsWqsfm1kar7m/tiQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"libc": [
|
||||||
|
"glibc"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -276,13 +291,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-linux-riscv64-musl": {
|
"node_modules/@rspack/binding-linux-riscv64-musl": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-2.3.4.tgz",
|
||||||
"integrity": "sha512-+5qNgdNdXzp/K8f8BjgJ3m7tcbBKPENN7WPDfBcSHvWb5GF4+o/pbrX26c0+LEugo0bYUOAoitBNd94AwcNvpA==",
|
"integrity": "sha512-S1rlaCnNVG5s4WZ9odLsqN3ySh5TEdNTLXWapEK8x3iQl56aLtdvqXTfbJWHWnYLJuS7M1WqnQGdJNdjy2NDsA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"libc": [
|
||||||
|
"musl"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -290,13 +308,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-linux-s390x-gnu": {
|
"node_modules/@rspack/binding-linux-s390x-gnu": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-2.3.4.tgz",
|
||||||
"integrity": "sha512-yNcg/y1+MV0wZ984CVU4d1HAYYwMcDPXoQO0xynU+K5YuBxPWALHOxuRRCKCcykBdL1GIEshAIewEFrsW/cmJg==",
|
"integrity": "sha512-0SkgGrgulVMam3xel5dMNKQ+U7BEpCczhF1avGT1DzDVIbMfIOsbb32gApQNSz0E7RfAQ/Pa5eWiA9oyRq7ZMQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"libc": [
|
||||||
|
"glibc"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -304,13 +325,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-linux-x64-gnu": {
|
"node_modules/@rspack/binding-linux-x64-gnu": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-2.3.4.tgz",
|
||||||
"integrity": "sha512-ffclKBuH8wwimOBd6xGUxrBfVKKY5Ow4E7OFdHZeg4xffm2O8auGszmOgvFu1eoDoOYHaVJn+cEV6UD0KwZk8A==",
|
"integrity": "sha512-q7E6x3rJJ/9fJyLuRe5+KyEPi23BF/xkAU4xCM5VwLkTf+rVyOkDZfu0qOkxmILjrxllQPV+b/ojBL/ZaIeQPw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"libc": [
|
||||||
|
"glibc"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -318,13 +342,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-linux-x64-musl": {
|
"node_modules/@rspack/binding-linux-x64-musl": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-2.3.4.tgz",
|
||||||
"integrity": "sha512-qcDwwuyxR7TMtrW+r5Y9RIW25boXd1Ip/9jz04jhdq/OiU/Am7rCP2X90CH8sWdzovIF9UNmsGjY4KklR0F2Mg==",
|
"integrity": "sha512-rey4Tyasui/WeMn6KfhH5xyZGOMt+Ny+GDK7nGh9TSz/cb3/bisxqGzpbu6GJK8leDmTUDD5ZdpODexytA5rzQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"libc": [
|
||||||
|
"musl"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -332,9 +359,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-wasm32-wasi": {
|
"node_modules/@rspack/binding-wasm32-wasi": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-wasm32-wasi/-/binding-wasm32-wasi-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-wasm32-wasi/-/binding-wasm32-wasi-2.3.4.tgz",
|
||||||
"integrity": "sha512-3dr6zjFaCK3A920ftCriSJkiRhEfhHtat7LtBdj6g0mcV5Rt+iealmli0vjeAvD0UdpE1u8EKWlfw82JLgFLSQ==",
|
"integrity": "sha512-sDt2MSXZrIaMBa6UaEqmXEqebwpTOPAXLdo9CYJ2Fa9FJWP4TCYbn30mbvV38ZC2n5YX411DRbjck+s97CceIg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"wasm32"
|
"wasm32"
|
||||||
],
|
],
|
||||||
@@ -342,15 +369,15 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emnapi/core": "1.11.3",
|
"@emnapi/core": "2.0.0-beta.3",
|
||||||
"@emnapi/runtime": "1.11.3",
|
"@emnapi/runtime": "2.0.0-beta.3",
|
||||||
"@napi-rs/wasm-runtime": "1.1.6"
|
"@napi-rs/wasm-runtime": "1.2.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-win32-arm64-msvc": {
|
"node_modules/@rspack/binding-win32-arm64-msvc": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-2.3.4.tgz",
|
||||||
"integrity": "sha512-AZbuLPylt1xvWssN93AsirbYs3WgfcrA8tMsqHmVJIHahLu9E+JPKZ3Gmsw6IYEZk3EfnV3ujQzeQ1/VfF0Vsw==",
|
"integrity": "sha512-24YC1YSodLAJ8VsMQJmJSHCNvHTqK9JP5hj50T50WE8lCHNsNl/rIYXO9V0VlCYT/HshE6EHHzAeKdahiEOtcw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -362,9 +389,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-win32-ia32-msvc": {
|
"node_modules/@rspack/binding-win32-ia32-msvc": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-2.3.4.tgz",
|
||||||
"integrity": "sha512-R5NVU68TePZcgRdYUzrQX9YFNxmcyXZEPwaPv40AAgsqNyacG3iRaYVmV79jt3rWYfa0QJaqvRLUchDe2SZ6zQ==",
|
"integrity": "sha512-xmUNu6kgV9lLEkRP1Zb+t6i1Z1ZMEWXmLlMalPx8tHqndz2RflNMBBx6kjB2nAPQBIZgWufwm7dVGS0HKomCmw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ia32"
|
"ia32"
|
||||||
],
|
],
|
||||||
@@ -376,9 +403,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/binding-win32-x64-msvc": {
|
"node_modules/@rspack/binding-win32-x64-msvc": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-2.3.4.tgz",
|
||||||
"integrity": "sha512-5T9DYjNPQpLbrNXjCssGd2B6xMQPlc3LxVOKHGUA1O0GV+88vBkTXAcryJ+Fo+yVEMPCzp4VvwBMGAVDpCjcSA==",
|
"integrity": "sha512-WY+AkJqpbLtLEZiG1fE7CVJZ54y0qHeCiVmLxGBsh4OOGIDCs6v2Ub5COcPrYVzGJFGyeHUS29dV7JAs93qIHw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -390,13 +417,13 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/core": {
|
"node_modules/@rspack/core": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/core/-/core-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/core/-/core-2.3.4.tgz",
|
||||||
"integrity": "sha512-9BWfaiEJLgLK9U53Q4WVruBZ19Mu/XWHXHEu0UFla4lUtH8Z+/ET2m044tiqbtyIgqQyG58fMrxHeVIAiXMXHg==",
|
"integrity": "sha512-T8HGkIjPVDlGlIN8st/ICe8Gfixq8te75g/8crSdNSf8F+6884sBcKNky0CRdfPxao1C5SXV+Vjv1XJTjyu83w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rspack/binding": "2.3.1"
|
"@rspack/binding": "2.3.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^20.19.0 || >=22.12.0"
|
"node": "^20.19.0 || >=22.12.0"
|
||||||
@@ -415,9 +442,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rspack/plugin-react-refresh": {
|
"node_modules/@rspack/plugin-react-refresh": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@rspack/plugin-react-refresh/-/plugin-react-refresh-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rspack/plugin-react-refresh/-/plugin-react-refresh-2.0.3.tgz",
|
||||||
"integrity": "sha512-dGNZiCxQxgAUI9sah7gd8u+O7OJZRCmqtEJNDOd8xW5RqcieC86F7p5qcShyw6onH5pKf57evpr2VjGbaFGkZg==",
|
"integrity": "sha512-/K86+2fzdtGdqorm8IwxaouAr5uXFdn7yej0P6/JtuqVYEo9tAUMypGbepAZgt3ClVevn6sC8Oo+fUCLhR10zg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
@@ -431,17 +458,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rspress/core": {
|
"node_modules/@rspress/core": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspress/core/-/core-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspress/core/-/core-2.1.4.tgz",
|
||||||
"integrity": "sha512-GArybZxyifQ/wC8N2SzVyFi5JCJpUXgajITV4if8ylOImjZr8j9Cgy+6o55tXEtq85r6XYYE5fbcEz2nxxCpnA==",
|
"integrity": "sha512-7OmP7ABDgQLSpVfpBHfpjqu4H3PGBGMyhLxF1crPQ48Q6MIWAVu77nw7cONn8AZa9GoVq0N/DoE3GEtgZzlu6w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mdx-js/mdx": "^3.1.1",
|
"@mdx-js/mdx": "^3.1.1",
|
||||||
"@mdx-js/react": "^3.1.1",
|
"@mdx-js/react": "^3.1.1",
|
||||||
"@rsbuild/core": "^2.2.14",
|
"@rsbuild/core": "^2.3.3",
|
||||||
"@rsbuild/plugin-react": "~2.1.1",
|
"@rsbuild/plugin-react": "~2.1.1",
|
||||||
"@rspress/shared": "2.1.1",
|
"@rspress/shared": "2.1.4",
|
||||||
"@shikijs/rehype": "^4.2.0",
|
"@shikijs/rehype": "^4.2.0",
|
||||||
"@shikijs/transformers": "^4.2.0",
|
"@shikijs/transformers": "^4.2.0",
|
||||||
"@types/mdast": "^4.0.4",
|
"@types/mdast": "^4.0.4",
|
||||||
@@ -464,8 +491,8 @@
|
|||||||
"react-router-dom": "^7.18.5",
|
"react-router-dom": "^7.18.5",
|
||||||
"rehype-external-links": "^3.0.0",
|
"rehype-external-links": "^3.0.0",
|
||||||
"rehype-raw": "^7.0.0",
|
"rehype-raw": "^7.0.0",
|
||||||
"remark-cjk-friendly": "^2.3.3",
|
"remark-cjk-friendly": "^2.3.4",
|
||||||
"remark-cjk-friendly-gfm-strikethrough": "^2.3.2",
|
"remark-cjk-friendly-gfm-strikethrough": "^2.3.3",
|
||||||
"remark-gfm": "^4.0.1",
|
"remark-gfm": "^4.0.1",
|
||||||
"remark-mdx": "^3.1.1",
|
"remark-mdx": "^3.1.1",
|
||||||
"remark-parse": "^11.0.0",
|
"remark-parse": "^11.0.0",
|
||||||
@@ -485,22 +512,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rspress/plugin-client-redirects": {
|
"node_modules/@rspress/plugin-client-redirects": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspress/plugin-client-redirects/-/plugin-client-redirects-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspress/plugin-client-redirects/-/plugin-client-redirects-2.1.4.tgz",
|
||||||
"integrity": "sha512-jrnh0UTczcTAk+xeJH6b2/LFLF2W7UzPYP992GxnW0mWJxPnvKQIk9v051bezD3gDuiGGRv8puFU7PMmwLOaHg==",
|
"integrity": "sha512-6/g+Mr8lslqiFzlMBouex8TLm6PlQK6cmZ71Yfv82+Uxcrb+LaFAFiPbq2G7gToXBQUoECM4D/7nSLAfeOhnEQ==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": "^20.19.0 || >=22.12.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@rspress/core": "^2.1.0-beta.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@rspress/plugin-sitemap": {
|
|
||||||
"version": "2.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@rspress/plugin-sitemap/-/plugin-sitemap-2.1.1.tgz",
|
|
||||||
"integrity": "sha512-3Zk+dmitcx5QxiSPi1Wh4exexRnKa09Yyj3710x6UM4sW2cl72SctMZapO7X9ETNrgVt9fW52eQsFzW1y38gSg==",
|
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -511,16 +525,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rspress/shared": {
|
"node_modules/@rspress/shared": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@rspress/shared/-/shared-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rspress/shared/-/shared-2.1.4.tgz",
|
||||||
"integrity": "sha512-U+OEPt/Ze+ryJdLHvpJJv9hxiRp03rknn5pvhh6v0enjib9SuUrsku/cPzneal3EsNyDZB5kncghpH1iwVKxnA==",
|
"integrity": "sha512-SuQyVKn9xcQwkzfl+4bPBzX10gxbhCs9UupqSoPtxvyr9pMgSbXnlo3gxTPZXLzk5HUqZZ6tlIju25PVCEtYWA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rsbuild/core": "^2.2.14",
|
"@rsbuild/core": "^2.3.3",
|
||||||
"@shikijs/rehype": "^4.2.0",
|
"@shikijs/rehype": "^4.2.0",
|
||||||
"@types/react": "^19.3.0",
|
"@types/react": "^19.3.0",
|
||||||
"mdast-util-mdx-jsx": "^3.2.0",
|
"mdast-util-mdx-jsx": "^3.2.1",
|
||||||
"unified": "^11.0.5"
|
"unified": "^11.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -672,9 +686,9 @@
|
|||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
},
|
},
|
||||||
"node_modules/@tybys/wasm-util": {
|
"node_modules/@tybys/wasm-util": {
|
||||||
"version": "0.10.4",
|
"version": "0.10.5",
|
||||||
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz",
|
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.5.tgz",
|
||||||
"integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==",
|
"integrity": "sha512-dOGOPxlaNV+G046mZzN+9C0dAcQZeSKcXiVaM0TYy/LM4ttTmgSBDxYfovcYI8Em3+eAbiAYpvWLOv8+ZVRJKA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
@@ -693,9 +707,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/estree": {
|
"node_modules/@types/estree": {
|
||||||
"version": "1.0.10",
|
"version": "1.0.11",
|
||||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz",
|
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.11.tgz",
|
||||||
"integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==",
|
"integrity": "sha512-YBdNe5JcjYR0sPhJW1QIeRCmI11YhYvaRuGCs9+WCeTTb+Yhb2BE2XMe5/wAqF10FK5g3+q1PDhQABfT7aX0gg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
@@ -743,10 +757,20 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/node": {
|
||||||
|
"version": "26.6.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.11.tgz",
|
||||||
|
"integrity": "sha512-uUyQ2XLEz+EXh34lmS3GhKrkqn/8FU7KUiKRpk347At2bmnMVWss45yz8b4FG/tUtmV1tV/+TVkITItPROyeeQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"undici-types": "~8.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/react": {
|
"node_modules/@types/react": {
|
||||||
"version": "19.3.0",
|
"version": "19.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.3.tgz",
|
||||||
"integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==",
|
"integrity": "sha512-K8uWpJc4teiuOPdiP1umjeA9rGMgVPiXuoL66fcS1QlwBT1WMqY8PORmub9FadopIs+RCW6siYEs7Lpq+vDlog==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -1108,13 +1132,13 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/@unhead/react": {
|
"node_modules/@unhead/react": {
|
||||||
"version": "2.1.17",
|
"version": "2.1.19",
|
||||||
"resolved": "https://registry.npmjs.org/@unhead/react/-/react-2.1.17.tgz",
|
"resolved": "https://registry.npmjs.org/@unhead/react/-/react-2.1.19.tgz",
|
||||||
"integrity": "sha512-KmcYksDjlLozL0fxUjIDwH/0k6+Lg2HWHLUPlkRW8Gl08hdB1AbLB5iU9QxFvkaT8p0Q4dFEqZWnz3g6RMeiRA==",
|
"integrity": "sha512-UNLxU5CgyJw6NzTOsxzUr11pX9zyW1DIHXPwkg2/V1zLcwPKPPcpDkx1tRmWmlajPdpSFZli3xmSrEt1HCGSDw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"unhead": "2.1.17"
|
"unhead": "2.1.19"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/harlan-zw"
|
"url": "https://github.com/sponsors/harlan-zw"
|
||||||
@@ -1262,9 +1286,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/compute-scroll-into-view": {
|
"node_modules/compute-scroll-into-view": {
|
||||||
"version": "3.1.1",
|
"version": "3.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.2.2.tgz",
|
||||||
"integrity": "sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw==",
|
"integrity": "sha512-X+jf3y2j3TbtxA3fq3/kBNiSnD1QlIChiIQdAc2Yo1LtOc0yjO1TzgxWJf8PwtKPGgSvSfWUlVvrb7vGx1eYWA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
@@ -1293,9 +1317,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/csstype": {
|
"node_modules/csstype": {
|
||||||
"version": "3.2.3",
|
"version": "3.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.4.tgz",
|
||||||
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
|
"integrity": "sha512-PoKaoPzQapnEoqUSnHx1u6W6ku8CVEgKsnpmmzU3m1nwkidpPBQ8V/Zq2+bWNrsOKoKLwTGdbx6xF7BXP1zLVQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
@@ -1626,9 +1650,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/hast-util-raw": {
|
"node_modules/hast-util-raw": {
|
||||||
"version": "9.2.0",
|
"version": "9.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.2.1.tgz",
|
||||||
"integrity": "sha512-1zVq3M9AlZiBZ4mlMPnLtkK2rdd+I8VhmFLNLb//XJm6xA2AVH2tz19EHy25RgRWut6z6FpTARAs7P8rnmRJUQ==",
|
"integrity": "sha512-8P0PLAr5C7xCRb+tkhUTV4v6OSNcnccKwjBkH/r19R5CkVCgTWlv4vmTkxFH1CVCA2UJOvOPQdBBMC3c6qnuOg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -1639,7 +1663,7 @@
|
|||||||
"hast-util-to-parse5": "^8.0.0",
|
"hast-util-to-parse5": "^8.0.0",
|
||||||
"html-void-elements": "^3.0.0",
|
"html-void-elements": "^3.0.0",
|
||||||
"mdast-util-to-hast": "^13.0.0",
|
"mdast-util-to-hast": "^13.0.0",
|
||||||
"parse5": "^8.0.0",
|
"parse5": "^8.1.0",
|
||||||
"unist-util-position": "^5.0.0",
|
"unist-util-position": "^5.0.0",
|
||||||
"unist-util-visit": "^5.0.0",
|
"unist-util-visit": "^5.0.0",
|
||||||
"vfile": "^6.0.0",
|
"vfile": "^6.0.0",
|
||||||
@@ -1681,9 +1705,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/hast-util-to-html": {
|
"node_modules/hast-util-to-html": {
|
||||||
"version": "9.0.6",
|
"version": "9.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.7.tgz",
|
||||||
"integrity": "sha512-1SZUxCN3TtJAE7e2BQN2MBHsoZ1gnmi9GoCP5Di59CSWptIezSAW09yDZyVbanb78V9eCwrKqdQsjtfVTxYHWA==",
|
"integrity": "sha512-HYNDA3qdnzUPitY/LcQm1nWs8z0cWFNH1Nz09jdI/tXifAqF7h3+jrLl4S/b9Mi4VSjn0Dsn54ctuTV6zhBthA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -1732,23 +1756,6 @@
|
|||||||
"url": "https://opencollective.com/unified"
|
"url": "https://opencollective.com/unified"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/hast-util-to-jsx-runtime/node_modules/inline-style-parser": {
|
|
||||||
"version": "0.2.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.9.tgz",
|
|
||||||
"integrity": "sha512-IttN8BqKLxzUrnTqHI+/hwAJQItBAUjdoHERCDv+oOuX48VP6bzW8+QjOXSfoevzq3YrYAwX1uLHp8TqO9yIeg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/hast-util-to-jsx-runtime/node_modules/style-to-object": {
|
|
||||||
"version": "2.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-2.0.2.tgz",
|
|
||||||
"integrity": "sha512-QmbXPUylqU80HAgTOJeEOdbA40W9KtxmjMhQy+tq+b8F2aoh3aQLuy82hh2jm2qsC9hR9eI0+eQidTMydKcqRA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"inline-style-parser": "0.2.9"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/hast-util-to-parse5": {
|
"node_modules/hast-util-to-parse5": {
|
||||||
"version": "8.0.1",
|
"version": "8.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.1.tgz",
|
||||||
@@ -1833,6 +1840,13 @@
|
|||||||
"url": "https://github.com/sponsors/wooorm"
|
"url": "https://github.com/sponsors/wooorm"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/inline-style-parser": {
|
||||||
|
"version": "0.2.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.9.tgz",
|
||||||
|
"integrity": "sha512-IttN8BqKLxzUrnTqHI+/hwAJQItBAUjdoHERCDv+oOuX48VP6bzW8+QjOXSfoevzq3YrYAwX1uLHp8TqO9yIeg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/is-absolute-url": {
|
"node_modules/is-absolute-url": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-4.0.1.tgz",
|
||||||
@@ -1943,9 +1957,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mdast-util-find-and-replace": {
|
"node_modules/mdast-util-find-and-replace": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.5.tgz",
|
||||||
"integrity": "sha512-z4B5c6jrnJ1ltOQemhWYPBSAo6y42Z8Gt2yEgfgNTMcLSU59B8bfj8Z8AnAlJrBGLnqkdAUZ7jdDEqQw3KuipQ==",
|
"integrity": "sha512-of3wZLEBWpK8mSYy8wmKnwyxfUKjhCkXxGLz45DVBqfcahTP37LscCK+0oAZh+ReZ5OunPDkB2zdGMIxrojLhw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2005,9 +2019,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mdast-util-gfm-autolink-literal": {
|
"node_modules/mdast-util-gfm-autolink-literal": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.1.2.tgz",
|
||||||
"integrity": "sha512-Jx6QSK8wDo558Bcf7q+1pe0v81g2PVs09Hlvu9xJHmCFRF3sAPW7vXFVIAwBncs3sde92WbsVqNxwdqViA2XnQ==",
|
"integrity": "sha512-rAlbZBGZfv2YRr6lSFGHTN305KkNawOYRRlbldFyPHnTlHJZwlGdzVwyIDvr3fxbhRbmJOSZc06c8H5Fgfu8Ng==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2131,9 +2145,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mdast-util-mdx-jsx": {
|
"node_modules/mdast-util-mdx-jsx": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.2.tgz",
|
||||||
"integrity": "sha512-oXp1GIa+E9IwIs3a106+tr3Bz2MlTTBvlXjOZMoIat11kk7vjqgmBnksB9WHmWv+gZh7k3IUgpAHlwHB7DH4GQ==",
|
"integrity": "sha512-/0FHaZMv2fSjIL3z/NYmXnQTSdzYyamPpI1BXpSCngTUqpSvMNIlERa26ABz+Z6UFQbrh3I5Yhzp448WZsPfMA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2190,9 +2204,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mdast-util-to-hast": {
|
"node_modules/mdast-util-to-hast": {
|
||||||
"version": "13.2.1",
|
"version": "13.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.2.tgz",
|
||||||
"integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==",
|
"integrity": "sha512-l2pnmOuqs+SGLVpTVXnRLQu5v1AzvDe181404fbXzzqObVxrAnnVxapAP27pUwzLBL/ABIkgUhGlPVU7QSvIFg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2212,9 +2226,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mdast-util-to-markdown": {
|
"node_modules/mdast-util-to-markdown": {
|
||||||
"version": "2.2.3",
|
"version": "2.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.2.4.tgz",
|
||||||
"integrity": "sha512-dImdB6VZRMRac1SwAW6o1c0ESk/7pFFAMCMuKM+9v7LpTSthMM5nzXpqKw4Mjo66aXVKhNkyrP4bMB9MurPyWg==",
|
"integrity": "sha512-aCsogoZ2Oz1EItAlC12A+/uGuzp+CWlDU0xZ3o5jbJaepLsOu2tlxpvHslnX5dRhspD1gxNVkBtYG0yMiIpXoQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3317,9 +3331,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router": {
|
"node_modules/react-router": {
|
||||||
"version": "7.18.5",
|
"version": "7.18.7",
|
||||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.5.tgz",
|
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.7.tgz",
|
||||||
"integrity": "sha512-dTgvcXDOrLPrlLHrcZAqWveiK1hMSqN+rGAJzegP8HtmNkfRxOoshGWBNX3ZJ0cZjOHkRdlUJtaIhZMLLyGyPw==",
|
"integrity": "sha512-nXl672FFobymVY/Ywbo0DnlXV/+VXOB5pOslCeuVqoegwwL7sau2yASdyGoWHvPRxAoqUBrAiFZRdli4nT7Wow==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3330,23 +3344,27 @@
|
|||||||
"node": ">=20.0.0"
|
"node": ">=20.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
"@types/react": ">=18",
|
||||||
"react": ">=18",
|
"react": ">=18",
|
||||||
"react-dom": ">=18"
|
"react-dom": ">=18"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
"react-dom": {
|
"react-dom": {
|
||||||
"optional": true
|
"optional": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router-dom": {
|
"node_modules/react-router-dom": {
|
||||||
"version": "7.18.5",
|
"version": "7.18.7",
|
||||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.5.tgz",
|
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.7.tgz",
|
||||||
"integrity": "sha512-9HcfDMU6JJ/fp6gJZYGwNE6RknVGS4kBjH1HkNw959mCJi70TVwdipQWv2FEol9uGpi+SZTFtVpJPtEQfayeOw==",
|
"integrity": "sha512-EBWBKV1TjvScebAIvidowN0Bfh9Bg7p54IDBRVJkFXz0wBKTBblDNLxUvCewx/GdzTiC7VWV/MOjWqsLWEMygA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react-router": "7.18.5"
|
"react-router": "7.18.7"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20.0.0"
|
"node": ">=20.0.0"
|
||||||
@@ -3644,13 +3662,13 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/scroll-into-view-if-needed": {
|
"node_modules/scroll-into-view-if-needed": {
|
||||||
"version": "3.1.0",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.2.1.tgz",
|
||||||
"integrity": "sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==",
|
"integrity": "sha512-dgeJvJhSV9MY6hyhtsivbSxHoZVm+lumsWTObtUdAchJflwOGmKKHNkEpU8pVYMomZ8h/yrfzVQkcPlObQNDWQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"compute-scroll-into-view": "^3.0.2"
|
"compute-scroll-into-view": "^3.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/set-cookie-parser": {
|
"node_modules/set-cookie-parser": {
|
||||||
@@ -3702,9 +3720,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/stringify-entities": {
|
"node_modules/stringify-entities": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.5.tgz",
|
||||||
"integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==",
|
"integrity": "sha512-jNuI2fNNw5ecxrWmgm90R3iH0Kc/94AQwoQWoSUYphWzvmUA2pjFG34H56Z7Z3FkvH3FpYwwewKAa97oQnPFhw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3743,6 +3761,16 @@
|
|||||||
"inline-style-parser": "0.2.7"
|
"inline-style-parser": "0.2.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/style-to-object": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-QmbXPUylqU80HAgTOJeEOdbA40W9KtxmjMhQy+tq+b8F2aoh3aQLuy82hh2jm2qsC9hR9eI0+eQidTMydKcqRA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"inline-style-parser": "0.2.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/toggle-selection": {
|
"node_modules/toggle-selection": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz",
|
||||||
@@ -3815,19 +3843,53 @@
|
|||||||
"@typescript/typescript-win32-x64": "7.0.2"
|
"@typescript/typescript-win32-x64": "7.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/undici-types": {
|
||||||
|
"version": "8.9.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
|
||||||
|
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/unhead": {
|
"node_modules/unhead": {
|
||||||
"version": "2.1.17",
|
"version": "2.1.19",
|
||||||
"resolved": "https://registry.npmjs.org/unhead/-/unhead-2.1.17.tgz",
|
"resolved": "https://registry.npmjs.org/unhead/-/unhead-2.1.19.tgz",
|
||||||
"integrity": "sha512-HLMKXOszRhAPBrr6VlqCeVeJq2kbC4kXwzGLEZvvojPLWNYTJw22xG7Bfwhsvs31+IBet3Wl8ADg9dwYdyphfQ==",
|
"integrity": "sha512-W+zxYQeulbi738I839IQFxOgdAzkNWLrNdaK0XmRGAqcDhojlFufESM7d/IeaMwPmue1rff27Sdl6NNckZqrrQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"hookable": "^6.0.1"
|
"hookable": "^6.0.1",
|
||||||
|
"parse5": "^7.3.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/harlan-zw"
|
"url": "https://github.com/sponsors/harlan-zw"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/unhead/node_modules/entities": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/unhead/node_modules/parse5": {
|
||||||
|
"version": "7.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",
|
||||||
|
"integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"entities": "^6.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/unified": {
|
"node_modules/unified": {
|
||||||
"version": "11.0.5",
|
"version": "11.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",
|
||||||
|
|||||||
+2
-2
@@ -20,11 +20,11 @@
|
|||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"type": "commonjs",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rspress/core": "^2.0.0",
|
"@rspress/core": "^2.0.0",
|
||||||
"@rspress/plugin-client-redirects": "^2.0.0",
|
"@rspress/plugin-client-redirects": "^2.0.0",
|
||||||
"@rspress/plugin-sitemap": "^2.0.0",
|
"@types/node": "^26.6.7",
|
||||||
"typescript": "^7.0.0"
|
"typescript": "^7.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+10
-1
@@ -1,7 +1,9 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": ["config:recommended", "replacements:all", ":semanticCommitTypeAll(chore)", "helpers:pinGitHubActionDigests"],
|
"extends": ["config:recommended", "replacements:all", ":semanticCommitTypeAll(chore)", "helpers:pinGitHubActionDigests"],
|
||||||
"dependencyDashboard": true,
|
"dependencyDashboard": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
"osvVulnerabilityAlerts": true,
|
"osvVulnerabilityAlerts": true,
|
||||||
"lockFileMaintenance": {
|
"lockFileMaintenance": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
@@ -90,6 +92,13 @@
|
|||||||
"matchUpdateTypes": ["patch"],
|
"matchUpdateTypes": ["patch"],
|
||||||
"groupName": "node-patch-updates"
|
"groupName": "node-patch-updates"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"description": "Batch patch-level Go dependency updates",
|
||||||
|
"matchManagers": ["gomod"],
|
||||||
|
"matchUpdateTypes": ["patch"],
|
||||||
|
"postUpdateOptions": ["gomodTidy"],
|
||||||
|
"groupName": "go-patch-updates"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "Pin forgejo artifact actions to prevent breaking changes",
|
"description": "Pin forgejo artifact actions to prevent breaking changes",
|
||||||
"matchManagers": ["github-actions"],
|
"matchManagers": ["github-actions"],
|
||||||
|
|||||||
+12
-9
@@ -1,16 +1,20 @@
|
|||||||
import { defineConfig } from '@rspress/core';
|
import { defineConfig } from '@rspress/core';
|
||||||
import { pluginSitemap } from '@rspress/plugin-sitemap';
|
|
||||||
import { pluginClientRedirects } from '@rspress/plugin-client-redirects';
|
import { pluginClientRedirects } from '@rspress/plugin-client-redirects';
|
||||||
|
|
||||||
|
const sitePath: string = process.env.SITE_PATH ?? '/';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
root: 'docs',
|
root: 'docs',
|
||||||
title: 'Continuwuity',
|
title: 'Continuwuity',
|
||||||
|
siteOrigin: sitePath != "/" ? "https://preview.continuwuity.org" : "https://continuwuity.org",
|
||||||
|
base: sitePath,
|
||||||
description: 'A community-driven Matrix homeserver',
|
description: 'A community-driven Matrix homeserver',
|
||||||
icon: '/assets/logo.svg',
|
icon: '/assets/logo.svg',
|
||||||
logo: {
|
logo: {
|
||||||
light: '/assets/logo.svg',
|
light: '/assets/logo.svg',
|
||||||
dark: '/assets/logo.svg',
|
dark: '/assets/logo.svg',
|
||||||
},
|
},
|
||||||
|
llms: false,
|
||||||
// Use `.no-zoom` class to disable image zooms
|
// Use `.no-zoom` class to disable image zooms
|
||||||
mediumZoom: {
|
mediumZoom: {
|
||||||
selector: '.rspress-doc :not(.no-zoom *) > img',
|
selector: '.rspress-doc :not(.no-zoom *) > img',
|
||||||
@@ -40,7 +44,9 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
webMcp: false,
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
|
llmsUI: false,
|
||||||
socialLinks: [
|
socialLinks: [
|
||||||
{
|
{
|
||||||
icon: {
|
icon: {
|
||||||
@@ -72,14 +78,11 @@ export default defineConfig({
|
|||||||
lastUpdated: true,
|
lastUpdated: true,
|
||||||
enableContentAnimation: true,
|
enableContentAnimation: true,
|
||||||
enableAppearanceAnimation: false,
|
enableAppearanceAnimation: false,
|
||||||
footer: {
|
footer: {},
|
||||||
},
|
darkMode: 'auto'
|
||||||
},
|
},
|
||||||
|
|
||||||
plugins: [pluginSitemap({
|
plugins: [pluginClientRedirects({
|
||||||
siteUrl: 'https://continuwuity.org', // TODO: Set automatically in build pipeline
|
|
||||||
}),
|
|
||||||
pluginClientRedirects({
|
|
||||||
redirects: [{
|
redirects: [{
|
||||||
from: '^/config_reference$',
|
from: '^/config_reference$',
|
||||||
to: '/reference/config'
|
to: '/reference/config'
|
||||||
@@ -102,8 +105,8 @@ export default defineConfig({
|
|||||||
from: "^/source(|_code)$",
|
from: "^/source(|_code)$",
|
||||||
to: "https://forgejo.ellis.link/continuwuation/continuwuity",
|
to: "https://forgejo.ellis.link/continuwuation/continuwuity",
|
||||||
}, {
|
}, {
|
||||||
from: "^/(CONTRIBUTING.md|contributing)$",
|
from: "^/(CONTRIBUTING.md|contributing)$",
|
||||||
to: "/development/contributing"
|
to: "/development/contributing"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})],
|
})],
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
[toolchain]
|
[toolchain]
|
||||||
profile = "minimal"
|
profile = "minimal"
|
||||||
channel = "1.99.1"
|
channel = "1.100.0"
|
||||||
components = [
|
components = [
|
||||||
# For rust-analyzer
|
# For rust-analyzer
|
||||||
"rust-src",
|
"rust-src",
|
||||||
|
|||||||
@@ -1007,7 +1007,7 @@ impl crate::Context<'_> {
|
|||||||
pub(super) async fn memory_stats(&self, opts: Option<String>) -> Result {
|
pub(super) async fn memory_stats(&self, opts: Option<String>) -> Result {
|
||||||
const OPTS: &str = "abcdefghijklmnopqrstuvwxyz";
|
const OPTS: &str = "abcdefghijklmnopqrstuvwxyz";
|
||||||
|
|
||||||
let opts: String = OPTS
|
let mut mapped_opts: String = OPTS
|
||||||
.chars()
|
.chars()
|
||||||
.filter(|&c| {
|
.filter(|&c| {
|
||||||
let allow_any = opts.as_ref().is_some_and(|opts| opts == "*");
|
let allow_any = opts.as_ref().is_some_and(|opts| opts == "*");
|
||||||
@@ -1018,7 +1018,11 @@ impl crate::Context<'_> {
|
|||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let stats = conduwuit::alloc::memory_stats(&opts).unwrap_or_default();
|
if opts.as_ref().is_some_and(|opts| opts.contains('J')) {
|
||||||
|
mapped_opts.push('J');
|
||||||
|
}
|
||||||
|
|
||||||
|
let stats = conduwuit::alloc::memory_stats(&mapped_opts).unwrap_or_default();
|
||||||
|
|
||||||
self.write_str("```\n").await?;
|
self.write_str("```\n").await?;
|
||||||
self.write_str(&stats).await?;
|
self.write_str(&stats).await?;
|
||||||
|
|||||||
@@ -192,7 +192,8 @@ pub enum DebugCommand {
|
|||||||
///
|
///
|
||||||
/// Optional argument is a character mask (a sequence of characters in any
|
/// Optional argument is a character mask (a sequence of characters in any
|
||||||
/// order) which enable additional extended statistics. Known characters are
|
/// order) which enable additional extended statistics. Known characters are
|
||||||
/// "abdeglmx". For convenience, a '*' will enable everything.
|
/// "abdeglmx" and 'J' for JSON output. For convenience, a '*' will enable
|
||||||
|
/// everything.
|
||||||
MemoryStats {
|
MemoryStats {
|
||||||
opts: Option<String>,
|
opts: Option<String>,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -142,11 +142,11 @@ impl crate::Context<'_> {
|
|||||||
.await?;
|
.await?;
|
||||||
self.write_str("| ------ | ---------- | --------------------------- |\n")
|
self.write_str("| ------ | ---------- | --------------------------- |\n")
|
||||||
.await?;
|
.await?;
|
||||||
for (key_id, key) in &response.verify_keys {
|
for (key_id, key) in &response.parsed.verify_keys {
|
||||||
self.write_str(&format!("| {key_id} | {} | |\n", key.key))
|
self.write_str(&format!("| {key_id} | {} | |\n", key.key))
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
for (key_id, old_key) in &response.old_verify_keys {
|
for (key_id, old_key) in &response.parsed.old_verify_keys {
|
||||||
self.write_str(&format!(
|
self.write_str(&format!(
|
||||||
"| {key_id} | {} | {:0<13} |\n",
|
"| {key_id} | {} | {:0<13} |\n",
|
||||||
old_key.key,
|
old_key.key,
|
||||||
|
|||||||
+1
-3
@@ -2,6 +2,7 @@
|
|||||||
#![allow(clippy::wildcard_imports)]
|
#![allow(clippy::wildcard_imports)]
|
||||||
#![allow(clippy::enum_glob_use)]
|
#![allow(clippy::enum_glob_use)]
|
||||||
#![allow(clippy::too_many_arguments)]
|
#![allow(clippy::too_many_arguments)]
|
||||||
|
#![allow(clippy::large_unopt_stack_frames, reason = "very large Subcommand macro expansions")]
|
||||||
|
|
||||||
conduwuit_macros::introspect_crate! {}
|
conduwuit_macros::introspect_crate! {}
|
||||||
|
|
||||||
@@ -33,9 +34,6 @@ pub(crate) use crate::{context::Context, utils::get_room_info};
|
|||||||
|
|
||||||
pub(crate) const PAGE_SIZE: usize = 100;
|
pub(crate) const PAGE_SIZE: usize = 100;
|
||||||
|
|
||||||
conduwuit::mod_ctor! {}
|
|
||||||
conduwuit::mod_dtor! {}
|
|
||||||
|
|
||||||
pub use crate::admin::AdminCommand;
|
pub use crate::admin::AdminCommand;
|
||||||
|
|
||||||
/// Install the admin command processor
|
/// Install the admin command processor
|
||||||
|
|||||||
@@ -110,14 +110,6 @@ impl crate::Context<'_> {
|
|||||||
self.write_str("Notice was sent to #admins").await
|
self.write_str("Notice was sent to #admins").await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) async fn reload_mods(&self) -> Result {
|
|
||||||
self.bail_restricted()?;
|
|
||||||
|
|
||||||
self.services.server.reload()?;
|
|
||||||
|
|
||||||
self.write_str("Reloading server...").await
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub(super) async fn restart(&self, force: bool) -> Result {
|
pub(super) async fn restart(&self, force: bool) -> Result {
|
||||||
use conduwuit::utils::sys::current_exe_deleted;
|
use conduwuit::utils::sys::current_exe_deleted;
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ pub enum ServerCommand {
|
|||||||
message: Vec<String>,
|
message: Vec<String>,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Hot-reload the server
|
|
||||||
#[command(name = "reload", alias = "reload-mods")]
|
|
||||||
ReloadMods,
|
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
/// Restart the server
|
/// Restart the server
|
||||||
Restart {
|
Restart {
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ serde.workspace = true
|
|||||||
sha1.workspace = true
|
sha1.workspace = true
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
|
wildmatch.workspace = true
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::collections::{BTreeMap, BTreeSet};
|
use std::collections::{BTreeMap, BTreeSet};
|
||||||
|
|
||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use conduwuit::{Result, Server};
|
use conduwuit::{Result, Server, config::experiments::ToggledExperiment};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
RoomVersionId,
|
RoomVersionId,
|
||||||
api::{
|
api::{
|
||||||
@@ -53,8 +53,11 @@ pub(crate) async fn get_capabilities_route(
|
|||||||
capabilities.account_moderation.lock = true;
|
capabilities.account_moderation.lock = true;
|
||||||
capabilities.account_moderation.suspend = true;
|
capabilities.account_moderation.suspend = true;
|
||||||
|
|
||||||
capabilities.admin =
|
if services.config.experiments.msc4484.is_enabled() {
|
||||||
AdminCapability::new(BTreeSet::from_iter([OAuthClientScope::ServerAdministration]));
|
capabilities.admin = AdminCapability::new(BTreeSet::from_iter([
|
||||||
|
OAuthClientScope::ServerAdministration,
|
||||||
|
]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
capabilities.profile_fields = Some(
|
capabilities.profile_fields = Some(
|
||||||
@@ -63,7 +66,10 @@ pub(crate) async fn get_capabilities_route(
|
|||||||
|
|
||||||
capabilities.set(
|
capabilities.set(
|
||||||
"org.matrix.msc4174.webpush",
|
"org.matrix.msc4174.webpush",
|
||||||
json!({ "enabled": true, "vapid": services.pusher.webpush_vapid_public_key() }),
|
json!({
|
||||||
|
"enabled": services.config.experiments.msc4174.is_enabled(),
|
||||||
|
"vapid": services.pusher.webpush_vapid_public_key()
|
||||||
|
}),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok(get_capabilities::v3::Response::new(capabilities))
|
Ok(get_capabilities::v3::Response::new(capabilities))
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ use conduwuit::{Err, Result, at};
|
|||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use ruma::{
|
use ruma::{
|
||||||
api::client::dehydrated_device::{
|
api::client::dehydrated_device::{
|
||||||
delete_dehydrated_device::unstable as delete_dehydrated_device,
|
delete_dehydrated_device::msc3814 as delete_dehydrated_device,
|
||||||
get_dehydrated_device::unstable as get_dehydrated_device,
|
get_dehydrated_device::msc3814 as get_dehydrated_device,
|
||||||
get_events::unstable as get_events,
|
get_events::msc3814 as get_events,
|
||||||
put_dehydrated_device::unstable as put_dehydrated_device,
|
put_dehydrated_device::msc3814 as put_dehydrated_device,
|
||||||
},
|
},
|
||||||
assign,
|
assign,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ use ruma::{
|
|||||||
OneTimeKeyAlgorithm, OwnedDeviceId, OwnedUserId, UserId,
|
OneTimeKeyAlgorithm, OwnedDeviceId, OwnedUserId, UserId,
|
||||||
api::{
|
api::{
|
||||||
client::keys::{
|
client::keys::{
|
||||||
claim_keys, get_key_changes, get_keys, upload_keys,
|
claim_keys, get_key_changes, get_keys, upload_keys, upload_signatures,
|
||||||
upload_signatures::{self},
|
|
||||||
upload_signing_keys,
|
upload_signing_keys,
|
||||||
},
|
},
|
||||||
federation,
|
federation,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::time::Duration;
|
|||||||
|
|
||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Err, Result, err,
|
Err, Result, debug, err,
|
||||||
utils::{self, content_disposition::make_content_disposition, math::ruma_from_usize},
|
utils::{self, content_disposition::make_content_disposition, math::ruma_from_usize},
|
||||||
};
|
};
|
||||||
use conduwuit_core::error;
|
use conduwuit_core::error;
|
||||||
@@ -30,9 +30,9 @@ pub(crate) async fn get_media_config_route(
|
|||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
_body: Ruma<get_media_config::v1::Request>,
|
_body: Ruma<get_media_config::v1::Request>,
|
||||||
) -> Result<get_media_config::v1::Response> {
|
) -> Result<get_media_config::v1::Response> {
|
||||||
Ok(get_media_config::v1::Response::new(ruma_from_usize(
|
Ok(get_media_config::v1::Response::new(Some(ruma_from_usize(
|
||||||
services.server.config.max_request_size,
|
services.server.config.max_request_size,
|
||||||
)))
|
))))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// # `POST /_matrix/media/v3/upload`
|
/// # `POST /_matrix/media/v3/upload`
|
||||||
@@ -219,10 +219,12 @@ pub(crate) async fn get_media_preview_route(
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug!("Fetching a URL preview for {url} on behalf of {sender_user}");
|
||||||
let preview = services
|
let preview = services
|
||||||
.media
|
.media
|
||||||
.get_url_preview(&url)
|
.get_url_preview(&url)
|
||||||
.await
|
.await
|
||||||
|
.inspect(|_| debug!(user=%sender_user, %url, "Finished fetching a URL preview"))
|
||||||
.map_err(|error| {
|
.map_err(|error| {
|
||||||
err!(Request(Unknown(
|
err!(Request(Unknown(
|
||||||
debug_error!(%sender_user, %url, "Failed to fetch URL preview: {error}")
|
debug_error!(%sender_user, %url, "Failed to fetch URL preview: {error}")
|
||||||
|
|||||||
@@ -1,398 +0,0 @@
|
|||||||
#![allow(deprecated)]
|
|
||||||
|
|
||||||
use axum::extract::State;
|
|
||||||
use conduwuit::{
|
|
||||||
Err, Result, err,
|
|
||||||
utils::{content_disposition::make_content_disposition, math::ruma_from_usize},
|
|
||||||
};
|
|
||||||
use conduwuit_service::media::{CORP_CROSS_ORIGIN, Dim, FileMeta};
|
|
||||||
use reqwest::Url;
|
|
||||||
use ruma::{
|
|
||||||
api::client::media::{
|
|
||||||
create_content, get_content, get_content_as_filename, get_content_thumbnail,
|
|
||||||
get_media_config, get_media_preview,
|
|
||||||
},
|
|
||||||
assign,
|
|
||||||
};
|
|
||||||
use service::media::mxc::Mxc;
|
|
||||||
|
|
||||||
use crate::{Ruma, RumaResponse, client::create_content_route};
|
|
||||||
|
|
||||||
/// # `GET /_matrix/media/v3/config`
|
|
||||||
///
|
|
||||||
/// Returns max upload size.
|
|
||||||
pub(crate) async fn get_media_config_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
_body: Ruma<get_media_config::v3::Request>,
|
|
||||||
) -> Result<get_media_config::v3::Response> {
|
|
||||||
Ok(get_media_config::v3::Response::new(ruma_from_usize(
|
|
||||||
services.server.config.max_request_size,
|
|
||||||
)))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// # `GET /_matrix/media/v1/config`
|
|
||||||
///
|
|
||||||
/// This is a legacy endpoint ("/v1/") that some very old homeservers and/or
|
|
||||||
/// clients may call. conduwuit adds these for compatibility purposes.
|
|
||||||
/// See <https://spec.matrix.org/legacy/legacy/#id27>
|
|
||||||
///
|
|
||||||
/// Returns max upload size.
|
|
||||||
pub(crate) async fn get_media_config_legacy_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
body: Ruma<get_media_config::v3::Request>,
|
|
||||||
) -> Result<RumaResponse<get_media_config::v3::Response>> {
|
|
||||||
get_media_config_legacy_route(State(services), body)
|
|
||||||
.await
|
|
||||||
.map(RumaResponse)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// # `GET /_matrix/media/v3/preview_url`
|
|
||||||
///
|
|
||||||
/// Returns URL preview.
|
|
||||||
pub(crate) async fn get_media_preview_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
body: Ruma<get_media_preview::v3::Request>,
|
|
||||||
) -> Result<get_media_preview::v3::Response> {
|
|
||||||
let sender_user = body.identity.expect_sender_user()?;
|
|
||||||
|
|
||||||
let url = &body.url;
|
|
||||||
let url = Url::parse(&body.url).map_err(|e| {
|
|
||||||
err!(Request(InvalidParam(
|
|
||||||
debug_warn!(%sender_user, %url, "Requested URL is not valid: {e}")
|
|
||||||
)))
|
|
||||||
})?;
|
|
||||||
|
|
||||||
if !services.media.url_preview_allowed(&url) {
|
|
||||||
return Err!(Request(Forbidden(
|
|
||||||
debug_warn!(%sender_user, %url, "URL is not allowed to be previewed")
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
|
|
||||||
let preview = services.media.get_url_preview(&url).await.map_err(|e| {
|
|
||||||
err!(Request(Unknown(
|
|
||||||
debug_error!(%sender_user, %url, "Failed to fetch a URL preview: {e}")
|
|
||||||
)))
|
|
||||||
})?;
|
|
||||||
|
|
||||||
serde_json::value::to_raw_value(&preview)
|
|
||||||
.map(get_media_preview::v3::Response::from_raw_value)
|
|
||||||
.map_err(|error| {
|
|
||||||
err!(Request(Unknown(
|
|
||||||
debug_error!(%sender_user, %url, "Failed to parse URL preview: {error}")
|
|
||||||
)))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/// # `GET /_matrix/media/v1/preview_url`
|
|
||||||
///
|
|
||||||
/// This is a legacy endpoint ("/v1/") that some very old homeservers and/or
|
|
||||||
/// clients may call. conduwuit adds these for compatibility purposes.
|
|
||||||
/// See <https://spec.matrix.org/legacy/legacy/#id27>
|
|
||||||
///
|
|
||||||
/// Returns URL preview.
|
|
||||||
pub(crate) async fn get_media_preview_legacy_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
body: Ruma<get_media_preview::v3::Request>,
|
|
||||||
) -> Result<RumaResponse<get_media_preview::v3::Response>> {
|
|
||||||
get_media_preview_legacy_route(State(services), body)
|
|
||||||
.await
|
|
||||||
.map(RumaResponse)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// # `POST /_matrix/media/v1/upload`
|
|
||||||
///
|
|
||||||
/// Permanently save media in the server.
|
|
||||||
///
|
|
||||||
/// This is a legacy endpoint ("/v1/") that some very old homeservers and/or
|
|
||||||
/// clients may call. conduwuit adds these for compatibility purposes.
|
|
||||||
/// See <https://spec.matrix.org/legacy/legacy/#id27>
|
|
||||||
///
|
|
||||||
/// - Some metadata will be saved in the database
|
|
||||||
/// - Media will be saved in the media/ directory
|
|
||||||
pub(crate) async fn create_content_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
body: Ruma<create_content::v3::Request>,
|
|
||||||
) -> Result<RumaResponse<create_content::v3::Response>> {
|
|
||||||
create_content_route(State(services), body)
|
|
||||||
.await
|
|
||||||
.map(RumaResponse)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// # `GET /_matrix/media/v3/download/{serverName}/{mediaId}`
|
|
||||||
///
|
|
||||||
/// Load media from our server or over federation.
|
|
||||||
///
|
|
||||||
/// - Only allows federation if `allow_remote` is true
|
|
||||||
/// - Only redirects if `allow_redirect` is true
|
|
||||||
/// - Uses client-provided `timeout_ms` if available, else defaults to 20
|
|
||||||
/// seconds
|
|
||||||
pub(crate) async fn get_content_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
body: Ruma<get_content::v3::Request>,
|
|
||||||
) -> Result<get_content::v3::Response> {
|
|
||||||
let mxc = Mxc {
|
|
||||||
server_name: &body.server_name,
|
|
||||||
media_id: &body.media_id,
|
|
||||||
};
|
|
||||||
|
|
||||||
match services.media.get(&mxc).await? {
|
|
||||||
| Some(FileMeta {
|
|
||||||
content,
|
|
||||||
content_type,
|
|
||||||
content_disposition,
|
|
||||||
}) => {
|
|
||||||
let content_disposition = make_content_disposition(
|
|
||||||
content_disposition.as_ref(),
|
|
||||||
content_type.as_deref(),
|
|
||||||
None,
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(assign!(
|
|
||||||
get_content::v3::Response::new(
|
|
||||||
content.expect("entire file contents"),
|
|
||||||
content_type.unwrap_or_default(),
|
|
||||||
content_disposition,
|
|
||||||
),
|
|
||||||
{
|
|
||||||
cross_origin_resource_policy: Some(CORP_CROSS_ORIGIN.into()),
|
|
||||||
}
|
|
||||||
))
|
|
||||||
},
|
|
||||||
| _ =>
|
|
||||||
if !services.globals.server_is_ours(&body.server_name) && body.allow_remote {
|
|
||||||
let response = services
|
|
||||||
.media
|
|
||||||
.fetch_remote_content_legacy(&mxc, body.allow_redirect, body.timeout_ms)
|
|
||||||
.await
|
|
||||||
.map_err(|e| {
|
|
||||||
err!(Request(NotFound(debug_warn!(%mxc, "Fetching media failed: {e:?}"))))
|
|
||||||
})?;
|
|
||||||
|
|
||||||
let content_disposition = make_content_disposition(
|
|
||||||
response.content_disposition.as_ref(),
|
|
||||||
response.content_type.as_deref(),
|
|
||||||
None,
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(assign!(
|
|
||||||
get_content::v3::Response::new(
|
|
||||||
response.file,
|
|
||||||
response.content_type.unwrap_or_default(),
|
|
||||||
content_disposition,
|
|
||||||
),
|
|
||||||
{
|
|
||||||
cross_origin_resource_policy: Some(CORP_CROSS_ORIGIN.into()),
|
|
||||||
}
|
|
||||||
))
|
|
||||||
} else {
|
|
||||||
Err!(Request(NotFound("Media not found.")))
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// # `GET /_matrix/media/v1/download/{serverName}/{mediaId}`
|
|
||||||
///
|
|
||||||
/// Load media from our server or over federation.
|
|
||||||
///
|
|
||||||
/// This is a legacy endpoint ("/v1/") that some very old homeservers and/or
|
|
||||||
/// clients may call. conduwuit adds these for compatibility purposes.
|
|
||||||
/// See <https://spec.matrix.org/legacy/legacy/#id27>
|
|
||||||
///
|
|
||||||
/// - Only allows federation if `allow_remote` is true
|
|
||||||
/// - Only redirects if `allow_redirect` is true
|
|
||||||
/// - Uses client-provided `timeout_ms` if available, else defaults to 20
|
|
||||||
/// seconds
|
|
||||||
pub(crate) async fn get_content_legacy_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
body: Ruma<get_content::v3::Request>,
|
|
||||||
) -> Result<RumaResponse<get_content::v3::Response>> {
|
|
||||||
get_content_legacy_route(State(services), body)
|
|
||||||
.await
|
|
||||||
.map(RumaResponse)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// # `GET /_matrix/media/v3/download/{serverName}/{mediaId}/{fileName}`
|
|
||||||
///
|
|
||||||
/// Load media from our server or over federation, permitting desired filename.
|
|
||||||
///
|
|
||||||
/// - Only allows federation if `allow_remote` is true
|
|
||||||
/// - Only redirects if `allow_redirect` is true
|
|
||||||
/// - Uses client-provided `timeout_ms` if available, else defaults to 20
|
|
||||||
/// seconds
|
|
||||||
pub(crate) async fn get_content_as_filename_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
body: Ruma<get_content_as_filename::v3::Request>,
|
|
||||||
) -> Result<get_content_as_filename::v3::Response> {
|
|
||||||
let mxc = Mxc {
|
|
||||||
server_name: &body.server_name,
|
|
||||||
media_id: &body.media_id,
|
|
||||||
};
|
|
||||||
|
|
||||||
match services.media.get(&mxc).await? {
|
|
||||||
| Some(FileMeta {
|
|
||||||
content,
|
|
||||||
content_type,
|
|
||||||
content_disposition,
|
|
||||||
}) => {
|
|
||||||
let content_disposition = make_content_disposition(
|
|
||||||
content_disposition.as_ref(),
|
|
||||||
content_type.as_deref(),
|
|
||||||
Some(&body.filename),
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(assign!(get_content_as_filename::v3::Response::new(
|
|
||||||
content.expect("entire file contents"),
|
|
||||||
content_type.unwrap_or_default(),
|
|
||||||
content_disposition,
|
|
||||||
),
|
|
||||||
{
|
|
||||||
cross_origin_resource_policy: Some(CORP_CROSS_ORIGIN.into()),
|
|
||||||
}
|
|
||||||
))
|
|
||||||
},
|
|
||||||
| _ =>
|
|
||||||
if !services.globals.server_is_ours(&body.server_name) && body.allow_remote {
|
|
||||||
let response = services
|
|
||||||
.media
|
|
||||||
.fetch_remote_content_legacy(&mxc, body.allow_redirect, body.timeout_ms)
|
|
||||||
.await
|
|
||||||
.map_err(|e| {
|
|
||||||
err!(Request(NotFound(debug_warn!(%mxc, "Fetching media failed: {e:?}"))))
|
|
||||||
})?;
|
|
||||||
|
|
||||||
let content_disposition = make_content_disposition(
|
|
||||||
response.content_disposition.as_ref(),
|
|
||||||
response.content_type.as_deref(),
|
|
||||||
None,
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(assign!(
|
|
||||||
get_content_as_filename::v3::Response::new(
|
|
||||||
response.file,
|
|
||||||
response.content_type.unwrap_or_default(),
|
|
||||||
content_disposition,
|
|
||||||
),
|
|
||||||
{
|
|
||||||
cross_origin_resource_policy: Some(CORP_CROSS_ORIGIN.into()),
|
|
||||||
}
|
|
||||||
))
|
|
||||||
} else {
|
|
||||||
Err!(Request(NotFound("Media not found.")))
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// # `GET /_matrix/media/v1/download/{serverName}/{mediaId}/{fileName}`
|
|
||||||
///
|
|
||||||
/// Load media from our server or over federation, permitting desired filename.
|
|
||||||
///
|
|
||||||
/// This is a legacy endpoint ("/v1/") that some very old homeservers and/or
|
|
||||||
/// clients may call. conduwuit adds these for compatibility purposes.
|
|
||||||
/// See <https://spec.matrix.org/legacy/legacy/#id27>
|
|
||||||
///
|
|
||||||
/// - Only allows federation if `allow_remote` is true
|
|
||||||
/// - Only redirects if `allow_redirect` is true
|
|
||||||
/// - Uses client-provided `timeout_ms` if available, else defaults to 20
|
|
||||||
/// seconds
|
|
||||||
pub(crate) async fn get_content_as_filename_legacy_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
body: Ruma<get_content_as_filename::v3::Request>,
|
|
||||||
) -> Result<RumaResponse<get_content_as_filename::v3::Response>> {
|
|
||||||
get_content_as_filename_legacy_route(State(services), body)
|
|
||||||
.await
|
|
||||||
.map(RumaResponse)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// # `GET /_matrix/media/v3/thumbnail/{serverName}/{mediaId}`
|
|
||||||
///
|
|
||||||
/// Load media thumbnail from our server or over federation.
|
|
||||||
///
|
|
||||||
/// - Only allows federation if `allow_remote` is true
|
|
||||||
/// - Only redirects if `allow_redirect` is true
|
|
||||||
/// - Uses client-provided `timeout_ms` if available, else defaults to 20
|
|
||||||
/// seconds
|
|
||||||
pub(crate) async fn get_content_thumbnail_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
body: Ruma<get_content_thumbnail::v3::Request>,
|
|
||||||
) -> Result<get_content_thumbnail::v3::Response> {
|
|
||||||
let mxc = Mxc {
|
|
||||||
server_name: &body.server_name,
|
|
||||||
media_id: &body.media_id,
|
|
||||||
};
|
|
||||||
|
|
||||||
let dim = Dim::from_ruma(body.width, body.height, body.method.clone())?;
|
|
||||||
match services.media.get_thumbnail(&mxc, &dim).await? {
|
|
||||||
| Some(FileMeta {
|
|
||||||
content,
|
|
||||||
content_type,
|
|
||||||
content_disposition,
|
|
||||||
}) => {
|
|
||||||
let content_disposition = make_content_disposition(
|
|
||||||
content_disposition.as_ref(),
|
|
||||||
content_type.as_deref(),
|
|
||||||
None,
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(assign!(
|
|
||||||
get_content_thumbnail::v3::Response::new(
|
|
||||||
content.expect("entire file contents"),
|
|
||||||
content_type.unwrap_or_default(),
|
|
||||||
content_disposition,
|
|
||||||
),
|
|
||||||
{
|
|
||||||
cross_origin_resource_policy: Some(CORP_CROSS_ORIGIN.to_owned()),
|
|
||||||
}
|
|
||||||
))
|
|
||||||
},
|
|
||||||
| _ =>
|
|
||||||
if !services.globals.server_is_ours(&body.server_name) && body.allow_remote {
|
|
||||||
let response = services
|
|
||||||
.media
|
|
||||||
.fetch_remote_thumbnail_legacy(&body)
|
|
||||||
.await
|
|
||||||
.map_err(|e| {
|
|
||||||
err!(Request(NotFound(debug_warn!(%mxc, "Fetching media failed: {e:?}"))))
|
|
||||||
})?;
|
|
||||||
|
|
||||||
let content_disposition = make_content_disposition(
|
|
||||||
response.content_disposition.as_ref(),
|
|
||||||
response.content_type.as_deref(),
|
|
||||||
None,
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(assign!(
|
|
||||||
get_content_thumbnail::v3::Response::new(
|
|
||||||
response.file,
|
|
||||||
response.content_type.unwrap_or_default(),
|
|
||||||
content_disposition,
|
|
||||||
),
|
|
||||||
{
|
|
||||||
cross_origin_resource_policy: Some(CORP_CROSS_ORIGIN.to_owned()),
|
|
||||||
}
|
|
||||||
))
|
|
||||||
} else {
|
|
||||||
Err!(Request(NotFound("Media not found.")))
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// # `GET /_matrix/media/v1/thumbnail/{serverName}/{mediaId}`
|
|
||||||
///
|
|
||||||
/// Load media thumbnail from our server or over federation.
|
|
||||||
///
|
|
||||||
/// This is a legacy endpoint ("/v1/") that some very old homeservers and/or
|
|
||||||
/// clients may call. conduwuit adds these for compatibility purposes.
|
|
||||||
/// See <https://spec.matrix.org/legacy/legacy/#id27>
|
|
||||||
///
|
|
||||||
/// - Only allows federation if `allow_remote` is true
|
|
||||||
/// - Only redirects if `allow_redirect` is true
|
|
||||||
/// - Uses client-provided `timeout_ms` if available, else defaults to 20
|
|
||||||
/// seconds
|
|
||||||
pub(crate) async fn get_content_thumbnail_legacy_legacy_route(
|
|
||||||
State(services): State<crate::State>,
|
|
||||||
body: Ruma<get_content_thumbnail::v3::Request>,
|
|
||||||
) -> Result<RumaResponse<get_content_thumbnail::v3::Response>> {
|
|
||||||
get_content_thumbnail_legacy_route(State(services), body)
|
|
||||||
.await
|
|
||||||
.map(RumaResponse)
|
|
||||||
}
|
|
||||||
+235
-474
@@ -1,9 +1,10 @@
|
|||||||
use std::{borrow::Borrow, collections::HashMap, sync::Arc};
|
use std::collections::{HashMap, hash_map::Entry};
|
||||||
|
|
||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Err, Result, debug, debug_info, debug_warn, err, info,
|
Err, EventTypeExt, Result, debug, debug_warn, err, info,
|
||||||
matrix::{
|
matrix::{
|
||||||
|
StateKey,
|
||||||
event::gen_event_id,
|
event::gen_event_id,
|
||||||
pdu::{PartialPdu, PduEvent},
|
pdu::{PartialPdu, PduEvent},
|
||||||
},
|
},
|
||||||
@@ -15,31 +16,25 @@ use conduwuit::{
|
|||||||
use futures::{FutureExt, StreamExt};
|
use futures::{FutureExt, StreamExt};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, OwnedServerName,
|
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, OwnedServerName,
|
||||||
OwnedUserId, RoomId, UserId,
|
OwnedUserId, RoomId, RoomVersionId, UserId,
|
||||||
api::{
|
api::{
|
||||||
client::knock::knock_room,
|
client::knock::knock_room,
|
||||||
federation::{self},
|
error::{ErrorKind, IncompatibleRoomVersionErrorData},
|
||||||
|
federation::{self, membership::RawStrippedState},
|
||||||
},
|
},
|
||||||
canonical_json::to_canonical_value,
|
canonical_json::to_canonical_value,
|
||||||
events::{
|
events::{
|
||||||
StateEventType,
|
StateEventType,
|
||||||
room::{
|
room::member::{MembershipState, RoomMemberEventContent},
|
||||||
join_rules::{AllowRule, JoinRule},
|
|
||||||
member::{MembershipState, RoomMemberEventContent},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use service::{
|
use service::{
|
||||||
Services,
|
Services,
|
||||||
rooms::{
|
rooms::{membership::validate_remote_member_event_stub, state::RoomMutexGuard},
|
||||||
membership::validate_remote_member_event_stub,
|
|
||||||
state::RoomMutexGuard,
|
|
||||||
state_compressor::{CompressedState, HashSetCompressStateEvent},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::banned_room_check;
|
use super::banned_room_check;
|
||||||
use crate::Ruma;
|
use crate::{Ruma, server::validate_partial_membership_event};
|
||||||
|
|
||||||
/// # `POST /_matrix/client/*/knock/{roomIdOrAlias}`
|
/// # `POST /_matrix/client/*/knock/{roomIdOrAlias}`
|
||||||
///
|
///
|
||||||
@@ -61,30 +56,42 @@ pub(crate) async fn knock_room_route(
|
|||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let mut servers = body.via.clone();
|
let mut servers = body.via.clone();
|
||||||
servers.extend(
|
if servers.is_empty() {
|
||||||
services
|
debug!("No via servers provided for knock, injecting some.");
|
||||||
.rooms
|
servers.extend(
|
||||||
.state_cache
|
services
|
||||||
.servers_invite_via(&room_id)
|
.rooms
|
||||||
.collect::<Vec<_>>()
|
.state_cache
|
||||||
.await,
|
.servers_invite_via(&room_id)
|
||||||
);
|
.collect::<Vec<_>>()
|
||||||
|
.await,
|
||||||
|
);
|
||||||
|
|
||||||
servers.extend(
|
let invite_state = services
|
||||||
services
|
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.invite_state(sender_user, &room_id)
|
.invite_state(sender_user, &room_id)
|
||||||
.await
|
.await
|
||||||
.unwrap_or_default()
|
.unwrap_or_default();
|
||||||
.iter()
|
let knock_state = services
|
||||||
.filter_map(|event| event.get_field("sender").ok().flatten())
|
.rooms
|
||||||
.filter_map(|sender: &str| UserId::parse(sender).ok())
|
.state_cache
|
||||||
.map(|user| user.server_name().to_owned()),
|
.knock_state(sender_user, &room_id)
|
||||||
);
|
.await
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
if let Some(server) = room_id.server_name() {
|
servers.extend(
|
||||||
servers.push(server.to_owned());
|
invite_state
|
||||||
|
.iter()
|
||||||
|
.chain(knock_state.iter())
|
||||||
|
.filter_map(|event| event.get_field("sender").ok().flatten())
|
||||||
|
.filter_map(|sender: &str| UserId::parse(sender).ok())
|
||||||
|
.map(|user| user.server_name().to_owned()),
|
||||||
|
);
|
||||||
|
|
||||||
|
if let Some(server) = room_id.server_name() {
|
||||||
|
servers.push(server.to_owned());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
servers.sort_unstable();
|
servers.sort_unstable();
|
||||||
@@ -106,20 +113,28 @@ pub(crate) async fn knock_room_route(
|
|||||||
|
|
||||||
let addl_via_servers = services.rooms.state_cache.servers_invite_via(&room_id);
|
let addl_via_servers = services.rooms.state_cache.servers_invite_via(&room_id);
|
||||||
|
|
||||||
let addl_state_servers = services
|
let addl_invite_state = services
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.invite_state(sender_user, &room_id)
|
.invite_state(sender_user, &room_id)
|
||||||
.await
|
.await
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
let addl_knock_state = services
|
||||||
|
.rooms
|
||||||
|
.state_cache
|
||||||
|
.knock_state(sender_user, &room_id)
|
||||||
|
.await
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
let mut addl_servers: Vec<_> = addl_state_servers
|
let mut addl_servers: Vec<_> = addl_invite_state
|
||||||
.iter()
|
.iter()
|
||||||
|
.chain(addl_knock_state.iter())
|
||||||
.map(|event| event.get_field("sender"))
|
.map(|event| event.get_field("sender"))
|
||||||
.filter_map(FlatOk::flat_ok)
|
.filter_map(FlatOk::flat_ok)
|
||||||
.map(|user: OwnedUserId| user.server_name().to_owned())
|
.map(|user: OwnedUserId| user.server_name().to_owned())
|
||||||
.stream()
|
.stream()
|
||||||
.chain(addl_via_servers)
|
.chain(addl_via_servers)
|
||||||
|
.chain(body.via.iter().cloned().stream())
|
||||||
.collect()
|
.collect()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
@@ -146,165 +161,69 @@ async fn knock_room_by_id_helper(
|
|||||||
) -> Result<knock_room::v3::Response> {
|
) -> Result<knock_room::v3::Response> {
|
||||||
let state_lock = services.rooms.state.mutex.lock(room_id).await;
|
let state_lock = services.rooms.state.mutex.lock(room_id).await;
|
||||||
|
|
||||||
if services
|
|
||||||
.rooms
|
|
||||||
.state_cache
|
|
||||||
.is_invited(sender_user, room_id)
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
debug_warn!("{sender_user} is already invited in {room_id} but attempted to knock");
|
|
||||||
return Err!(Request(Forbidden(
|
|
||||||
"You cannot knock on a room you are already invited/accepted to."
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
|
|
||||||
if services
|
|
||||||
.rooms
|
|
||||||
.state_cache
|
|
||||||
.is_joined(sender_user, room_id)
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
debug_warn!("{sender_user} is already joined in {room_id} but attempted to knock");
|
|
||||||
return Err!(Request(Forbidden("You cannot knock on a room you are already joined in.")));
|
|
||||||
}
|
|
||||||
|
|
||||||
if services
|
|
||||||
.rooms
|
|
||||||
.state_cache
|
|
||||||
.is_knocked(sender_user, room_id)
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
debug_warn!("{sender_user} is already knocked in {room_id}");
|
|
||||||
return Ok(knock_room::v3::Response::new(room_id.into()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Ok(membership) = services
|
|
||||||
.rooms
|
|
||||||
.state_accessor
|
|
||||||
.get_member(room_id, sender_user)
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
if membership.membership == MembershipState::Ban {
|
|
||||||
debug_warn!("{sender_user} is banned from {room_id} but attempted to knock");
|
|
||||||
return Err!(Request(Forbidden("You cannot knock on a room you are banned from.")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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 {
|
|
||||||
let restriction_rooms: Vec<_> = restricted
|
|
||||||
.allow
|
|
||||||
.iter()
|
|
||||||
.filter_map(|a| match a {
|
|
||||||
| AllowRule::RoomMembership(r) => Some(&r.room_id),
|
|
||||||
| _ => None,
|
|
||||||
})
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
// Check if the user is in any of the allowed rooms
|
|
||||||
let mut user_meets_restrictions = false;
|
|
||||||
for restriction_room_id in &restriction_rooms {
|
|
||||||
if services
|
|
||||||
.rooms
|
|
||||||
.state_cache
|
|
||||||
.is_joined(sender_user, restriction_room_id)
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
user_meets_restrictions = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the user meets the restrictions, try joining instead
|
|
||||||
if user_meets_restrictions {
|
|
||||||
debug_info!(
|
|
||||||
"{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
|
|
||||||
drop(state_lock);
|
|
||||||
match services
|
|
||||||
.rooms
|
|
||||||
.membership
|
|
||||||
.join_room(sender_user, room_id, reason.clone(), servers)
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
| Ok(_) => return Ok(knock_room::v3::Response::new(room_id.to_owned())),
|
|
||||||
| Err(e) => {
|
|
||||||
debug_warn!(
|
|
||||||
"Failed to convert knock to join for {sender_user} in {room_id}: {e:?}"
|
|
||||||
);
|
|
||||||
// Get a new state lock for the remaining knock logic
|
|
||||||
let new_state_lock = services.rooms.state.mutex.lock(room_id).await;
|
|
||||||
|
|
||||||
let server_in_room = services
|
|
||||||
.rooms
|
|
||||||
.state_cache
|
|
||||||
.server_in_room(services.globals.server_name(), room_id)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
let local_knock = server_in_room
|
|
||||||
|| servers.is_empty()
|
|
||||||
|| (servers.len() == 1 && services.globals.server_is_ours(&servers[0]));
|
|
||||||
|
|
||||||
if local_knock {
|
|
||||||
knock_room_helper_local(
|
|
||||||
services,
|
|
||||||
sender_user,
|
|
||||||
room_id,
|
|
||||||
reason,
|
|
||||||
servers,
|
|
||||||
new_state_lock,
|
|
||||||
)
|
|
||||||
.boxed()
|
|
||||||
.await?;
|
|
||||||
} else {
|
|
||||||
knock_room_helper_remote(
|
|
||||||
services,
|
|
||||||
sender_user,
|
|
||||||
room_id,
|
|
||||||
reason,
|
|
||||||
servers,
|
|
||||||
new_state_lock,
|
|
||||||
)
|
|
||||||
.boxed()
|
|
||||||
.await?;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(knock_room::v3::Response::new(room_id.to_owned()));
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if !matches!(join_rule, JoinRule::Knock | JoinRule::KnockRestricted(_)) {
|
|
||||||
debug_warn!(
|
|
||||||
"{sender_user} attempted to knock on room {room_id} but its join rule is \
|
|
||||||
{join_rule:?}, not knock or knock_restricted"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let server_in_room = services
|
let server_in_room = services
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.server_in_room(services.globals.server_name(), room_id)
|
.server_in_room(services.globals.server_name(), room_id)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
let local_knock = server_in_room
|
// Only check our known membership if we're already in the room.
|
||||||
|| servers.is_empty()
|
if server_in_room {
|
||||||
|| (servers.len() == 1 && services.globals.server_is_ours(&servers[0]));
|
if services
|
||||||
|
.rooms
|
||||||
|
.state_cache
|
||||||
|
.is_invited(sender_user, room_id)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
debug_warn!("{sender_user} is already invited in {room_id} but attempted to knock");
|
||||||
|
return Err!(Request(Forbidden(
|
||||||
|
"You cannot knock on a room you are already invited/accepted to."
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
if local_knock {
|
if services
|
||||||
knock_room_helper_local(services, sender_user, room_id, reason, servers, state_lock)
|
.rooms
|
||||||
|
.state_cache
|
||||||
|
.is_joined(sender_user, room_id)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
debug_warn!("{sender_user} is already joined in {room_id} but attempted to knock");
|
||||||
|
return Err!(Request(Forbidden(
|
||||||
|
"You cannot knock on a room you are already joined in."
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Ok(membership) = services
|
||||||
|
.rooms
|
||||||
|
.state_accessor
|
||||||
|
.get_member(room_id, sender_user)
|
||||||
|
.await
|
||||||
|
&& membership.membership == MembershipState::Ban
|
||||||
|
{
|
||||||
|
debug_warn!("{sender_user} is banned from {room_id} but attempted to knock");
|
||||||
|
return Err!(Request(Forbidden("You cannot knock on a room you are banned from.")));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Local knocks can't fail unless the room is corrupted, so we don't
|
||||||
|
// fall back to remote knocks like we do with remote joins.
|
||||||
|
knock_room_helper_local(services, sender_user, room_id, reason, state_lock)
|
||||||
.boxed()
|
.boxed()
|
||||||
.await?;
|
.await?;
|
||||||
} else {
|
} else {
|
||||||
knock_room_helper_remote(services, sender_user, room_id, reason, servers, state_lock)
|
drop(state_lock);
|
||||||
|
let remote_servers: Vec<_> = servers
|
||||||
|
.iter()
|
||||||
|
.filter(|sn| !services.globals.server_is_ours(sn))
|
||||||
|
.cloned()
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
if remote_servers.is_empty() {
|
||||||
|
return Err!(Request(NotFound(
|
||||||
|
"Room {room_id} not found and no remote servers were provided to discover it"
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
knock_room_helper_remote(services, sender_user, room_id, reason, &remote_servers)
|
||||||
.boxed()
|
.boxed()
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
@@ -312,16 +231,14 @@ async fn knock_room_by_id_helper(
|
|||||||
Ok(knock_room::v3::Response::new(room_id.to_owned()))
|
Ok(knock_room::v3::Response::new(room_id.to_owned()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(name = "local", skip(services, reason, state_lock))]
|
||||||
async fn knock_room_helper_local(
|
async fn knock_room_helper_local(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
sender_user: &UserId,
|
sender_user: &UserId,
|
||||||
room_id: &RoomId,
|
room_id: &RoomId,
|
||||||
reason: Option<String>,
|
reason: Option<String>,
|
||||||
servers: &[OwnedServerName],
|
|
||||||
state_lock: RoomMutexGuard,
|
state_lock: RoomMutexGuard,
|
||||||
) -> Result {
|
) -> Result {
|
||||||
debug_info!("We can knock locally");
|
|
||||||
|
|
||||||
let room_version = services.rooms.state.get_room_version(room_id).await?;
|
let room_version = services.rooms.state.get_room_version(room_id).await?;
|
||||||
let room_version_rules = room_version
|
let room_version_rules = room_version
|
||||||
.rules()
|
.rules()
|
||||||
@@ -334,10 +251,9 @@ async fn knock_room_helper_local(
|
|||||||
let mut content = RoomMemberEventContent::new(MembershipState::Knock);
|
let mut content = RoomMemberEventContent::new(MembershipState::Knock);
|
||||||
content.displayname = services.users.displayname(sender_user).await.ok();
|
content.displayname = services.users.displayname(sender_user).await.ok();
|
||||||
content.avatar_url = services.users.avatar_url(sender_user).await.ok();
|
content.avatar_url = services.users.avatar_url(sender_user).await.ok();
|
||||||
content.reason.clone_from(&reason.clone());
|
content.reason = reason;
|
||||||
|
|
||||||
// Try normal knock first
|
services
|
||||||
let Err(error) = services
|
|
||||||
.rooms
|
.rooms
|
||||||
.timeline
|
.timeline
|
||||||
.build_and_append_pdu(
|
.build_and_append_pdu(
|
||||||
@@ -347,147 +263,24 @@ async fn knock_room_helper_local(
|
|||||||
&state_lock,
|
&state_lock,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
else {
|
.map(|_| ())
|
||||||
return Ok(());
|
|
||||||
};
|
|
||||||
|
|
||||||
if servers.is_empty() || (servers.len() == 1 && services.globals.server_is_ours(&servers[0]))
|
|
||||||
{
|
|
||||||
return Err(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
let (make_knock_response, remote_server) =
|
|
||||||
make_knock_request(services, sender_user, room_id, servers).await?;
|
|
||||||
|
|
||||||
info!("make_knock finished");
|
|
||||||
|
|
||||||
let room_version = make_knock_response.room_version;
|
|
||||||
let room_version_rules = room_version
|
|
||||||
.rules()
|
|
||||||
.expect("room version should have defined rules");
|
|
||||||
|
|
||||||
if !services.server.supported_room_version(&room_version) {
|
|
||||||
return Err!(BadServerResponse("Remote room version {room_version} is not supported"));
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut knock_event_stub = serde_json::from_str::<CanonicalJsonObject>(
|
|
||||||
make_knock_response.event.get(),
|
|
||||||
)
|
|
||||||
.map_err(|e| {
|
|
||||||
err!(BadServerResponse("Invalid make_knock event json received from server: {e:?}"))
|
|
||||||
})?;
|
|
||||||
|
|
||||||
validate_remote_member_event_stub(
|
|
||||||
&MembershipState::Knock,
|
|
||||||
sender_user,
|
|
||||||
room_id,
|
|
||||||
&knock_event_stub,
|
|
||||||
)?;
|
|
||||||
|
|
||||||
knock_event_stub.insert(
|
|
||||||
"origin".to_owned(),
|
|
||||||
CanonicalJsonValue::String(services.globals.server_name().as_str().to_owned()),
|
|
||||||
);
|
|
||||||
knock_event_stub.insert(
|
|
||||||
"origin_server_ts".to_owned(),
|
|
||||||
CanonicalJsonValue::Integer(
|
|
||||||
utils::millis_since_unix_epoch()
|
|
||||||
.try_into()
|
|
||||||
.expect("Timestamp is valid js_int value"),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
knock_event_stub.insert(
|
|
||||||
"content".to_owned(),
|
|
||||||
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
|
|
||||||
services
|
|
||||||
.server_keys
|
|
||||||
.hash_and_sign_event(&mut knock_event_stub, &room_version_rules)?;
|
|
||||||
|
|
||||||
// Generate event id
|
|
||||||
let event_id = gen_event_id(&knock_event_stub, &room_version_rules)?;
|
|
||||||
|
|
||||||
// Add event_id
|
|
||||||
knock_event_stub
|
|
||||||
.insert("event_id".to_owned(), CanonicalJsonValue::String(event_id.clone().into()));
|
|
||||||
|
|
||||||
// It has enough fields to be called a proper event now
|
|
||||||
let knock_event = knock_event_stub;
|
|
||||||
|
|
||||||
info!("Asking {remote_server} for send_knock in room {room_id}");
|
|
||||||
let send_knock_request = federation::membership::create_knock_event::v1::Request::new(
|
|
||||||
room_id.to_owned(),
|
|
||||||
event_id.clone(),
|
|
||||||
services
|
|
||||||
.sending
|
|
||||||
.convert_to_outgoing_federation_event(knock_event.clone())
|
|
||||||
.await,
|
|
||||||
);
|
|
||||||
|
|
||||||
services
|
|
||||||
.sending
|
|
||||||
.send_federation_request(&remote_server, send_knock_request)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
info!("send_knock finished");
|
|
||||||
|
|
||||||
services
|
|
||||||
.rooms
|
|
||||||
.short
|
|
||||||
.get_or_create_shortroomid(room_id)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
info!("Parsing knock event");
|
|
||||||
|
|
||||||
let parsed_knock_pdu = PduEvent::from_id_val(&event_id, knock_event.clone())
|
|
||||||
.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`.
|
|
||||||
services
|
|
||||||
.rooms
|
|
||||||
.state_cache
|
|
||||||
.update_membership(room_id, sender_user, &parsed_knock_pdu, false)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
info!("Appending room knock event locally");
|
|
||||||
services
|
|
||||||
.rooms
|
|
||||||
.timeline
|
|
||||||
.progress_extremities(&parsed_knock_pdu)
|
|
||||||
.await?;
|
|
||||||
services
|
|
||||||
.rooms
|
|
||||||
.timeline
|
|
||||||
.append_pdu(&parsed_knock_pdu, knock_event, room_id)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(name = "remote", skip(services, reason, servers))]
|
||||||
async fn knock_room_helper_remote(
|
async fn knock_room_helper_remote(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
sender_user: &UserId,
|
sender_user: &UserId,
|
||||||
room_id: &RoomId,
|
room_id: &RoomId,
|
||||||
reason: Option<String>,
|
reason: Option<String>,
|
||||||
servers: &[OwnedServerName],
|
servers: &[OwnedServerName],
|
||||||
state_lock: RoomMutexGuard,
|
|
||||||
) -> Result {
|
) -> Result {
|
||||||
info!("Knocking {room_id} over federation.");
|
info!(via=?servers, "Knocking on {room_id} over federation.");
|
||||||
|
|
||||||
let (make_knock_response, remote_server) =
|
let (mut stub, room_version, remote_server) =
|
||||||
make_knock_request(services, sender_user, room_id, servers).await?;
|
make_knock_request(services, sender_user, room_id, servers).await?;
|
||||||
|
|
||||||
info!("make_knock finished");
|
info!(%remote_server, "make_knock finished");
|
||||||
|
|
||||||
let room_version = make_knock_response.room_version;
|
|
||||||
let room_version_rules = room_version
|
let room_version_rules = room_version
|
||||||
.rules()
|
.rules()
|
||||||
.expect("room version should have defined rules");
|
.expect("room version should have defined rules");
|
||||||
@@ -496,16 +289,7 @@ async fn knock_room_helper_remote(
|
|||||||
return Err!(BadServerResponse("Remote room version {room_version} is not supported"));
|
return Err!(BadServerResponse("Remote room version {room_version} is not supported"));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut knock_event_stub: CanonicalJsonObject =
|
stub.insert(
|
||||||
serde_json::from_str(make_knock_response.event.get()).map_err(|e| {
|
|
||||||
err!(BadServerResponse("Invalid make_knock event json received from server: {e:?}"))
|
|
||||||
})?;
|
|
||||||
|
|
||||||
knock_event_stub.insert(
|
|
||||||
"origin".to_owned(),
|
|
||||||
CanonicalJsonValue::String(services.globals.server_name().as_str().to_owned()),
|
|
||||||
);
|
|
||||||
knock_event_stub.insert(
|
|
||||||
"origin_server_ts".to_owned(),
|
"origin_server_ts".to_owned(),
|
||||||
CanonicalJsonValue::Integer(
|
CanonicalJsonValue::Integer(
|
||||||
utils::millis_since_unix_epoch()
|
utils::millis_since_unix_epoch()
|
||||||
@@ -519,7 +303,7 @@ async fn knock_room_helper_remote(
|
|||||||
knock_content.avatar_url = services.users.avatar_url(sender_user).await.ok();
|
knock_content.avatar_url = services.users.avatar_url(sender_user).await.ok();
|
||||||
knock_content.reason = reason;
|
knock_content.reason = reason;
|
||||||
|
|
||||||
knock_event_stub.insert(
|
stub.insert(
|
||||||
"content".to_owned(),
|
"content".to_owned(),
|
||||||
to_canonical_value(knock_content).expect("event is valid, we just created it"),
|
to_canonical_value(knock_content).expect("event is valid, we just created it"),
|
||||||
);
|
);
|
||||||
@@ -528,17 +312,15 @@ async fn knock_room_helper_remote(
|
|||||||
// needs to be present
|
// needs to be present
|
||||||
services
|
services
|
||||||
.server_keys
|
.server_keys
|
||||||
.hash_and_sign_event(&mut knock_event_stub, &room_version_rules)?;
|
.hash_and_sign_event(&mut stub, &room_version_rules)?;
|
||||||
|
|
||||||
// Generate event id
|
let event_id = gen_event_id(&stub, &room_version_rules)?;
|
||||||
let event_id = gen_event_id(&knock_event_stub, &room_version_rules)?;
|
|
||||||
|
|
||||||
// Add event_id
|
// Just verify that this event isn't hilariously malformed before we sent it
|
||||||
knock_event_stub
|
// off.
|
||||||
.insert("event_id".to_owned(), CanonicalJsonValue::String(event_id.clone().into()));
|
debug!(?stub, "Parsing knock event");
|
||||||
|
PduEvent::from_id_val(&event_id, stub.clone())
|
||||||
// It has enough fields to be called a proper event now
|
.map_err(|e| err!(BadServerResponse("Invalid knock event PDU: {e:?}")))?;
|
||||||
let knock_event = knock_event_stub;
|
|
||||||
|
|
||||||
info!("Asking {remote_server} for send_knock in room {room_id}");
|
info!("Asking {remote_server} for send_knock in room {room_id}");
|
||||||
let request = federation::membership::create_knock_event::v1::Request::new(
|
let request = federation::membership::create_knock_event::v1::Request::new(
|
||||||
@@ -546,7 +328,7 @@ async fn knock_room_helper_remote(
|
|||||||
event_id.clone(),
|
event_id.clone(),
|
||||||
services
|
services
|
||||||
.sending
|
.sending
|
||||||
.convert_to_outgoing_federation_event(knock_event.clone())
|
.convert_to_outgoing_federation_event(stub.clone())
|
||||||
.await,
|
.await,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -557,126 +339,95 @@ async fn knock_room_helper_remote(
|
|||||||
|
|
||||||
info!("send_knock finished");
|
info!("send_knock finished");
|
||||||
|
|
||||||
|
info!("Validating send_knock response");
|
||||||
services
|
services
|
||||||
.rooms
|
.rooms
|
||||||
.short
|
.short
|
||||||
.get_or_create_shortroomid(room_id)
|
.get_or_create_shortroomid(room_id)
|
||||||
.await;
|
.await;
|
||||||
|
let mut state: HashMap<(StateEventType, StateKey), CanonicalJsonObject> =
|
||||||
|
HashMap::with_capacity(send_knock_response.knock_room_state.len().saturating_add(1));
|
||||||
|
let mut create_event: Option<(OwnedEventId, CanonicalJsonObject)> = None;
|
||||||
|
|
||||||
info!("Parsing knock event");
|
for (idx, event) in send_knock_response.knock_room_state.iter().enumerate() {
|
||||||
let parsed_knock_pdu = PduEvent::from_id_val(&event_id, knock_event.clone())
|
let (state_event_id, key, state_event_json) = match validate_partial_membership_event(
|
||||||
.map_err(|e| err!(BadServerResponse("Invalid knock event PDU: {e:?}")))?;
|
services,
|
||||||
|
event,
|
||||||
info!("Going through send_knock response knock state events");
|
&room_version_rules,
|
||||||
let state = send_knock_response
|
room_id,
|
||||||
.knock_room_state
|
idx,
|
||||||
.iter()
|
)
|
||||||
.map(|event| {
|
.await
|
||||||
#[allow(deprecated)]
|
{
|
||||||
let raw_value = match event {
|
| Ok(res) => res,
|
||||||
| federation::membership::RawStrippedState::Stripped(raw_state) =>
|
| Err(e) => {
|
||||||
&raw_state.clone().into_json(),
|
debug_warn!(%idx, "Dropping invalid event from knock_room_state: {e}");
|
||||||
| federation::membership::RawStrippedState::Pdu(raw_value) => raw_value,
|
continue;
|
||||||
| _ => panic!("unknown raw stripped state type"),
|
},
|
||||||
};
|
|
||||||
|
|
||||||
serde_json::from_str::<CanonicalJsonObject>(raw_value.get())
|
|
||||||
})
|
|
||||||
.filter_map(Result::ok);
|
|
||||||
|
|
||||||
let mut state_map: HashMap<u64, OwnedEventId> = HashMap::new();
|
|
||||||
|
|
||||||
for mut event in state {
|
|
||||||
let Some(state_key) = event.get("state_key") else {
|
|
||||||
debug_warn!("send_knock stripped state event missing state_key: {event:?}");
|
|
||||||
continue;
|
|
||||||
};
|
|
||||||
let Some(event_type) = event.get("type") else {
|
|
||||||
debug_warn!("send_knock stripped state event missing event type: {event:?}");
|
|
||||||
continue;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let Ok(state_key) = serde_json::from_value::<String>(state_key.clone().into()) else {
|
match state.entry(key) {
|
||||||
debug_warn!("send_knock stripped state event has invalid state_key: {event:?}");
|
| Entry::Occupied(entry) => {
|
||||||
continue;
|
debug_warn!(
|
||||||
};
|
key=?entry.key(),
|
||||||
let Ok(event_type) = serde_json::from_value::<StateEventType>(event_type.clone().into())
|
"Dropping duplicate state event from knock_room_state"
|
||||||
else {
|
);
|
||||||
debug_warn!("send_knock stripped state event has invalid event type: {event:?}");
|
},
|
||||||
continue;
|
| Entry::Vacant(entry) => {
|
||||||
};
|
if entry.key().0 == StateEventType::RoomCreate {
|
||||||
|
create_event = Some((state_event_id, state_event_json.clone()));
|
||||||
let event_id = gen_event_id(&event, &room_version_rules)?;
|
}
|
||||||
let shortstatekey = services
|
entry.insert(state_event_json);
|
||||||
.rooms
|
},
|
||||||
.short
|
}
|
||||||
.get_or_create_shortstatekey(&event_type, &state_key)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
event.insert("event_id".into(), CanonicalJsonValue::String(event_id.to_string()));
|
|
||||||
services.rooms.outlier.add_pdu_outlier(&event_id, &event);
|
|
||||||
state_map.insert(shortstatekey, event_id.clone());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("Compressing state from send_knock");
|
if let Some((create_event_id, create_event_json)) = &create_event {
|
||||||
let compressed: CompressedState = services
|
state.retain(|key, event_json| {
|
||||||
.rooms
|
if let Err(e) = service::rooms::event_handler::Service::pdu_format_check_1(
|
||||||
.state_compressor
|
event_json,
|
||||||
.compress_state_events(state_map.iter().map(|(ssk, eid)| (ssk, eid.borrow())))
|
&room_version_rules,
|
||||||
.collect()
|
create_event_id,
|
||||||
.await;
|
) {
|
||||||
|
debug_warn!(
|
||||||
|
?key,
|
||||||
|
"Dropping event from knock_room_state violating room event format: {e}"
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
true
|
||||||
|
});
|
||||||
|
|
||||||
debug!("Saving compressed state");
|
// Much like when receiving an invite over federation, if we're in this
|
||||||
let HashSetCompressStateEvent {
|
// room we'll receive the knock PDU over /send. Otherwise, we need to
|
||||||
shortstatehash: statehash_before_knock,
|
// add it as an outlier. Since this function isn't a fallback when local
|
||||||
added,
|
// knocks fail, we can do this unconditionally.
|
||||||
removed,
|
services
|
||||||
} = services
|
.rooms
|
||||||
.rooms
|
.outlier
|
||||||
.state_compressor
|
.add_pdu_outlier(create_event_id, create_event_json);
|
||||||
.save_state(room_id, Arc::new(compressed))
|
}
|
||||||
.await?;
|
|
||||||
|
|
||||||
debug!("Forcing state for new room");
|
state.insert(StateEventType::RoomMember.with_state_key(sender_user.as_str()), stub);
|
||||||
services
|
|
||||||
.rooms
|
|
||||||
.state
|
|
||||||
.force_state(room_id, statehash_before_knock, added, removed, &state_lock)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
let statehash_after_knock = services
|
let knocked_state = state
|
||||||
.rooms
|
.into_values()
|
||||||
.state
|
.filter_map(|event_json| serde_json::value::to_raw_value(&event_json).ok())
|
||||||
.append_to_state(&parsed_knock_pdu, room_id)
|
.map(RawStrippedState::Pdu)
|
||||||
.await?;
|
.collect();
|
||||||
|
|
||||||
info!("Updating membership locally to knock state with provided stripped state events");
|
info!("Saving knock data");
|
||||||
// TODO: see TODO on the other call to `update_membership`
|
|
||||||
services
|
services
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.update_membership(room_id, sender_user, &parsed_knock_pdu, false)
|
.mark_as_knocked(sender_user, room_id, knocked_state);
|
||||||
.await?;
|
|
||||||
|
|
||||||
info!("Appending room knock event locally");
|
|
||||||
services
|
services
|
||||||
.rooms
|
.rooms
|
||||||
.timeline
|
.state_cache
|
||||||
.progress_extremities(&parsed_knock_pdu)
|
.update_joined_count(room_id)
|
||||||
.await?;
|
|
||||||
services
|
|
||||||
.rooms
|
|
||||||
.timeline
|
|
||||||
.append_pdu(&parsed_knock_pdu, knock_event, room_id)
|
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
info!("Setting final room state for new room");
|
services.sync.wake(sender_user).await;
|
||||||
// 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
|
|
||||||
.set_room_state(room_id, statehash_after_knock, &state_lock);
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -686,18 +437,13 @@ async fn make_knock_request(
|
|||||||
sender_user: &UserId,
|
sender_user: &UserId,
|
||||||
room_id: &RoomId,
|
room_id: &RoomId,
|
||||||
servers: &[OwnedServerName],
|
servers: &[OwnedServerName],
|
||||||
) -> Result<(federation::membership::prepare_knock_event::v1::Response, OwnedServerName)> {
|
) -> Result<(CanonicalJsonObject, RoomVersionId, OwnedServerName)> {
|
||||||
let mut make_knock_response_and_server =
|
for (idx, remote_server) in servers.iter().enumerate() {
|
||||||
Err!(BadServerResponse("No server available to assist in knocking."));
|
|
||||||
|
|
||||||
let mut make_knock_counter: usize = 0;
|
|
||||||
|
|
||||||
for remote_server in servers {
|
|
||||||
if services.globals.server_is_ours(remote_server) {
|
if services.globals.server_is_ours(remote_server) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("Asking {remote_server} for make_knock ({make_knock_counter})");
|
info!("Asking {remote_server} for make_knock ({})", idx.saturating_add(1));
|
||||||
|
|
||||||
let mut request = federation::membership::prepare_knock_event::v1::Request::new(
|
let mut request = federation::membership::prepare_knock_event::v1::Request::new(
|
||||||
room_id.to_owned(),
|
room_id.to_owned(),
|
||||||
@@ -711,36 +457,51 @@ async fn make_knock_request(
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
trace!("make_knock response: {make_knock_response:?}");
|
trace!("make_knock response: {make_knock_response:?}");
|
||||||
make_knock_counter = make_knock_counter.saturating_add(1);
|
match make_knock_response
|
||||||
if let Ok(r) = &make_knock_response {
|
.and_then(|r| {
|
||||||
if let Err(e) = validate_remote_member_event_stub(
|
to_canonical_object(&r.event)
|
||||||
&MembershipState::Knock,
|
.map(|o| (o, r.room_version))
|
||||||
sender_user,
|
.map_err(Into::into)
|
||||||
room_id,
|
})
|
||||||
&to_canonical_object(&r.event)?,
|
.and_then(|(stub, room_version)| {
|
||||||
) {
|
validate_remote_member_event_stub(
|
||||||
warn!("make_knock response from {remote_server} failed validation: {e}");
|
&MembershipState::Knock,
|
||||||
continue;
|
sender_user,
|
||||||
}
|
room_id,
|
||||||
}
|
&stub,
|
||||||
|
)
|
||||||
make_knock_response_and_server = make_knock_response.map(|r| (r, remote_server.clone()));
|
.map(|()| (stub, room_version))
|
||||||
|
}) {
|
||||||
if make_knock_response_and_server.is_ok() {
|
| Ok((evt, room_version)) =>
|
||||||
break;
|
return Ok((evt, room_version, remote_server.to_owned())),
|
||||||
}
|
| Err(e) => match e.kind() {
|
||||||
|
| ErrorKind::IncompatibleRoomVersion(IncompatibleRoomVersionErrorData {
|
||||||
if make_knock_counter > 40 {
|
room_version,
|
||||||
warn!(
|
..
|
||||||
"50 servers failed to provide valid make_knock response, assuming no server can \
|
}) => {
|
||||||
assist in knocking."
|
warn!(
|
||||||
);
|
"{remote_server} reports the room we are trying to knock on is \
|
||||||
make_knock_response_and_server =
|
v{room_version}, which we do not support."
|
||||||
Err!(BadServerResponse("No server available to assist in knocking."));
|
);
|
||||||
|
return Err(e);
|
||||||
return make_knock_response_and_server;
|
},
|
||||||
|
| ErrorKind::Forbidden => {
|
||||||
|
warn!("{remote_server} refuses to let us knock: {e}.");
|
||||||
|
return Err(e);
|
||||||
|
},
|
||||||
|
| ErrorKind::NotFound => {
|
||||||
|
info!(
|
||||||
|
"{remote_server} does not know about {room_id}: {e}. Will continue \
|
||||||
|
trying."
|
||||||
|
);
|
||||||
|
},
|
||||||
|
| _ => {
|
||||||
|
info!("{remote_server} failed to make_knock: {e}. Will continue trying.");
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
make_knock_response_and_server
|
info!("All {} servers were unable to assist in knocking {room_id} :(", servers.len());
|
||||||
|
Err!(BadServerResponse("No server available to assist in knocking."))
|
||||||
}
|
}
|
||||||
@@ -10,10 +10,7 @@ use conduwuit::{
|
|||||||
use futures::{FutureExt, StreamExt, pin_mut};
|
use futures::{FutureExt, StreamExt, pin_mut};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
CanonicalJsonObject, CanonicalJsonValue, OwnedServerName, RoomId, UserId,
|
CanonicalJsonObject, CanonicalJsonValue, OwnedServerName, RoomId, UserId,
|
||||||
api::{
|
api::{client::membership::leave_room, federation},
|
||||||
client::membership::leave_room,
|
|
||||||
federation::{self},
|
|
||||||
},
|
|
||||||
events::{
|
events::{
|
||||||
StateEventType,
|
StateEventType,
|
||||||
room::member::{MembershipState, RoomMemberEventContent},
|
room::member::{MembershipState, RoomMemberEventContent},
|
||||||
@@ -91,19 +88,13 @@ pub async fn leave_room(
|
|||||||
.server_in_room(services.globals.server_name(), room_id)
|
.server_in_room(services.globals.server_name(), room_id)
|
||||||
.eq(&false);
|
.eq(&false);
|
||||||
|
|
||||||
let not_knocked = services
|
|
||||||
.rooms
|
|
||||||
.state_cache
|
|
||||||
.is_knocked(user_id, room_id)
|
|
||||||
.eq(&false);
|
|
||||||
|
|
||||||
pin_mut!(is_banned, is_disabled);
|
pin_mut!(is_banned, is_disabled);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
there are three possible cases when leaving a room:
|
there are three possible cases when leaving a room:
|
||||||
1. the room is banned or disabled, so we're not federating with it.
|
1. the room is banned or disabled, so we're not federating with it.
|
||||||
2. nobody on the homeserver is in the room, which can happen if the user is rejecting an invite
|
2. nobody on the homeserver is in the room, which can happen if the user is rejecting an invite
|
||||||
to a room that we don't have any members in.
|
or rescinding a knock for a room that we don't have any members in.
|
||||||
3. someone else on the homeserver is in the room. in this case we can leave like normal by sending a PDU over federation.
|
3. someone else on the homeserver is in the room. in this case we can leave like normal by sending a PDU over federation.
|
||||||
|
|
||||||
in cases 1 and 2, we have to update the state cache using `mark_as_left` directly.
|
in cases 1 and 2, we have to update the state cache using `mark_as_left` directly.
|
||||||
@@ -116,7 +107,7 @@ pub async fn leave_room(
|
|||||||
// case 1: the room is banned/disabled. we don't want to federate with
|
// 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.
|
// another server to leave, so we can't create an outlier PDU.
|
||||||
None
|
None
|
||||||
} else if dont_have_room.and(not_knocked).await {
|
} else if dont_have_room.await {
|
||||||
// case 2: ask a remote server to assist us with leaving
|
// case 2: ask a remote server to assist us with leaving
|
||||||
// we always mark the room as left locally, regardless of if the
|
// we always mark the room as left locally, regardless of if the
|
||||||
// federated leave failed
|
// federated leave failed
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use conduwuit::{
|
|||||||
use futures::{FutureExt, StreamExt, future::join};
|
use futures::{FutureExt, StreamExt, future::join};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
api::client::membership::{
|
api::client::membership::{
|
||||||
get_member_events::{self},
|
get_member_events,
|
||||||
joined_members::{self, v3::RoomMember},
|
joined_members::{self, v3::RoomMember},
|
||||||
},
|
},
|
||||||
events::{
|
events::{
|
||||||
|
|||||||
+21
-11
@@ -1,6 +1,8 @@
|
|||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Err, Error, Result, at, debug_warn,
|
Err, Error, Result, at,
|
||||||
|
config::experiments::ToggledExperiment,
|
||||||
|
debug_warn,
|
||||||
matrix::{
|
matrix::{
|
||||||
event::{Event, Matches},
|
event::{Event, Matches},
|
||||||
pdu::PduCount,
|
pdu::PduCount,
|
||||||
@@ -315,21 +317,29 @@ where
|
|||||||
|
|
||||||
if server_ignored {
|
if server_ignored {
|
||||||
// the sender's server is ignored, so ignore this event
|
// the sender's server is ignored, so ignore this event
|
||||||
return Err(Error::BadRequest(
|
return if services.config.experiments.msc4406.is_enabled() {
|
||||||
ErrorKind::SenderIgnored(SenderIgnoredErrorData::new()),
|
Err(Error::BadRequest(
|
||||||
"The sender's server is ignored by this server.",
|
ErrorKind::SenderIgnored(SenderIgnoredErrorData::new()),
|
||||||
));
|
"The sender's server is ignored by this server.",
|
||||||
|
))
|
||||||
|
} else {
|
||||||
|
Err!(Request(NotFound("This event's sender's homeserver is ignored by this server.")))
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if user_ignored && !services.config.send_messages_from_ignored_users_to_client {
|
if user_ignored && !services.config.send_messages_from_ignored_users_to_client {
|
||||||
// the recipient of this PDU has the sender ignored, and we're not
|
// the recipient of this PDU has the sender ignored, and we're not
|
||||||
// configured to send ignored messages to clients
|
// configured to send ignored messages to clients
|
||||||
return Err(Error::BadRequest(
|
return if services.config.experiments.msc4406.is_enabled() {
|
||||||
ErrorKind::SenderIgnored(SenderIgnoredErrorData::with_sender(
|
Err(Error::BadRequest(
|
||||||
event.sender().to_owned(),
|
ErrorKind::SenderIgnored(SenderIgnoredErrorData::with_sender(
|
||||||
)),
|
event.sender().to_owned(),
|
||||||
"You have ignored this sender.",
|
)),
|
||||||
));
|
"You have ignored this sender.",
|
||||||
|
))
|
||||||
|
} else {
|
||||||
|
Err!(Request(NotFound("You have ignored the sender of this event.")))
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(false)
|
Ok(false)
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ pub(super) mod directory;
|
|||||||
pub(super) mod filter;
|
pub(super) mod filter;
|
||||||
pub(super) mod keys;
|
pub(super) mod keys;
|
||||||
pub(super) mod media;
|
pub(super) mod media;
|
||||||
pub(super) mod media_legacy;
|
|
||||||
pub(super) mod membership;
|
pub(super) mod membership;
|
||||||
pub(super) mod message;
|
pub(super) mod message;
|
||||||
pub(super) mod mutual_rooms;
|
pub(super) mod mutual_rooms;
|
||||||
@@ -24,6 +23,7 @@ pub(super) mod push;
|
|||||||
pub(super) mod read_marker;
|
pub(super) mod read_marker;
|
||||||
pub(super) mod redact;
|
pub(super) mod redact;
|
||||||
pub(super) mod relations;
|
pub(super) mod relations;
|
||||||
|
pub(super) mod rendezvous;
|
||||||
pub(super) mod report;
|
pub(super) mod report;
|
||||||
pub(super) mod room;
|
pub(super) mod room;
|
||||||
pub(super) mod search;
|
pub(super) mod search;
|
||||||
@@ -57,7 +57,6 @@ pub(super) use directory::*;
|
|||||||
pub(super) use filter::*;
|
pub(super) use filter::*;
|
||||||
pub(super) use keys::*;
|
pub(super) use keys::*;
|
||||||
pub(super) use media::*;
|
pub(super) use media::*;
|
||||||
pub(super) use media_legacy::*;
|
|
||||||
pub(super) use membership::*;
|
pub(super) use membership::*;
|
||||||
pub use membership::{leave_all_rooms, leave_room, remote_leave_room};
|
pub use membership::{leave_all_rooms, leave_room, remote_leave_room};
|
||||||
pub(super) use message::*;
|
pub(super) use message::*;
|
||||||
@@ -71,6 +70,7 @@ pub(super) use push::*;
|
|||||||
pub(super) use read_marker::*;
|
pub(super) use read_marker::*;
|
||||||
pub(super) use redact::*;
|
pub(super) use redact::*;
|
||||||
pub(super) use relations::*;
|
pub(super) use relations::*;
|
||||||
|
pub(super) use rendezvous::*;
|
||||||
pub(super) use report::*;
|
pub(super) use report::*;
|
||||||
pub(super) use room::*;
|
pub(super) use room::*;
|
||||||
pub(super) use search::*;
|
pub(super) use search::*;
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ use crate::Ruma;
|
|||||||
#[tracing::instrument(skip_all, name = "mutual_rooms", level = "info")]
|
#[tracing::instrument(skip_all, name = "mutual_rooms", level = "info")]
|
||||||
pub(crate) async fn get_mutual_rooms_unstable_route(
|
pub(crate) async fn get_mutual_rooms_unstable_route(
|
||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
body: Ruma<get_mutual_rooms::unstable::Request>,
|
body: Ruma<get_mutual_rooms::msc2666::Request>,
|
||||||
) -> Result<get_mutual_rooms::unstable::Response> {
|
) -> Result<get_mutual_rooms::msc2666::Response> {
|
||||||
let sender_user = body.identity.expect_sender_user()?;
|
let sender_user = body.identity.expect_sender_user()?;
|
||||||
|
|
||||||
if sender_user == body.user_id {
|
if sender_user == body.user_id {
|
||||||
@@ -28,7 +28,7 @@ pub(crate) async fn get_mutual_rooms_unstable_route(
|
|||||||
.collect()
|
.collect()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
Ok(get_mutual_rooms::unstable::Response::new(mutual_rooms))
|
Ok(get_mutual_rooms::msc2666::Response::new(mutual_rooms))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// # `GET /_matrix/client/v1/mutual_rooms`
|
/// # `GET /_matrix/client/v1/mutual_rooms`
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
use axum::extract::State;
|
||||||
|
use conduwuit::{Err, Result};
|
||||||
|
use http::HeaderMap;
|
||||||
|
use ruma::api::client::rendezvous::{
|
||||||
|
create_rendezvous_session, delete_rendezvous_session, discover_rendezvous,
|
||||||
|
get_rendezvous_session, update_rendezvous_session,
|
||||||
|
};
|
||||||
|
use service::Services;
|
||||||
|
|
||||||
|
use crate::{Ruma, router::ClientIdentity};
|
||||||
|
|
||||||
|
/// `GET /_matrix/client/msc4388/io.element.msc4388/rendezvous`
|
||||||
|
pub(crate) async fn discover_rendezvous_route(
|
||||||
|
State(services): State<crate::State>,
|
||||||
|
body: Ruma<discover_rendezvous::msc4388::Request>,
|
||||||
|
) -> Result<discover_rendezvous::msc4388::Response> {
|
||||||
|
Ok(discover_rendezvous::msc4388::Response::new(rendezvous_available(
|
||||||
|
&services,
|
||||||
|
body.identity.as_ref(),
|
||||||
|
)))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `POST /_matrix/client/msc4388/io.element.msc4388/rendezvous/`
|
||||||
|
pub(crate) async fn create_rendezvous_session_route(
|
||||||
|
State(services): State<crate::State>,
|
||||||
|
body: Ruma<create_rendezvous_session::msc4388::Request>,
|
||||||
|
) -> Result<create_rendezvous_session::msc4388::Response> {
|
||||||
|
if !rendezvous_available(&services, body.identity.as_ref()) {
|
||||||
|
return Err!(Request(Forbidden("You are not authorized to create a rendezvous session")));
|
||||||
|
}
|
||||||
|
|
||||||
|
services.rendezvous.create_session(body.data.clone())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `PUT /_matrix/client/msc4388/io.element.msc4388/rendezvous/{id}/{txn_id}`
|
||||||
|
pub(crate) async fn update_rendezvous_session_route(
|
||||||
|
State(services): State<crate::State>,
|
||||||
|
body: Ruma<update_rendezvous_session::msc4388::Request>,
|
||||||
|
) -> Result<update_rendezvous_session::msc4388::Response> {
|
||||||
|
services.rendezvous.update_session(
|
||||||
|
&body.id,
|
||||||
|
body.txn_id.clone(),
|
||||||
|
body.sequence_token.clone(),
|
||||||
|
body.data.clone(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `GET /_matrix/client/msc4388/io.element.msc4388/rendezvous/{id}`
|
||||||
|
pub(crate) async fn get_rendezvous_session_route(
|
||||||
|
State(services): State<crate::State>,
|
||||||
|
headers: HeaderMap,
|
||||||
|
body: Ruma<get_rendezvous_session::msc4388::Request>,
|
||||||
|
) -> Result<get_rendezvous_session::msc4388::Response> {
|
||||||
|
if let Some(mode) = headers.get("Sec-Fetch-Mode")
|
||||||
|
&& let Ok(mode) = mode.to_str()
|
||||||
|
&& mode == "navigate"
|
||||||
|
{
|
||||||
|
return Err!(Request(Forbidden(
|
||||||
|
"Rendezvous sessions do not accept browser navigation requests."
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
services.rendezvous.get_session(&body.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `DELETE /_matrix/client/msc4388/io.element.msc4388/rendezvous/{id}`
|
||||||
|
pub(crate) async fn delete_rendezvous_session_route(
|
||||||
|
State(services): State<crate::State>,
|
||||||
|
body: Ruma<delete_rendezvous_session::msc4388::Request>,
|
||||||
|
) -> Result<delete_rendezvous_session::msc4388::Response> {
|
||||||
|
services.rendezvous.delete_session(&body.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn rendezvous_available(services: &Services, identity: Option<&ClientIdentity>) -> bool {
|
||||||
|
!services.config.require_auth_for_rendezvous || identity.is_some()
|
||||||
|
}
|
||||||
@@ -77,7 +77,7 @@ struct FullCreationContent {
|
|||||||
/// - Send events listed in initial state
|
/// - Send events listed in initial state
|
||||||
/// - Send events implied by `name` and `topic`
|
/// - Send events implied by `name` and `topic`
|
||||||
/// - Send invite events
|
/// - Send invite events
|
||||||
#[allow(clippy::large_stack_frames)]
|
#[allow(clippy::large_unopt_stack_frames)]
|
||||||
#[allow(clippy::cognitive_complexity)]
|
#[allow(clippy::cognitive_complexity)]
|
||||||
pub(crate) async fn create_room_route(
|
pub(crate) async fn create_room_route(
|
||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
@@ -121,7 +121,10 @@ pub(crate) async fn create_room_route(
|
|||||||
// ID exactly matches this, and abort if it doesn't. Otherwise, we use it
|
// ID exactly matches this, and abort if it doesn't. Otherwise, we use it
|
||||||
// as the room ID itself.
|
// as the room ID itself.
|
||||||
let expect_room_id = {
|
let expect_room_id = {
|
||||||
let body_ref = body.json_body.as_ref().unwrap();
|
let body_ref = body
|
||||||
|
.json_body
|
||||||
|
.as_ref()
|
||||||
|
.ok_or_else(|| err!(Request(BadJson("Invalid JSON body"))))?;
|
||||||
if let Some(CanonicalJsonValue::String(room_id)) = body_ref
|
if let Some(CanonicalJsonValue::String(room_id)) = body_ref
|
||||||
.get("fi.mau.room_id")
|
.get("fi.mau.room_id")
|
||||||
.or_else(|| body_ref.get("room_id"))
|
.or_else(|| body_ref.get("room_id"))
|
||||||
@@ -302,7 +305,10 @@ pub(crate) async fn create_room_route(
|
|||||||
// Allow requesters to override the `origin_server_ts` to customize room ids
|
// Allow requesters to override the `origin_server_ts` to customize room ids
|
||||||
// from v12 onwards
|
// from v12 onwards
|
||||||
let custom_origin_server_ts = {
|
let custom_origin_server_ts = {
|
||||||
let body_ref = body.json_body.as_ref().unwrap();
|
let body_ref = body
|
||||||
|
.json_body
|
||||||
|
.as_ref()
|
||||||
|
.ok_or_else(|| err!(Request(BadJson("Invalid JSON body"))))?;
|
||||||
body_ref
|
body_ref
|
||||||
.get("origin_server_ts")
|
.get("origin_server_ts")
|
||||||
.or_else(|| body_ref.get("fi.mau.origin_server_ts"))
|
.or_else(|| body_ref.get("fi.mau.origin_server_ts"))
|
||||||
|
|||||||
@@ -1,14 +1,30 @@
|
|||||||
use axum::extract::State;
|
use axum::extract::{Query, State};
|
||||||
use conduwuit::{Err, Event, Result, debug_warn, err};
|
use conduwuit::{
|
||||||
use ruma::api::client::room::get_room_event;
|
Err, Error, Event, PduEvent, Result, config::experiments::ToggledExperiment, debug_warn, err,
|
||||||
|
};
|
||||||
|
use futures::TryFutureExt;
|
||||||
|
use http::StatusCode;
|
||||||
|
use ruma::{
|
||||||
|
UserId,
|
||||||
|
api::{client::room::get_room_event, error::ErrorKind},
|
||||||
|
};
|
||||||
|
use serde::Deserialize;
|
||||||
|
use serde_json::json;
|
||||||
|
|
||||||
use crate::{Ruma, client::is_ignored_pdu};
|
use crate::{Ruma, client::is_ignored_pdu};
|
||||||
|
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
pub(crate) struct Msc2815Params {
|
||||||
|
#[serde(rename = "fi.mau.msc2815.include_unredacted_content", default)]
|
||||||
|
include_unredacted_content: Option<bool>,
|
||||||
|
}
|
||||||
|
|
||||||
/// # `GET /_matrix/client/r0/rooms/{roomId}/event/{eventId}`
|
/// # `GET /_matrix/client/r0/rooms/{roomId}/event/{eventId}`
|
||||||
///
|
///
|
||||||
/// Gets a single event.
|
/// Gets a single event.
|
||||||
pub(crate) async fn get_room_event_route(
|
pub(crate) async fn get_room_event_route(
|
||||||
State(ref services): State<crate::State>,
|
State(ref services): State<crate::State>,
|
||||||
|
Query(params): Query<Msc2815Params>,
|
||||||
ref body: Ruma<get_room_event::v3::Request>,
|
ref body: Ruma<get_room_event::v3::Request>,
|
||||||
) -> Result<get_room_event::v3::Response> {
|
) -> Result<get_room_event::v3::Response> {
|
||||||
let sender_user = body.identity.expect_sender_user()?;
|
let sender_user = body.identity.expect_sender_user()?;
|
||||||
@@ -54,6 +70,13 @@ pub(crate) async fn get_room_event_route(
|
|||||||
return Err!(Request(Forbidden("You don't have permission to view this event.")));
|
return Err!(Request(Forbidden("You don't have permission to view this event.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if services.config.experiments.msc2815.is_enabled()
|
||||||
|
&& params.include_unredacted_content.unwrap_or(false)
|
||||||
|
&& event.is_redacted()
|
||||||
|
{
|
||||||
|
unredact(services, sender_user, &mut event).await?;
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(e) = services
|
if let Err(e) = services
|
||||||
.rooms
|
.rooms
|
||||||
.pdu_metadata
|
.pdu_metadata
|
||||||
@@ -72,3 +95,59 @@ pub(crate) async fn get_room_event_route(
|
|||||||
|
|
||||||
Ok(get_room_event::v3::Response::new(event.into_format()))
|
Ok(get_room_event::v3::Response::new(event.into_format()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn unredact(services: &crate::State, sender_user: &UserId, event: &mut PduEvent) -> Result {
|
||||||
|
if !services.users.is_admin(sender_user).await {
|
||||||
|
let power_levels = services
|
||||||
|
.rooms
|
||||||
|
.state_accessor
|
||||||
|
.get_room_power_levels(&event.room_id_or_hash())
|
||||||
|
.await;
|
||||||
|
|
||||||
|
if power_levels.for_user(sender_user) < power_levels.redact {
|
||||||
|
return Err!(Request(Forbidden(
|
||||||
|
"You don't have permission to view redacted content in this room."
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let content = services
|
||||||
|
.rooms
|
||||||
|
.timeline
|
||||||
|
.get_pdu_id(event.event_id())
|
||||||
|
.and_then(async |pdu_id| {
|
||||||
|
services
|
||||||
|
.rooms
|
||||||
|
.timeline
|
||||||
|
.get_unredacted_content(&pdu_id)
|
||||||
|
.await
|
||||||
|
})
|
||||||
|
.await;
|
||||||
|
|
||||||
|
let Ok(content) = content else {
|
||||||
|
// CustomErrorKind has private fields; only serde can build one.
|
||||||
|
let keep_ms = services
|
||||||
|
.config
|
||||||
|
.experiments
|
||||||
|
.msc2815
|
||||||
|
.expect("msc2815 config is disabled but unredact() attempted to access it anyway")
|
||||||
|
.unredacted_content_max_age_secs
|
||||||
|
.saturating_mul(1000);
|
||||||
|
|
||||||
|
let kind = serde_json::from_value::<ErrorKind>(json!({
|
||||||
|
"errcode": "FI.MAU.MSC2815_UNREDACTED_CONTENT_DELETED",
|
||||||
|
"fi.mau.msc2815.content_keep_ms": keep_ms,
|
||||||
|
}))
|
||||||
|
.expect("errcode is a valid custom error kind");
|
||||||
|
|
||||||
|
return Err(Error::Request(
|
||||||
|
kind,
|
||||||
|
"The unredacted content of this event is not available.".into(),
|
||||||
|
StatusCode::NOT_FOUND,
|
||||||
|
));
|
||||||
|
};
|
||||||
|
|
||||||
|
event.content = content;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
@@ -94,8 +94,7 @@ pub(crate) async fn room_initial_sync_route(
|
|||||||
.first()
|
.first()
|
||||||
.map(at!(0))
|
.map(at!(0))
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(ToString::to_string)
|
.map_or_default(ToString::to_string);
|
||||||
.unwrap_or_default();
|
|
||||||
let start = events.last().map(at!(0)).as_ref().map(ToString::to_string);
|
let start = events.last().map(at!(0)).as_ref().map(ToString::to_string);
|
||||||
|
|
||||||
let chunk = events
|
let chunk = events
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ mod event;
|
|||||||
mod initial_sync;
|
mod initial_sync;
|
||||||
mod stripped_state;
|
mod stripped_state;
|
||||||
mod summary;
|
mod summary;
|
||||||
|
mod timestamp_to_event;
|
||||||
mod upgrade;
|
mod upgrade;
|
||||||
|
|
||||||
pub(crate) use self::{
|
pub(crate) use self::{
|
||||||
aliases::get_room_aliases_route, create::create_room_route, event::get_room_event_route,
|
aliases::get_room_aliases_route, create::create_room_route, event::get_room_event_route,
|
||||||
initial_sync::room_initial_sync_route, stripped_state::get_stripped_state_route,
|
initial_sync::room_initial_sync_route, stripped_state::get_stripped_state_route,
|
||||||
summary::get_room_summary, upgrade::upgrade_room_route,
|
summary::get_room_summary, timestamp_to_event::get_event_by_timestamp_route,
|
||||||
|
upgrade::upgrade_room_route,
|
||||||
};
|
};
|
||||||
@@ -15,11 +15,11 @@ use crate::{Ruma, router::ClientIdentity};
|
|||||||
#[tracing::instrument(skip_all, name = "stripped_state", level = "info")]
|
#[tracing::instrument(skip_all, name = "stripped_state", level = "info")]
|
||||||
pub(crate) async fn get_stripped_state_route(
|
pub(crate) async fn get_stripped_state_route(
|
||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
body: Ruma<get_stripped_state::unstable::Request>,
|
body: Ruma<get_stripped_state::msc4560::Request>,
|
||||||
) -> Result<get_stripped_state::unstable::Response> {
|
) -> Result<get_stripped_state::msc4560::Response> {
|
||||||
let user_id = body.identity.as_ref().and_then(ClientIdentity::sender_user);
|
let user_id = body.identity.as_ref().and_then(ClientIdentity::sender_user);
|
||||||
|
|
||||||
if body.via.len() > get_stripped_state::unstable::MAX_VIAS {
|
if body.via.len() > get_stripped_state::msc4560::MAX_VIAS {
|
||||||
return Err!(Request(TooLarge("Too many vias, please be less indecisive.")));
|
return Err!(Request(TooLarge("Too many vias, please be less indecisive.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ pub(crate) async fn get_stripped_state_route(
|
|||||||
via,
|
via,
|
||||||
RoomStrippedState { state, num_joined_members, .. },
|
RoomStrippedState { state, num_joined_members, .. },
|
||||||
)) => Ok(
|
)) => Ok(
|
||||||
assign!(get_stripped_state::unstable::Response::new(via), { state, num_joined_members }),
|
assign!(get_stripped_state::msc4560::Response::new(via), { state, num_joined_members }),
|
||||||
),
|
),
|
||||||
| Accessibility::Inaccessible => {
|
| Accessibility::Inaccessible => {
|
||||||
Err!(Request(Forbidden("You may not request this room's stripped state.")))
|
Err!(Request(Forbidden("You may not request this room's stripped state.")))
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ pub(crate) async fn get_room_summary(
|
|||||||
Err!(Request(Forbidden("You may not preview this room."), FORBIDDEN))
|
Err!(Request(Forbidden("You may not preview this room."), FORBIDDEN))
|
||||||
},
|
},
|
||||||
| Accessibility::NotFound => {
|
| Accessibility::NotFound => {
|
||||||
Err!(Request(Forbidden("This room does not exist."), FORBIDDEN))
|
Err!(Request(NotFound("This room does not exist.")))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
use axum::extract::State;
|
||||||
|
use conduwuit::{Err, Event, Result, utils::stream::TryIgnore};
|
||||||
|
use futures::{StreamExt, pin_mut};
|
||||||
|
use ruma::api::client::room::get_event_by_timestamp;
|
||||||
|
|
||||||
|
use crate::Ruma;
|
||||||
|
|
||||||
|
const MAX_CANDIDATES: usize = 20;
|
||||||
|
|
||||||
|
/// # `GET /_matrix/client/v1/rooms/{roomId}/timestamp_to_event`
|
||||||
|
///
|
||||||
|
/// Gets the ID of the event closest to the given timestamp, in the direction
|
||||||
|
/// specified by `dir`.
|
||||||
|
pub(crate) async fn get_event_by_timestamp_route(
|
||||||
|
State(ref services): State<crate::State>,
|
||||||
|
body: Ruma<get_event_by_timestamp::v1::Request>,
|
||||||
|
) -> Result<get_event_by_timestamp::v1::Response> {
|
||||||
|
let sender_user = body.identity.expect_sender_user()?;
|
||||||
|
let room_id = &body.room_id;
|
||||||
|
|
||||||
|
if !services
|
||||||
|
.rooms
|
||||||
|
.state_accessor
|
||||||
|
.user_can_see_state_events(sender_user, room_id)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
return Err!(Request(Forbidden("You don't have permission to view this room.")));
|
||||||
|
}
|
||||||
|
|
||||||
|
if !services.rooms.timeline.timestamp_index_ready().await {
|
||||||
|
return Err!(FeatureDisabled("timestamp_to_event"));
|
||||||
|
}
|
||||||
|
|
||||||
|
let candidates = services
|
||||||
|
.rooms
|
||||||
|
.timeline
|
||||||
|
.pdus_by_timestamp(room_id, body.ts, body.dir)
|
||||||
|
.ignore_err()
|
||||||
|
.take(MAX_CANDIDATES);
|
||||||
|
|
||||||
|
pin_mut!(candidates);
|
||||||
|
while let Some((_, pdu)) = candidates.next().await {
|
||||||
|
if services
|
||||||
|
.rooms
|
||||||
|
.state_accessor
|
||||||
|
.user_can_see_event(sender_user, room_id, pdu.event_id())
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
return Ok(get_event_by_timestamp::v1::Response::new(
|
||||||
|
pdu.event_id().to_owned(),
|
||||||
|
pdu.origin_server_ts(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Err!(Request(NotFound(
|
||||||
|
"Unable to find event from {} in direction {:?}",
|
||||||
|
body.ts.get(),
|
||||||
|
body.dir
|
||||||
|
)))
|
||||||
|
}
|
||||||
@@ -95,12 +95,7 @@ pub(crate) async fn send_message_event_route(
|
|||||||
PartialPdu {
|
PartialPdu {
|
||||||
event_type: body.event_type.clone().into(),
|
event_type: body.event_type.clone().into(),
|
||||||
content,
|
content,
|
||||||
sticky: services
|
sticky: body.sticky_duration_ms.map(sticky::object),
|
||||||
.config
|
|
||||||
.allow_sticky_events
|
|
||||||
.then_some(body.sticky_duration_ms)
|
|
||||||
.flatten()
|
|
||||||
.map(sticky::object),
|
|
||||||
unsigned: Some(unsigned),
|
unsigned: Some(unsigned),
|
||||||
timestamp: if body.identity.is_appservice()
|
timestamp: if body.identity.is_appservice()
|
||||||
|| services.admin.user_is_admin(sender_user).await
|
|| services.admin.user_is_admin(sender_user).await
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ pub(super) async fn load_joined_room(
|
|||||||
services: &Services,
|
services: &Services,
|
||||||
sync_context: SyncContext<'_>,
|
sync_context: SyncContext<'_>,
|
||||||
ref room_id: OwnedRoomId,
|
ref room_id: OwnedRoomId,
|
||||||
) -> Result<(JoinedRoom, DeviceListUpdates)> {
|
) -> Result<JoinedRoom> {
|
||||||
/*
|
/*
|
||||||
Building a sync response involves many steps which all depend on each other.
|
Building a sync response involves many steps which all depend on each other.
|
||||||
To parallelize the process as much as possible, each step is divided into its own function,
|
To parallelize the process as much as possible, each step is divided into its own function,
|
||||||
@@ -80,7 +80,6 @@ pub(super) async fn load_joined_room(
|
|||||||
sticky,
|
sticky,
|
||||||
summary,
|
summary,
|
||||||
notification_counts,
|
notification_counts,
|
||||||
device_list_updates,
|
|
||||||
},
|
},
|
||||||
) = try_join3(
|
) = try_join3(
|
||||||
build_account_data(services, sync_context, room_id),
|
build_account_data(services, sync_context, room_id),
|
||||||
@@ -117,7 +116,7 @@ pub(super) async fn load_joined_room(
|
|||||||
unread_thread_notifications: BTreeMap::new(),
|
unread_thread_notifications: BTreeMap::new(),
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok((joined_room, device_list_updates))
|
Ok(joined_room)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Collect changes to the syncing user's account data events.
|
/// Collect changes to the syncing user's account data events.
|
||||||
@@ -263,7 +262,6 @@ struct StateAndTimeline {
|
|||||||
sticky: Sticky,
|
sticky: Sticky,
|
||||||
summary: Option<RoomSummary>,
|
summary: Option<RoomSummary>,
|
||||||
notification_counts: Option<UnreadNotificationsCount>,
|
notification_counts: Option<UnreadNotificationsCount>,
|
||||||
device_list_updates: DeviceListUpdates,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn build_sticky_events(
|
async fn build_sticky_events(
|
||||||
@@ -273,10 +271,6 @@ async fn build_sticky_events(
|
|||||||
timeline: &TimelinePdus,
|
timeline: &TimelinePdus,
|
||||||
joined_since_last_sync: bool,
|
joined_since_last_sync: bool,
|
||||||
) -> Sticky {
|
) -> Sticky {
|
||||||
if !services.config.allow_sticky_events {
|
|
||||||
return Sticky::new();
|
|
||||||
}
|
|
||||||
|
|
||||||
let SyncContext {
|
let SyncContext {
|
||||||
syncing_user,
|
syncing_user,
|
||||||
last_sync_end_count,
|
last_sync_end_count,
|
||||||
@@ -381,24 +375,14 @@ async fn build_state_and_timeline(
|
|||||||
debug_warn!("timeline for newly joined room is empty");
|
debug_warn!("timeline for newly joined room is empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
let (summary, device_list_updates) = try_join(
|
let summary = build_room_summary(
|
||||||
build_room_summary(
|
services,
|
||||||
services,
|
sync_context,
|
||||||
sync_context,
|
room_id,
|
||||||
room_id,
|
shortstatehashes,
|
||||||
shortstatehashes,
|
&timeline,
|
||||||
&timeline,
|
&state_events,
|
||||||
&state_events,
|
joined_since_last_sync,
|
||||||
joined_since_last_sync,
|
|
||||||
),
|
|
||||||
build_device_list_updates(
|
|
||||||
services,
|
|
||||||
sync_context,
|
|
||||||
room_id,
|
|
||||||
shortstatehashes,
|
|
||||||
&state_events,
|
|
||||||
joined_since_last_sync,
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
@@ -434,7 +418,6 @@ async fn build_state_and_timeline(
|
|||||||
sticky,
|
sticky,
|
||||||
summary,
|
summary,
|
||||||
notification_counts,
|
notification_counts,
|
||||||
device_list_updates,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -804,8 +787,7 @@ async fn build_room_summary(
|
|||||||
|
|
||||||
Ok(Some(assign!(RoomSummary::new(), {
|
Ok(Some(assign!(RoomSummary::new(), {
|
||||||
heroes: heroes
|
heroes: heroes
|
||||||
.map(|heroes| heroes.into_iter().collect())
|
.map_or_default(|heroes| heroes.into_iter().collect()),
|
||||||
.unwrap_or_default(),
|
|
||||||
joined_member_count: Some(ruma_from_u64(joined_member_count)),
|
joined_member_count: Some(ruma_from_u64(joined_member_count)),
|
||||||
invited_member_count: Some(ruma_from_u64(invited_member_count)),
|
invited_member_count: Some(ruma_from_u64(invited_member_count)),
|
||||||
})))
|
})))
|
||||||
@@ -858,35 +840,34 @@ async fn build_heroes(
|
|||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Collect updates to users' device lists for E2EE.
|
/// Collect updates to users' device lists for E2EE in a joined room.
|
||||||
#[tracing::instrument(level = "debug", skip_all)]
|
#[tracing::instrument(level = "debug", skip_all, fields(%room_id))]
|
||||||
async fn build_device_list_updates(
|
pub(super) async fn load_device_list_updates(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
SyncContext {
|
sync_context: SyncContext<'_>,
|
||||||
|
room_id: &RoomId,
|
||||||
|
) -> Result<DeviceListUpdates> {
|
||||||
|
let SyncContext {
|
||||||
syncing_user,
|
syncing_user,
|
||||||
last_sync_end_count,
|
last_sync_end_count,
|
||||||
current_count,
|
current_count,
|
||||||
..
|
..
|
||||||
}: SyncContext<'_>,
|
} = sync_context;
|
||||||
room_id: &RoomId,
|
|
||||||
ShortStateHashes { current_shortstatehash, .. }: ShortStateHashes,
|
let mut device_list_updates = DeviceListUpdates::new();
|
||||||
state_events: &Vec<PduEvent>,
|
|
||||||
joined_since_last_sync: bool,
|
|
||||||
) -> Result<DeviceListUpdates> {
|
|
||||||
let is_encrypted_room = services
|
|
||||||
.rooms
|
|
||||||
.state_accessor
|
|
||||||
.state_get(current_shortstatehash, &StateEventType::RoomEncryption, "")
|
|
||||||
.is_ok();
|
|
||||||
|
|
||||||
// initial syncs don't include device updates, and rooms which aren't
|
// 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
|
// encrypted don't affect them, so return early in either of those cases
|
||||||
if last_sync_end_count.is_none() || !(is_encrypted_room.await) {
|
if last_sync_end_count.is_none()
|
||||||
return Ok(DeviceListUpdates::new());
|
|| !services
|
||||||
|
.rooms
|
||||||
|
.state_accessor
|
||||||
|
.is_encrypted_room(room_id)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
return Ok(device_list_updates);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut device_list_updates = DeviceListUpdates::new();
|
|
||||||
|
|
||||||
// add users with changed keys to the `changed` list
|
// add users with changed keys to the `changed` list
|
||||||
services
|
services
|
||||||
.users
|
.users
|
||||||
@@ -897,19 +878,56 @@ async fn build_device_list_updates(
|
|||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
// add users who now share encrypted rooms to `changed` and
|
let shortstatehashes = fetch_shortstatehashes(services, sync_context, room_id).await?;
|
||||||
// users who no longer share encrypted rooms to `left`
|
let ShortStateHashes {
|
||||||
for state_event in state_events {
|
current_shortstatehash,
|
||||||
if state_event.kind == RoomMember {
|
last_sync_end_shortstatehash,
|
||||||
let Some(content): Option<RoomMemberEventContent> = state_event.get_content().ok()
|
} = shortstatehashes;
|
||||||
|
|
||||||
|
if check_joined_since_last_sync(services, shortstatehashes, sync_context).await? {
|
||||||
|
// the syncing user now shares an encrypted room with every member
|
||||||
|
services
|
||||||
|
.rooms
|
||||||
|
.state_cache
|
||||||
|
.room_members(room_id)
|
||||||
|
.ready_for_each(|user_id| {
|
||||||
|
device_list_updates.changed.insert(user_id);
|
||||||
|
})
|
||||||
|
.await;
|
||||||
|
} else if let Some(last_sync_end_shortstatehash) = last_sync_end_shortstatehash
|
||||||
|
&& last_sync_end_shortstatehash != current_shortstatehash
|
||||||
|
{
|
||||||
|
// add users who now share encrypted rooms to `changed` and
|
||||||
|
// users who no longer share encrypted rooms to `left`
|
||||||
|
let state_added = services
|
||||||
|
.rooms
|
||||||
|
.state_accessor
|
||||||
|
.state_added((last_sync_end_shortstatehash, current_shortstatehash))
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
for (shortstatekey, _) in state_added {
|
||||||
|
let Ok((StateEventType::RoomMember, state_key)) = services
|
||||||
|
.rooms
|
||||||
|
.short
|
||||||
|
.get_statekey_from_short(shortstatekey)
|
||||||
|
.await
|
||||||
else {
|
else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
let Some(user_id): Option<OwnedUserId> = state_event
|
let Ok(user_id) = OwnedUserId::try_from(state_key.as_str()) else {
|
||||||
.state_key
|
continue;
|
||||||
.as_ref()
|
};
|
||||||
.and_then(|key| key.parse().ok())
|
|
||||||
|
let Ok(content): Result<RoomMemberEventContent> = services
|
||||||
|
.rooms
|
||||||
|
.state_accessor
|
||||||
|
.state_get_content(
|
||||||
|
current_shortstatehash,
|
||||||
|
&StateEventType::RoomMember,
|
||||||
|
user_id.as_str(),
|
||||||
|
)
|
||||||
|
.await
|
||||||
else {
|
else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
@@ -925,7 +943,7 @@ async fn build_device_list_updates(
|
|||||||
| Leave if !shares_encrypted_room => {
|
| Leave if !shares_encrypted_room => {
|
||||||
device_list_updates.left.insert(user_id);
|
device_list_updates.left.insert(user_id);
|
||||||
},
|
},
|
||||||
| Join if joined_since_last_sync || shares_encrypted_room => {
|
| Join if shares_encrypted_room => {
|
||||||
device_list_updates.changed.insert(user_id);
|
device_list_updates.changed.insert(user_id);
|
||||||
},
|
},
|
||||||
| _ => (),
|
| _ => (),
|
||||||
|
|||||||
+117
-21
@@ -3,7 +3,6 @@ mod left;
|
|||||||
mod state;
|
mod state;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
cmp::{self},
|
|
||||||
collections::{BTreeMap, HashMap, HashSet},
|
collections::{BTreeMap, HashMap, HashSet},
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
@@ -21,7 +20,7 @@ use futures::{FutureExt, StreamExt, TryFutureExt, future::OptionFuture};
|
|||||||
use ruma::{
|
use ruma::{
|
||||||
DeviceId, OwnedUserId, RoomId, UserId,
|
DeviceId, OwnedUserId, RoomId, UserId,
|
||||||
api::client::{
|
api::client::{
|
||||||
filter::FilterDefinition,
|
filter::{self, FilterDefinition, RoomFilter},
|
||||||
sync::sync_events::{
|
sync::sync_events::{
|
||||||
self, DeviceLists,
|
self, DeviceLists,
|
||||||
v3::{
|
v3::{
|
||||||
@@ -39,13 +38,17 @@ use service::{
|
|||||||
account_data::AnyRawAccountDataEvent,
|
account_data::AnyRawAccountDataEvent,
|
||||||
rooms::lazy_loading::{self, MemberSet, Options as _},
|
rooms::lazy_loading::{self, MemberSet, Options as _},
|
||||||
};
|
};
|
||||||
|
use wildmatch::WildMatch;
|
||||||
|
|
||||||
use super::{load_timeline, share_encrypted_room};
|
use super::{load_timeline, share_encrypted_room};
|
||||||
use crate::{
|
use crate::{
|
||||||
Ruma,
|
Ruma,
|
||||||
client::{
|
client::{
|
||||||
is_ignored_invite,
|
is_ignored_invite,
|
||||||
sync::v3::{joined::load_joined_room, left::load_left_room},
|
sync::v3::{
|
||||||
|
joined::{load_device_list_updates, load_joined_room},
|
||||||
|
left::load_left_room,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
client_ip::ClientIp,
|
client_ip::ClientIp,
|
||||||
};
|
};
|
||||||
@@ -203,7 +206,12 @@ pub(crate) async fn sync_events_route(
|
|||||||
|
|
||||||
let mut wake_receiver = services.sync.subscribe_to_wake(sender_user);
|
let mut wake_receiver = services.sync.subscribe_to_wake(sender_user);
|
||||||
let response = build_sync_events(&services, &body).await?;
|
let response = build_sync_events(&services, &body).await?;
|
||||||
if body.body.full_state
|
|
||||||
|
let timeout_duration = body.body.timeout.unwrap_or_default();
|
||||||
|
// If the timeout is zero, request has full_state=true, or there's
|
||||||
|
// meaningful data to return, do so immediately.
|
||||||
|
if timeout_duration.is_zero()
|
||||||
|
|| body.body.full_state
|
||||||
|| !(response.rooms.is_empty()
|
|| !(response.rooms.is_empty()
|
||||||
&& response.presence.is_empty()
|
&& response.presence.is_empty()
|
||||||
&& response.account_data.is_empty()
|
&& response.account_data.is_empty()
|
||||||
@@ -213,11 +221,15 @@ pub(crate) async fn sync_events_route(
|
|||||||
return Ok(response);
|
return Ok(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hang a few seconds so requests are not spammed
|
// Otherwise, wait for a wake signal to rebuild changes. Cap timeout at 30
|
||||||
// Stop hanging if new info arrives
|
// seconds (this isn't specced, but a reasonable cap since most clients have
|
||||||
let default = Duration::from_secs(30);
|
// a 30-second polling interval).
|
||||||
let duration = cmp::min(body.body.timeout.unwrap_or(default), default);
|
let duration = timeout_duration.min(Duration::from_secs(30));
|
||||||
_ = tokio::time::timeout(duration, wake_receiver.changed()).await;
|
let mut shutdown_signal = services.server.signal.subscribe();
|
||||||
|
tokio::select! {
|
||||||
|
_ = tokio::time::timeout(duration, wake_receiver.changed()) => {},
|
||||||
|
_ = shutdown_signal.recv() => return Err!(Request(Unknown("Server is shutting down"), SERVICE_UNAVAILABLE)),
|
||||||
|
};
|
||||||
|
|
||||||
// Retry returning data
|
// Retry returning data
|
||||||
build_sync_events(&services, &body).await
|
build_sync_events(&services, &body).await
|
||||||
@@ -271,34 +283,47 @@ pub(crate) async fn build_sync_events(
|
|||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.rooms_joined(syncing_user)
|
.rooms_joined(syncing_user)
|
||||||
|
.ready_filter(|room_id| room_selected(&filter.room, room_id))
|
||||||
.broad_filter_map(|room_id| async {
|
.broad_filter_map(|room_id| async {
|
||||||
let joined_room = load_joined_room(services, context, room_id.clone()).await;
|
let joined_room = load_joined_room(services, context, room_id.clone()).await;
|
||||||
|
|
||||||
match joined_room {
|
match joined_room {
|
||||||
| Ok((room, updates)) => Some((room_id, room, updates)),
|
| Ok(room) => Some((room_id, room)),
|
||||||
| Err(err) => {
|
| Err(err) => {
|
||||||
error!(?err, %room_id, "error loading joined room");
|
error!(?err, %room_id, "error loading joined room");
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.ready_fold(
|
.ready_fold(BTreeMap::new(), |mut joined_rooms, (room_id, joined_room)| {
|
||||||
(BTreeMap::new(), DeviceListUpdates::new()),
|
if !joined_room.is_empty() {
|
||||||
|(mut joined_rooms, mut all_updates), (room_id, joined_room, updates)| {
|
joined_rooms.insert(room_id, joined_room);
|
||||||
all_updates.merge(updates);
|
}
|
||||||
|
|
||||||
if !joined_room.is_empty() {
|
joined_rooms
|
||||||
joined_rooms.insert(room_id, joined_room);
|
});
|
||||||
}
|
|
||||||
|
|
||||||
(joined_rooms, all_updates)
|
// a filtered out room still contributes its device list updates
|
||||||
},
|
let device_list_updates = services
|
||||||
);
|
.rooms
|
||||||
|
.state_cache
|
||||||
|
.rooms_joined(syncing_user)
|
||||||
|
.broad_filter_map(|room_id| async move {
|
||||||
|
load_device_list_updates(services, context, &room_id)
|
||||||
|
.await
|
||||||
|
.inspect_err(|err| error!(?err, %room_id, "error loading device list updates"))
|
||||||
|
.ok()
|
||||||
|
})
|
||||||
|
.ready_fold(DeviceListUpdates::new(), |mut all_updates, updates| {
|
||||||
|
all_updates.merge(updates);
|
||||||
|
all_updates
|
||||||
|
});
|
||||||
|
|
||||||
let left_rooms = services
|
let left_rooms = services
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.rooms_left(syncing_user)
|
.rooms_left(syncing_user)
|
||||||
|
.ready_filter(|(room_id, _)| room_selected(&filter.room, room_id))
|
||||||
.broad_filter_map(|(room_id, leave_pdu)| async {
|
.broad_filter_map(|(room_id, leave_pdu)| async {
|
||||||
let left_room = load_left_room(services, context, room_id.clone(), leave_pdu).await;
|
let left_room = load_left_room(services, context, room_id.clone(), leave_pdu).await;
|
||||||
|
|
||||||
@@ -317,6 +342,7 @@ pub(crate) async fn build_sync_events(
|
|||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.rooms_invited(syncing_user)
|
.rooms_invited(syncing_user)
|
||||||
|
.ready_filter(|(room_id, _)| room_selected(&filter.room, room_id))
|
||||||
.wide_filter_map(async |(room_id, invite_state)| {
|
.wide_filter_map(async |(room_id, invite_state)| {
|
||||||
if is_ignored_invite(services, syncing_user, &room_id).await {
|
if is_ignored_invite(services, syncing_user, &room_id).await {
|
||||||
None
|
None
|
||||||
@@ -347,6 +373,7 @@ pub(crate) async fn build_sync_events(
|
|||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.rooms_knocked(syncing_user)
|
.rooms_knocked(syncing_user)
|
||||||
|
.ready_filter(|(room_id, _)| room_selected(&filter.room, room_id))
|
||||||
.fold_default(|mut knocked_rooms: BTreeMap<_, _>, (room_id, knock_state)| async move {
|
.fold_default(|mut knocked_rooms: BTreeMap<_, _>, (room_id, knock_state)| async move {
|
||||||
let knock_count = services
|
let knock_count = services
|
||||||
.rooms
|
.rooms
|
||||||
@@ -376,6 +403,13 @@ pub(crate) async fn build_sync_events(
|
|||||||
.account_data
|
.account_data
|
||||||
.changes_since(None, syncing_user, last_sync_end_count, Some(current_count))
|
.changes_since(None, syncing_user, last_sync_end_count, Some(current_count))
|
||||||
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Global))
|
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Global))
|
||||||
|
.ready_filter(|event| {
|
||||||
|
event
|
||||||
|
.get_field::<String>("type")
|
||||||
|
.ok()
|
||||||
|
.flatten()
|
||||||
|
.is_some_and(|event_type| type_selected(&filter.account_data, &event_type))
|
||||||
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let to_device_events = services
|
let to_device_events = services
|
||||||
@@ -404,7 +438,8 @@ pub(crate) async fn build_sync_events(
|
|||||||
.list_unused_fallback_key_types(syncing_user, syncing_device);
|
.list_unused_fallback_key_types(syncing_user, syncing_device);
|
||||||
|
|
||||||
let (
|
let (
|
||||||
(joined_rooms, mut device_list_updates),
|
joined_rooms,
|
||||||
|
mut device_list_updates,
|
||||||
left_rooms,
|
left_rooms,
|
||||||
invited_rooms,
|
invited_rooms,
|
||||||
knocked_rooms,
|
knocked_rooms,
|
||||||
@@ -417,6 +452,7 @@ pub(crate) async fn build_sync_events(
|
|||||||
) = async {
|
) = async {
|
||||||
futures::join!(
|
futures::join!(
|
||||||
joined_rooms,
|
joined_rooms,
|
||||||
|
device_list_updates,
|
||||||
left_rooms,
|
left_rooms,
|
||||||
invited_rooms,
|
invited_rooms,
|
||||||
knocked_rooms,
|
knocked_rooms,
|
||||||
@@ -465,6 +501,24 @@ pub(crate) async fn build_sync_events(
|
|||||||
Ok(response)
|
Ok(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn room_selected(filter: &RoomFilter, room_id: &RoomId) -> bool {
|
||||||
|
!filter.not_rooms.iter().any(|not_room| not_room == room_id)
|
||||||
|
&& filter
|
||||||
|
.rooms
|
||||||
|
.as_ref()
|
||||||
|
.is_none_or(|rooms| rooms.iter().any(|room| room == room_id))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn type_selected(filter: &filter::Filter, event_type: &str) -> bool {
|
||||||
|
let matches = |pattern: &String| WildMatch::new(pattern).matches(event_type);
|
||||||
|
|
||||||
|
!filter.not_types.iter().any(matches)
|
||||||
|
&& filter
|
||||||
|
.types
|
||||||
|
.as_ref()
|
||||||
|
.is_none_or(|types| types.iter().any(matches))
|
||||||
|
}
|
||||||
|
|
||||||
#[tracing::instrument(name = "presence", level = "debug", skip_all)]
|
#[tracing::instrument(name = "presence", level = "debug", skip_all)]
|
||||||
async fn process_presence_updates(
|
async fn process_presence_updates(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
@@ -528,3 +582,45 @@ async fn prepare_lazily_loaded_members(
|
|||||||
|
|
||||||
lazily_loaded_members
|
lazily_loaded_members
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use ruma::{owned_room_id, room_id};
|
||||||
|
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn rooms_filter_selects_rooms() {
|
||||||
|
let room_id = room_id!("!a:example.com");
|
||||||
|
let mut filter = RoomFilter::default();
|
||||||
|
assert!(room_selected(&filter, room_id));
|
||||||
|
|
||||||
|
filter.rooms = Some(Vec::new());
|
||||||
|
assert!(!room_selected(&filter, room_id));
|
||||||
|
|
||||||
|
filter.rooms = Some(vec![room_id.to_owned()]);
|
||||||
|
assert!(room_selected(&filter, room_id));
|
||||||
|
|
||||||
|
filter.not_rooms = vec![owned_room_id!("!a:example.com")];
|
||||||
|
assert!(!room_selected(&filter, room_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn types_filter_selects_account_data() {
|
||||||
|
let mut filter = filter::Filter::default();
|
||||||
|
assert!(type_selected(&filter, "m.direct"));
|
||||||
|
|
||||||
|
filter.types = Some(Vec::new());
|
||||||
|
assert!(!type_selected(&filter, "m.direct"));
|
||||||
|
|
||||||
|
filter.types = Some(vec!["m.direct".to_owned()]);
|
||||||
|
assert!(type_selected(&filter, "m.direct"));
|
||||||
|
|
||||||
|
filter.types = Some(vec!["m.*".to_owned()]);
|
||||||
|
assert!(type_selected(&filter, "m.direct"));
|
||||||
|
assert!(!type_selected(&filter, "im.ponies.user_emotes"));
|
||||||
|
|
||||||
|
filter.not_types = vec!["m.direct".to_owned()];
|
||||||
|
assert!(!type_selected(&filter, "m.direct"));
|
||||||
|
}
|
||||||
|
}
|
||||||
+127
-129
@@ -24,7 +24,7 @@ use conduwuit::{
|
|||||||
use conduwuit_service::{
|
use conduwuit_service::{
|
||||||
Services,
|
Services,
|
||||||
rooms::read_receipt::pack_receipts,
|
rooms::read_receipt::pack_receipts,
|
||||||
sync::{SnakeConnectionsKey, into_snake_key},
|
sync::{SnakeConnectionsKey, StickyDelivered, into_snake_key},
|
||||||
};
|
};
|
||||||
use futures::{
|
use futures::{
|
||||||
FutureExt, StreamExt, TryFutureExt,
|
FutureExt, StreamExt, TryFutureExt,
|
||||||
@@ -34,7 +34,7 @@ use futures::{
|
|||||||
use ruma::{
|
use ruma::{
|
||||||
DeviceId, MilliSecondsSinceUnixEpoch, OwnedEventId, OwnedRoomId, RoomId, UInt, UserId,
|
DeviceId, MilliSecondsSinceUnixEpoch, OwnedEventId, OwnedRoomId, RoomId, UInt, UserId,
|
||||||
api::client::sync::sync_events::{
|
api::client::sync::sync_events::{
|
||||||
self, DeviceLists, UnreadNotificationsCount, v5::request::ExtensionRoomConfig,
|
self, DeviceLists, UnreadNotificationsCount, msc4186::request::ExtensionRoomConfig,
|
||||||
},
|
},
|
||||||
assign,
|
assign,
|
||||||
directory::RoomTypeFilter,
|
directory::RoomTypeFilter,
|
||||||
@@ -63,7 +63,7 @@ use crate::{
|
|||||||
client_ip::ClientIp,
|
client_ip::ClientIp,
|
||||||
};
|
};
|
||||||
|
|
||||||
type SyncInfo<'a> = (&'a UserId, &'a DeviceId, u64, &'a sync_events::v5::Request);
|
type SyncInfo<'a> = (&'a UserId, &'a DeviceId, u64, &'a sync_events::msc4186::Request);
|
||||||
type TodoRooms = BTreeMap<OwnedRoomId, (BTreeSet<TypeStateKey>, usize, u64)>;
|
type TodoRooms = BTreeMap<OwnedRoomId, (BTreeSet<TypeStateKey>, usize, u64)>;
|
||||||
type KnownRooms = BTreeMap<String, BTreeMap<OwnedRoomId, u64>>;
|
type KnownRooms = BTreeMap<String, BTreeMap<OwnedRoomId, u64>>;
|
||||||
type KnownRoomUpdates = BTreeMap<String, BTreeSet<OwnedRoomId>>;
|
type KnownRoomUpdates = BTreeMap<String, BTreeSet<OwnedRoomId>>;
|
||||||
@@ -86,8 +86,9 @@ fn num_live_events<'a>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct SyncCollection {
|
struct SyncCollection {
|
||||||
response: sync_events::v5::Response,
|
response: sync_events::msc4186::Response,
|
||||||
known_room_updates: KnownRoomUpdates,
|
known_room_updates: KnownRoomUpdates,
|
||||||
|
sticky_delivered: StickyDelivered,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `POST /_matrix/client/unstable/org.matrix.simplified_msc3575/sync`
|
/// `POST /_matrix/client/unstable/org.matrix.simplified_msc3575/sync`
|
||||||
@@ -103,8 +104,8 @@ struct SyncCollection {
|
|||||||
pub(crate) async fn sync_events_v5_route(
|
pub(crate) async fn sync_events_v5_route(
|
||||||
State(ref services): State<crate::State>,
|
State(ref services): State<crate::State>,
|
||||||
ClientIp(client_ip): ClientIp, // NOTE: Required for updating device metadata
|
ClientIp(client_ip): ClientIp, // NOTE: Required for updating device metadata
|
||||||
body: Ruma<sync_events::v5::Request>,
|
body: Ruma<sync_events::msc4186::Request>,
|
||||||
) -> Result<sync_events::v5::Response> {
|
) -> Result<sync_events::msc4186::Response> {
|
||||||
let sender_user = body.identity.expect_sender_user()?;
|
let sender_user = body.identity.expect_sender_user()?;
|
||||||
let sender_device = body.identity.expect_sender_device()?;
|
let sender_device = body.identity.expect_sender_device()?;
|
||||||
|
|
||||||
@@ -142,7 +143,7 @@ pub(crate) async fn sync_events_v5_route(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get sticky parameters from cache
|
// Get sticky parameters from cache
|
||||||
let known_rooms =
|
let (known_rooms, sticky_delivered) =
|
||||||
services
|
services
|
||||||
.sync
|
.sync
|
||||||
.update_snake_sync_request_with_cache(&snake_key, globalsince, &mut body);
|
.update_snake_sync_request_with_cache(&snake_key, globalsince, &mut body);
|
||||||
@@ -155,6 +156,7 @@ pub(crate) async fn sync_events_v5_route(
|
|||||||
&body,
|
&body,
|
||||||
globalsince,
|
globalsince,
|
||||||
&known_rooms,
|
&known_rooms,
|
||||||
|
&sticky_delivered,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
@@ -173,6 +175,7 @@ pub(crate) async fn sync_events_v5_route(
|
|||||||
&body,
|
&body,
|
||||||
globalsince,
|
globalsince,
|
||||||
&known_rooms,
|
&known_rooms,
|
||||||
|
&sticky_delivered,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
@@ -202,13 +205,13 @@ async fn collect_sync_response(
|
|||||||
services: &Services,
|
services: &Services,
|
||||||
sender_user: &UserId,
|
sender_user: &UserId,
|
||||||
sender_device: &DeviceId,
|
sender_device: &DeviceId,
|
||||||
body: &sync_events::v5::Request,
|
body: &sync_events::msc4186::Request,
|
||||||
globalsince: u64,
|
globalsince: u64,
|
||||||
known_rooms: &KnownRooms,
|
known_rooms: &KnownRooms,
|
||||||
|
sticky_delivered: &StickyDelivered,
|
||||||
) -> Result<SyncCollection> {
|
) -> Result<SyncCollection> {
|
||||||
// Bounds every read below and becomes the `pos` returned to the client.
|
// 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.next_count()?;
|
||||||
let next_batch = services.globals.current_count()?.max(1);
|
|
||||||
|
|
||||||
let all_joined_rooms = services
|
let all_joined_rooms = services
|
||||||
.rooms
|
.rooms
|
||||||
@@ -262,7 +265,6 @@ async fn collect_sync_response(
|
|||||||
let pos = next_batch.to_string();
|
let pos = next_batch.to_string();
|
||||||
|
|
||||||
let mut todo_rooms: TodoRooms = BTreeMap::new();
|
let mut todo_rooms: TodoRooms = BTreeMap::new();
|
||||||
let mut sticky_rooms = BTreeSet::new();
|
|
||||||
|
|
||||||
let sync_info: SyncInfo<'_> = (sender_user, sender_device, globalsince, body);
|
let sync_info: SyncInfo<'_> = (sender_user, sender_device, globalsince, body);
|
||||||
|
|
||||||
@@ -277,16 +279,16 @@ async fn collect_sync_response(
|
|||||||
let (account_data, e2ee, to_device, receipts) =
|
let (account_data, e2ee, to_device, receipts) =
|
||||||
try_join4(account_data, e2ee, to_device, receipts).await?;
|
try_join4(account_data, e2ee, to_device, receipts).await?;
|
||||||
|
|
||||||
let extensions = assign!(sync_events::v5::response::Extensions::default(), {
|
let extensions = assign!(sync_events::msc4186::response::Extensions::default(), {
|
||||||
account_data,
|
account_data,
|
||||||
e2ee,
|
e2ee,
|
||||||
to_device,
|
to_device,
|
||||||
receipts,
|
receipts,
|
||||||
typing: sync_events::v5::response::Typing::default(),
|
typing: sync_events::msc4186::response::Typing::default(),
|
||||||
sticky_events: sync_events::v5::response::StickyEvents::default(),
|
sticky_events: sync_events::msc4186::response::StickyEvents::default(),
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut response = assign!(sync_events::v5::Response::new(pos), {
|
let mut response = assign!(sync_events::msc4186::Response::new(pos), {
|
||||||
txn_id: body.txn_id.clone(),
|
txn_id: body.txn_id.clone(),
|
||||||
lists: BTreeMap::new(),
|
lists: BTreeMap::new(),
|
||||||
rooms: BTreeMap::new(),
|
rooms: BTreeMap::new(),
|
||||||
@@ -319,7 +321,6 @@ async fn collect_sync_response(
|
|||||||
all_rooms,
|
all_rooms,
|
||||||
&direct_rooms,
|
&direct_rooms,
|
||||||
&mut todo_rooms,
|
&mut todo_rooms,
|
||||||
&mut sticky_rooms,
|
|
||||||
known_rooms,
|
known_rooms,
|
||||||
&mut response,
|
&mut response,
|
||||||
)
|
)
|
||||||
@@ -329,7 +330,6 @@ async fn collect_sync_response(
|
|||||||
"subscriptions".to_owned(),
|
"subscriptions".to_owned(),
|
||||||
fetch_subscriptions(services, body, known_rooms, &allowed_rooms, &mut todo_rooms).await,
|
fetch_subscriptions(services, body, known_rooms, &allowed_rooms, &mut todo_rooms).await,
|
||||||
);
|
);
|
||||||
sticky_rooms.extend(body.room_subscriptions.keys().cloned());
|
|
||||||
|
|
||||||
let mut timeline_event_ids = BTreeSet::new();
|
let mut timeline_event_ids = BTreeSet::new();
|
||||||
response.rooms = process_rooms(
|
response.rooms = process_rooms(
|
||||||
@@ -346,25 +346,31 @@ async fn collect_sync_response(
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
response.extensions.sticky_events = collect_sticky_events(
|
let (sticky_events, sticky_delivered) = collect_sticky_events(
|
||||||
services,
|
services,
|
||||||
sender_user,
|
sender_user,
|
||||||
body,
|
body,
|
||||||
&sticky_rooms,
|
next_batch,
|
||||||
|
sticky_delivered,
|
||||||
|
&known_room_updates,
|
||||||
&joined_room_ids,
|
&joined_room_ids,
|
||||||
&todo_rooms,
|
|
||||||
&timeline_event_ids,
|
&timeline_event_ids,
|
||||||
)
|
)
|
||||||
.await?;
|
.await;
|
||||||
|
response.extensions.sticky_events = sticky_events;
|
||||||
|
|
||||||
response.extensions.typing =
|
response.extensions.typing =
|
||||||
collect_typing_events(services, sender_user, body, &todo_rooms, &known_room_updates)
|
collect_typing_events(services, sender_user, body, &todo_rooms, &known_room_updates)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
Ok(SyncCollection { response, known_room_updates })
|
Ok(SyncCollection {
|
||||||
|
response,
|
||||||
|
known_room_updates,
|
||||||
|
sticky_delivered,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn response_is_empty(response: &sync_events::v5::Response) -> bool {
|
fn response_is_empty(response: &sync_events::msc4186::Response) -> bool {
|
||||||
let no_account_data = response.extensions.account_data.global.is_empty()
|
let no_account_data = response.extensions.account_data.global.is_empty()
|
||||||
&& response
|
&& response
|
||||||
.extensions
|
.extensions
|
||||||
@@ -395,7 +401,7 @@ async fn commit_sync_collection(
|
|||||||
services: &Services,
|
services: &Services,
|
||||||
sender_user: &UserId,
|
sender_user: &UserId,
|
||||||
sender_device: &DeviceId,
|
sender_device: &DeviceId,
|
||||||
body: &sync_events::v5::Request,
|
body: &sync_events::msc4186::Request,
|
||||||
globalsince: u64,
|
globalsince: u64,
|
||||||
snake_key: &SnakeConnectionsKey,
|
snake_key: &SnakeConnectionsKey,
|
||||||
collection: &SyncCollection,
|
collection: &SyncCollection,
|
||||||
@@ -408,9 +414,10 @@ async fn commit_sync_collection(
|
|||||||
.parse()
|
.parse()
|
||||||
.expect("generated sync position"),
|
.expect("generated sync position"),
|
||||||
collection.known_room_updates.clone(),
|
collection.known_room_updates.clone(),
|
||||||
|
collection.sticky_delivered.clone(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if body.extensions.to_device.enabled.unwrap_or(false) {
|
if body.extensions.to_device.enabled {
|
||||||
services
|
services
|
||||||
.users
|
.users
|
||||||
.remove_to_device_events(sender_user, sender_device, globalsince)
|
.remove_to_device_events(sender_user, sender_device, globalsince)
|
||||||
@@ -420,7 +427,7 @@ async fn commit_sync_collection(
|
|||||||
|
|
||||||
async fn fetch_subscriptions(
|
async fn fetch_subscriptions(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
body: &sync_events::v5::Request,
|
body: &sync_events::msc4186::Request,
|
||||||
known_rooms: &KnownRooms,
|
known_rooms: &KnownRooms,
|
||||||
allowed_rooms: &BTreeSet<OwnedRoomId>,
|
allowed_rooms: &BTreeSet<OwnedRoomId>,
|
||||||
todo_rooms: &mut TodoRooms,
|
todo_rooms: &mut TodoRooms,
|
||||||
@@ -480,15 +487,14 @@ async fn fetch_subscriptions(
|
|||||||
async fn handle_lists<'a, Rooms, AllRooms>(
|
async fn handle_lists<'a, Rooms, AllRooms>(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
sender_user: &UserId,
|
sender_user: &UserId,
|
||||||
body: &sync_events::v5::Request,
|
body: &sync_events::msc4186::Request,
|
||||||
all_invited_rooms: Rooms,
|
all_invited_rooms: Rooms,
|
||||||
all_joined_rooms: Rooms,
|
all_joined_rooms: Rooms,
|
||||||
all_rooms: AllRooms,
|
all_rooms: AllRooms,
|
||||||
direct_rooms: &HashSet<OwnedRoomId>,
|
direct_rooms: &HashSet<OwnedRoomId>,
|
||||||
todo_rooms: &'a mut TodoRooms,
|
todo_rooms: &'a mut TodoRooms,
|
||||||
sticky_rooms: &mut BTreeSet<OwnedRoomId>,
|
|
||||||
known_rooms: &'a KnownRooms,
|
known_rooms: &'a KnownRooms,
|
||||||
response: &'_ mut sync_events::v5::Response,
|
response: &'_ mut sync_events::msc4186::Response,
|
||||||
) -> KnownRoomUpdates
|
) -> KnownRoomUpdates
|
||||||
where
|
where
|
||||||
Rooms: Iterator<Item = &'a RoomId> + Clone + Send + 'a,
|
Rooms: Iterator<Item = &'a RoomId> + Clone + Send + 'a,
|
||||||
@@ -579,7 +585,6 @@ where
|
|||||||
.await;
|
.await;
|
||||||
sort_rooms_by_activity(&mut active_rooms);
|
sort_rooms_by_activity(&mut active_rooms);
|
||||||
let active_rooms: Vec<_> = active_rooms.into_iter().map(at!(0)).collect();
|
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();
|
let mut new_known_rooms: BTreeSet<OwnedRoomId> = BTreeSet::new();
|
||||||
|
|
||||||
@@ -631,7 +636,7 @@ where
|
|||||||
}
|
}
|
||||||
response.lists.insert(
|
response.lists.insert(
|
||||||
list_id.clone(),
|
list_id.clone(),
|
||||||
assign!(sync_events::v5::response::List::default(), {
|
assign!(sync_events::msc4186::response::List::default(), {
|
||||||
count: ruma_from_usize(active_rooms.len()),
|
count: ruma_from_usize(active_rooms.len()),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -749,10 +754,10 @@ async fn process_rooms<'a, Rooms>(
|
|||||||
all_invited_rooms: Rooms,
|
all_invited_rooms: Rooms,
|
||||||
all_knocked_rooms: Rooms,
|
all_knocked_rooms: Rooms,
|
||||||
todo_rooms: &TodoRooms,
|
todo_rooms: &TodoRooms,
|
||||||
response: &mut sync_events::v5::Response,
|
response: &mut sync_events::msc4186::Response,
|
||||||
body: &sync_events::v5::Request,
|
body: &sync_events::msc4186::Request,
|
||||||
timeline_event_ids: &mut BTreeSet<OwnedEventId>,
|
timeline_event_ids: &mut BTreeSet<OwnedEventId>,
|
||||||
) -> Result<BTreeMap<OwnedRoomId, sync_events::v5::response::Room>>
|
) -> Result<BTreeMap<OwnedRoomId, sync_events::msc4186::response::Room>>
|
||||||
where
|
where
|
||||||
Rooms: Iterator<Item = &'a RoomId> + Clone + Send + 'a,
|
Rooms: Iterator<Item = &'a RoomId> + Clone + Send + 'a,
|
||||||
{
|
{
|
||||||
@@ -787,7 +792,7 @@ where
|
|||||||
|
|
||||||
rooms.insert(
|
rooms.insert(
|
||||||
room_id.clone(),
|
room_id.clone(),
|
||||||
assign!(sync_events::v5::response::Room::new(), {
|
assign!(sync_events::msc4186::response::Room::new(), {
|
||||||
initial: Some(roomsince == &0),
|
initial: Some(roomsince == &0),
|
||||||
invite_state,
|
invite_state,
|
||||||
limited: true,
|
limited: true,
|
||||||
@@ -821,7 +826,7 @@ where
|
|||||||
|
|
||||||
rooms.insert(
|
rooms.insert(
|
||||||
room_id.clone(),
|
room_id.clone(),
|
||||||
assign!(sync_events::v5::response::Room::new(), {
|
assign!(sync_events::msc4186::response::Room::new(), {
|
||||||
initial: Some(roomsince == &0),
|
initial: Some(roomsince == &0),
|
||||||
invite_state: Some(knock_state),
|
invite_state: Some(knock_state),
|
||||||
limited: true,
|
limited: true,
|
||||||
@@ -988,7 +993,7 @@ where
|
|||||||
.state_accessor
|
.state_accessor
|
||||||
.get_member(room_id, &user_id)
|
.get_member(room_id, &user_id)
|
||||||
.map_ok(|member_event| {
|
.map_ok(|member_event| {
|
||||||
assign!(sync_events::v5::response::Hero::new(user_id.clone()), {
|
assign!(sync_events::msc4186::response::Hero::new(user_id.clone()), {
|
||||||
name: member_event.displayname,
|
name: member_event.displayname,
|
||||||
avatar: member_event.avatar_url,
|
avatar: member_event.avatar_url,
|
||||||
})
|
})
|
||||||
@@ -1032,7 +1037,7 @@ where
|
|||||||
|
|
||||||
rooms.insert(
|
rooms.insert(
|
||||||
room_id.clone(),
|
room_id.clone(),
|
||||||
assign!(sync_events::v5::response::Room::new(), {
|
assign!(sync_events::msc4186::response::Room::new(), {
|
||||||
name: services
|
name: services
|
||||||
.rooms
|
.rooms
|
||||||
.state_accessor
|
.state_accessor
|
||||||
@@ -1103,64 +1108,61 @@ where
|
|||||||
Ok(rooms)
|
Ok(rooms)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[expect(clippy::too_many_arguments)]
|
||||||
async fn collect_sticky_events(
|
async fn collect_sticky_events(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
sender_user: &UserId,
|
sender_user: &UserId,
|
||||||
body: &sync_events::v5::Request,
|
body: &sync_events::msc4186::Request,
|
||||||
sticky_rooms: &BTreeSet<OwnedRoomId>,
|
next_batch: u64,
|
||||||
|
sticky_delivered: &StickyDelivered,
|
||||||
|
known_room_updates: &KnownRoomUpdates,
|
||||||
joined_room_ids: &BTreeSet<OwnedRoomId>,
|
joined_room_ids: &BTreeSet<OwnedRoomId>,
|
||||||
todo_rooms: &TodoRooms,
|
|
||||||
timeline_event_ids: &BTreeSet<OwnedEventId>,
|
timeline_event_ids: &BTreeSet<OwnedEventId>,
|
||||||
) -> Result<sync_events::v5::response::StickyEvents> {
|
) -> (sync_events::msc4186::response::StickyEvents, StickyDelivered) {
|
||||||
if !services.config.allow_sticky_events
|
let mut response = sync_events::msc4186::response::StickyEvents::default();
|
||||||
|| !body.extensions.sticky_events.enabled.unwrap_or(false)
|
let mut delivered = StickyDelivered::new();
|
||||||
{
|
|
||||||
return Ok(sync_events::v5::response::StickyEvents::default());
|
let sticky_events = &body.extensions.sticky_events;
|
||||||
|
if !sticky_events.enabled.unwrap_or(false) {
|
||||||
|
return (response, delivered);
|
||||||
}
|
}
|
||||||
|
|
||||||
let since = body
|
let scope = extension_scope(
|
||||||
.extensions
|
sticky_events.lists.as_deref(),
|
||||||
.sticky_events
|
sticky_events.rooms.as_deref(),
|
||||||
.since
|
body.lists.keys().map(String::as_str),
|
||||||
.as_deref()
|
known_room_updates,
|
||||||
.and_then(|token| token.parse::<u64>().ok())
|
);
|
||||||
.unwrap_or(0);
|
let limit = sticky_events
|
||||||
let limit = body
|
|
||||||
.extensions
|
|
||||||
.sticky_events
|
|
||||||
.limit
|
.limit
|
||||||
.map_or(DEFAULT_STICKY_LIMIT, usize_from_ruma)
|
.map_or(DEFAULT_STICKY_LIMIT, usize_from_ruma)
|
||||||
.clamp(1, DEFAULT_STICKY_LIMIT);
|
.clamp(1, DEFAULT_STICKY_LIMIT);
|
||||||
let now = u64::from(MilliSecondsSinceUnixEpoch::now().get());
|
let now = u64::from(MilliSecondsSinceUnixEpoch::now().get());
|
||||||
let oldest_sticky_ts = now.saturating_sub(sticky::MAX_DURATION_MS);
|
let oldest_sticky_ts = now.saturating_sub(sticky::MAX_DURATION_MS);
|
||||||
|
|
||||||
let mut backlog = Vec::new();
|
for room_id in scope.intersection(joined_room_ids) {
|
||||||
let mut stream = Vec::new();
|
let since = sticky_delivered.get(room_id).copied();
|
||||||
for room_id in sticky_rooms
|
|
||||||
.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
|
|
||||||
let initial = todo_rooms
|
|
||||||
.get(room_id)
|
|
||||||
.is_some_and(|&(_, _, roomsince)| roomsince == 0);
|
|
||||||
|
|
||||||
|
let mut pending = Vec::new();
|
||||||
let pdus = services.rooms.timeline.pdus_rev(room_id, None).ignore_err();
|
let pdus = services.rooms.timeline.pdus_rev(room_id, None).ignore_err();
|
||||||
pin_mut!(pdus);
|
pin_mut!(pdus);
|
||||||
while let Some((count, pdu)) = pdus.next().await {
|
while let Some((count, pdu)) = pdus.next().await {
|
||||||
// nothing older than this can still be sticky, and on the stream we
|
|
||||||
// have already delivered everything up to `since`
|
|
||||||
if u64::from(pdu.origin_server_ts) < oldest_sticky_ts
|
|
||||||
|| (!initial && count <= PduCount::Normal(since))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
let PduCount::Normal(count) = count else {
|
let PduCount::Normal(count) = count else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if count > next_batch {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nothing older than this can still be sticky, and everything up to
|
||||||
|
// `since` has already been delivered
|
||||||
|
if u64::from(pdu.origin_server_ts) < oldest_sticky_ts
|
||||||
|
|| since.is_some_and(|since| count <= since)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
let is_sticky = pdu
|
let is_sticky = pdu
|
||||||
.sticky
|
.sticky
|
||||||
.as_deref()
|
.as_deref()
|
||||||
@@ -1177,38 +1179,26 @@ async fn collect_sticky_events(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if count > since {
|
pending.push((count, pdu));
|
||||||
stream.push((count, room_id.clone(), pdu));
|
|
||||||
} else {
|
|
||||||
backlog.push((room_id.clone(), pdu));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
stream.sort_by_key(|(count, ..)| *count);
|
|
||||||
|
|
||||||
let mut response = sync_events::v5::response::StickyEvents::default();
|
pending.reverse();
|
||||||
|
let truncated = pending.len() > limit;
|
||||||
|
let mut last_count = next_batch;
|
||||||
|
for (count, pdu) in pending.into_iter().take(limit) {
|
||||||
|
push_sticky_event(services, &mut response, sender_user, room_id.clone(), pdu).await;
|
||||||
|
last_count = count;
|
||||||
|
}
|
||||||
|
|
||||||
// MSC4480 lets us ignore the limit for a newly visible room's backlog
|
delivered.insert(room_id.clone(), if truncated { last_count } else { next_batch });
|
||||||
for (room_id, pdu) in backlog {
|
|
||||||
push_sticky_event(services, &mut response, sender_user, room_id, pdu).await;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut next_batch = None;
|
(response, delivered)
|
||||||
for (count, room_id, pdu) in stream.into_iter().take(limit) {
|
|
||||||
push_sticky_event(services, &mut response, sender_user, room_id, pdu).await;
|
|
||||||
next_batch = Some(count);
|
|
||||||
}
|
|
||||||
|
|
||||||
if !response.rooms.is_empty() {
|
|
||||||
response.next_batch = Some(next_batch.unwrap_or(since).to_string());
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(response)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn push_sticky_event(
|
async fn push_sticky_event(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
response: &mut sync_events::v5::response::StickyEvents,
|
response: &mut sync_events::msc4186::response::StickyEvents,
|
||||||
sender_user: &UserId,
|
sender_user: &UserId,
|
||||||
room_id: OwnedRoomId,
|
room_id: OwnedRoomId,
|
||||||
mut pdu: PduEvent,
|
mut pdu: PduEvent,
|
||||||
@@ -1275,12 +1265,12 @@ async fn collect_required_state(
|
|||||||
async fn collect_typing_events(
|
async fn collect_typing_events(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
sender_user: &UserId,
|
sender_user: &UserId,
|
||||||
body: &sync_events::v5::Request,
|
body: &sync_events::msc4186::Request,
|
||||||
todo_rooms: &TodoRooms,
|
todo_rooms: &TodoRooms,
|
||||||
known_room_updates: &KnownRoomUpdates,
|
known_room_updates: &KnownRoomUpdates,
|
||||||
) -> Result<sync_events::v5::response::Typing> {
|
) -> Result<sync_events::msc4186::response::Typing> {
|
||||||
if !body.extensions.typing.enabled.unwrap_or(false) {
|
if !body.extensions.typing.enabled.unwrap_or(false) {
|
||||||
return Ok(sync_events::v5::response::Typing::default());
|
return Ok(sync_events::msc4186::response::Typing::default());
|
||||||
}
|
}
|
||||||
let typing = &body.extensions.typing;
|
let typing = &body.extensions.typing;
|
||||||
let scope = extension_scope(
|
let scope = extension_scope(
|
||||||
@@ -1290,10 +1280,10 @@ async fn collect_typing_events(
|
|||||||
known_room_updates,
|
known_room_updates,
|
||||||
);
|
);
|
||||||
if scope.is_empty() {
|
if scope.is_empty() {
|
||||||
return Ok(sync_events::v5::response::Typing::default());
|
return Ok(sync_events::msc4186::response::Typing::default());
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut typing_response = sync_events::v5::response::Typing::default();
|
let mut typing_response = sync_events::msc4186::response::Typing::default();
|
||||||
for (room_id, (_, _, roomsince)) in todo_rooms {
|
for (room_id, (_, _, roomsince)) in todo_rooms {
|
||||||
if !scope.contains(room_id) {
|
if !scope.contains(room_id) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1373,12 +1363,17 @@ fn extension_scope<'a>(
|
|||||||
|
|
||||||
async fn collect_account_data(
|
async fn collect_account_data(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
(sender_user, _, globalsince, body): (&UserId, &DeviceId, u64, &sync_events::v5::Request),
|
(sender_user, _, globalsince, body): (
|
||||||
) -> sync_events::v5::response::AccountData {
|
&UserId,
|
||||||
let mut account_data = sync_events::v5::response::AccountData::default();
|
&DeviceId,
|
||||||
|
u64,
|
||||||
|
&sync_events::msc4186::Request,
|
||||||
|
),
|
||||||
|
) -> sync_events::msc4186::response::AccountData {
|
||||||
|
let mut account_data = sync_events::msc4186::response::AccountData::default();
|
||||||
|
|
||||||
if !body.extensions.account_data.enabled.unwrap_or(false) {
|
if !body.extensions.account_data.enabled.unwrap_or(false) {
|
||||||
return sync_events::v5::response::AccountData::default();
|
return sync_events::msc4186::response::AccountData::default();
|
||||||
}
|
}
|
||||||
|
|
||||||
account_data.global = services
|
account_data.global = services
|
||||||
@@ -1413,15 +1408,15 @@ async fn collect_e2ee<'a, Rooms>(
|
|||||||
&UserId,
|
&UserId,
|
||||||
&DeviceId,
|
&DeviceId,
|
||||||
u64,
|
u64,
|
||||||
&sync_events::v5::Request,
|
&sync_events::msc4186::Request,
|
||||||
),
|
),
|
||||||
all_joined_rooms: Rooms,
|
all_joined_rooms: Rooms,
|
||||||
) -> Result<sync_events::v5::response::E2EE>
|
) -> Result<sync_events::msc4186::response::E2EE>
|
||||||
where
|
where
|
||||||
Rooms: Iterator<Item = &'a RoomId> + Send + 'a,
|
Rooms: Iterator<Item = &'a RoomId> + Send + 'a,
|
||||||
{
|
{
|
||||||
if !body.extensions.e2ee.enabled.unwrap_or(false) {
|
if !body.extensions.e2ee.enabled {
|
||||||
return Ok(sync_events::v5::response::E2EE::default());
|
return Ok(sync_events::msc4186::response::E2EE::default());
|
||||||
}
|
}
|
||||||
let mut left_encrypted_users = HashSet::new(); // Users that have left any encrypted rooms the sender was in
|
let mut left_encrypted_users = HashSet::new(); // Users that have left any encrypted rooms the sender was in
|
||||||
let mut device_list_changes = HashSet::new();
|
let mut device_list_changes = HashSet::new();
|
||||||
@@ -1608,7 +1603,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(assign!(sync_events::v5::response::E2EE::default(), {
|
Ok(assign!(sync_events::msc4186::response::E2EE::default(), {
|
||||||
device_unused_fallback_key_types: None,
|
device_unused_fallback_key_types: None,
|
||||||
|
|
||||||
device_one_time_keys_count: services
|
device_one_time_keys_count: services
|
||||||
@@ -1627,12 +1622,12 @@ async fn collect_to_device(
|
|||||||
services: &Services,
|
services: &Services,
|
||||||
(sender_user, sender_device, globalsince, body): SyncInfo<'_>,
|
(sender_user, sender_device, globalsince, body): SyncInfo<'_>,
|
||||||
next_batch: u64,
|
next_batch: u64,
|
||||||
) -> Option<sync_events::v5::response::ToDevice> {
|
) -> Option<sync_events::msc4186::response::ToDevice> {
|
||||||
if !body.extensions.to_device.enabled.unwrap_or(false) {
|
if !body.extensions.to_device.enabled {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(assign!(sync_events::v5::response::ToDevice::default(), {
|
Some(assign!(sync_events::msc4186::response::ToDevice::default(), {
|
||||||
next_batch: next_batch.to_string(),
|
next_batch: next_batch.to_string(),
|
||||||
events: services
|
events: services
|
||||||
.users
|
.users
|
||||||
@@ -1643,9 +1638,9 @@ async fn collect_to_device(
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn collect_receipts(_services: &Services) -> sync_events::v5::response::Receipts {
|
async fn collect_receipts(_services: &Services) -> sync_events::msc4186::response::Receipts {
|
||||||
// TODO: get explicitly requested read receipts
|
// TODO: get explicitly requested read receipts
|
||||||
sync_events::v5::response::Receipts::default()
|
sync_events::msc4186::response::Receipts::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@@ -1658,23 +1653,25 @@ mod tests {
|
|||||||
|
|
||||||
fn custom_room_type() -> RoomTypeFilter { RoomTypeFilter::from(Some("com.example")) }
|
fn custom_room_type() -> RoomTypeFilter { RoomTypeFilter::from(Some("com.example")) }
|
||||||
|
|
||||||
fn response() -> sync_events::v5::Response { sync_events::v5::Response::new("1".to_owned()) }
|
fn response() -> sync_events::msc4186::Response {
|
||||||
|
sync_events::msc4186::Response::new("1".to_owned())
|
||||||
|
}
|
||||||
|
|
||||||
fn typing_scope_request() -> sync_events::v5::Request {
|
fn typing_scope_request() -> sync_events::msc4186::Request {
|
||||||
let mut request = sync_events::v5::Request::new();
|
let mut request = sync_events::msc4186::Request::new();
|
||||||
request
|
request
|
||||||
.lists
|
.lists
|
||||||
.insert("first".to_owned(), sync_events::v5::request::List::default());
|
.insert("first".to_owned(), sync_events::msc4186::request::List::default());
|
||||||
request
|
request
|
||||||
.lists
|
.lists
|
||||||
.insert("second".to_owned(), sync_events::v5::request::List::default());
|
.insert("second".to_owned(), sync_events::msc4186::request::List::default());
|
||||||
request.room_subscriptions.insert(
|
request.room_subscriptions.insert(
|
||||||
owned_room_id!("!subscription-a:example.com"),
|
owned_room_id!("!subscription-a:example.com"),
|
||||||
sync_events::v5::request::RoomSubscription::default(),
|
sync_events::msc4186::request::RoomSubscription::default(),
|
||||||
);
|
);
|
||||||
request.room_subscriptions.insert(
|
request.room_subscriptions.insert(
|
||||||
owned_room_id!("!subscription-b:example.com"),
|
owned_room_id!("!subscription-b:example.com"),
|
||||||
sync_events::v5::request::RoomSubscription::default(),
|
sync_events::msc4186::request::RoomSubscription::default(),
|
||||||
);
|
);
|
||||||
request
|
request
|
||||||
}
|
}
|
||||||
@@ -1768,9 +1765,10 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn a_room_with_no_events_is_still_empty() {
|
fn a_room_with_no_events_is_still_empty() {
|
||||||
let mut response = response();
|
let mut response = response();
|
||||||
response
|
response.rooms.insert(
|
||||||
.rooms
|
owned_room_id!("!a:example.com"),
|
||||||
.insert(owned_room_id!("!a:example.com"), sync_events::v5::response::Room::default());
|
sync_events::msc4186::response::Room::default(),
|
||||||
|
);
|
||||||
|
|
||||||
assert!(response_is_empty(&response));
|
assert!(response_is_empty(&response));
|
||||||
}
|
}
|
||||||
@@ -1781,7 +1779,7 @@ mod tests {
|
|||||||
let mut response = response();
|
let mut response = response();
|
||||||
response
|
response
|
||||||
.rooms
|
.rooms
|
||||||
.insert(room_id.to_owned(), sync_events::v5::response::Room::default());
|
.insert(room_id.to_owned(), sync_events::msc4186::response::Room::default());
|
||||||
response
|
response
|
||||||
.extensions
|
.extensions
|
||||||
.receipts
|
.receipts
|
||||||
@@ -1846,7 +1844,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn to_device_without_events_is_empty() {
|
fn to_device_without_events_is_empty() {
|
||||||
let mut response = response();
|
let mut response = response();
|
||||||
response.extensions.to_device = Some(sync_events::v5::response::ToDevice::default());
|
response.extensions.to_device = Some(sync_events::msc4186::response::ToDevice::default());
|
||||||
|
|
||||||
assert!(response_is_empty(&response));
|
assert!(response_is_empty(&response));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,12 +27,7 @@ pub(crate) async fn get_supported_versions_route(
|
|||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
_body: Ruma<get_supported_versions::Request>,
|
_body: Ruma<get_supported_versions::Request>,
|
||||||
) -> Result<get_supported_versions::Response> {
|
) -> Result<get_supported_versions::Response> {
|
||||||
let mut unstable_features = unstable_features();
|
let unstable_features = unstable_features(&services.config.experiments);
|
||||||
|
|
||||||
if services.config.allow_sticky_events {
|
|
||||||
// sticky events (https://github.com/matrix-org/matrix-spec-proposals/pull/4354)
|
|
||||||
unstable_features.insert("org.matrix.msc4354".to_owned(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(assign!(get_supported_versions::Response::new(versions()), {
|
Ok(assign!(get_supported_versions::Response::new(versions()), {
|
||||||
unstable_features
|
unstable_features
|
||||||
|
|||||||
@@ -5,9 +5,7 @@ use conduwuit::{
|
|||||||
};
|
};
|
||||||
use futures::{FutureExt, StreamExt, pin_mut};
|
use futures::{FutureExt, StreamExt, pin_mut};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
api::client::user_directory::search_users::{self},
|
api::client::user_directory::search_users, assign, events::room::join_rules::JoinRule,
|
||||||
assign,
|
|
||||||
events::room::join_rules::JoinRule,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::Ruma;
|
use crate::Ruma;
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use conduwuit::{Err, Result};
|
use conduwuit::{Err, Result};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
api::client::discovery::{
|
api::client::{
|
||||||
discover_homeserver::{self, HomeserverInfo},
|
discovery::{
|
||||||
discover_policy_server, discover_support,
|
discover_homeserver::{self, HomeserverInfo},
|
||||||
|
discover_policy_server, discover_support,
|
||||||
|
},
|
||||||
|
rtc,
|
||||||
},
|
},
|
||||||
assign,
|
assign,
|
||||||
};
|
};
|
||||||
@@ -37,17 +40,25 @@ pub(crate) async fn well_known_client(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # `GET /_matrix/client/v1/rtc/transports`
|
/// # `GET /_matrix/client/v1/rtc/transports`
|
||||||
/// # `GET /_matrix/client/unstable/org.matrix.msc4143/rtc/transports`
|
|
||||||
///
|
///
|
||||||
/// Returns the list of MatrixRTC foci (transports) configured for this
|
/// Returns the list of MatrixRTC transports configured for this homeserver,
|
||||||
/// homeserver, implementing MSC4143.
|
/// implementing the stable version of MSC4143.
|
||||||
pub(crate) async fn get_rtc_transports(
|
pub(crate) async fn get_rtc_transports(
|
||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
_body: Ruma<ruma::api::client::rtc::transports::v1::Request>,
|
_body: Ruma<rtc::transports::v1::Request>,
|
||||||
) -> Result<ruma::api::client::rtc::transports::v1::Response> {
|
) -> Result<rtc::transports::v1::Response> {
|
||||||
Ok(ruma::api::client::rtc::transports::v1::Response::new(
|
Ok(rtc::transports::v1::Response::new(services.config.matrix_rtc.foci.clone()))
|
||||||
services.config.matrix_rtc.foci.clone(),
|
}
|
||||||
))
|
|
||||||
|
/// # `GET /_matrix/client/unstable/org.matrix.msc4143/rtc/transports`
|
||||||
|
///
|
||||||
|
/// Unstable version of [`get_rtc_transports`], which names the response field
|
||||||
|
/// `rtc_transports` instead of `transports`.
|
||||||
|
pub(crate) async fn get_rtc_transports_unstable(
|
||||||
|
State(services): State<crate::State>,
|
||||||
|
_body: Ruma<rtc::transports::msc4143::Request>,
|
||||||
|
) -> Result<rtc::transports::msc4143::Response> {
|
||||||
|
Ok(rtc::transports::msc4143::Response::new(services.config.matrix_rtc.foci.clone()))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// # `GET /.well-known/matrix/support`
|
/// # `GET /.well-known/matrix/support`
|
||||||
|
|||||||
@@ -16,6 +16,3 @@ pub mod client_ip;
|
|||||||
pub mod admin;
|
pub mod admin;
|
||||||
|
|
||||||
pub(crate) use self::router::{Ruma, RumaResponse, State};
|
pub(crate) use self::router::{Ruma, RumaResponse, State};
|
||||||
|
|
||||||
conduwuit::mod_ctor! {}
|
|
||||||
conduwuit::mod_dtor! {}
|
|
||||||
+32
-47
@@ -8,9 +8,9 @@ use std::str::FromStr;
|
|||||||
use axum::{
|
use axum::{
|
||||||
Router,
|
Router,
|
||||||
response::{IntoResponse, Redirect},
|
response::{IntoResponse, Redirect},
|
||||||
routing::{any, get, post},
|
routing::{any, get},
|
||||||
};
|
};
|
||||||
use conduwuit::err;
|
use conduwuit::{config::experiments::ToggledExperiment, err};
|
||||||
pub(super) use conduwuit_service::state::State;
|
pub(super) use conduwuit_service::state::State;
|
||||||
use http::{Uri, uri};
|
use http::{Uri, uri};
|
||||||
|
|
||||||
@@ -52,6 +52,7 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
|
|||||||
.ruma_route(&client::set_pushrule_actions_route)
|
.ruma_route(&client::set_pushrule_actions_route)
|
||||||
.ruma_route(&client::delete_pushrule_route)
|
.ruma_route(&client::delete_pushrule_route)
|
||||||
.ruma_route(&client::get_room_event_route)
|
.ruma_route(&client::get_room_event_route)
|
||||||
|
.ruma_route(&client::get_event_by_timestamp_route)
|
||||||
.ruma_route(&client::get_room_aliases_route)
|
.ruma_route(&client::get_room_aliases_route)
|
||||||
.ruma_route(&client::get_filter_route)
|
.ruma_route(&client::get_filter_route)
|
||||||
.ruma_route(&client::create_filter_route)
|
.ruma_route(&client::create_filter_route)
|
||||||
@@ -162,10 +163,6 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
|
|||||||
.ruma_route(&client::update_device_route)
|
.ruma_route(&client::update_device_route)
|
||||||
.ruma_route(&client::delete_device_route)
|
.ruma_route(&client::delete_device_route)
|
||||||
.ruma_route(&client::delete_devices_route)
|
.ruma_route(&client::delete_devices_route)
|
||||||
.ruma_route(&client::put_dehydrated_device_route)
|
|
||||||
.ruma_route(&client::delete_dehydrated_device_route)
|
|
||||||
.ruma_route(&client::get_dehydrated_device_route)
|
|
||||||
.ruma_route(&client::get_dehydrated_events_route)
|
|
||||||
.ruma_route(&client::get_tags_route)
|
.ruma_route(&client::get_tags_route)
|
||||||
.ruma_route(&client::update_tag_route)
|
.ruma_route(&client::update_tag_route)
|
||||||
.ruma_route(&client::delete_tag_route)
|
.ruma_route(&client::delete_tag_route)
|
||||||
@@ -184,7 +181,6 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
|
|||||||
.ruma_route(&client::get_mutual_rooms_unstable_route)
|
.ruma_route(&client::get_mutual_rooms_unstable_route)
|
||||||
.ruma_route(&client::get_mutual_rooms_route)
|
.ruma_route(&client::get_mutual_rooms_route)
|
||||||
.ruma_route(&client::get_room_summary)
|
.ruma_route(&client::get_room_summary)
|
||||||
.ruma_route(&client::get_stripped_state_route)
|
|
||||||
.ruma_route(&client::get_suspended_status)
|
.ruma_route(&client::get_suspended_status)
|
||||||
.ruma_route(&client::put_suspended_status)
|
.ruma_route(&client::put_suspended_status)
|
||||||
.ruma_route(&client::get_lock_status)
|
.ruma_route(&client::get_lock_status)
|
||||||
@@ -193,12 +189,28 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
|
|||||||
.ruma_route(&client::well_known_client)
|
.ruma_route(&client::well_known_client)
|
||||||
.ruma_route(&client::well_known_policy_server)
|
.ruma_route(&client::well_known_policy_server)
|
||||||
.ruma_route(&client::get_rtc_transports)
|
.ruma_route(&client::get_rtc_transports)
|
||||||
|
.ruma_route(&client::get_rtc_transports_unstable)
|
||||||
.ruma_route(&client::room_initial_sync_route)
|
.ruma_route(&client::room_initial_sync_route)
|
||||||
|
.ruma_route(&client::discover_rendezvous_route)
|
||||||
|
.ruma_route(&client::create_rendezvous_session_route)
|
||||||
|
.ruma_route(&client::update_rendezvous_session_route)
|
||||||
|
.ruma_route(&client::get_rendezvous_session_route)
|
||||||
|
.ruma_route(&client::delete_rendezvous_session_route)
|
||||||
.ruma_route(&client::get_authorization_server_metadata_route)
|
.ruma_route(&client::get_authorization_server_metadata_route)
|
||||||
.merge(client::oauth::router(state))
|
.merge(client::oauth::router(state))
|
||||||
.route("/_continuwuity/server_version", get(client::continuwuity_server_version))
|
.route("/_continuwuity/server_version", get(client::continuwuity_server_version))
|
||||||
.ruma_route(&admin::rooms::ban::ban_room)
|
.ruma_route(&admin::rooms::ban::ban_room)
|
||||||
.ruma_route(&admin::rooms::list::list_rooms);
|
.ruma_route(&admin::rooms::list::list_rooms);
|
||||||
|
if config.experiments.msc3814.is_enabled() {
|
||||||
|
router = router
|
||||||
|
.ruma_route(&client::put_dehydrated_device_route)
|
||||||
|
.ruma_route(&client::delete_dehydrated_device_route)
|
||||||
|
.ruma_route(&client::get_dehydrated_device_route)
|
||||||
|
.ruma_route(&client::get_dehydrated_events_route);
|
||||||
|
}
|
||||||
|
if config.experiments.msc4560.is_enabled() {
|
||||||
|
router = router.ruma_route(&client::get_stripped_state_route);
|
||||||
|
}
|
||||||
|
|
||||||
if config.allow_prometheus_metrics {
|
if config.allow_prometheus_metrics {
|
||||||
router = router.route("/_continuwuity/metrics", get(client::continuwuity_metrics));
|
router = router.route("/_continuwuity/metrics", get(client::continuwuity_metrics));
|
||||||
@@ -230,11 +242,13 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
|
|||||||
.ruma_route(&server::get_keys_route)
|
.ruma_route(&server::get_keys_route)
|
||||||
.ruma_route(&server::claim_keys_route)
|
.ruma_route(&server::claim_keys_route)
|
||||||
.ruma_route(&server::get_hierarchy_route)
|
.ruma_route(&server::get_hierarchy_route)
|
||||||
.ruma_route(&server::get_stripped_state_route)
|
|
||||||
.ruma_route(&server::well_known_server)
|
.ruma_route(&server::well_known_server)
|
||||||
.ruma_route(&server::get_content_route)
|
.ruma_route(&server::get_content_route)
|
||||||
.ruma_route(&server::get_content_thumbnail_route)
|
.ruma_route(&server::get_content_thumbnail_route)
|
||||||
.route("/_continuwuity/local_user_count", get(client::continuwuity_local_user_count));
|
.route("/_continuwuity/local_user_count", get(client::continuwuity_local_user_count));
|
||||||
|
if config.experiments.msc4560.is_enabled() {
|
||||||
|
router = router.ruma_route(&server::get_stripped_state_route);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
router = router
|
router = router
|
||||||
.route("/_matrix/federation/{*path}", any(federation_disabled))
|
.route("/_matrix/federation/{*path}", any(federation_disabled))
|
||||||
@@ -247,45 +261,16 @@ pub fn build(router: Router<State>, state: State) -> Router<State> {
|
|||||||
// and other functionality will continue to work
|
// and other functionality will continue to work
|
||||||
router = router.ruma_route(&server::get_openid_userinfo_route);
|
router = router.ruma_route(&server::get_openid_userinfo_route);
|
||||||
|
|
||||||
if config.allow_legacy_media {
|
|
||||||
router = router
|
|
||||||
.ruma_route(&client::get_media_config_legacy_route)
|
|
||||||
.ruma_route(&client::get_media_preview_legacy_route)
|
|
||||||
.ruma_route(&client::get_content_legacy_route)
|
|
||||||
.ruma_route(&client::get_content_as_filename_legacy_route)
|
|
||||||
.ruma_route(&client::get_content_thumbnail_legacy_route)
|
|
||||||
.route("/_matrix/media/v1/config", get(client::get_media_config_legacy_legacy_route))
|
|
||||||
.route("/_matrix/media/v1/upload", post(client::create_content_legacy_route))
|
|
||||||
.route(
|
|
||||||
"/_matrix/media/v1/preview_url",
|
|
||||||
get(client::get_media_preview_legacy_legacy_route),
|
|
||||||
)
|
|
||||||
.route(
|
|
||||||
"/_matrix/media/v1/download/{server_name}/{media_id}",
|
|
||||||
get(client::get_content_legacy_legacy_route),
|
|
||||||
)
|
|
||||||
.route(
|
|
||||||
"/_matrix/media/v1/download/{server_name}/{media_id}/{file_name}",
|
|
||||||
get(client::get_content_as_filename_legacy_legacy_route),
|
|
||||||
)
|
|
||||||
.route(
|
|
||||||
"/_matrix/media/v1/thumbnail/{server_name}/{media_id}",
|
|
||||||
get(client::get_content_thumbnail_legacy_legacy_route),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
router = router
|
|
||||||
.route("/_matrix/media/v1/{*path}", any(legacy_media_disabled))
|
|
||||||
.route("/_matrix/media/v3/config", any(legacy_media_disabled))
|
|
||||||
.route("/_matrix/media/v3/download/{*path}", any(legacy_media_disabled))
|
|
||||||
.route("/_matrix/media/v3/thumbnail/{*path}", any(legacy_media_disabled))
|
|
||||||
.route("/_matrix/media/v3/preview_url", any(redirect_legacy_preview))
|
|
||||||
.route("/_matrix/media/r0/config", any(legacy_media_disabled))
|
|
||||||
.route("/_matrix/media/r0/download/{*path}", any(legacy_media_disabled))
|
|
||||||
.route("/_matrix/media/r0/thumbnail/{*path}", any(legacy_media_disabled))
|
|
||||||
.route("/_matrix/media/r0/preview_url", any(redirect_legacy_preview));
|
|
||||||
}
|
|
||||||
|
|
||||||
router
|
router
|
||||||
|
.route("/_matrix/media/v1/{*path}", any(legacy_media_disabled))
|
||||||
|
.route("/_matrix/media/v3/config", any(legacy_media_disabled))
|
||||||
|
.route("/_matrix/media/v3/download/{*path}", any(legacy_media_disabled))
|
||||||
|
.route("/_matrix/media/v3/thumbnail/{*path}", any(legacy_media_disabled))
|
||||||
|
.route("/_matrix/media/v3/preview_url", any(redirect_legacy_preview))
|
||||||
|
.route("/_matrix/media/r0/config", any(legacy_media_disabled))
|
||||||
|
.route("/_matrix/media/r0/download/{*path}", any(legacy_media_disabled))
|
||||||
|
.route("/_matrix/media/r0/thumbnail/{*path}", any(legacy_media_disabled))
|
||||||
|
.route("/_matrix/media/r0/preview_url", any(redirect_legacy_preview))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn redirect_legacy_preview(uri: Uri) -> impl IntoResponse {
|
async fn redirect_legacy_preview(uri: Uri) -> impl IntoResponse {
|
||||||
@@ -306,7 +291,7 @@ async fn redirect_legacy_preview(uri: Uri) -> impl IntoResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn legacy_media_disabled() -> impl IntoResponse {
|
async fn legacy_media_disabled() -> impl IntoResponse {
|
||||||
err!(Request(Forbidden("Unauthenticated media is disabled.")))
|
err!(Request(NotFound("Unauthenticated media is disabled.")))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn federation_disabled() -> impl IntoResponse {
|
async fn federation_disabled() -> impl IntoResponse {
|
||||||
|
|||||||
Loaded 100 of 212 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user