Commit Graph

171 Commits

Author SHA1 Message Date
Quentin Gliech
90fb2f0369 Make the password registration create a user_registration 2025-01-14 16:30:44 +01:00
Quentin Gliech
5aa5c9cb03 Job to send the new email authentication codes 2025-01-14 15:47:17 +01:00
Quentin Gliech
9db14f6743 Rip out the email verification codes
This considers all user_emails as confirmed, and removes the verification code.
It will be replaced by a new email authentication code flow
2025-01-14 15:46:45 +01:00
Quentin Gliech
1c6a8000f0 Shutdown the server if any of the tasks crashes (#3672) 2024-12-17 09:11:08 +00:00
Quentin Gliech
2dbfbfb03f Add metrics to the job queue
This adds:

 - a histogram of the time it takes to process a job for each queue,
   with the status of the job (success, failure, etc.)
 - a histogram which records the time it takes to do a "tick", fetch jobs
 - a counter of the number of jobs currently in-flight for each queue
 - a counter which tracks the reasons why the worker got worken up
2024-12-16 14:57:17 +01:00
Quentin Gliech
a26bc6c843 Cleanup revoked tokens instead of expired ones
If we continue deleting expired tokens, we might not record whether the
token was used or not, and not know what to do in case of
a double-refresh.

Revoked tokens are safe to delete.

This also reduces the frequency of the cleanup job to once an hour.
2024-12-11 14:15:01 +01:00
Quentin Gliech
e0aab3740f Remove the schedule_expression from the database & other fixes 2024-12-06 16:24:26 +01:00
Quentin Gliech
fc7dd0ffdf Cron-like recurring jobs 2024-12-06 16:24:26 +01:00
Quentin Gliech
a01201f954 Allow scheduling jobs in the future
Also retries jobs with an exponential backoff.
2024-12-06 16:24:26 +01:00
Quentin Gliech
5ab826c778 Refactor job processing to wait for them to finish on shutdown 2024-12-06 16:24:26 +01:00
Quentin Gliech
7113e0ddf6 Retry failed jobs 2024-12-06 16:24:26 +01:00
Quentin Gliech
ae5374d458 Decide in each job whether it should retry or not 2024-12-06 16:24:26 +01:00
Quentin Gliech
bd72a57719 Actually consume jobs 2024-12-06 16:24:26 +01:00
Quentin Gliech
70b864f609 WIP: job consumption 2024-12-06 16:24:26 +01:00
Quentin Gliech
703bd743d6 Schedule jobs through the new queue 2024-12-06 16:24:26 +01:00
Quentin Gliech
b82483f936 Move the jobs types in the queue module 2024-12-06 16:24:26 +01:00
Quentin Gliech
312640605d Graceful shutdown 2024-12-06 16:24:26 +01:00
Quentin Gliech
c5e447e633 Move the worker logic in a struct 2024-12-06 16:24:26 +01:00
Quentin Gliech
f34ab1089c Make the worker heartbeat take a worker reference 2024-12-06 16:24:26 +01:00
Quentin Gliech
62ccd2b08c New job queue: worker registration and leader election 2024-12-06 16:24:26 +01:00
dependabot[bot]
3b1344896e build(deps): bump futures-lite from 2.4.0 to 2.5.0
Bumps [futures-lite](https://github.com/smol-rs/futures-lite) from 2.4.0 to 2.5.0.
- [Release notes](https://github.com/smol-rs/futures-lite/releases)
- [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/futures-lite/compare/v2.4.0...v2.5.0)

---
updated-dependencies:
- dependency-name: futures-lite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-12 14:19:39 +01:00
dependabot[bot]
658ade4794 build(deps): bump futures-lite from 2.3.0 to 2.4.0
Bumps [futures-lite](https://github.com/smol-rs/futures-lite) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/smol-rs/futures-lite/releases)
- [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/futures-lite/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: futures-lite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-31 18:12:46 +01:00
dependabot[bot]
686c0255a2 build(deps): bump async-stream from 0.3.5 to 0.3.6
Bumps [async-stream](https://github.com/tokio-rs/async-stream) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/tokio-rs/async-stream/releases)
- [Commits](https://github.com/tokio-rs/async-stream/compare/v0.3.5...v0.3.6)

---
updated-dependencies:
- dependency-name: async-stream
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 18:50:08 +02:00
Quentin Gliech
9a946c19e7 Remove (C) 2024-09-10 14:28:55 +02:00
Quentin Gliech
9da19e2af0 License headers change 2024-09-05 13:25:42 +02:00
Quentin Gliech
678753c2e1 storage: freeze the error type on BoxRepository
This avoids having to deal with traits bounds everywhere. It also moves
the `boxed()` method to the PgRepository, because it was unnecessary to
keep it on the `Repository` trait
2024-07-26 11:36:55 +02:00
Quentin Gliech
a2f581a99a Kill all sessions when deactivating a user 2024-07-16 14:13:11 +02:00
Quentin Gliech
98d66c1356 Add a way to reactivate users on the homeserver 2024-07-16 13:20:28 +02:00
Quentin Gliech
c7963c3af5 Add a lock during syncs of user devices 2024-07-16 09:32:07 +02:00
Quentin Gliech
52b260fdcf Deprecate the ProvisionDeviceJob and DeleteDeviceJob jobs 2024-07-16 09:32:07 +02:00
Quentin Gliech
fa218d2cac Don't hold the database connection for too long 2024-07-16 09:32:07 +02:00
Quentin Gliech
f5e189304e Fully sync the devices with the homeserver 2024-07-16 09:32:07 +02:00
dependabot[bot]
9ca0596386 build(deps): bump event-listener from 5.3.0 to 5.3.1
Bumps [event-listener](https://github.com/smol-rs/event-listener) from 5.3.0 to 5.3.1.
- [Release notes](https://github.com/smol-rs/event-listener/releases)
- [Changelog](https://github.com/smol-rs/event-listener/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/event-listener/compare/v5.3.0...v5.3.1)

---
updated-dependencies:
- dependency-name: event-listener
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 10:35:46 +02:00
Quentin Gliech
df89f570ac Actually send emails for recovery 2024-06-28 15:59:21 +02:00
Quentin Gliech
6e58404c4e Job to generate codes for all emails in a recovery session 2024-06-28 15:59:21 +02:00
Quentin Gliech
fe737e497b Move tokio to a workspace dependency 2024-05-15 14:54:34 +02:00
Quentin Gliech
3e450b50f0 Fix recently added Clippy lints
This also ignores the clippy::blocks_in_conditions lint in two crates,
until tracing gets fixed: https://github.com/tokio-rs/tracing/issues/2876
2024-05-07 07:32:02 +02:00
dependabot[bot]
d76570cdfd build(deps): bump tokio from 1.36.0 to 1.37.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.36.0 to 1.37.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.36.0...tokio-1.37.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 18:11:14 +02:00
dependabot[bot]
149e08b524 build(deps): bump event-listener from 5.2.0 to 5.3.0
Bumps [event-listener](https://github.com/smol-rs/event-listener) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/smol-rs/event-listener/releases)
- [Changelog](https://github.com/smol-rs/event-listener/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/event-listener/compare/v5.2.0...v5.3.0)

---
updated-dependencies:
- dependency-name: event-listener
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 14:23:59 +02:00
Quentin Gliech
7dd59c962c Moved some dependencies in the workspace and upgrade some dependencies 2024-03-19 14:54:35 +01:00
Quentin Gliech
771b6a2f8b Upgrade OTEL and remove support for Jaeger and Zipkin exporters 2024-03-18 17:26:40 +01:00
Quentin Gliech
1627fc6945 Upgrade chrono and replace deprecated methods usage 2024-03-18 17:26:40 +01:00
Quentin Gliech
4706d387a0 Use rustls-platform-verifier for cert validation
This simplifies by removing the mutually exclusive `native-roots` and
`webpki-roots` features with something that is suitable for all
platforms.
2024-03-06 14:03:59 +01:00
Quentin Gliech
306c99d49d Bump most Rust dependencies 2024-02-02 15:37:05 +01:00
Quentin Gliech
b49eadf418 Upgrade rustls 2024-02-02 11:45:20 +01:00
Quentin Gliech
dc66b5b18f Prepare workspace to publish OIDC crates 2023-12-07 16:02:55 +01:00
Quentin Gliech
a7ff6b00aa Enable clippy lints on a workspace level
This enables a lot more lints than before in some crates, so this fixed a lot of warnings as well.
2023-12-05 17:20:42 +01:00
Quentin Gliech
f47f059013 listener: fix the connection not being polled on graceful shutdown 2023-11-28 17:40:18 +01:00
Quentin Gliech
90a6b64c88 Bump Rust dependencies 2023-11-24 13:04:37 +01:00
dependabot[bot]
d63609db14 build(deps): bump event-listener from 3.0.1 to 3.1.0
Bumps [event-listener](https://github.com/smol-rs/event-listener) from 3.0.1 to 3.1.0.
- [Release notes](https://github.com/smol-rs/event-listener/releases)
- [Changelog](https://github.com/smol-rs/event-listener/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/event-listener/compare/v3.0.1...v3.1.0)

---
updated-dependencies:
- dependency-name: event-listener
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-14 15:46:14 +01:00