Commit graph

430 commits

Author SHA1 Message Date
Olivia Lee
c4abca1eb5
Bump ruma to c4f467781a7ef330dc0b7eb5d0d0cad77ebc3337 (refactor Capabilities)
<https://github.com/ruma/ruma/pull/2086>
2025-08-30 18:38:08 +02:00
Olivia Lee
9532c853bd
Bump ruma to daa3c8b014a601fa277e8653dea86e8897b17552 (optional UiaaInfo::params)
<https://github.com/ruma/ruma/pull/2050>

We could just set None now, but the ruma changelog states that

> Servers are encouraged to keep sending it for compatibility with
> clients that required it.
2025-08-30 18:38:08 +02:00
Olivia Lee
8c9800735b
Bump ruma to 2ea8b833e3a80c1d650964a1f3e83ee569cf5c0b (RoomVersion -> RoomVersionRules)
<https://github.com/ruma/ruma/pull/2045>

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2025-08-30 18:37:54 +02:00
Olivia Lee
c4c294d64c
Bump ruma to 3924283c5e94d2020f0991ce35c27667f8c61f0a (add RoomVersion arg to auth_types_for_event) 2025-08-30 13:57:03 +02:00
Olivia Lee
d8ec961589 Bump ruma to e8b0876dda083433a7f9181d47d0aff5a5e05497 (auth check return type change) 2025-08-10 14:57:28 -07:00
Olivia Lee
15ab91c012
Bump ruma to d84760a925d8e5830d668b031fec53ddf9101814 (drop compat-signature-id) 2025-08-09 02:28:20 +02:00
Olivia Lee
98dee6ad49
Bump ruma to 649d683f3f5b8f4f7eb1e728443e4baf25cfebca (stateres refactor #1)
The only change to the internal interface for this one is removing the
current_third_party_invite argument from state_res::auth_check. Ruma now
fetches the event using the fetch_state closure. This is convenient for
us, because we previously didn't bother to implement it.
2025-08-09 02:28:02 +02:00
Jonas Platte
d283da51c6
Upgrade rust-rocksdb 2025-08-09 01:18:51 +02:00
Olivia Lee
b94cc429b7
Bump ruma to 1387667de806c37a6d7f72125117009bd618e32a
The significant change is 26edd40a704040e7104161da81c9bae91b7ddcaa,
which removes the global compat feature, so that each compat feature
must now be enabled individually. We're using the slightly later
1387667d because it has a bugfix that ruma needs to compile.

There are a few ruma compat features that were not previously part of
the global compat feature:

 - compat-arbitrary-length-ids
 - compat-upload-signature
 - compat-encrypted-stickers

I have not enabled these here, to avoid a behavior change.
2025-08-09 00:31:35 +02:00
Jonas Platte
ab5f76f49f
Put ruma dependency in its own TOML table 2025-08-09 00:13:27 +02:00
Jonas Platte
d87848b9a6
Remove support for MSC3575 (sliding sync)
Co-authored-by: Olivia Lee <olivia@computer.surgery>
2025-08-08 22:24:56 +02:00
Olivia Lee
98222b38c2 bump cargo dependencies
There are two new default features:

'system-proxy' for reqwest, which we are not enabling because it only
does anything on windows and mac, which we don't support.

'prefer-post-quantum' for rustls, which we are not enabling because it
only does anything for aws-lc-rs, which we don't use.
2025-08-06 12:27:45 -07:00
Olivia Lee
fa6fb37a2c bump rust version to 1.85.0
base64ct 1.8 (a transitive dependency of argon2) requires >=1.85.0.
2025-08-06 12:27:45 -07:00
Charles Hall
e6dbc293f1 remove jemalloc support
It's no longer being developed and it is very very annoying to maintain
support for.
2025-07-21 21:48:57 -07:00
LordMZTE
868bb44adf
support listening on Unix sockets 2025-06-01 22:16:48 +02:00
Lambda
d425ba72f8
Update ruma to 0.12.2 2025-05-04 14:03:46 -07:00
Olivia Lee
6cb7896e17
use trust-dns for all DNS queries
Previously we were only using trust-dns for resolving SRV records in
server discovery, and then for resolving the hostname from the SRV
record target if one exists. With the previous behavior, admins need to
ensure that both their system resolver and trust-dns are working
correctly in order for outgoing traffic to work reliably. This can be
confusing to debug, because it's not obvious to the admin if or when
each resolver are being used. Now, everything goes through trust-dns and
outgoing federation DNS should fail/succeed more predictably.

I also expect some performance improvement from having an in-process DNS
cache, but haven't taken measurements yet.
2025-04-14 15:56:33 -07:00
Olivia Lee
abb1b5681e
add partial_canonicalize helper function
This is useful for checking for potential overlap between paths that
have not been fully created yet.
2025-04-14 15:28:31 -07:00
Charles Hall
bb80f1cf2e
update rust deps that don't require code changes
I also had to pin ruma because otherwise cargo complained that features
were removed from ruma so it couldn't resolve the dependency by itself.
2025-03-27 16:31:45 -07:00
Charles Hall
8b7cbb5f25
update rocksdb
This is done separately since it requires more involved changes than
just cargo's files.
2025-03-27 16:30:52 -07:00
Lambda
65ec500d75 Enable useful new clippy lints
Picked from this filtered list:
https://rust-lang.github.io/rust-clippy/master/index.html?versions=gte%3A82%2Clte%3A84&levels=allow&groups=cargo%2Ccomplexity%2Ccorrectness%2Cnursery%2Cperf%2Crestriction%2Cstyle%2Csuspicious
2025-02-18 17:06:08 +00:00
Lambda
175a62007d Update MSRV to 1.84.0
And appease clippy (`__CARGO_FIX_YOLO=1 cargo clippy --fix` plus some
manual type shuffling).
2025-02-18 17:06:08 +00:00
Charles Hall
ec01a84efb
add custom release profile with debuginfo enabled
This is primarily useful for profiling. Also change the nix package to
decide whether to strip based on whether the "release" profile is used.
2024-12-01 08:47:09 -08:00
Charles Hall
2f8e0e3e52
update rust dependencies
Ruma dropped a couple dependencies and includes a stateres performance
improvement. May as well pull in everything else (except OTel) while
we're at it.
2024-11-29 10:39:53 -08:00
Charles Hall
af15f0c596
update rust dependencies
Except OTel stuff, as usual.

The main point is to bump `ruma-state-res` for a state resolution fix.
2024-11-18 11:07:23 -08:00
Charles Hall
2dbb101140
upgrade to latest rust-rocksdb
We gotta overrideAttrs to set the src and version to a newer version
than nixpkgs has now.
2024-11-08 17:26:38 -08:00
Charles Hall
d565b22da9
run cargo upgrade && cargo update
There are a few available incompatible updates not covered here:

* RocksDB
* Ruma
* OTel stuff
2024-11-07 11:36:13 -08:00
Charles Hall
e74c8687f5
drop dependency on once-cell 2024-11-07 11:36:13 -08:00
Charles Hall
f07c8c2b6f
update flake.lock
And some supporting changes:

* crane: It removed its dependency on nixpkgs and made overrideToolchain
  take a function for splicing reasons, but we're doing splicing
  ourselves so we can just ignore the function argument. These changes
  are in `flake.nix`.
* [NixOS/nixpkgs#347228][0]: linkerFor* were removed because the linker
  no longer needs to be different in some edge cases. Based on the
  diff of the PR that introduced this change, ccFor* are the proper
  replacements. These changes are in `cross-compilation-env.nix` in the
  compiler-and-linker-choosing section.
* [NixOS/nixpkgs#350299][1]: buildPlatform isn't at the top level
  anymore, we have to go through stdenv now. These changes are in
  `nix/shell.nix`.
* rocksdb: nixpkgs has 9.6.1 now so we need to upgrade our rust
  library to use the matching version. These changes are in
  `Cargo.toml`, `Cargo.lock`, `nix/pkgs/default/default.nix`, and
  `cross-compilation-env.nix` in the linker flags section.

[0]: https://github.com/NixOS/nixpkgs/pull/347228
[1]: https://github.com/NixOS/nixpkgs/pull/350299

Flake lock file updates:

• Updated input 'attic':
    'github:zhaofengli/attic/4dbdbee45728d8ce5788db6461aaaa89d98081f0' (2024-03-29)
  → 'github:zhaofengli/attic/48c8b395bfbc6b76c7eae74df6c74351255a095c' (2024-10-30)
• Updated input 'attic/crane':
    'github:ipetkov/crane/7195c00c272fdd92fc74e7d5a0a2844b9fadb2fb' (2023-12-18)
  → 'github:ipetkov/crane/4c6c77920b8d44cd6660c1621dea6b3fc4b4c4f4' (2024-08-06)
• Updated input 'attic/flake-compat':
    'github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9' (2023-01-17)
  → 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04)
• Added input 'attic/flake-parts':
    'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01)
• Added input 'attic/flake-parts/nixpkgs-lib':
    follows 'attic/nixpkgs'
• Removed input 'attic/flake-utils'
• Updated input 'attic/nixpkgs':
    'github:NixOS/nixpkgs/07262b18b97000d16a4bdb003418bd2fb067a932' (2024-03-25)
  → 'github:NixOS/nixpkgs/159be5db480d1df880a0135ca0bfed84c2f88353' (2024-09-11)
• Updated input 'attic/nixpkgs-stable':
    'github:NixOS/nixpkgs/44733514b72e732bd49f5511bd0203dea9b9a434' (2024-03-26)
  → 'github:NixOS/nixpkgs/797f7dc49e0bc7fab4b57c021cdf68f595e47841' (2024-08-22)
• Added input 'attic/nix-github-actions':
    'github:nix-community/nix-github-actions/e04df33f62cdcf93d73e9a04142464753a16db67' (2024-10-24)
• Added input 'attic/nix-github-actions/nixpkgs':
    follows 'attic/nixpkgs'
• Updated input 'crane':
    'github:ipetkov/crane/109987da061a1bf452f435f1653c47511587d919' (2024-05-24)
  → 'github:ipetkov/crane/498d9f122c413ee1154e8131ace5a35a80d8fa76' (2024-10-27)
• Removed input 'crane/nixpkgs'
• Updated input 'fenix':
    'github:nix-community/fenix/b6fc5035b28e36a98370d0eac44f4ef3fd323df6' (2024-05-22)
  → 'github:nix-community/fenix/87b4d20f896c99018dde4702a9c6157b516f2a76' (2024-11-01)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/21ec8f523812b88418b2bfc64240c62b3dd967bd' (2024-05-19)
  → 'github:rust-lang/rust-analyzer/0ba893e1a00d92557ac91efb771d72eee36ca687' (2024-10-31)
• Updated input 'flake-utils':
    'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11)
  → 'github:numtide/flake-utils/c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a' (2024-09-17)
• Updated input 'nix-filter':
    'github:numtide/nix-filter/3342559a24e85fc164b295c3444e8a139924675b' (2024-03-11)
  → 'github:numtide/nix-filter/776e68c1d014c3adde193a18db9d738458cd2ba4' (2024-10-29)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5710852ba686cc1fd0d3b8e22b3117d43ba374c2' (2024-05-21)
  → 'github:NixOS/nixpkgs/807e9154dcb16384b1b765ebe9cd2bba2ac287fd' (2024-10-29)
2024-11-07 11:35:48 -08:00
Andreas Fuchs
26ba489aa3 Add a "check-config" command to validate config files & tests for it 2024-11-01 12:08:17 -04:00
Lambda
70ee206031 Extract source address for requests 2024-10-25 20:48:38 +00:00
Lambda
3247c64cd8 Add support for HAProxy proxy protocol for listeners 2024-10-25 20:48:38 +00:00
Lambda
94d523ebcb
Reload TLS config on SIGHUP 2024-09-27 09:51:17 -07:00
Benjamin Lee
e2318cad8a
fix serving tls by setting rustls default crypto provider
The rustls version bump in c24f79b79b
introduced a panic when serving listeners with 'tls = true':

> thread 'main' panicked at /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/rustls-0.23.13/src/crypto/mod.rs:265:14:
> no process-level CryptoProvider available -- call CryptoProvider::install_default() before this point

This commit fixes this by setting the default provider to ring. I chose
ring (the old rustls default) over aws-lc-rs (the new default) for a few
reasons:

 - Judging by github issues, aws-lc-rs seems to have a lot of build problems.
   We don't need more of that.
 - The "motivation" section in the aws-lc-rs docs only talks about FIPS,
   which we do not care about.
 - My past experience with things that start with "aws-" has been very
   negative.
2024-09-23 23:39:23 -07:00
Charles Hall
b0d1cc1b63
bump otel to v0.24.0
Someone contributed opentelemetry-prometheus support for v0.24 and this
version also doesn't put stupid requirements on the tokio version. This
version of the OTel ecosystem also fixes an apparent bug with some hacks
I plan on doing in the future...
2024-09-23 14:22:55 -07:00
Charles Hall
c24f79b79b
update rust deps except rocksdb and otel clownery
* OTel v0.25.0 requires downgrading Tokio to 1.38 [0]
* They have a fix for this but aren't cutting a release just for release
  schedule reasons [1]
* Prometheus support (at least for server-pull) was dropped at OTel
  v0.23 and isn't planned to be picked up again until OTel v1 [2]
* No real reasoning was provided for this decision AFAICT [3] [4]
* So many compiler errors
* Unhelpful changelogs

The last two points are what made me give up on trying to upgrade to
OTel v0.24 too.

RocksDB isn't updated because we'd need to update our nixpkgs too but
that causes other problems, such as an upstream bug in liburing when
building for musl.

[0]: https://github.com/open-telemetry/opentelemetry-rust/issues/2094
[1]: https://github.com/open-telemetry/opentelemetry-rust/issues/2094#issuecomment-2346834030
[2]: https://docs.rs/opentelemetry-prometheus/0.17.0/opentelemetry_prometheus/index.html
[3]: https://github.com/open-telemetry/opentelemetry-rust/pull/1792
[4]: https://github.com/open-telemetry/opentelemetry-rust/pull/1792#issuecomment-2121514344
2024-09-23 14:22:55 -07:00
Lambda
3a55684623
Update MSRV to 1.81.0
Plus a "__CARGO_FIX_YOLO=1 cargo clippy --fix"
2024-09-08 09:54:08 -07:00
Benjamin Lee
a909e2079b
config options for log format and color usage
We want to be able to disable colors for complement logs (since they
are likely to be opened in a text editor). There's no pressing need for
alternative log formats, but I'm interested in whether the 'pretty'
format will be easier for debugging.

I chose to add 'log_*' options rather than making a separate 'log'
section for now. There's been some discussion about trying to separate
the tracing/logging stuff into more structured sections, but that can
happen later.
2024-06-13 21:21:14 -07:00
Charles Hall
70fa17dde0
enable clap's wrap_help feature
This makes the output easier to read.
2024-06-12 19:57:00 -07:00
Charles Hall
85e77832e9
follow xdg base dirs spec by default 2024-06-12 19:57:00 -07:00
Charles Hall
2b0bc140cf
drop figment
Just deserialize directly via the `toml` crate.
2024-06-12 19:56:59 -07:00
Charles Hall
9364d44ce2
use strum instead 2024-06-05 17:41:39 -07:00
Charles Hall
aa4cd8b1e1
switch to RustCrypto's argon2 crate 2024-06-04 19:35:21 -07:00
Charles Hall
a0b92c82e8
set up opentelemetry for metrics
Also adds an `allow_prometheus` option (disabled by default) to expose
a `/metrics` endpoint that returns Prometheus data.
2024-06-03 18:18:44 -07:00
Lambda
62dd097f49 Use Ruma XMatrix type instead of rolling our own
Both the hand-rolled parser and serialization were wrong in countless
ways. The current Ruma parser is much better, and the Ruma serialization
will be fixed by https://github.com/ruma/ruma/pull/1830.
2024-06-03 20:50:49 +00:00
Charles Hall
aec314ce85
get tracing-opentelemetry from crates.io
They made a release with the changes we needed; we can stop pulling it
from git now.
2024-06-02 17:27:54 -07:00
Charles Hall
a275543494
enable axum's tracing feature
This pretty much only makes it log a single error event, but it's one
that's useful to know about.
2024-05-26 19:47:00 -07:00
Charles Hall
8f0fdfb2f2
upgrade all cargo dependencies
Unfortunately we need to pull tracing-opentelemetry from git because
there hasn't been a release including the dependency bump on the other
opentelemetry crates.
2024-05-26 19:47:00 -07:00
Charles Hall
13de9ecd41
enable unnecessary_to_owned lint
*facepalm*
2024-05-26 19:47:00 -07:00
Charles Hall
7e7911abcf
enable thread_local_initializer_can_be_made_const
There's barely enough room in the commit title for this lint's name...
2024-05-26 19:47:00 -07:00