mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-19 09:31:35 +03:00
Set default config value for tests
This commit is contained in:
parent
53f8936b40
commit
8b0a9b3ad7
3 changed files with 8 additions and 6 deletions
|
@ -108,17 +108,17 @@ class ServerConfig(Config):
|
||||||
"federation_domain_whitelist", None
|
"federation_domain_whitelist", None
|
||||||
)
|
)
|
||||||
|
|
||||||
# Optional proxy address for federation traffic
|
|
||||||
self.federation_request_gateway_addr = config.get(
|
|
||||||
"federation_request_gateway_addr", None
|
|
||||||
)
|
|
||||||
|
|
||||||
# turn the whitelist into a hash for speed of lookup
|
# turn the whitelist into a hash for speed of lookup
|
||||||
if federation_domain_whitelist is not None:
|
if federation_domain_whitelist is not None:
|
||||||
self.federation_domain_whitelist = {}
|
self.federation_domain_whitelist = {}
|
||||||
for domain in federation_domain_whitelist:
|
for domain in federation_domain_whitelist:
|
||||||
self.federation_domain_whitelist[domain] = True
|
self.federation_domain_whitelist[domain] = True
|
||||||
|
|
||||||
|
# Optional proxy address for federation traffic
|
||||||
|
self.federation_request_gateway_addr = config.get(
|
||||||
|
"federation_request_gateway_addr", None
|
||||||
|
)
|
||||||
|
|
||||||
if self.federation_request_gateway_addr is not None:
|
if self.federation_request_gateway_addr is not None:
|
||||||
# Ensure proxy address is correctly formatted
|
# Ensure proxy address is correctly formatted
|
||||||
if len(self.federation_request_gateway_addr.split(':')) != 2:
|
if len(self.federation_request_gateway_addr.split(':')) != 2:
|
||||||
|
|
|
@ -69,10 +69,11 @@ class ProxyMatrixFederationEndpointFactory(object):
|
||||||
def __init__(self, hs):
|
def __init__(self, hs):
|
||||||
self.reactor = hs.get_reactor()
|
self.reactor = hs.get_reactor()
|
||||||
self.tls_client_options_factory = hs.tls_client_options_factory
|
self.tls_client_options_factory = hs.tls_client_options_factory
|
||||||
|
self.gateway_addr = hs.config.federation_request_gateway_addr
|
||||||
|
|
||||||
def endpointForURI(self, uri):
|
def endpointForURI(self, uri):
|
||||||
return matrix_federation_endpoint(
|
return matrix_federation_endpoint(
|
||||||
self.reactor, self.hs.config.federation_request_gateway_addr, timeout=10,
|
self.reactor, self.gateway_addr, timeout=10,
|
||||||
tls_client_options_factory=None
|
tls_client_options_factory=None
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,7 @@ def default_config(name):
|
||||||
config.email_enable_notifs = False
|
config.email_enable_notifs = False
|
||||||
config.block_non_admin_invites = False
|
config.block_non_admin_invites = False
|
||||||
config.federation_domain_whitelist = None
|
config.federation_domain_whitelist = None
|
||||||
|
config.federation_request_gateway_addr = None
|
||||||
config.federation_rc_reject_limit = 10
|
config.federation_rc_reject_limit = 10
|
||||||
config.federation_rc_sleep_limit = 10
|
config.federation_rc_sleep_limit = 10
|
||||||
config.federation_rc_sleep_delay = 100
|
config.federation_rc_sleep_delay = 100
|
||||||
|
|
Loading…
Reference in a new issue