summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-11-13 12:05:55 +0000
committerErik Johnston <erik@matrix.org>2020-11-13 12:05:55 +0000
commit52984e9e695ac446e43fec0d8676f71c1130c837 (patch)
treecd9e2a02704aefa0e3f560bd6439f271466427f7 /docs
parentMerge branch 'rav/fix_sighup' into matrix-org-hotfixes (diff)
parentAdd metrics for tracking 3PID /requestToken requests. (#8712) (diff)
downloadsynapse-52984e9e695ac446e43fec0d8676f71c1130c837.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'docs')
-rw-r--r--docs/admin_api/register_api.rst4
-rw-r--r--docs/admin_api/rooms.md4
-rw-r--r--docs/admin_api/statistics.md83
-rw-r--r--docs/openid.md2
-rw-r--r--docs/systemd-with-workers/README.md4
-rw-r--r--docs/workers.md21
6 files changed, 109 insertions, 9 deletions
diff --git a/docs/admin_api/register_api.rst b/docs/admin_api/register_api.rst

index 3a63109aa0..c3057b204b 100644 --- a/docs/admin_api/register_api.rst +++ b/docs/admin_api/register_api.rst
@@ -18,7 +18,8 @@ To fetch the nonce, you need to request one from the API:: Once you have the nonce, you can make a ``POST`` to the same URL with a JSON body containing the nonce, username, password, whether they are an admin -(optional, False by default), and a HMAC digest of the content. +(optional, False by default), and a HMAC digest of the content. Also you can +set the displayname (optional, ``username`` by default). As an example:: @@ -26,6 +27,7 @@ As an example:: > { "nonce": "thisisanonce", "username": "pepper_roni", + "displayname": "Pepper Roni", "password": "pizza", "admin": true, "mac": "mac_digest_here" diff --git a/docs/admin_api/rooms.md b/docs/admin_api/rooms.md
index fa9b914fa7..0c05b0ed55 100644 --- a/docs/admin_api/rooms.md +++ b/docs/admin_api/rooms.md
@@ -265,12 +265,10 @@ Response: Once the `next_token` parameter is no longer present, we know we've reached the end of the list. -# DRAFT: Room Details API +# Room Details API The Room Details admin API allows server admins to get all details of a room. -This API is still a draft and details might change! - The following fields are possible in the JSON response body: * `room_id` - The ID of the room. diff --git a/docs/admin_api/statistics.md b/docs/admin_api/statistics.md new file mode 100644
index 0000000000..d398a120fb --- /dev/null +++ b/docs/admin_api/statistics.md
@@ -0,0 +1,83 @@ +# Users' media usage statistics + +Returns information about all local media usage of users. Gives the +possibility to filter them by time and user. + +The API is: + +``` +GET /_synapse/admin/v1/statistics/users/media +``` + +To use it, you will need to authenticate by providing an `access_token` +for a server admin: see [README.rst](README.rst). + +A response body like the following is returned: + +```json +{ + "users": [ + { + "displayname": "foo_user_0", + "media_count": 2, + "media_length": 134, + "user_id": "@foo_user_0:test" + }, + { + "displayname": "foo_user_1", + "media_count": 2, + "media_length": 134, + "user_id": "@foo_user_1:test" + } + ], + "next_token": 3, + "total": 10 +} +``` + +To paginate, check for `next_token` and if present, call the endpoint +again with `from` set to the value of `next_token`. This will return a new page. + +If the endpoint does not return a `next_token` then there are no more +reports to paginate through. + +**Parameters** + +The following parameters should be set in the URL: + +* `limit`: string representing a positive integer - Is optional but is + used for pagination, denoting the maximum number of items to return + in this call. Defaults to `100`. +* `from`: string representing a positive integer - Is optional but used for pagination, + denoting the offset in the returned results. This should be treated as an opaque value + and not explicitly set to anything other than the return value of `next_token` from a + previous call. Defaults to `0`. +* `order_by` - string - The method in which to sort the returned list of users. Valid values are: + - `user_id` - Users are ordered alphabetically by `user_id`. This is the default. + - `displayname` - Users are ordered alphabetically by `displayname`. + - `media_length` - Users are ordered by the total size of uploaded media in bytes. + Smallest to largest. + - `media_count` - Users are ordered by number of uploaded media. Smallest to largest. +* `from_ts` - string representing a positive integer - Considers only + files created at this timestamp or later. Unix timestamp in ms. +* `until_ts` - string representing a positive integer - Considers only + files created at this timestamp or earlier. Unix timestamp in ms. +* `search_term` - string - Filter users by their user ID localpart **or** displayname. + The search term can be found in any part of the string. + Defaults to no filtering. +* `dir` - string - Direction of order. 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 returned in the JSON response body: + +* `users` - An array of objects, each containing information + about the user and their local media. Objects contain the following fields: + - `displayname` - string - Displayname of this user. + - `media_count` - integer - Number of uploaded media by this user. + - `media_length` - integer - Size of uploaded media in bytes by this user. + - `user_id` - string - Fully-qualified user ID (ex. `@user:server.com`). +* `next_token` - integer - Opaque value used for pagination. See above. +* `total` - integer - Total number of users after filtering. diff --git a/docs/openid.md b/docs/openid.md
index 6670f36261..da391f74aa 100644 --- a/docs/openid.md +++ b/docs/openid.md
@@ -205,7 +205,7 @@ GitHub is a bit special as it is not an OpenID Connect compliant provider, but just a regular OAuth2 provider. The [`/user` API endpoint](https://developer.github.com/v3/users/#get-the-authenticated-user) -can be used to retrieve information on the authenticated user. As the Synaspse +can be used to retrieve information on the authenticated user. As the Synapse login mechanism needs an attribute to uniquely identify users, and that endpoint does not return a `sub` property, an alternative `subject_claim` has to be set. diff --git a/docs/systemd-with-workers/README.md b/docs/systemd-with-workers/README.md
index 257c09446f..8e57d4f62e 100644 --- a/docs/systemd-with-workers/README.md +++ b/docs/systemd-with-workers/README.md
@@ -37,10 +37,10 @@ synapse master process to be started as part of the `matrix-synapse.target` target. 1. For each worker process to be enabled, run `systemctl enable matrix-synapse-worker@<worker_name>.service`. For each `<worker_name>`, there -should be a corresponding configuration file +should be a corresponding configuration file. `/etc/matrix-synapse/workers/<worker_name>.yaml`. 1. Start all the synapse processes with `systemctl start matrix-synapse.target`. -1. Tell systemd to start synapse on boot with `systemctl enable matrix-synapse.target`/ +1. Tell systemd to start synapse on boot with `systemctl enable matrix-synapse.target`. ## Usage diff --git a/docs/workers.md b/docs/workers.md
index 84a9759e34..c53d1bd2ff 100644 --- a/docs/workers.md +++ b/docs/workers.md
@@ -116,7 +116,7 @@ public internet; it has no authentication and is unencrypted. ### Worker configuration In the config file for each worker, you must specify the type of worker -application (`worker_app`), and you should specify a unqiue name for the worker +application (`worker_app`), and you should specify a unique name for the worker (`worker_name`). The currently available worker applications are listed below. You must also specify the HTTP replication endpoint that it should talk to on the main synapse process. `worker_replication_host` should specify the host of @@ -262,6 +262,9 @@ using): Note that a HTTP listener with `client` and `federation` resources must be configured in the `worker_listeners` option in the worker config. +Ensure that all SSO logins go to a single process (usually the main process). +For multiple workers not handling the SSO endpoints properly, see +[#7530](https://github.com/matrix-org/synapse/issues/7530). #### Load balancing @@ -302,7 +305,7 @@ Additionally, there is *experimental* support for moving writing of specific streams (such as events) off of the main process to a particular worker. (This is only supported with Redis-based replication.) -Currently support streams are `events` and `typing`. +Currently supported streams are `events` and `typing`. To enable this, the worker must have a HTTP replication listener configured, have a `worker_name` and be listed in the `instance_map` config. For example to @@ -319,6 +322,18 @@ stream_writers: events: event_persister1 ``` +The `events` stream also experimentally supports having multiple writers, where +work is sharded between them by room ID. Note that you *must* restart all worker +instances when adding or removing event persisters. An example `stream_writers` +configuration with multiple writers: + +```yaml +stream_writers: + events: + - event_persister1 + - event_persister2 +``` + #### Background tasks There is also *experimental* support for moving background tasks to a separate @@ -408,6 +423,8 @@ and you must configure a single instance to run the background tasks, e.g.: media_instance_running_background_jobs: "media-repository-1" ``` +Note that if a reverse proxy is used , then `/_matrix/media/` must be routed for both inbound client and federation requests (if they are handled separately). + ### `synapse.app.user_dir` Handles searches in the user directory. It can handle REST endpoints matching