synapse/docs
Quentin Gliech 5ea2cf2484
Move device changes off the main process (#18581)
The main goal of this PR is to handle device list changes onto multiple
writers, off the main process, so that we can have logins happening
whilst Synapse is rolling-restarting.

This is quite an intrusive change, so I would advise to review this
commit by commit; I tried to keep the history as clean as possible.

There are a few things to consider:

- the `device_list_key` in stream tokens becomes a
`MultiWriterStreamToken`, which has a few implications in sync and on
the storage layer
- we had a split between `DeviceHandler` and `DeviceWorkerHandler` for
master vs. worker process. I've kept this split, but making it rather
writer vs. non-writer worker, using method overrides for doing
replication calls when needed
- there are a few operations that need to happen on a single worker at a
time. Instead of using cross-worker locks, for now I made them run on
the first writer on the list

---------

Co-authored-by: Eric Eastwood <erice@element.io>
2025-07-18 09:06:14 +02:00
..
admin_api Allow admins to see soft failed events (if they want to) (#18238) 2025-07-14 16:55:19 +01:00
changelogs move additional release missed in last commit 2025-01-14 14:23:35 +00:00
development Replace PyICU with Rust icu_segmenter crate (#18553) 2025-07-03 11:12:12 +01:00
modules Add federated_user_may_invite spam checker callback (#18241) 2025-06-26 12:27:21 +01:00
other Fix broken links on docs (#16853) 2024-02-06 09:26:55 +00:00
privacy_policy_templates/en
setup Replace PyICU with Rust icu_segmenter crate (#18553) 2025-07-03 11:12:12 +01:00
systemd-with-workers Add RuntimeDirectory to matrix-synapse.service (#17084) 2024-04-26 09:56:20 +01:00
usage Move device changes off the main process (#18581) 2025-07-18 09:06:14 +02:00
website_files Sort versions in the documentation version picker appropriately. (#16966) 2024-03-14 15:18:51 +00:00
.sample_config_header.yaml Fix sample config doc CI (#16758) 2023-12-21 13:31:19 +00:00
ancient_architecture_notes.md Fix-up incorrect spellings in docs. (#16282) 2023-09-08 09:47:36 -04:00
application_services.md Fix missing field in AS documentation (#14845) 2023-01-16 12:59:15 +00:00
architecture.md
auth_chain_diff.dot
auth_chain_diff.dot.png
auth_chain_difference_algorithm.md
CAPTCHA_SETUP.md
code_style.md Replace isort and black with ruff (#17620) 2024-08-30 10:07:46 +02:00
consent_tracking.md Fix typo 2023-12-13 16:37:10 +00:00
delegate.md Clarify limitations of SRV delegation in documentation (#14959) 2023-02-08 10:44:19 +00:00
deprecation_policy.md Drop debian buster (#15893) 2023-07-10 10:39:36 -07:00
element_logo_white_bg.svg Upload new logo with white bg and update readme to use it (#17387) 2024-07-10 14:59:24 +01:00
favicon.png
favicon.svg
federate.md Update book location 2023-12-13 16:15:22 +00:00
jwt.md
log_contexts.md Fix-up incorrect spellings in docs. (#16282) 2023-09-08 09:47:36 -04:00
manhole.md Update documentation to refer to element-hq. 2023-12-13 15:16:48 +00:00
media_repository.md
message_retention_policies.md Fix various typos in docs (#17114) 2024-04-26 18:10:45 +00:00
metrics-howto.md Fix typo 2023-12-13 16:37:10 +00:00
openid.md Added Pocket ID to openid.md (#18237) 2025-04-30 16:13:09 +00:00
opentracing.md Mention how to redirect the Jaeger traces to a specific Jaeger instance (#16531) 2023-10-23 11:55:36 +00:00
password_auth_providers.md
postgres.md Update postgres.md (#18445) 2025-05-20 13:31:05 +00:00
presence_router_module.md
README.md Machine-readable config description (#17892) 2025-06-03 10:29:38 +01:00
replication.md Update code to refer to "workers". (#15606) 2023-05-16 15:56:38 -04:00
reverse_proxy.md Propose CAP_NET_BIND_SERVICE instead running Synapse with root (#18408) 2025-06-04 20:44:25 +00:00
room_and_user_statistics.md
sample_config.yaml Update book location 2023-12-13 16:15:22 +00:00
sample_log_config.yaml Update book location 2023-12-13 16:15:22 +00:00
server_notices.md Add avatar and topic settings for server notice room (#16679) 2023-12-12 15:22:19 +00:00
spam_checker.md Pass room_config argument to user_may_create_room spam checker module callback (#18486) 2025-06-04 11:30:45 +01:00
sso_mapping_providers.md Correct typo "SAML" -> SSO in mapping providers docs (#18276) 2025-03-25 10:35:01 +00:00
structured_logging.md Add link explaining ELK stack to structured_logging.md (#16091) 2023-08-16 14:08:35 +01:00
SUMMARY.md Allow admins to see soft failed events (if they want to) (#18238) 2025-07-14 16:55:19 +01:00
synctl_workers.md
tcp_replication.md Fix-up incorrect spellings in docs. (#16282) 2023-09-08 09:47:36 -04:00
templates.md Fix typo 2023-12-13 16:37:10 +00:00
turn-howto.md Fix-up incorrect spellings in docs. (#16282) 2023-09-08 09:47:36 -04:00
upgrade.md Move registrations off the main worker (#18552) 2025-07-10 13:13:27 +00:00
user_directory.md Replace PyICU with Rust icu_segmenter crate (#18553) 2025-07-03 11:12:12 +01:00
welcome_and_overview.md Fix outdated Security Disclosure Policy references (#17341) 2024-06-25 15:58:30 +01:00
workers.md Move device changes off the main process (#18581) 2025-07-18 09:06:14 +02:00

Synapse Documentation

The documentation is currently hosted here. Please update any links to point to the new website instead.

About

This directory currently holds a series of markdown files documenting how to install, use and develop Synapse. The documentation is readable directly from this repository, but it is recommended to instead browse through the website for easier discoverability.

Adding to the documentation

Most of the documentation currently exists as top-level files, as when organising them into a structured website, these files were kept in place so that existing links would not break. The rest of the documentation is stored in folders, such as setup, usage, and development etc. All new documentation files should be placed in structured folders. For example:

To create a new user-facing documentation page about a new Single Sign-On protocol named "MyCoolProtocol", one should create a new file with a relevant name, such as "my_cool_protocol.md". This file might fit into the documentation structure at:

  • Usage
    • Configuration
      • User Authentication
        • Single Sign-On
          • My Cool Protocol

Given that, one would place the new file under usage/configuration/user_authentication/single_sign_on/my_cool_protocol.md.

Note that the structure of the documentation (and thus the left sidebar on the website) is determined by the list in SUMMARY.md. The final thing to do when adding a new page is to add a new line linking to the new documentation file:

- [My Cool Protocol](usage/configuration/user_authentication/single_sign_on/my_cool_protocol.md)

Building the documentation

The documentation is built with mdbook, and the outline of the documentation is determined by the structure of SUMMARY.md.

First, get mdbook. Then, from the root of the repository, build the documentation with:

mdbook build

The rendered contents will be outputted to a new book/ directory at the root of the repository. Please note that index.html is not built by default, it is created by copying over the file welcome_and_overview.html to index.html during deployment. Thus, when running mdbook serve locally the book will initially show a 404 in place of the index due to the above. Do not be alarmed!

You can also have mdbook host the docs on a local webserver with hot-reload functionality via:

mdbook serve

The URL at which the docs can be viewed at will be logged.

Synapse configuration documentation

The Configuration Manual page is generated from a YAML file, schema/synapse-config.schema.yaml. To add new options or modify existing ones, first edit that file, then run scripts-dev/gen_config_documentation.py to generate an updated Configuration Manual markdown file.

Build the book as described above to preview it in a web browser.

Configuration and theming

The look and behaviour of the website is configured by the book.toml file at the root of the repository. See mdbook's documentation on configuration for available options.

The site can be themed and additionally extended with extra UI and features. See website_files/README.md for details.