From 6d4ab8fb90ae2eaa3393dcbd37c83c486202b347 Mon Sep 17 00:00:00 2001
From: DMRobertson If building on an uncommon architecture for which pre-built wheels are
+unavailable, you will need to have a recent Rust compiler installed. The easiest
+way of installing the latest version is to use rustup. To install the Synapse homeserver run: You may need to install the latest Xcode developer tools: On ARM-based Macs you may need to explicitly install libjpeg which is a pillow dependency. You can use Homebrew (https://brew.sh): On ARM-based Macs you may need to install libjpeg and libpq.
+You can use Homebrew (https://brew.sh): On macOS Catalina (10.15) you may need to explicitly install OpenSSL
via brew and inform /var/synapse
should be taken into consideration.
mkdir -p ~/synapse
virtualenv -p python3 ~/synapse/env
@@ -430,8 +433,9 @@ sudo dnf groupinstall "Development Tools"
-xcode-select --install
brew install jpeg
+
brew install jpeg libpq
pip
about it so that psycopg2
builds:bind_addresses: ['127.0.0.1']
so that the server o
listens to traffic on localhost. (Do not change bind_addresses
to 127.0.0.1
when using a containerized Synapse, as that will prevent it from responding
to proxied traffic.)
Optionally, you can also set
+request_id_header
+so that the server extracts and re-uses the same request ID format that the
+reverse proxy is using.
NOTE: You only need one of these.
If Synapse was installed using prebuilt -packages, you will need to follow the -normal process for upgrading those packages.
+If Synapse was installed using prebuilt packages, +you will need to follow the normal process for upgrading those packages.
If Synapse was installed using pip then upgrade to the latest @@ -1617,6 +1624,17 @@ dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
As announced in the upgrade notes for v1.67.0, Synapse now requires a SQLite +version of 3.27.0 or higher if SQLite is in use and source checkouts of Synapse +now require a recent Rust compiler.
+Installations using
+matrixdotorg
,pip install matrix-synapse
(on supported platforms and architectures)will not be affected.
Redis support was added in v1.13.0 with it becoming the recommended method in @@ -1642,7 +1660,7 @@ will require a recent Rust compiler. Those using packages or
From the next major release (v1.68.0) Synapse will require SQLite 3.27.0 or higher. Synapse v1.67.0 will be the last major release supporting SQLite versions 3.22 to 3.26.
-Those using docker images or Debian packages from Matrix.org will not be +
Those using Docker images or Debian packages from Matrix.org will not be affected. If you have installed from source, you should check the version of SQLite used by Python with:
python -c "import sqlite3; print(sqlite3.sqlite_version)"
@@ -3539,7 +3557,16 @@ configuration.
x_forwarded
: Only valid for an 'http' listener. Set to true to use the X-Forwarded-For header as the client IP. Useful when Synapse is
-behind a reverse-proxy.
+behind a reverse-proxy.
+
+
+request_id_header
: The header extracted from each incoming request that is
+used as the basis for the request ID. The request ID is used in
+logs and tracing to
+correlate and match up requests. When unset, Synapse will automatically
+generate sequential request IDs. This option is useful when Synapse is behind
+a reverse-proxy.
+Added in Synapse 1.68.0.
resources
: Only valid for an 'http' listener. A list of resources to host
@@ -4059,8 +4086,9 @@ on this homeserver.
Options related to caching.
event_cache_size
-The number of events to cache in memory. Not affected by
-caches.global_factor
and is not part of the caches
section. Defaults to 10K.
+The number of events to cache in memory. Defaults to 10K. Like other caches,
+this is affected by caches.global_factor
(see below).
+Note that this option is not part of the caches
section.
Example configuration:
event_cache_size: 15K
@@ -4365,7 +4393,7 @@ client is attempting to log into. Defaults to per_second: 0.17
,
burst_count: 3
.
-failted_attempts
ratelimits login requests based on the account the
+
failed_attempts
ratelimits login requests based on the account the
client is attempting to log into, based on the amount of failed login
attempts for this account. Defaults to per_second: 0.17
, burst_count: 3
.
@@ -11583,6 +11611,133 @@ If the room does not define a type, the value will be null
.
]
}
+The Room Messages admin API allows server admins to get all messages +sent to a room in a given timeframe. There are various parameters available +that allow for filtering and ordering the returned list. This API supports pagination.
+To use it, you will need to authenticate by providing an access_token
+for a server admin: see Admin API.
This endpoint mirrors the Matrix Spec defined Messages API.
+The API is:
+GET /_synapse/admin/v1/rooms/<room_id>/messages
+
+Parameters
+The following path parameters are required:
+room_id
- The ID of the room you wish you fetch messages from.The following query parameters are available:
+from
(required) - The token to start returning events from. This token can be obtained from a prev_batch
+or next_batch token returned by the /sync endpoint, or from an end token returned by a previous request to this endpoint.to
- The token to spot returning events at.limit
- The maximum number of events to return. Defaults to 10
.filter
- A JSON RoomEventFilter to filter returned events with.dir
- The direction to return events from. Either f
for forwards or b
for backwards. Setting
+this value to b
will reverse the above sort order. Defaults to f
.Response
+The following fields are possible in the JSON response body:
+chunk
- A list of room events. The order depends on the dir parameter.
+Note that an empty chunk does not necessarily imply that no more events are available. Clients should continue to paginate until no end property is returned.end
- A token corresponding to the end of chunk. This token can be passed back to this endpoint to request further events.
+If no further events are available, this property is omitted from the response.start
- A token corresponding to the start of chunk.state
- A list of state events relevant to showing the chunk.Example
+For more details on each chunk, read the Matrix specification.
+{
+ "chunk": [
+ {
+ "content": {
+ "body": "This is an example text message",
+ "format": "org.matrix.custom.html",
+ "formatted_body": "<b>This is an example text message</b>",
+ "msgtype": "m.text"
+ },
+ "event_id": "$143273582443PhrSn:example.org",
+ "origin_server_ts": 1432735824653,
+ "room_id": "!636q39766251:example.com",
+ "sender": "@example:example.org",
+ "type": "m.room.message",
+ "unsigned": {
+ "age": 1234
+ }
+ },
+ {
+ "content": {
+ "name": "The room name"
+ },
+ "event_id": "$143273582443PhrSn:example.org",
+ "origin_server_ts": 1432735824653,
+ "room_id": "!636q39766251:example.com",
+ "sender": "@example:example.org",
+ "state_key": "",
+ "type": "m.room.name",
+ "unsigned": {
+ "age": 1234
+ }
+ },
+ {
+ "content": {
+ "body": "Gangnam Style",
+ "info": {
+ "duration": 2140786,
+ "h": 320,
+ "mimetype": "video/mp4",
+ "size": 1563685,
+ "thumbnail_info": {
+ "h": 300,
+ "mimetype": "image/jpeg",
+ "size": 46144,
+ "w": 300
+ },
+ "thumbnail_url": "mxc://example.org/FHyPlCeYUSFFxlgbQYZmoEoe",
+ "w": 480
+ },
+ "msgtype": "m.video",
+ "url": "mxc://example.org/a526eYUSFFxlgbQYZmo442"
+ },
+ "event_id": "$143273582443PhrSn:example.org",
+ "origin_server_ts": 1432735824653,
+ "room_id": "!636q39766251:example.com",
+ "sender": "@example:example.org",
+ "type": "m.room.message",
+ "unsigned": {
+ "age": 1234
+ }
+ }
+ ],
+ "end": "t47409-4357353_219380_26003_2265",
+ "start": "t47429-4392820_219380_26003_2265"
+}
+
+The Room Timestamp to Event API endpoint fetches the event_id
of the closest event to the given
+timestamp (ts
query parameter) in the given direction (dir
query parameter).
Useful for cases like jump to date so you can start paginating messages from +a given date in the archive.
+The API is:
+ GET /_synapse/admin/v1/rooms/<room_id>/timestamp_to_event
+
+Parameters
+The following path parameters are required:
+room_id
- The ID of the room you wish to check.The following query parameters are available:
+ts
- a timestamp in milliseconds where we will find the closest event in
+the given direction.dir
- can be f
or b
to indicate forwards and backwards in time from the
+given timestamp. Defaults to f
.Response
+event_id
- converted from timestampThe Block Room admin API allows server admins to block and unblock rooms,
and query to see if a given room is blocked.
@@ -12193,6 +12348,7 @@ for a server admin: see Ad
"appservice_id": null,
"consent_server_notice_sent": null,
"consent_version": null,
+ "consent_ts": null,
"external_ids": [
{
"auth_provider": "<provider1>",
@@ -12500,6 +12656,7 @@ is set to true
:
Changes the password of another user. This will automatically log the user out of all their devices.
@@ -13148,6 +13305,30 @@ for more information.The request and response format is the same as the /_matrix/client/r0/register/available API.
+The API is:
+GET /_synapse/admin/v1/auth_providers/$provider/users/$external_id
+
+When a user matched the given ID for the given provider, an HTTP code 200
with a response body like the following is returned:
{
+ "user_id": "@hello:example.org"
+}
+
+Parameters
+The following parameters should be set in the URL:
+provider
- The ID of the authentication provider, as advertised by the GET /_matrix/client/v3/login
API in the m.login.sso
authentication method.external_id
- The user ID from the authentication provider. Usually corresponds to the sub
claim for OIDC providers, or to the uid
attestation for SAML2 providers.The external_id
may have characters that are not URL-safe (typically /
, :
or @
), so it is advised to URL-encode those parameters.
Errors
+Returns a 404
HTTP status code if no user was found, with a response body like this:
{
+ "errcode":"M_NOT_FOUND",
+ "error":"User not found"
+}
+
+Added in Synapse 1.68.0.
This API returns the running Synapse version and the Python version on which Synapse is being run. This is useful when a Synapse instance @@ -14037,14 +14218,14 @@ WHERE room_stats_state.room_id = event_json.room_id" | psql -d synapse -h l -AAAAAAAAAAAAAAAAAAAAA- -BBBBBBBBBBBBBBBBBBBBBB- -C- -DD- -EEEEEE- -FFFFFFFFF- -GG- -HHHHHHHHHHHHHHHHHHHHHHH- -IIIIII- -JJJJJJJ- -KKKKKK-, -LLLLLL- -MMMMMMM- -NNNNNN- O -P- -QQ- -RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR- -SSSSSSSSSSSS- -TTTTTT-
Part | Explanation |
---|---|
AAAA | Timestamp request was logged (not recieved) |
AAAA | Timestamp request was logged (not received) |
BBBB | Logger name (synapse.access.(http\|https).<tag> , where 'tag' is defined in the listeners config section, normally the port) |
CCCC | Line number in code |
DDDD | Log Level |
EEEE | Request Identifier (This identifier is shared by related log lines) |
FFFF | Source IP (Or X-Forwarded-For if enabled) |
GGGG | Server Port |
HHHH | Federated Server or Local User making request (blank if unauthenticated or not supplied) |
HHHH | Federated Server or Local User making request (blank if unauthenticated or not supplied). If this is of the form `@aaa:example.com |
IIII | Total Time to process the request |
JJJJ | Time to send response over network once generated (this may be negative if the socket is closed before the response is generated) |
KKKK | Userland CPU time |