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

Commit 8ee3f06

Browse files
committed
Merge commit 'a3a90ee03' into anoa/dinsic_release_1_21_x
* commit 'a3a90ee03': Show a confirmation page during user password reset (#8004) Do not error when thumbnailing invalid files (#8236) Remove some unused distributor signals (#8216) Fixup pusher pool notifications (#8287) Revert "Fixup pusher pool notifications" Fixup pusher pool notifications
2 parents ab58329 + a3a90ee commit 8ee3f06

35 files changed

+415
-262
lines changed

UPGRADE.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,27 @@ modules are expected to make use of the `http_client` property on the `ModuleApi
152152
Modules are now passed a `module_api` argument during initialisation, which is an instance of
153153
`ModuleApi`.
154154

155+
New HTML templates
156+
------------------
157+
158+
A new HTML template,
159+
`password_reset_confirmation.html <https://github.com/matrix-org/synapse/blob/develop/synapse/res/templates/password_reset_confirmation.html>`_,
160+
has been added to the ``synapse/res/templates`` directory. If you are using a
161+
custom template directory, you may want to copy the template over and modify it.
162+
163+
Note that as of v1.20.0, templates do not need to be included in custom template
164+
directories for Synapse to start. The default templates will be used if a custom
165+
template cannot be found.
166+
167+
This page will appear to the user after clicking a password reset link that has
168+
been emailed to them.
169+
170+
To complete password reset, the page must include a way to make a `POST`
171+
request to
172+
``/_synapse/client/password_reset/{medium}/submit_token``
173+
with the query parameters from the original link, presented as a URL-encoded form. See the file
174+
itself for more details.
175+
155176
Upgrading to v1.18.0
156177
====================
157178

changelog.d/8004.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Require the user to confirm that their password should be reset after clicking the email confirmation link.

changelog.d/8216.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Simplify the distributor code to avoid unnecessary work.

changelog.d/8236.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a longstanding bug where files that could not be thumbnailed would result in an Internal Server Error.

changelog.d/8287.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix edge case where push could get delayed for a user until a later event was pushed.

docs/sample_config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,9 +2214,13 @@ email:
22142214
# * The contents of password reset emails sent by the homeserver:
22152215
# 'password_reset.html' and 'password_reset.txt'
22162216
#
2217-
# * HTML pages for success and failure that a user will see when they follow
2218-
# the link in the password reset email: 'password_reset_success.html' and
2219-
# 'password_reset_failure.html'
2217+
# * An HTML page that a user will see when they follow the link in the password
2218+
# reset email. The user will be asked to confirm the action before their
2219+
# password is reset: 'password_reset_confirmation.html'
2220+
#
2221+
# * HTML pages for success and failure that a user will see when they confirm
2222+
# the password reset flow using the page above: 'password_reset_success.html'
2223+
# and 'password_reset_failure.html'
22202224
#
22212225
# * The contents of address verification emails sent during registration:
22222226
# 'registration.html' and 'registration.txt'

synapse/api/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from synapse.config import ConfigError
2323

24+
SYNAPSE_CLIENT_API_PREFIX = "/_synapse/client"
2425
CLIENT_API_PREFIX = "/_matrix/client"
2526
FEDERATION_PREFIX = "/_matrix/federation"
2627
FEDERATION_V1_PREFIX = FEDERATION_PREFIX + "/v1"

synapse/app/homeserver.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
from synapse.app import _base
4949
from synapse.app._base import listen_ssl, listen_tcp, quit_with_error
5050
from synapse.config._base import ConfigError
51+
from synapse.config.emailconfig import ThreepidBehaviour
5152
from synapse.config.homeserver import HomeServerConfig
5253
from synapse.config.server import ListenerConfig
5354
from synapse.federation.transport.server import TransportLayerServer
@@ -209,6 +210,15 @@ def _configure_named_resource(self, name, compress=False):
209210

210211
resources["/_matrix/saml2"] = SAML2Resource(self)
211212

213+
if self.get_config().threepid_behaviour_email == ThreepidBehaviour.LOCAL:
214+
from synapse.rest.synapse.client.password_reset import (
215+
PasswordResetSubmitTokenResource,
216+
)
217+
218+
resources[
219+
"/_synapse/client/password_reset/email/submit_token"
220+
] = PasswordResetSubmitTokenResource(self)
221+
212222
if name == "consent":
213223
from synapse.rest.consent.consent_resource import ConsentResource
214224

synapse/config/emailconfig.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def read_config(self, config, **kwargs):
228228
self.email_registration_template_text,
229229
self.email_add_threepid_template_html,
230230
self.email_add_threepid_template_text,
231+
self.email_password_reset_template_confirmation_html,
231232
self.email_password_reset_template_failure_html,
232233
self.email_registration_template_failure_html,
233234
self.email_add_threepid_template_failure_html,
@@ -242,6 +243,7 @@ def read_config(self, config, **kwargs):
242243
registration_template_text,
243244
add_threepid_template_html,
244245
add_threepid_template_text,
246+
"password_reset_confirmation.html",
245247
password_reset_template_failure_html,
246248
registration_template_failure_html,
247249
add_threepid_template_failure_html,
@@ -404,9 +406,13 @@ def generate_config_section(self, config_dir_path, server_name, **kwargs):
404406
# * The contents of password reset emails sent by the homeserver:
405407
# 'password_reset.html' and 'password_reset.txt'
406408
#
407-
# * HTML pages for success and failure that a user will see when they follow
408-
# the link in the password reset email: 'password_reset_success.html' and
409-
# 'password_reset_failure.html'
409+
# * An HTML page that a user will see when they follow the link in the password
410+
# reset email. The user will be asked to confirm the action before their
411+
# password is reset: 'password_reset_confirmation.html'
412+
#
413+
# * HTML pages for success and failure that a user will see when they confirm
414+
# the password reset flow using the page above: 'password_reset_success.html'
415+
# and 'password_reset_failure.html'
410416
#
411417
# * The contents of address verification emails sent during registration:
412418
# 'registration.html' and 'registration.txt'

synapse/handlers/events.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ class EventStreamHandler(BaseHandler):
3939
def __init__(self, hs: "HomeServer"):
4040
super(EventStreamHandler, self).__init__(hs)
4141

42-
self.distributor = hs.get_distributor()
43-
self.distributor.declare("started_user_eventstream")
44-
self.distributor.declare("stopped_user_eventstream")
45-
4642
self.clock = hs.get_clock()
4743

4844
self.notifier = hs.get_notifier()

0 commit comments

Comments
 (0)