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/re…
Browse files Browse the repository at this point in the history
…plication_noop
  • Loading branch information
erikjohnston committed Oct 11, 2016
2 parents 668f91d + 0061e87 commit 3061dac
Show file tree
Hide file tree
Showing 28 changed files with 599 additions and 331 deletions.
83 changes: 83 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,86 @@
Changes in synapse v0.18.1 (2016-10-0)
======================================

No changes since v0.18.1-rc1


Changes in synapse v0.18.1-rc1 (2016-09-30)
===========================================

Features:

* Add total_room_count_estimate to ``/publicRooms`` (PR #1133)


Changes:

* Time out typing over federation (PR #1140)
* Restructure LDAP authentication (PR #1153)


Bug fixes:

* Fix 3pid invites when server is already in the room (PR #1136)
* Fix upgrading with SQLite taking lots of CPU for a few days
after upgrade (PR #1144)
* Fix upgrading from very old database versions (PR #1145)
* Fix port script to work with recently added tables (PR #1146)


Changes in synapse v0.18.0 (2016-09-19)
=======================================

The release includes major changes to the state storage database schemas, which
significantly reduce database size. Synapse will attempt to upgrade the current
data in the background. Servers with large SQLite database may experience
degradation of performance while this upgrade is in progress, therefore you may
want to consider migrating to using Postgres before upgrading very large SQLite
databases


Changes:

* Make public room search case insensitive (PR #1127)


Bug fixes:

* Fix and clean up publicRooms pagination (PR #1129)


Changes in synapse v0.18.0-rc1 (2016-09-16)
===========================================

Features:

* Add ``only=highlight`` on ``/notifications`` (PR #1081)
* Add server param to /publicRooms (PR #1082)
* Allow clients to ask for the whole of a single state event (PR #1094)
* Add is_direct param to /createRoom (PR #1108)
* Add pagination support to publicRooms (PR #1121)
* Add very basic filter API to /publicRooms (PR #1126)
* Add basic direct to device messaging support for E2E (PR #1074, #1084, #1104,
#1111)


Changes:

* Move to storing state_groups_state as deltas, greatly reducing DB size (PR
#1065)
* Reduce amount of state pulled out of the DB during common requests (PR #1069)
* Allow PDF to be rendered from media repo (PR #1071)
* Reindex state_groups_state after pruning (PR #1085)
* Clobber EDUs in send queue (PR #1095)
* Conform better to the CAS protocol specification (PR #1100)
* Limit how often we ask for keys from dead servers (PR #1114)


Bug fixes:

* Fix /notifications API when used with ``from`` param (PR #1080)
* Fix backfill when cannot find an event. (PR #1107)


Changes in synapse v0.17.3 (2016-09-09)
=======================================

Expand Down
4 changes: 3 additions & 1 deletion res/templates/notif_mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
<div class="summarytext">{{ summary_text }}</div>
</td>
<td class="logo">
{% if app_name == "Vector" %}
{% if app_name == "Riot" %}
<img src="http://matrix.org/img/riot-logo-email.png" width="83" height="83" alt="[Riot]"/>
{% elif app_name == "Vector" %}
<img src="http://matrix.org/img/vector-logo-email.png" width="64" height="83" alt="[Vector]"/>
{% else %}
<img src="http://matrix.org/img/matrix-120x51.png" width="120" height="51" alt="[matrix]"/>
Expand Down
9 changes: 9 additions & 0 deletions scripts/synapse_port_db
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ BOOLEAN_COLUMNS = {
"event_edges": ["is_state"],
"presence_list": ["accepted"],
"presence_stream": ["currently_active"],
"public_room_list_stream": ["visibility"],
}


Expand Down Expand Up @@ -71,6 +72,14 @@ APPEND_ONLY_TABLES = [
"event_to_state_groups",
"rejections",
"event_search",
"presence_stream",
"push_rules_stream",
"current_state_resets",
"ex_outlier_stream",
"cache_invalidation_stream",
"public_room_list_stream",
"state_group_edges",
"stream_ordering_to_exterm",
]


Expand Down
2 changes: 1 addition & 1 deletion synapse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
""" This is a reference implementation of a Matrix home server.
"""

__version__ = "0.17.3"
__version__ = "0.18.1"
17 changes: 3 additions & 14 deletions synapse/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ def get_user_by_req(self, request, allow_guest=False, rights="access"):

@defer.inlineCallbacks
def _get_appservice_user_id(self, request):
app_service = yield self.store.get_app_service_by_token(
app_service = self.store.get_app_service_by_token(
get_access_token_from_request(
request, self.TOKEN_NOT_FOUND_HTTP_STATUS
)
Expand Down Expand Up @@ -855,13 +855,12 @@ def _look_up_user_by_access_token(self, token):
}
defer.returnValue(user_info)

@defer.inlineCallbacks
def get_appservice_by_req(self, request):
try:
token = get_access_token_from_request(
request, self.TOKEN_NOT_FOUND_HTTP_STATUS
)
service = yield self.store.get_app_service_by_token(token)
service = self.store.get_app_service_by_token(token)
if not service:
logger.warn("Unrecognised appservice access token: %s" % (token,))
raise AuthError(
Expand All @@ -870,7 +869,7 @@ def get_appservice_by_req(self, request):
errcode=Codes.UNKNOWN_TOKEN
)
request.authenticated_entity = service.sender
defer.returnValue(service)
return defer.succeed(service)
except KeyError:
raise AuthError(
self.TOKEN_NOT_FOUND_HTTP_STATUS, "Missing access token."
Expand Down Expand Up @@ -1002,16 +1001,6 @@ def _can_send_event(self, event, auth_events):
403,
"You are not allowed to set others state"
)
else:
sender_domain = UserID.from_string(
event.user_id
).domain

if sender_domain != event.state_key:
raise AuthError(
403,
"You are not allowed to set others state"
)

return True

Expand Down
2 changes: 0 additions & 2 deletions synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ def send_edu(self, destination, edu_type, content, key=None):

sent_edus_counter.inc()

# TODO, add errback, etc.
self._transaction_queue.enqueue_edu(edu, key=key)
return defer.succeed(None)

@log_function
def send_device_messages(self, destination):
Expand Down
8 changes: 7 additions & 1 deletion synapse/handlers/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@ def __init__(self, hs):

def ratelimit(self, requester):
time_now = self.clock.time()
user_id = requester.user.to_string()

app_service = self.store.get_app_service_by_user_id(user_id)
if app_service is not None:
return # do not ratelimit app service senders

allowed, time_allowed = self.ratelimiter.send_message(
requester.user.to_string(), time_now,
user_id, time_now,
msg_rate_hz=self.hs.config.rc_messages_per_second,
burst_count=self.hs.config.rc_message_burst_count,
)
Expand Down
20 changes: 9 additions & 11 deletions synapse/handlers/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def notify_interested_services(self, current_id):
Args:
current_id(int): The current maximum ID.
"""
services = yield self.store.get_app_services()
services = self.store.get_app_services()
if not services or not self.notify_appservices:
return

Expand Down Expand Up @@ -142,7 +142,7 @@ def query_room_alias_exists(self, room_alias):
association can be found.
"""
room_alias_str = room_alias.to_string()
services = yield self.store.get_app_services()
services = self.store.get_app_services()
alias_query_services = [
s for s in services if (
s.is_interested_in_alias(room_alias_str)
Expand Down Expand Up @@ -177,7 +177,7 @@ def query_3pe(self, kind, protocol, fields):

@defer.inlineCallbacks
def get_3pe_protocols(self, only_protocol=None):
services = yield self.store.get_app_services()
services = self.store.get_app_services()
protocols = {}

# Collect up all the individual protocol responses out of the ASes
Expand Down Expand Up @@ -224,31 +224,29 @@ def _get_services_for_event(self, event):
list<ApplicationService>: A list of services interested in this
event based on the service regex.
"""
services = yield self.store.get_app_services()
services = self.store.get_app_services()
interested_list = [
s for s in services if (
yield s.is_interested(event, self.store)
)
]
defer.returnValue(interested_list)

@defer.inlineCallbacks
def _get_services_for_user(self, user_id):
services = yield self.store.get_app_services()
services = self.store.get_app_services()
interested_list = [
s for s in services if (
s.is_interested_in_user(user_id)
)
]
defer.returnValue(interested_list)
return defer.succeed(interested_list)

@defer.inlineCallbacks
def _get_services_for_3pn(self, protocol):
services = yield self.store.get_app_services()
services = self.store.get_app_services()
interested_list = [
s for s in services if s.is_interested_in_protocol(protocol)
]
defer.returnValue(interested_list)
return defer.succeed(interested_list)

@defer.inlineCallbacks
def _is_unknown_user(self, user_id):
Expand All @@ -264,7 +262,7 @@ def _is_unknown_user(self, user_id):
return

# user not found; could be the AS though, so check.
services = yield self.store.get_app_services()
services = self.store.get_app_services()
service_list = [s for s in services if s.sender == user_id]
defer.returnValue(len(service_list) == 0)

Expand Down
Loading

0 comments on commit 3061dac

Please sign in to comment.