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

Commit

Permalink
Merge branch 'master' into dinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
babolivier committed Jun 11, 2019
2 parents 8d16321 + c831748 commit 3c8262b
Show file tree
Hide file tree
Showing 55 changed files with 2,771 additions and 329 deletions.
59 changes: 59 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
Synapse 0.99.5.2 (2019-05-30)
=============================

Bugfixes
--------

- Fix bug where we leaked extremities when we soft failed events, leading to performance degradation. ([\#5274](https://github.com/matrix-org/synapse/issues/5274), [\#5278](https://github.com/matrix-org/synapse/issues/5278), [\#5291](https://github.com/matrix-org/synapse/issues/5291))


Synapse 0.99.5.1 (2019-05-22)
=============================

0.99.5.1 supersedes 0.99.5 due to malformed debian changelog - no functional changes.

Synapse 0.99.5 (2019-05-22)
===========================

No significant changes.


Synapse 0.99.5rc1 (2019-05-21)
==============================

Features
--------

- Add ability to blacklist IP ranges for the federation client. ([\#5043](https://github.com/matrix-org/synapse/issues/5043))
- Ratelimiting configuration for clients sending messages and the federation server has been altered to match login ratelimiting. The old configuration names will continue working. Check the sample config for details of the new names. ([\#5181](https://github.com/matrix-org/synapse/issues/5181))
- Drop support for the undocumented /_matrix/client/v2_alpha API prefix. ([\#5190](https://github.com/matrix-org/synapse/issues/5190))
- Add an option to disable per-room profiles. ([\#5196](https://github.com/matrix-org/synapse/issues/5196))
- Stick an expiration date to any registered user missing one at startup if account validity is enabled. ([\#5204](https://github.com/matrix-org/synapse/issues/5204))
- Add experimental support for relations (aka reactions and edits). ([\#5209](https://github.com/matrix-org/synapse/issues/5209), [\#5211](https://github.com/matrix-org/synapse/issues/5211), [\#5203](https://github.com/matrix-org/synapse/issues/5203), [\#5212](https://github.com/matrix-org/synapse/issues/5212))
- Add a room version 4 which uses a new event ID format, as per [MSC2002](https://github.com/matrix-org/matrix-doc/pull/2002). ([\#5210](https://github.com/matrix-org/synapse/issues/5210), [\#5217](https://github.com/matrix-org/synapse/issues/5217))


Bugfixes
--------

- Fix image orientation when generating thumbnails (needs pillow>=4.3.0). Contributed by Pau Rodriguez-Estivill. ([\#5039](https://github.com/matrix-org/synapse/issues/5039))
- Exclude soft-failed events from forward-extremity candidates: fixes "No forward extremities left!" error. ([\#5146](https://github.com/matrix-org/synapse/issues/5146))
- Re-order stages in registration flows such that msisdn and email verification are done last. ([\#5174](https://github.com/matrix-org/synapse/issues/5174))
- Fix 3pid guest invites. ([\#5177](https://github.com/matrix-org/synapse/issues/5177))
- Fix a bug where the register endpoint would fail with M_THREEPID_IN_USE instead of returning an account previously registered in the same session. ([\#5187](https://github.com/matrix-org/synapse/issues/5187))
- Prevent registration for user ids that are too long to fit into a state key. Contributed by Reid Anderson. ([\#5198](https://github.com/matrix-org/synapse/issues/5198))
- Fix incompatibility between ACME support and Python 3.5.2. ([\#5218](https://github.com/matrix-org/synapse/issues/5218))
- Fix error handling for rooms whose versions are unknown. ([\#5219](https://github.com/matrix-org/synapse/issues/5219))


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

- Make /sync attempt to return device updates for both joined and invited users. Note that this doesn't currently work correctly due to other bugs. ([\#3484](https://github.com/matrix-org/synapse/issues/3484))
- Update tests to consistently be configured via the same code that is used when loading from configuration files. ([\#5171](https://github.com/matrix-org/synapse/issues/5171), [\#5185](https://github.com/matrix-org/synapse/issues/5185))
- Allow client event serialization to be async. ([\#5183](https://github.com/matrix-org/synapse/issues/5183))
- Expose DataStore._get_events as get_events_as_list. ([\#5184](https://github.com/matrix-org/synapse/issues/5184))
- Make generating SQL bounds for pagination generic. ([\#5191](https://github.com/matrix-org/synapse/issues/5191))
- Stop telling people to install the optional dependencies by default. ([\#5197](https://github.com/matrix-org/synapse/issues/5197))


Synapse 0.99.4 (2019-05-15)
===========================

Expand Down
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ virtualenv -p python3 ~/synapse/env
source ~/synapse/env/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools
pip install matrix-synapse[all]
pip install matrix-synapse
```

This will download Synapse from [PyPI](https://pypi.org/project/matrix-synapse)
Expand All @@ -48,7 +48,7 @@ update flag:

```
source ~/synapse/env/bin/activate
pip install -U matrix-synapse[all]
pip install -U matrix-synapse
```

Before you can start Synapse, you will need to generate a configuration
Expand Down
1 change: 0 additions & 1 deletion changelog.d/3484.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/5043.feature

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/5171.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/5181.feature

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/5183.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/5184.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/5185.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/5187.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/5190.feature

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/5196.feature

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/5204.feature

This file was deleted.

12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
matrix-synapse-py3 (0.99.5.2) stable; urgency=medium

* New synapse release 0.99.5.2.

-- Synapse Packaging team <packages@matrix.org> Thu, 30 May 2019 16:28:07 +0100

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

* New synapse release 0.99.5.1.

-- Synapse Packaging team <packages@matrix.org> Wed, 22 May 2019 16:22:24 +0000

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

[ Christoph Müller ]
Expand Down
2 changes: 2 additions & 0 deletions debian/test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vagrant
*.log
23 changes: 23 additions & 0 deletions debian/test/provision.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
#
# provisioning script for vagrant boxes for testing the matrix-synapse debs.
#
# Will install the most recent matrix-synapse-py3 deb for this platform from
# the /debs directory.

set -e

apt-get update
apt-get install -y lsb-release

deb=`ls /debs/matrix-synapse-py3_*+$(lsb_release -cs)*.deb | sort | tail -n1`

debconf-set-selections <<EOF
matrix-synapse matrix-synapse/report-stats boolean false
matrix-synapse matrix-synapse/server-name string localhost:18448
EOF

dpkg -i "$deb"

sed -i -e '/port: 8...$/{s/8448/18448/; s/8008/18008/}' -e '$aregistration_shared_secret: secret' /etc/matrix-synapse/homeserver.yaml
systemctl restart matrix-synapse
13 changes: 13 additions & 0 deletions debian/test/stretch/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

ver = `cd ../../..; dpkg-parsechangelog -S Version`.strip()

Vagrant.configure("2") do |config|
config.vm.box = "debian/stretch64"

config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "../../../../debs", "/debs", type: "nfs"

config.vm.provision "shell", path: "../provision.sh"
end
10 changes: 10 additions & 0 deletions debian/test/xenial/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"

config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "../../../../debs", "/debs"
config.vm.provision "shell", path: "../provision.sh"
end
45 changes: 22 additions & 23 deletions docs/postgres.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@ Using Postgres

Postgres version 9.4 or later is known to work.

Install postgres client libraries
=================================

Synapse will require the python postgres client library in order to connect to
a postgres database.

* If you are using the `matrix.org debian/ubuntu
packages <../INSTALL.md#matrixorg-packages>`_,
the necessary libraries will already be installed.

* For other pre-built packages, please consult the documentation from the
relevant package.

* If you installed synapse `in a virtualenv
<../INSTALL.md#installing-from-source>`_, you can install the library with::

~/synapse/env/bin/pip install matrix-synapse[postgres]

(substituting the path to your virtualenv for ``~/synapse/env``, if you used a
different path). You will require the postgres development files. These are in
the ``libpq-dev`` package on Debian-derived distributions.

Set up database
===============

Expand All @@ -26,29 +48,6 @@ encoding use, e.g.::
This would create an appropriate database named ``synapse`` owned by the
``synapse_user`` user (which must already exist).

Set up client in Debian/Ubuntu
===========================

Postgres support depends on the postgres python connector ``psycopg2``. In the
virtual env::

sudo apt-get install libpq-dev
pip install psycopg2

Set up client in RHEL/CentOs 7
==============================

Make sure you have the appropriate version of postgres-devel installed. For a
postgres 9.4, use the postgres 9.4 packages from
[here](https://wiki.postgresql.org/wiki/YUM_Installation).

As with Debian/Ubuntu, postgres support depends on the postgres python connector
``psycopg2``. In the virtual env::

sudo yum install postgresql-devel libpqxx-devel.x86_64
export PATH=/usr/pgsql-9.4/bin/:$PATH
pip install psycopg2

Tuning Postgres
===============

Expand Down
2 changes: 1 addition & 1 deletion synapse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
except ImportError:
pass

__version__ = "0.99.4"
__version__ = "0.99.5.2"
11 changes: 11 additions & 0 deletions synapse/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
# the maximum length for a room alias is 255 characters
MAX_ALIAS_LENGTH = 255

# the maximum length for a user id is 255 characters
MAX_USERID_LENGTH = 255


class Membership(object):

Expand Down Expand Up @@ -117,3 +120,11 @@ class UserTypes(object):
"""
SUPPORT = "support"
ALL_USER_TYPES = (SUPPORT,)


class RelationTypes(object):
"""The types of relations known to this server.
"""
ANNOTATION = "m.annotation"
REPLACE = "m.replace"
REFERENCE = "m.reference"
16 changes: 15 additions & 1 deletion synapse/api/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,23 @@ def __init__(self, current_version):
self.current_version = current_version


class UnsupportedRoomVersionError(SynapseError):
"""The client's request to create a room used a room version that the server does
not support."""
def __init__(self):
super(UnsupportedRoomVersionError, self).__init__(
code=400,
msg="Homeserver does not support this room version",
errcode=Codes.UNSUPPORTED_ROOM_VERSION,
)


class IncompatibleRoomVersionError(SynapseError):
"""A server is trying to join a room whose version it does not support."""
"""A server is trying to join a room whose version it does not support.
Unlike UnsupportedRoomVersionError, it is specific to the case of the make_join
failing.
"""
def __init__(self, room_version):
super(IncompatibleRoomVersionError, self).__init__(
code=400,
Expand Down
13 changes: 11 additions & 2 deletions synapse/api/room_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ class EventFormatVersions(object):
"""This is an internal enum for tracking the version of the event format,
independently from the room version.
"""
V1 = 1 # $id:server format
V2 = 2 # MSC1659-style $hash format: introduced for room v3
V1 = 1 # $id:server event id format
V2 = 2 # MSC1659-style $hash event id format: introduced for room v3
V3 = 3 # MSC1884-style $hash format: introduced for room v4


KNOWN_EVENT_FORMAT_VERSIONS = {
EventFormatVersions.V1,
EventFormatVersions.V2,
EventFormatVersions.V3,
}


Expand Down Expand Up @@ -75,6 +77,12 @@ class RoomVersions(object):
EventFormatVersions.V2,
StateResolutionVersions.V2,
)
V4 = RoomVersion(
"4",
RoomDisposition.STABLE,
EventFormatVersions.V3,
StateResolutionVersions.V2,
)


# the version we will give rooms which are created on this server
Expand All @@ -87,5 +95,6 @@ class RoomVersions(object):
RoomVersions.V2,
RoomVersions.V3,
RoomVersions.STATE_V2_TEST,
RoomVersions.V4,
)
} # type: dict[str, RoomVersion]
5 changes: 5 additions & 0 deletions synapse/config/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ def read_config(self, config):
"block_non_admin_invites", False,
)

# Whether to enable experimental MSC1849 (aka relations) support
self.experimental_msc1849_support_enabled = config.get(
"experimental_msc1849_support_enabled", False,
)

# Options to control access by tracking MAU
self.limit_usage_by_mau = config.get("limit_usage_by_mau", False)
self.max_mau_value = 0
Expand Down
Loading

0 comments on commit 3c8262b

Please sign in to comment.