Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into anoa/blacklist_ip_ranges
Browse files Browse the repository at this point in the history
* develop: (45 commits)
  URL preview blacklisting fixes (#5155)
  Revert 085ae34
  Add a DUMMY stage to captcha-only registration flow
  Make Prometheus snippet less confusing on the metrics collection doc (#4288)
  Set syslog identifiers in systemd units (#5023)
  Run Black on the tests again (#5170)
  Add AllowEncodedSlashes to apache (#5068)
  remove instructions for jessie installation (#5164)
  Run `black` on per_destination_queue
  Limit the number of EDUs in transactions to 100 as expected by receiver (#5138)
  Fix bogus imports in tests (#5154)
  add options to require an access_token to GET /profile and /publicRooms on CS API (#5083)
  Do checks on aliases for incoming m.room.aliases events (#5128)
  Remove the requirement to authenticate for /admin/server_version. (#5122)
  Fix spelling in server notices admin API docs (#5142)
  Fix sample config
  0.99.3.2
  include disco in deb build target list
  changelog
  Debian: we now need libpq-dev.
  ...
  • Loading branch information
anoadragon453 committed May 10, 2019
2 parents 6b29f7e + 2f48c4e commit e0715d0
Show file tree
Hide file tree
Showing 127 changed files with 2,025 additions and 1,472 deletions.
20 changes: 20 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
Synapse 0.99.3.2 (2019-05-03)
=============================

Internal Changes
----------------

- Ensure that we have `urllib3` <1.25, to resolve incompatibility with `requests`. ([\#5135](https://github.com/matrix-org/synapse/issues/5135))


Synapse 0.99.3.1 (2019-05-03)
=============================

Security update
---------------

This release includes two security fixes:

- Switch to using a cryptographically-secure random number generator for token strings, ensuring they cannot be predicted by an attacker. Thanks to @opnsec for identifying and responsibly disclosing this issue! ([\#5133](https://github.com/matrix-org/synapse/issues/5133))
- Blacklist 0.0.0.0 and :: by default for URL previews. Thanks to @opnsec for identifying and responsibly disclosing this issue too! ([\#5134](https://github.com/matrix-org/synapse/issues/5134))

Synapse 0.99.3 (2019-04-01)
===========================

Expand Down
21 changes: 5 additions & 16 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,8 @@ https://github.com/spantaleev/matrix-docker-ansible-deploy
#### Matrix.org packages

Matrix.org provides Debian/Ubuntu packages of the latest stable version of
Synapse via https://packages.matrix.org/debian/. To use them:

For Debian 9 (Stretch), Ubuntu 16.04 (Xenial), and later:
Synapse via https://packages.matrix.org/debian/. They are available for Debian
9 (Stretch), Ubuntu 16.04 (Xenial), and later. To use them:

```
sudo apt install -y lsb-release wget apt-transport-https
Expand All @@ -270,26 +269,16 @@ sudo apt update
sudo apt install matrix-synapse-py3
```

For Debian 8 (Jessie):

```
sudo apt install -y lsb-release wget apt-transport-https
sudo wget -O /etc/apt/trusted.gpg.d/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
echo "deb [signed-by=5586CCC0CBBBEFC7A25811ADF473DD4473365DE1] https://packages.matrix.org/debian/ $(lsb_release -cs) main" |
sudo tee /etc/apt/sources.list.d/matrix-org.list
sudo apt update
sudo apt install matrix-synapse-py3
```

The fingerprint of the repository signing key is AAF9AE843A7584B5A3E4CD2BCF45A512DE2DA058.

**Note**: if you followed a previous version of these instructions which
recommended using `apt-key add` to add an old key from
`https://matrix.org/packages/debian/`, you should note that this key has been
revoked. You should remove the old key with `sudo apt-key remove
C35EB17E1EAE708E6603A9B3AD0592FE47F0DF61`, and follow the above instructions to
update your configuration.

The fingerprint of the repository signing key (as shown by `gpg
/usr/share/keyrings/matrix-org-archive-keyring.gpg`) is
`AAF9AE843A7584B5A3E4CD2BCF45A512DE2DA058`.

#### Downstream Debian/Ubuntu packages

Expand Down
3 changes: 3 additions & 0 deletions changelog.d/5023.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Configure the example systemd units to have a log identifier of `matrix-synapse`
instead of the executable name, `python`.
Contributed by Christoph Müller.
1 change: 1 addition & 0 deletions changelog.d/5037.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Workaround bug in twisted where attempting too many concurrent DNS requests could cause it to hang due to running out of file descriptors.
1 change: 1 addition & 0 deletions changelog.d/5083.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add an configuration option to require authentication on /publicRooms and /profile endpoints.
1 change: 1 addition & 0 deletions changelog.d/5104.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the ratelimting on third party invites.
1 change: 1 addition & 0 deletions changelog.d/5116.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add time-based account expiration.
1 change: 1 addition & 0 deletions changelog.d/5119.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Move admin APIs to `/_synapse/admin/v1`. (The old paths are retained for backwards-compatibility, for now).
1 change: 1 addition & 0 deletions changelog.d/5120.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Factor out an "assert_requester_is_admin" function.
1 change: 1 addition & 0 deletions changelog.d/5121.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement an admin API for sending server notices. Many thanks to @krombel who provided a foundation for this work.
1 change: 1 addition & 0 deletions changelog.d/5122.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove the requirement to authenticate for /admin/server_version.
1 change: 1 addition & 0 deletions changelog.d/5124.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add some missing limitations to room alias creation.
1 change: 1 addition & 0 deletions changelog.d/5128.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add some missing limitations to room alias creation.
1 change: 1 addition & 0 deletions changelog.d/5138.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Limit the number of EDUs in transactions to 100 as expected by synapse. Thanks to @superboum for this work!
1 change: 1 addition & 0 deletions changelog.d/5142.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement an admin API for sending server notices. Many thanks to @krombel who provided a foundation for this work.
1 change: 1 addition & 0 deletions changelog.d/5154.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bogus imports in unit tests.
1 change: 1 addition & 0 deletions changelog.d/5155.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent an exception from being raised in a IResolutionReceiver and use a more generic error message for blacklisted URL previews.
1 change: 1 addition & 0 deletions changelog.d/5170.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Run `black` on the tests directory.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ExecStart=/opt/venvs/matrix-synapse/bin/python -m synapse.app.%i --config-path=/
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
RestartSec=3
SyslogIdentifier=matrix-synapse-%i

[Install]
WantedBy=matrix-synapse.service
1 change: 1 addition & 0 deletions contrib/systemd-with-workers/system/matrix-synapse.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ExecStart=/opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --confi
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
RestartSec=3
SyslogIdentifier=matrix-synapse

[Install]
WantedBy=matrix.target
2 changes: 1 addition & 1 deletion contrib/systemd/matrix-synapse.service
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Group=nogroup

WorkingDirectory=/opt/synapse
ExecStart=/opt/synapse/env/bin/python -m synapse.app.homeserver --config-path=/opt/synapse/homeserver.yaml
SyslogIdentifier=matrix-synapse

# adjust the cache factor if necessary
# Environment=SYNAPSE_CACHE_FACTOR=2.0

[Install]
WantedBy=multi-user.target

19 changes: 19 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
matrix-synapse-py3 (0.99.3.2+nmu1) UNRELEASED; urgency=medium

[ Christoph Müller ]
* Configure the systemd units to have a log identifier of `matrix-synapse`

-- Christoph Müller <iblzm@hotmail.de> Wed, 17 Apr 2019 16:17:32 +0200

matrix-synapse-py3 (0.99.3.2) stable; urgency=medium

* New synapse release 0.99.3.2.

-- Synapse Packaging team <packages@matrix.org> Fri, 03 May 2019 18:56:20 +0100

matrix-synapse-py3 (0.99.3.1) stable; urgency=medium

* New synapse release 0.99.3.1.

-- Synapse Packaging team <packages@matrix.org> Fri, 03 May 2019 16:02:43 +0100

matrix-synapse-py3 (0.99.3) stable; urgency=medium

[ Richard van der Hoff ]
Expand Down
1 change: 1 addition & 0 deletions debian/matrix-synapse.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ExecStart=/opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --confi
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
RestartSec=3
SyslogIdentifier=matrix-synapse

[Install]
WantedBy=multi-user.target
3 changes: 2 additions & 1 deletion docker/Dockerfile-dhvirtualenv
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ RUN apt-get update -qq -o Acquire::Languages=none \
python3-pip \
python3-setuptools \
python3-venv \
sqlite3
sqlite3 \
libpq-dev

COPY --from=builder /dh-virtualenv_1.1-1_all.deb /

Expand Down
2 changes: 1 addition & 1 deletion docs/admin_api/account_validity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This API extends the validity of an account by as much time as configured in the

The API is::

POST /_matrix/client/unstable/account_validity/send_mail
POST /_synapse/admin/v1/account_validity/validity

with the following body:

Expand Down
2 changes: 1 addition & 1 deletion docs/admin_api/delete_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ being deleted.
The API is:

```
POST /_matrix/client/r0/admin/delete_group/<group_id>
POST /_synapse/admin/v1/delete_group/<group_id>
```

including an `access_token` of a server admin.
2 changes: 1 addition & 1 deletion docs/admin_api/media_admin_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This API gets a list of known media in a room.

The API is:
```
GET /_matrix/client/r0/admin/room/<room_id>/media
GET /_synapse/admin/v1/room/<room_id>/media
```
including an `access_token` of a server admin.

Expand Down
4 changes: 2 additions & 2 deletions docs/admin_api/purge_history_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ paginate further back in the room from the point being purged from.

The API is:

``POST /_matrix/client/r0/admin/purge_history/<room_id>[/<event_id>]``
``POST /_synapse/admin/v1/purge_history/<room_id>[/<event_id>]``

including an ``access_token`` of a server admin.

Expand Down Expand Up @@ -49,7 +49,7 @@ Purge status query

It is possible to poll for updates on recent purges with a second API;

``GET /_matrix/client/r0/admin/purge_history_status/<purge_id>``
``GET /_synapse/admin/v1/purge_history_status/<purge_id>``

(again, with a suitable ``access_token``). This API returns a JSON body like
the following:
Expand Down
2 changes: 1 addition & 1 deletion docs/admin_api/purge_remote_media.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ media.

The API is::

POST /_matrix/client/r0/admin/purge_media_cache?before_ts=<unix_timestamp_in_ms>&access_token=<access_token>
POST /_synapse/admin/v1/purge_media_cache?before_ts=<unix_timestamp_in_ms>&access_token=<access_token>

{}

Expand Down
4 changes: 2 additions & 2 deletions docs/admin_api/register_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ is not enabled.

To fetch the nonce, you need to request one from the API::

> GET /_matrix/client/r0/admin/register
> GET /_synapse/admin/v1/register

< {"nonce": "thisisanonce"}

Expand All @@ -22,7 +22,7 @@ body containing the nonce, username, password, whether they are an admin

As an example::

> POST /_matrix/client/r0/admin/register
> POST /_synapse/admin/v1/register
> {
"nonce": "thisisanonce",
"username": "pepper_roni",
Expand Down
48 changes: 48 additions & 0 deletions docs/admin_api/server_notices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Server Notices

The API to send notices is as follows:

```
POST /_synapse/admin/v1/send_server_notice
```

or:

```
PUT /_synapse/admin/v1/send_server_notice/{txnId}
```

You will need to authenticate with an access token for an admin user.

When using the `PUT` form, retransmissions with the same transaction ID will be
ignored in the same way as with `PUT
/_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}`.

The request body should look something like the following:

```json
{
"user_id": "@target_user:server_name",
"content": {
"msgtype": "m.text",
"body": "This is my message"
}
}
```

You can optionally include the following additional parameters:

* `type`: the type of event. Defaults to `m.room.message`.
* `state_key`: Setting this will result in a state event being sent.


Once the notice has been sent, the API will return the following response:

```json
{
"event_id": "<event_id>"
}
```

Note that server notices must be enabled in `homeserver.yaml` before this API
can be used. See [server_notices.md](../server_notices.md) for more information.
6 changes: 3 additions & 3 deletions docs/admin_api/user_admin_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This API returns information about a specific user account.

The api is::

GET /_matrix/client/r0/admin/whois/<user_id>
GET /_synapse/admin/v1/whois/<user_id>

including an ``access_token`` of a server admin.

Expand Down Expand Up @@ -50,7 +50,7 @@ references to it).

The api is::

POST /_matrix/client/r0/admin/deactivate/<user_id>
POST /_synapse/admin/v1/deactivate/<user_id>

with a body of:

Expand All @@ -73,7 +73,7 @@ Changes the password of another user.

The api is::

POST /_matrix/client/r0/admin/reset_password/<user_id>
POST /_synapse/admin/v1/reset_password/<user_id>

with a body of:

Expand Down
4 changes: 1 addition & 3 deletions docs/admin_api/version_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ contains Synapse version information).

The api is::

GET /_matrix/client/r0/admin/server_version

including an ``access_token`` of a server admin.
GET /_synapse/admin/v1/server_version

It returns a JSON body like the following:

Expand Down
5 changes: 4 additions & 1 deletion docs/metrics-howto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ How to monitor Synapse metrics using Prometheus
- job_name: "synapse"
metrics_path: "/_synapse/metrics"
static_configs:
- targets: ["my.server.here:9092"]
- targets: ["my.server.here:port"]

where ``my.server.here`` is the IP address of Synapse, and ``port`` is the listener port
configured with the ``metrics`` resource.

If your prometheus is older than 1.5.2, you will need to replace
``static_configs`` in the above with ``target_groups``.
Expand Down
2 changes: 2 additions & 0 deletions docs/reverse_proxy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Let's assume that we expect clients to connect to our server at
SSLEngine on
ServerName matrix.example.com;

AllowEncodedSlashes NoDecode
ProxyPass /_matrix http://127.0.0.1:8008/_matrix nocanon
ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix
</VirtualHost>
Expand All @@ -77,6 +78,7 @@ Let's assume that we expect clients to connect to our server at
SSLEngine on
ServerName example.com;
AllowEncodedSlashes NoDecode
ProxyPass /_matrix http://127.0.0.1:8008/_matrix nocanon
ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix
</VirtualHost>
Expand Down
Loading

0 comments on commit e0715d0

Please sign in to comment.