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

Commit 56e2477

Browse files
committed
Merge commit '6a8fd03ac' into anoa/dinsic_release_1_21_x
* commit '6a8fd03ac': 1.21.0rc2 1.21.0rc2 Fix bug in remote thumbnail search (#8438) Fix DB query on startup for negative streams. (#8447) Convert additional templates to Jinja (#8444) Fix malformed log line in new federation "catch up" logic (#8442) Do not expose the experimental appservice login flow to clients. (#8440) update changelog fix a logging error in thumbnailer (#8435) changelog fixes fix version number
2 parents 8547640 + 6a8fd03 commit 56e2477

File tree

15 files changed

+164
-147
lines changed

15 files changed

+164
-147
lines changed

CHANGES.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
Synapse 1.21.0 (2020-10-01)
2-
===========================
1+
Synapse 1.21.0rc2 (2020-10-02)
2+
==============================
3+
4+
Bugfixes
5+
--------
6+
7+
- Fix a regression in v1.21.0rc1 which broke thumbnails of remote media. ([\#8438](https://github.com/matrix-org/synapse/issues/8438))
8+
- Do not expose the experimental `uk.half-shot.msc2778.login.application_service` flow in the login API, which caused a compatibility problem with Element iOS. ([\#8440](https://github.com/matrix-org/synapse/issues/8440))
9+
- Fix malformed log line in new federation "catch up" logic. ([\#8442](https://github.com/matrix-org/synapse/issues/8442))
10+
- Convert additional templates from inline HTML to Jinja2 templates. ([\#8444](https://github.com/matrix-org/synapse/issues/8444))
11+
- Fix DB query on startup for negative streams which caused long start up times. Introduced in #8374. ([\#8447](https://github.com/matrix-org/synapse/issues/8447))
12+
13+
14+
Synapse 1.21.0rc1 (2020-10-01)
15+
==============================
316

417
Features
518
--------
@@ -27,9 +40,9 @@ Bugfixes
2740
- Fix inconsistent handling of non-existent push rules, and stop tracking the `enabled` state of removed push rules. ([\#7796](https://github.com/matrix-org/synapse/issues/7796))
2841
- Fix a longstanding bug when storing a media file with an empty `upload_name`. ([\#7905](https://github.com/matrix-org/synapse/issues/7905))
2942
- Fix messages not being sent over federation until an event is sent into the same room. ([\#8230](https://github.com/matrix-org/synapse/issues/8230), [\#8247](https://github.com/matrix-org/synapse/issues/8247), [\#8258](https://github.com/matrix-org/synapse/issues/8258), [\#8272](https://github.com/matrix-org/synapse/issues/8272), [\#8322](https://github.com/matrix-org/synapse/issues/8322))
30-
- Fix a longstanding bug where files that could not be thumbnailed would result in an Internal Server Error. ([\#8236](https://github.com/matrix-org/synapse/issues/8236))
43+
- Fix a longstanding bug where files that could not be thumbnailed would result in an Internal Server Error. ([\#8236](https://github.com/matrix-org/synapse/issues/8236), [\#8435](https://github.com/matrix-org/synapse/issues/8435))
3144
- Upgrade minimum version of `canonicaljson` to version 1.4.0, to fix an unicode encoding issue. ([\#8262](https://github.com/matrix-org/synapse/issues/8262))
32-
- Fix logstanding bug which could lead to incomplete database upgrades on SQLite. ([\#8265](https://github.com/matrix-org/synapse/issues/8265))
45+
- Fix longstanding bug which could lead to incomplete database upgrades on SQLite. ([\#8265](https://github.com/matrix-org/synapse/issues/8265))
3346
- Fix stack overflow when stderr is redirected to the logging system, and the logging system encounters an error. ([\#8268](https://github.com/matrix-org/synapse/issues/8268))
3447
- Fix a bug which cause the logging system to report errors, if `DEBUG` was enabled and no `context` filter was applied. ([\#8278](https://github.com/matrix-org/synapse/issues/8278))
3548
- Fix edge case where push could get delayed for a user until a later event was pushed. ([\#8287](https://github.com/matrix-org/synapse/issues/8287))
@@ -41,7 +54,6 @@ Bugfixes
4154
- Include `guest_access` in the fields that are checked for null bytes when updating `room_stats_state`. Broke in v1.7.2. ([\#8373](https://github.com/matrix-org/synapse/issues/8373))
4255
- Fix theoretical race condition where events are not sent down `/sync` if the synchrotron worker is restarted without restarting other workers. ([\#8374](https://github.com/matrix-org/synapse/issues/8374))
4356
- Fix a bug which could cause errors in rooms with malformed membership events, on servers using sqlite. ([\#8385](https://github.com/matrix-org/synapse/issues/8385))
44-
- Fix a bug introduced in v1.20.0 which caused the `synapse_port_db` script to fail. ([\#8386](https://github.com/matrix-org/synapse/issues/8386))
4557
- Fix "Re-starting finished log context" warning when receiving an event we already had over federation. ([\#8398](https://github.com/matrix-org/synapse/issues/8398))
4658
- Fix incorrect handling of timeouts on outgoing HTTP requests. ([\#8400](https://github.com/matrix-org/synapse/issues/8400))
4759
- Fix a regression in v1.20.0 in the `synapse_port_db` script regarding the `ui_auth_sessions_ips` table. ([\#8410](https://github.com/matrix-org/synapse/issues/8410))

synapse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
except ImportError:
4949
pass
5050

51-
__version__ = "1.21.0"
51+
__version__ = "1.21.0rc2"
5252

5353
if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
5454
# We import here so that we don't have to install a bunch of deps when

synapse/config/_base.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,11 @@ def read_templates(
243243
env = jinja2.Environment(loader=loader, autoescape=autoescape)
244244

245245
# Update the environment with our custom filters
246-
env.filters.update(
247-
{
248-
"format_ts": _format_ts_filter,
249-
"mxc_to_http": _create_mxc_to_http_filter(self.public_baseurl),
250-
}
251-
)
246+
env.filters.update({"format_ts": _format_ts_filter})
247+
if self.public_baseurl:
248+
env.filters.update(
249+
{"mxc_to_http": _create_mxc_to_http_filter(self.public_baseurl)}
250+
)
252251

253252
for filename in filenames:
254253
# Load the template

synapse/config/captcha.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ def read_config(self, config, **kwargs):
2828
"recaptcha_siteverify_api",
2929
"https://www.recaptcha.net/recaptcha/api/siteverify",
3030
)
31+
self.recaptcha_template = self.read_templates(
32+
["recaptcha.html"], autoescape=True
33+
)[0]
3134

3235
def generate_config_section(self, **kwargs):
3336
return """\

synapse/config/consent_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def __init__(self, *args):
8989

9090
def read_config(self, config, **kwargs):
9191
consent_config = config.get("user_consent")
92+
self.terms_template = self.read_templates(["terms.html"], autoescape=True)[0]
93+
9294
if consent_config is None:
9395
return
9496
self.user_consent_version = str(consent_config["version"])

synapse/config/registration.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ def read_config(self, config, **kwargs):
221221
session_lifetime = self.parse_duration(session_lifetime)
222222
self.session_lifetime = session_lifetime
223223

224+
# The success template used during fallback auth.
225+
self.fallback_success_template = self.read_templates(
226+
["auth_success.html"], autoescape=True
227+
)[0]
228+
224229
self.bind_new_user_emails_to_sydent = config.get(
225230
"bind_new_user_emails_to_sydent"
226231
)

synapse/federation/sender/per_destination_queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ async def _catch_up_transmission_loop(self) -> None:
490490
)
491491

492492
if logger.isEnabledFor(logging.INFO):
493-
rooms = (p.room_id for p in catchup_pdus)
493+
rooms = [p.room_id for p in catchup_pdus]
494494
logger.info("Catching up rooms to %s: %r", self._destination, rooms)
495495

496496
success = await self._transaction_manager.send_new_transaction(
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<html>
2+
<head>
3+
<title>Success!</title>
4+
<meta name='viewport' content='width=device-width, initial-scale=1,
5+
user-scalable=no, minimum-scale=1.0, maximum-scale=1.0'>
6+
<link rel="stylesheet" href="/_matrix/static/client/register/style.css">
7+
<script>
8+
if (window.onAuthDone) {
9+
window.onAuthDone();
10+
} else if (window.opener && window.opener.postMessage) {
11+
window.opener.postMessage("authDone", "*");
12+
}
13+
</script>
14+
</head>
15+
<body>
16+
<div>
17+
<p>Thank you</p>
18+
<p>You may now close this window and return to the application</p>
19+
</div>
20+
</body>
21+
</html>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<html>
2+
<head>
3+
<title>Authentication</title>
4+
<meta name='viewport' content='width=device-width, initial-scale=1,
5+
user-scalable=no, minimum-scale=1.0, maximum-scale=1.0'>
6+
<script src="https://www.recaptcha.net/recaptcha/api.js"
7+
async defer></script>
8+
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
9+
<link rel="stylesheet" href="/_matrix/static/client/register/style.css">
10+
<script>
11+
function captchaDone() {
12+
$('#registrationForm').submit();
13+
}
14+
</script>
15+
</head>
16+
<body>
17+
<form id="registrationForm" method="post" action="{{ myurl }}">
18+
<div>
19+
<p>
20+
Hello! We need to prevent computer programs and other automated
21+
things from creating accounts on this server.
22+
</p>
23+
<p>
24+
Please verify that you're not a robot.
25+
</p>
26+
<input type="hidden" name="session" value="{{ session }}" />
27+
<div class="g-recaptcha"
28+
data-sitekey="{{ sitekey }}"
29+
data-callback="captchaDone">
30+
</div>
31+
<noscript>
32+
<input type="submit" value="All Done" />
33+
</noscript>
34+
</div>
35+
</div>
36+
</form>
37+
</body>
38+
</html>

synapse/res/templates/terms.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<html>
2+
<head>
3+
<title>Authentication</title>
4+
<meta name='viewport' content='width=device-width, initial-scale=1,
5+
user-scalable=no, minimum-scale=1.0, maximum-scale=1.0'>
6+
<link rel="stylesheet" href="/_matrix/static/client/register/style.css">
7+
</head>
8+
<body>
9+
<form id="registrationForm" method="post" action="{{ myurl }}">
10+
<div>
11+
<p>
12+
Please click the button below if you agree to the
13+
<a href="{{ terms_url }}">privacy policy of this homeserver.</a>
14+
</p>
15+
<input type="hidden" name="session" value="{{ session }}" />
16+
<input type="submit" value="Agree" />
17+
</div>
18+
</form>
19+
</body>
20+
</html>

0 commit comments

Comments
 (0)