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

Commit 3e27c19

Browse files
committed
Merge remote-tracking branch 'origin/develop' into rav/remove_unused_mocks
2 parents ef27046 + 30fba62 commit 3e27c19

File tree

103 files changed

+481
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+481
-171
lines changed

CHANGES.md

+72

changelog.d/8565.misc

-1
This file was deleted.

changelog.d/8617.feature

-1
This file was deleted.

changelog.d/8630.feature

-1
This file was deleted.

changelog.d/8731.misc

-1
This file was deleted.

changelog.d/8734.doc

-1
This file was deleted.

changelog.d/8744.bugfix

-1
This file was deleted.

changelog.d/8751.misc

-1
This file was deleted.

changelog.d/8754.misc

-1
This file was deleted.

changelog.d/8757.misc

-1
This file was deleted.

changelog.d/8758.misc

-1
This file was deleted.

changelog.d/8759.misc

-1
This file was deleted.

changelog.d/8760.misc

-1
This file was deleted.

changelog.d/8761.misc

-1
This file was deleted.

changelog.d/8765.misc

-1
This file was deleted.

changelog.d/8770.misc

-1
This file was deleted.

changelog.d/8771.doc

-1
This file was deleted.

changelog.d/8772.misc

-1
This file was deleted.

changelog.d/8773.misc

-1
This file was deleted.

changelog.d/8774.misc

-1
This file was deleted.

changelog.d/8776.bugfix

-1
This file was deleted.

changelog.d/8777.misc

-1
This file was deleted.

changelog.d/8779.doc

-1
This file was deleted.

changelog.d/8784.misc

-1
This file was deleted.

changelog.d/8785.removal

-1
This file was deleted.

changelog.d/8793.doc

-1
This file was deleted.

changelog.d/8795.doc

-1
This file was deleted.

changelog.d/8798.bugfix

-1
This file was deleted.

changelog.d/8799.bugfix

-1
This file was deleted.

changelog.d/8800.misc

-1
This file was deleted.

changelog.d/8801.feature

-1
This file was deleted.

changelog.d/8802.doc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the "Event persist rate" section of the included grafana dashboard by adding missing prometheus rules.

changelog.d/8804.feature

-1
This file was deleted.

changelog.d/8806.misc

-1
This file was deleted.

changelog.d/8809.misc

-1
This file was deleted.

changelog.d/8812.misc

-1
This file was deleted.

changelog.d/8815.misc

-1
This file was deleted.

changelog.d/8817.bugfix

-1
This file was deleted.

changelog.d/8818.doc

-1
This file was deleted.

changelog.d/8819.misc

-1
This file was deleted.

changelog.d/8820.feature

-1
This file was deleted.

changelog.d/8821.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Apply the `federation_ip_range_blacklist` to push and key revocation requests.

changelog.d/8822.doc

-1
This file was deleted.

changelog.d/8823.bugfix

-1
This file was deleted.

changelog.d/8824.doc

-1
This file was deleted.

changelog.d/8827.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug where we might not correctly calculate the current state for rooms with multiple extremities.

changelog.d/8833.removal

-1
This file was deleted.

changelog.d/8835.bugfix

-1
This file was deleted.

changelog.d/8837.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a long standing bug in the register admin endpoint (`/_synapse/admin/v1/register`) when the `mac` field was not provided. The endpoint now properly returns a 400 error. Contributed by @edwargix.

changelog.d/8843.feature

-1
This file was deleted.

changelog.d/8845.misc

-1
This file was deleted.

changelog.d/8847.misc

-1
This file was deleted.

changelog.d/8848.bugfix

-1
This file was deleted.

changelog.d/8849.misc

-1
This file was deleted.

changelog.d/8850.misc

-1
This file was deleted.

changelog.d/8851.misc

-1
This file was deleted.

changelog.d/8854.misc

-1
This file was deleted.

changelog.d/8855.feature

-1
This file was deleted.

contrib/prometheus/synapse-v2.rules

+18
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,21 @@ groups:
5858
labels:
5959
type: "PDU"
6060
expr: 'synapse_federation_transaction_queue_pending_pdus + 0'
61+
62+
- record: synapse_storage_events_persisted_by_source_type
63+
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep{origin_type="remote"})
64+
labels:
65+
type: remote
66+
- record: synapse_storage_events_persisted_by_source_type
67+
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep{origin_entity="*client*",origin_type="local"})
68+
labels:
69+
type: local
70+
- record: synapse_storage_events_persisted_by_source_type
71+
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep{origin_entity!="*client*",origin_type="local"})
72+
labels:
73+
type: bridges
74+
- record: synapse_storage_events_persisted_by_event_type
75+
expr: sum without(origin_entity, origin_type) (synapse_storage_events_persisted_events_sep)
76+
- record: synapse_storage_events_persisted_by_origin
77+
expr: sum without(type) (synapse_storage_events_persisted_events_sep)
78+

docs/sample_config.yaml

+8-6
Original file line numberDiff line numberDiff line change
@@ -642,17 +642,19 @@ acme:
642642
# - nyc.example.com
643643
# - syd.example.com
644644

645-
# Prevent federation requests from being sent to the following
646-
# blacklist IP address CIDR ranges. If this option is not specified, or
647-
# specified with an empty list, no ip range blacklist will be enforced.
645+
# Prevent outgoing requests from being sent to the following blacklisted IP address
646+
# CIDR ranges. If this option is not specified, or specified with an empty list,
647+
# no IP range blacklist will be enforced.
648648
#
649-
# As of Synapse v1.4.0 this option also affects any outbound requests to identity
650-
# servers provided by user input.
649+
# The blacklist applies to the outbound requests for federation, identity servers,
650+
# push servers, and for checking key validitity for third-party invite events.
651651
#
652652
# (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
653653
# listed here, since they correspond to unroutable addresses.)
654654
#
655-
federation_ip_range_blacklist:
655+
# This option replaces federation_ip_range_blacklist in Synapse v1.24.0.
656+
#
657+
ip_range_blacklist:
656658
- '127.0.0.0/8'
657659
- '10.0.0.0/8'
658660
- '172.16.0.0/12'

synapse/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
except ImportError:
4949
pass
5050

51-
__version__ = "1.23.0"
51+
__version__ = "1.24.0rc1"
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/app/generic_worker.py

-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ def __init__(self, hs):
266266
super().__init__(hs)
267267
self.hs = hs
268268
self.is_mine_id = hs.is_mine_id
269-
self.http_client = hs.get_simple_http_client()
270269

271270
self._presence_enabled = hs.config.use_presence
272271

synapse/config/federation.py

+25-15
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,30 @@ def read_config(self, config, **kwargs):
3636
for domain in federation_domain_whitelist:
3737
self.federation_domain_whitelist[domain] = True
3838

39-
self.federation_ip_range_blacklist = config.get(
40-
"federation_ip_range_blacklist", []
41-
)
39+
ip_range_blacklist = config.get("ip_range_blacklist", [])
4240

4341
# Attempt to create an IPSet from the given ranges
4442
try:
45-
self.federation_ip_range_blacklist = IPSet(
46-
self.federation_ip_range_blacklist
47-
)
48-
49-
# Always blacklist 0.0.0.0, ::
50-
self.federation_ip_range_blacklist.update(["0.0.0.0", "::"])
43+
self.ip_range_blacklist = IPSet(ip_range_blacklist)
44+
except Exception as e:
45+
raise ConfigError("Invalid range(s) provided in ip_range_blacklist: %s" % e)
46+
# Always blacklist 0.0.0.0, ::
47+
self.ip_range_blacklist.update(["0.0.0.0", "::"])
48+
49+
# The federation_ip_range_blacklist is used for backwards-compatibility
50+
# and only applies to federation and identity servers. If it is not given,
51+
# default to ip_range_blacklist.
52+
federation_ip_range_blacklist = config.get(
53+
"federation_ip_range_blacklist", ip_range_blacklist
54+
)
55+
try:
56+
self.federation_ip_range_blacklist = IPSet(federation_ip_range_blacklist)
5157
except Exception as e:
5258
raise ConfigError(
5359
"Invalid range(s) provided in federation_ip_range_blacklist: %s" % e
5460
)
61+
# Always blacklist 0.0.0.0, ::
62+
self.federation_ip_range_blacklist.update(["0.0.0.0", "::"])
5563

5664
federation_metrics_domains = config.get("federation_metrics_domains") or []
5765
validate_config(
@@ -76,17 +84,19 @@ def generate_config_section(self, config_dir_path, server_name, **kwargs):
7684
# - nyc.example.com
7785
# - syd.example.com
7886
79-
# Prevent federation requests from being sent to the following
80-
# blacklist IP address CIDR ranges. If this option is not specified, or
81-
# specified with an empty list, no ip range blacklist will be enforced.
87+
# Prevent outgoing requests from being sent to the following blacklisted IP address
88+
# CIDR ranges. If this option is not specified, or specified with an empty list,
89+
# no IP range blacklist will be enforced.
8290
#
83-
# As of Synapse v1.4.0 this option also affects any outbound requests to identity
84-
# servers provided by user input.
91+
# The blacklist applies to the outbound requests for federation, identity servers,
92+
# push servers, and for checking key validitity for third-party invite events.
8593
#
8694
# (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
8795
# listed here, since they correspond to unroutable addresses.)
8896
#
89-
federation_ip_range_blacklist:
97+
# This option replaces federation_ip_range_blacklist in Synapse v1.24.0.
98+
#
99+
ip_range_blacklist:
90100
- '127.0.0.0/8'
91101
- '10.0.0.0/8'
92102
- '172.16.0.0/12'

synapse/crypto/keyring.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ class PerspectivesKeyFetcher(BaseV2KeyFetcher):
578578
def __init__(self, hs):
579579
super().__init__(hs)
580580
self.clock = hs.get_clock()
581-
self.client = hs.get_http_client()
581+
self.client = hs.get_federation_http_client()
582582
self.key_servers = self.config.key_servers
583583

584584
async def get_keys(self, keys_to_fetch):
@@ -748,7 +748,7 @@ class ServerKeyFetcher(BaseV2KeyFetcher):
748748
def __init__(self, hs):
749749
super().__init__(hs)
750750
self.clock = hs.get_clock()
751-
self.client = hs.get_http_client()
751+
self.client = hs.get_federation_http_client()
752752

753753
async def get_keys(self, keys_to_fetch):
754754
"""

0 commit comments

Comments
 (0)