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' of github.com:matrix-org/synapse into erikj/sp…
Browse files Browse the repository at this point in the history
…lit_federation
  • Loading branch information
erikjohnston committed Aug 15, 2018
2 parents 488ffe6 + 1c5e690 commit ef184ca
Show file tree
Hide file tree
Showing 217 changed files with 2,605 additions and 2,760 deletions.
48 changes: 48 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: 2
jobs:
sytestpy2:
machine: true
steps:
- checkout
- run: docker pull matrixdotorg/sytest-synapsepy2
- run: docker run --rm -it -v $(pwd)\:/src -v $(pwd)/logs\:/logs matrixdotorg/sytest-synapsepy2
- store_artifacts:
path: ~/project/logs
destination: logs
sytestpy2postgres:
machine: true
steps:
- checkout
- run: docker pull matrixdotorg/sytest-synapsepy2
- run: docker run --rm -it -v $(pwd)\:/src -v $(pwd)/logs\:/logs -e POSTGRES=1 matrixdotorg/sytest-synapsepy2
- store_artifacts:
path: ~/project/logs
destination: logs
sytestpy3:
machine: true
steps:
- checkout
- run: docker pull matrixdotorg/sytest-synapsepy3
- run: docker run --rm -it -v $(pwd)\:/src -v $(pwd)/logs\:/logs hawkowl/sytestpy3
- store_artifacts:
path: ~/project/logs
destination: logs
sytestpy3postgres:
machine: true
steps:
- checkout
- run: docker pull matrixdotorg/sytest-synapsepy3
- run: docker run --rm -it -v $(pwd)\:/src -v $(pwd)/logs\:/logs -e POSTGRES=1 matrixdotorg/sytest-synapsepy3
- store_artifacts:
path: ~/project/logs
destination: logs

workflows:
version: 2
build:
jobs:
- sytestpy2
- sytestpy2postgres
# Currently broken while the Python 3 port is incomplete
# - sytestpy3
# - sytestpy3postgres
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Dockerfile
.gitignore
demo/etc
tox.ini
synctl
.git/*
.tox/*
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ before_script:
- git remote set-branches --add origin develop
- git fetch origin develop

services:
- postgresql

matrix:
fast_finish: true
include:
Expand All @@ -20,6 +23,9 @@ matrix:
- python: 2.7
env: TOX_ENV=py27

- python: 2.7
env: TOX_ENV=py27-postgres TRIAL_FLAGS="-j 4"

- python: 3.6
env: TOX_ENV=py36

Expand All @@ -29,6 +35,10 @@ matrix:
- python: 3.6
env: TOX_ENV=check-newsfragment

allow_failures:
- python: 2.7
env: TOX_ENV=py27-postgres TRIAL_FLAGS="-j 4"

install:
- pip install tox

Expand Down
73 changes: 73 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@
Synapse 0.33.2 (2018-08-09)
===========================

No significant changes.


Synapse 0.33.2rc1 (2018-08-07)
==============================

Features
--------

- add support for the lazy_loaded_members filter as per MSC1227 ([\#2970](https://github.com/matrix-org/synapse/issues/2970))
- add support for the include_redundant_members filter param as per MSC1227 ([\#3331](https://github.com/matrix-org/synapse/issues/3331))
- Add metrics to track resource usage by background processes ([\#3553](https://github.com/matrix-org/synapse/issues/3553), [\#3556](https://github.com/matrix-org/synapse/issues/3556), [\#3604](https://github.com/matrix-org/synapse/issues/3604), [\#3610](https://github.com/matrix-org/synapse/issues/3610))
- Add `code` label to `synapse_http_server_response_time_seconds` prometheus metric ([\#3554](https://github.com/matrix-org/synapse/issues/3554))
- Add support for client_reader to handle more APIs ([\#3555](https://github.com/matrix-org/synapse/issues/3555), [\#3597](https://github.com/matrix-org/synapse/issues/3597))
- make the /context API filter & lazy-load aware as per MSC1227 ([\#3567](https://github.com/matrix-org/synapse/issues/3567))
- Add ability to limit number of monthly active users on the server ([\#3630](https://github.com/matrix-org/synapse/issues/3630))
- When we fail to join a room over federation, pass the error code back to the client. ([\#3639](https://github.com/matrix-org/synapse/issues/3639))
- Add a new /admin/register API for non-interactively creating users. ([\#3415](https://github.com/matrix-org/synapse/issues/3415))


Bugfixes
--------

- Make /directory/list API return 404 for room not found instead of 400 ([\#2952](https://github.com/matrix-org/synapse/issues/2952))
- Default inviter_display_name to mxid for email invites ([\#3391](https://github.com/matrix-org/synapse/issues/3391))
- Don't generate TURN credentials if no TURN config options are set ([\#3514](https://github.com/matrix-org/synapse/issues/3514))
- Correctly announce deleted devices over federation ([\#3520](https://github.com/matrix-org/synapse/issues/3520))
- Catch failures saving metrics captured by Measure, and instead log the faulty metrics information for further analysis. ([\#3548](https://github.com/matrix-org/synapse/issues/3548))
- Unicode passwords are now normalised before hashing, preventing the instance where two different devices or browsers might send a different UTF-8 sequence for the password. ([\#3569](https://github.com/matrix-org/synapse/issues/3569))
- Fix potential stack overflow and deadlock under heavy load ([\#3570](https://github.com/matrix-org/synapse/issues/3570))
- Respond with M_NOT_FOUND when profiles are not found locally or over federation. Fixes #3585 ([\#3585](https://github.com/matrix-org/synapse/issues/3585))
- Fix failure to persist events over federation under load ([\#3601](https://github.com/matrix-org/synapse/issues/3601))
- Fix updating of cached remote profiles ([\#3605](https://github.com/matrix-org/synapse/issues/3605))
- Fix 'tuple index out of range' error ([\#3607](https://github.com/matrix-org/synapse/issues/3607))
- Only import secrets when available (fix for py < 3.6) ([\#3626](https://github.com/matrix-org/synapse/issues/3626))


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

- Remove redundant checks on who_forgot_in_room ([\#3350](https://github.com/matrix-org/synapse/issues/3350))
- Remove unnecessary event re-signing hacks ([\#3367](https://github.com/matrix-org/synapse/issues/3367))
- Rewrite cache list decorator ([\#3384](https://github.com/matrix-org/synapse/issues/3384))
- Move v1-only REST APIs into their own module. ([\#3460](https://github.com/matrix-org/synapse/issues/3460))
- Replace more instances of Python 2-only iteritems and itervalues uses. ([\#3562](https://github.com/matrix-org/synapse/issues/3562))
- Refactor EventContext to accept state during init ([\#3577](https://github.com/matrix-org/synapse/issues/3577))
- Improve Dockerfile and docker-compose instructions ([\#3543](https://github.com/matrix-org/synapse/issues/3543))
- Release notes are now in the Markdown format. ([\#3552](https://github.com/matrix-org/synapse/issues/3552))
- add config for pep8 ([\#3559](https://github.com/matrix-org/synapse/issues/3559))
- Merge Linearizer and Limiter ([\#3571](https://github.com/matrix-org/synapse/issues/3571), [\#3572](https://github.com/matrix-org/synapse/issues/3572))
- Lazily load state on master process when using workers to reduce DB consumption ([\#3579](https://github.com/matrix-org/synapse/issues/3579), [\#3581](https://github.com/matrix-org/synapse/issues/3581), [\#3582](https://github.com/matrix-org/synapse/issues/3582), [\#3584](https://github.com/matrix-org/synapse/issues/3584))
- Fixes and optimisations for resolve_state_groups ([\#3586](https://github.com/matrix-org/synapse/issues/3586))
- Improve logging for exceptions when handling PDUs ([\#3587](https://github.com/matrix-org/synapse/issues/3587))
- Add some measure blocks to persist_events ([\#3590](https://github.com/matrix-org/synapse/issues/3590))
- Fix some random logcontext leaks. ([\#3591](https://github.com/matrix-org/synapse/issues/3591), [\#3606](https://github.com/matrix-org/synapse/issues/3606))
- Speed up calculating state deltas in persist_event loop ([\#3592](https://github.com/matrix-org/synapse/issues/3592))
- Attempt to reduce amount of state pulled out of DB during persist_events ([\#3595](https://github.com/matrix-org/synapse/issues/3595))
- Fix a documentation typo in on_make_leave_request ([\#3609](https://github.com/matrix-org/synapse/issues/3609))
- Make EventStore inherit from EventFederationStore ([\#3612](https://github.com/matrix-org/synapse/issues/3612))
- Remove some redundant joins on event_edges.room_id ([\#3613](https://github.com/matrix-org/synapse/issues/3613))
- Stop populating events.content ([\#3614](https://github.com/matrix-org/synapse/issues/3614))
- Update the /send_leave path registration to use event_id rather than a transaction ID. ([\#3616](https://github.com/matrix-org/synapse/issues/3616))
- Refactor FederationHandler to move DB writes into separate functions ([\#3621](https://github.com/matrix-org/synapse/issues/3621))
- Remove unused field "pdu_failures" from transactions. ([\#3628](https://github.com/matrix-org/synapse/issues/3628))
- rename replication_layer to federation_client ([\#3634](https://github.com/matrix-org/synapse/issues/3634))
- Factor out exception handling in federation_client ([\#3638](https://github.com/matrix-org/synapse/issues/3638))
- Refactor location of docker build script. ([\#3644](https://github.com/matrix-org/synapse/issues/3644))
- Update CONTRIBUTING to mention newsfragments. ([\#3645](https://github.com/matrix-org/synapse/issues/3645))


Synapse 0.33.1 (2018-08-02)
===========================

Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ recursive-include changelog.d *
prune .github
prune demo/etc
prune docker
prune .circleci
1 change: 1 addition & 0 deletions changelog.d/1491.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for the SNI extension to federation TLS connections
1 change: 0 additions & 1 deletion changelog.d/2952.bugfix

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Empty file removed changelog.d/3415.misc
Empty file.
1 change: 1 addition & 0 deletions changelog.d/3423.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The test suite now can run under PostgreSQL.
Empty file removed changelog.d/3460.misc
Empty file.
1 change: 0 additions & 1 deletion changelog.d/3514.bugfix

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Empty file removed changelog.d/3562.misc
Empty file.
1 change: 0 additions & 1 deletion changelog.d/3567.feature

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Empty file removed changelog.d/3577.misc
Empty file.
1 change: 0 additions & 1 deletion changelog.d/3579.misc

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

1 change: 1 addition & 0 deletions changelog.d/3655.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ability to disable client/server Synapse via conf toggle
1 change: 1 addition & 0 deletions changelog.d/3660.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sytests can now be run inside a Docker container.
1 change: 1 addition & 0 deletions changelog.d/3661.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug on deleting 3pid when using identity servers that don't support unbind API
1 change: 1 addition & 0 deletions changelog.d/3669.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update docker base image from alpine 3.7 to 3.8.
1 change: 1 addition & 0 deletions changelog.d/3670.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Where server is disabled, block ability for locked out users to read new messages
1 change: 1 addition & 0 deletions changelog.d/3676.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make the tests pass on Twisted < 18.7.0
1 change: 1 addition & 0 deletions changelog.d/3677.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don’t ship recaptcha_ajax.js, use it directly from Google
1 change: 1 addition & 0 deletions changelog.d/3678.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename synapse.util.async to synapse.util.async_helpers to mitigate async becoming a keyword on Python 3.7.
1 change: 1 addition & 0 deletions changelog.d/3679.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Synapse's tests are now formatted with the black autoformatter.
1 change: 1 addition & 0 deletions changelog.d/3681.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes test_reap_monthly_active_users so it passes under postgres
1 change: 1 addition & 0 deletions changelog.d/3684.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implemented a new testing base class to reduce test boilerplate.
1 change: 1 addition & 0 deletions changelog.d/3690.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename MAU prometheus metrics
1 change: 1 addition & 0 deletions changelog.d/3692.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix missing yield in synapse.storage.monthly_active_users.initialise_reserved_users
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/python:2-alpine3.7
FROM docker.io/python:2-alpine3.8

RUN apk add --no-cache --virtual .nacl_deps \
build-base \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package = "synapse"
filename = "CHANGES.md"
directory = "changelog.d"
issue_format = "[\\#{issue}](https://github.com/matrix-org/synapse/issues/{issue}>)"
issue_format = "[\\#{issue}](https://github.com/matrix-org/synapse/issues/{issue})"

[[tool.towncrier.type]]
directory = "feature"
Expand Down
2 changes: 1 addition & 1 deletion synapse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
""" This is a reference implementation of a Matrix home server.
"""

__version__ = "0.33.1"
__version__ = "0.33.2"
16 changes: 15 additions & 1 deletion synapse/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,25 @@ def check_in_room_or_world_readable(self, room_id, user_id):
)

@defer.inlineCallbacks
def check_auth_blocking(self):
def check_auth_blocking(self, user_id=None):
"""Checks if the user should be rejected for some external reason,
such as monthly active user limiting or global disable flag

Args:
user_id(str|None): If present, checks for presence against existing
MAU cohort
"""
if self.hs.config.hs_disabled:
raise AuthError(
403, self.hs.config.hs_disabled_message, errcode=Codes.HS_DISABLED
)
if self.hs.config.limit_usage_by_mau is True:
# If the user is already part of the MAU cohort
if user_id:
timestamp = yield self.store.user_last_seen_monthly_active(user_id)
if timestamp:
return
# Else if there is no room in the MAU bucket, bail
current_mau = yield self.store.get_monthly_active_count()
if current_mau >= self.hs.config.max_mau_value:
raise AuthError(
Expand Down
1 change: 1 addition & 0 deletions synapse/api/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Codes(object):
CONSENT_NOT_GIVEN = "M_CONSENT_NOT_GIVEN"
CANNOT_LEAVE_SERVER_NOTICE_ROOM = "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM"
MAU_LIMIT_EXCEEDED = "M_MAU_LIMIT_EXCEEDED"
HS_DISABLED = "M_HS_DISABLED"
UNSUPPORTED_ROOM_VERSION = "M_UNSUPPORTED_ROOM_VERSION"
INCOMPATIBLE_ROOM_VERSION = "M_INCOMPATIBLE_ROOM_VERSION"

Expand Down
2 changes: 2 additions & 0 deletions synapse/app/client_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ def start(config_options):
database_engine = create_engine(config.database_config)

tls_server_context_factory = context_factory.ServerContextFactory(config)
tls_client_options_factory = context_factory.ClientTLSOptionsFactory(config)

ss = ClientReaderServer(
config.server_name,
db_config=config.database_config,
tls_server_context_factory=tls_server_context_factory,
tls_client_options_factory=tls_client_options_factory,
config=config,
version_string="Synapse/" + get_version_string(synapse),
database_engine=database_engine,
Expand Down
Loading

0 comments on commit ef184ca

Please sign in to comment.