Commit Graph
539 Commits
Author SHA1 Message Date
Devon HudsonandClaude Opus 5 4ad436fb33 Add a POST /api/admin/v1/room-invites admin endpoint
Mints a single-use, passwordless registration token per recipient, pinned to
their address and optionally to a username, and schedules the invite emails.
The links are only ever mailed to the recipients, so the response carries a
count rather than the tokens.

Minting moves out of the queue and into the caller so a username that is
already taken is refused up front, rather than emailed out as a link nobody
can register with. That leaves the fan-out job with nothing to do, so
`SendRoomInviteEmailsJob` goes away and `SendRoomInviteEmailJob` carries the
token: it takes both the address and the invite link from it, which replaces
the `matrix.to` stub and keeps the link and its recipient together.

`manage send-room-invites` and the endpoint share the minting through
`mas_storage::room_invite`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-28 14:22:00 -06:00
Devon HudsonandClaude Opus 5 4872e25929 Add a manage send-room-invites command
Schedules a `SendRoomInviteEmailsJob` from the command line, so the room
invite emails can be triggered by hand without an API caller. A worker has
to be running to actually send them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 11:52:03 -06:00
Quentin Gliech 2c08dfb304 Add a passwordless flag to registration tokens
A registration token can now be marked `passwordless`, which will let the
user register without picking a password: their identity is established by
the email verification code instead.

This only adds the column and plumbs it through the storage layer, the
admin API and the anonymous `registrationToken` GraphQL query; the
registration flow itself is unchanged for now.
2026-09-10 18:53:59 +02:00
Quentin Gliech 40f8828a77 Expose the invite URL and the pinned username and email in the admin API
Registration tokens now report the `/invite/{token}` deep link alongside the
`username` and `email` they were issued for, and the create endpoint accepts
both. All the token endpoints now take the `UrlBuilder` so they can build that
link.
2026-09-10 18:53:59 +02:00
Quentin Gliech 5bc5baaa5f Add username and email columns to registration tokens
A registration token can now optionally carry the username and/or the email
address the account it is used for has to be registered with. This only adds
the columns and plumbs them through the storage layer and the CLI; nothing
enforces them yet.
2026-09-10 18:53:59 +02:00
Quentin Gliech bd52dc3829 Add a usernameAvailable GraphQL query for anonymous lookups
Exposes a new query telling whether a given username is available for
registration, and if not, why: already taken, or rejected by the
registration policy. A username reserved on the homeserver side is
deliberately reported as taken, mirroring the ambiguity of the
registration form, which doesn't tell the two apart either.

Because this effectively is a username-existence oracle, the query is
rate-limited per requester, configurable through the new
`rate_limiting.username_availability` option.
2026-09-10 18:52:10 +02:00
Quentin Gliech 7891a7a31b Fix positional arguments in manage CLI docs (#5964) 2026-09-08 12:36:53 +02:00
Quentin Gliech 065ff2fe55 CI: move to pnpm/setup for installing node, pnpm and installing frontend dependencies (#5965) 2026-09-08 12:18:46 +02:00
Quentin Gliech dbbb93915e Declare the Node.js version in devEngines.runtime
`pnpm/setup` reads the runtime version from `package.json` and ignores `.node-version`. With `onFail: download`, pnpm records Node 24.15.0 in the lockfile and downloads it on every install unless `--no-runtime` is passed. The Dockerfile and the docs build pass it, since they already run a pinned Node. `.node-version` stays for the Cloudflare Pages build, which reads it to pick the Node that bootstraps corepack.
2026-09-07 16:04:48 +02:00
Noah Gao aeae198d0e docs: fix manage command positional arguments 2026-09-06 02:57:35 +08:00
Paul Chobert aa8b6b9a27 Merge branch 'main' into fix-missing-appservice-login-unsupported 2026-09-03 15:28:01 +02:00
Paul Chobert 765fa97ffe Return M_APPSERVICE_LOGIN_UNSUPPORTED for m.login.application_service
Matrix 1.17 requires servers that don't support the legacy
authentication API to reject `m.login.application_service` on
`/login` with a 400 and the `M_APPSERVICE_LOGIN_UNSUPPORTED` error
code. Previously this login type fell through the generic unsupported
credentials path and returned `M_UNKNOWN`, which appservices written
against Matrix 1.17 can't distinguish from an unrelated failure.
2026-09-03 11:10:26 +02:00
Quentin Gliech 8bef2570c0 Pin the Rust toolchain for CI build jobs and let dependabot update it (#5938) 2026-09-02 14:44:02 +02:00
Olivier 'reivilibre e94477d1b3 docs: Merge error description for the same status code (#5911) 2026-08-27 14:57:32 +01:00
Quentin Gliech 66e73f9910 Pin the Rust toolchain with a rust-toolchain.toml
Until now only the clippy CI job and the Dockerfile named a Rust version (kept in sync by hand), while every other CI job, the release binaries and the docs build ran on whatever `stable` happened to be that day. Rust 1.98.0 landing on 2026-08-20 broke `build-binaries` overnight because of that (#5935).

`rust-toolchain.toml` pins 1.96.0 with the `minimal` profile plus clippy, and every `rustup toolchain install stable ...` in CI becomes a bare `rustup toolchain install`, which reads the file. Starting at 1.96.0 (the version clippy is already clean against) keeps this change free of lint churn; catching up to 1.98.0 is a follow-up.

rustfmt stays on nightly because `.rustfmt.toml` uses nightly-only options, so that job now invokes `cargo +nightly fmt` explicitly instead of setting a rustup directory override, which would silently take precedence over the toolchain file.

The file does not list the linux cross-compilation targets on purpose: that would make every developer and CI job download `rust-std` they never use. The two consumers that cross-compile add the targets themselves.
2026-08-26 12:01:34 +02:00
Quentin Gliech c3b5fa3b0c Remove the GraphQL playground
The interactive playground page and its route/config option are gone; the GraphQL API itself (POST /graphql) is unaffected. External GraphQL usage is deprecated anyway in favour of the REST admin API.
2026-08-07 12:26:42 +02:00
Kai A. Hiller 5647b8a8a4 Update schema 2026-08-07 02:08:51 +02:00
Quentin Gliech 7abe147ba0 Expose a logged_out variable to upstream authorization parameter templates (#5859) 2026-07-29 17:57:55 +02:00
Quentin GliechandAndrew Morgan cae99ccef3 Adapt punctionation in docs
Co-Authored-By: Andrew Morgan <andrewm@element.io>
2026-07-29 14:52:02 +02:00
Quentin Gliech 9d521acd02 Replace Unix socket on startup & allow setting permissions (#5858) 2026-07-28 13:48:39 +02:00
Quentin Gliech 406d678a6f Add a filter[human-account-name] param to the upstream OAuth links admin API
Fuzzy (case-insensitive substring) search on the link's human account
name.
2026-07-27 16:09:01 +02:00
networkException bdfeee2ceb Add password_file config variant for email and database 2026-07-26 17:57:40 +02:00
Kai A. Hiller 02a216d071 Update schema 2026-07-24 13:27:11 +02:00
Eric Eastwood 819957eeb8 Move "Full release process" section higher up 2026-07-15 15:00:45 -05:00
Quentin Gliech cd78f82f9c Replace Unix socket on startup & allow setting permissions
Fixes #5572
Fixes #2424

This makes it so that MAS binds on a temporary path on startup, sets
permissions and then moves it to the configured path. This means that we don't
error out anymore if there is a stale socket file, and that it is safe to
rollout a new process without killing the old one first, without breaking
connections.
2026-07-13 13:46:47 +02:00
Quentin Gliech e7c57e013a Expose a logged_out variable to upstream authorization parameter templates
When a browser signs out (or discovers its session was ended), the
session cookie now remembers when that happened; the flag is cleared by
the next successful login. The `additional_authorization_parameters`
templates can read it as `logged_out`, so operators can force a fresh
prompt at the upstream provider after sign-out, e.g.:

    additional_authorization_parameters:
      prompt: "{% if logged_out %}login{% endif %}"

This addresses the "sign out signs me back in" loop with upstream SSO
providers that still hold a live session.

Fixes #1569
2026-07-10 15:55:14 +02:00
Quentin Gliech 92318fc368 Upgrade aide, schemars and axum (#5752) 2026-07-02 17:43:41 +02:00
Quentin Gliech e40f5f97ec Regenerate config/API/policy schemas for schemars 1.0 + aide 0.16
Mechanical output changes from the dependency bump:
- aide 0.16 strips redundant null branches from optional query-param schemas
  (optionality stays expressed via required:false on the parameter).
- schemars 1.0 changes doc-comment dedenting, emits the ClientsConfig newtype as
  a named definition, and simplifies generic schema names
  (e.g. JsonWebKeySet_for_JsonWebKeyPublicParameters -> JsonWebKeySet).
2026-07-01 17:09:26 +02:00
Quentin Gliech f948dec457 config: remove the unused branding.logo_uri option
branding.logo_uri was accepted and validated by the config layer but never
plumbed through to SiteConfig or any template, so it had no effect. Remove the
field and regenerate the committed config schema to remove the confusion.
2026-06-25 19:04:19 +02:00
Quentin Gliech 670cdce15e docs: fix stale config references in setup and CLI docs
This is a pass on the whole setup guide to make sure all the configuration
options are correctly referenced.
2026-06-25 19:04:18 +02:00
Quentin Gliech a22b71d7d9 docs: document missing configuration options
This was done by auditing what's in the `mas-config` crate (and resulting
config JSON schema) and comparing it to the current configuration options
documentation.
2026-06-25 19:04:18 +02:00
Quentin Gliech e913ddbc9e docs: explain the new database statistics in log lines 2026-06-22 14:43:05 +02:00
Quentin Gliech f328d2f62f Rephrase slightly the request log documentation 2026-06-18 16:36:05 +02:00
Quentin Gliech 393b42ed6e docs: document the request log line
Add a reference page describing the `http.server.response` log line and its
fields (method, status, requester, client address, GraphQL operation, request
id, trace id, …), aimed at administrators feeding the logs into a SIEM, with a
table of well-known operations and how to classify them (login, logout, token
issuance, …).
2026-06-18 13:43:59 +02:00
Quentin Gliech fe622331a8 Admin API: allow listing and viewing of OAuth 2.0 clients (#5710) 2026-06-17 17:44:34 +02:00
Quentin Gliech 78036a933d Fix the compat session API definition in the admin API spec (#5714) 2026-06-17 17:42:31 +02:00
Quentin Gliech 2ea88c6377 Document what user data is stored and how long it is kept (#5673) 2026-06-17 17:42:17 +02:00
Quentin Gliech d33577cf4d Admin API: filter users based on client usage (#5707) 2026-06-17 17:12:56 +02:00
Quentin Gliech 9464ca8038 Merge branch 'main' into quenting/admin-api/session-time-filters 2026-06-17 17:01:02 +02:00
Quentin Gliech a8ffce8f13 Admin API: allow filtering OAuth 2.0 sessions by multiple clients (#5708) 2026-06-17 16:40:53 +02:00
Quentin Gliech 9815902e9b Allow passing arbitrary values from clients down to upstream OAuth providers (#5677) 2026-06-17 16:28:57 +02:00
Olivier 'reivilibre e856e19638 Update Authelia Sample for OIDC upstream (#5672) 2026-06-17 14:41:03 +01:00
Quentin Gliech eb0ef6380c Merge branch 'main' into quenting/upstream-pass-parameters 2026-06-17 14:54:37 +02:00
Quentin Gliech 0e9be7881f Merge branch 'main' into patch-1 2026-06-10 10:57:53 +02:00
Quentin Gliech e31c937f02 Fix a typo in the Synapse configuration instructions in the documentation (#5726) 2026-06-10 10:22:44 +02:00
Quentin Gliech db58127117 Merge branch 'main' into patch-1 2026-06-10 10:11:00 +02:00
Quentin Gliech 632d64d199 Per-provider registration token requirement (#5605) 2026-06-10 10:05:46 +02:00
TuxCoder f3cd388316 Update homeserver.md
fix synapse config name
ref: https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html#matrix_authentication_service
2026-06-04 22:52:35 +02:00
Quentin Gliech 6c330ec72e Fix the compat session API definition in the admin API spec 2026-06-02 10:22:28 +02:00
Quentin Gliech 5104bb84d1 admin-api: filter OAuth2 client list by presence of active sessions 2026-06-01 17:30:16 +02:00