diff --git a/synapse/config/emailconfig.py b/synapse/config/emailconfig.py
index a3af35b7c4..e33791fab9 100644
--- a/synapse/config/emailconfig.py
+++ b/synapse/config/emailconfig.py
@@ -294,6 +294,11 @@ class EmailConfig(Config):
self.email_riot_base_url = email_config.get(
"client_base_url", email_config.get("riot_base_url", None)
)
+ # The amount of time we always wait before ever emailing about a notification
+ # (to give the user a chance to respond to other push or notice the window)
+ self.notif_delay_before_mail_ms = Config.parse_duration(
+ email_config.get("notif_delay_before_mail", "10m")
+ )
if self.root.account_validity.account_validity_renew_by_email_enabled:
expiry_template_html = email_config.get(
diff --git a/synapse/config/key.py b/synapse/config/key.py
index f3dc4df695..1920498cd1 100644
--- a/synapse/config/key.py
+++ b/synapse/config/key.py
@@ -263,7 +263,9 @@ class KeyConfig(Config):
if not self.path_exists(signing_key_path):
print("Generating signing key file %s" % (signing_key_path,))
- with open(signing_key_path, "w") as signing_key_file:
+ with open(
+ signing_key_path, "w", opener=lambda p, f: os.open(p, f, mode=0o640)
+ ) as signing_key_file:
key_id = "a_" + random_string(4)
write_signing_keys(signing_key_file, (generate_signing_key(key_id),))
else:
@@ -274,7 +276,9 @@ class KeyConfig(Config):
key = decode_signing_key_base64(
NACL_ED25519, key_id, signing_keys.split("\n")[0]
)
- with open(signing_key_path, "w") as signing_key_file:
+ with open(
+ signing_key_path, "w", opener=lambda p, f: os.open(p, f, mode=0o640)
+ ) as signing_key_file:
write_signing_keys(signing_key_file, (key,))
diff --git a/synapse/config/metrics.py b/synapse/config/metrics.py
index 8c1c9bd12d..cb2a61a1c7 100644
--- a/synapse/config/metrics.py
+++ b/synapse/config/metrics.py
@@ -61,6 +61,7 @@ class MetricsConfig(Config):
check_requirements("sentry")
self.sentry_dsn = config["sentry"].get("dsn")
+ self.sentry_environment = config["sentry"].get("environment")
if not self.sentry_dsn:
raise ConfigError(
"sentry.dsn field is required when sentry integration is enabled"
diff --git a/synapse/config/server_notices.py b/synapse/config/server_notices.py
index a8badba0f8..79f365cad5 100644
--- a/synapse/config/server_notices.py
+++ b/synapse/config/server_notices.py
@@ -38,6 +38,14 @@ class ServerNoticesConfig(Config):
server_notices_room_name (str|None):
The name to use for the server notices room.
None if server notices are not enabled.
+
+ server_notices_room_avatar_url (str|None):
+ The avatar URL to use for the server notices room.
+ None if server notices are not enabled.
+
+ server_notices_room_topic (str|None):
+ The topic to use for the server notices room.
+ None if server notices are not enabled.
"""
section = "servernotices"
@@ -48,6 +56,8 @@ class ServerNoticesConfig(Config):
self.server_notices_mxid_display_name: Optional[str] = None
self.server_notices_mxid_avatar_url: Optional[str] = None
self.server_notices_room_name: Optional[str] = None
+ self.server_notices_room_avatar_url: Optional[str] = None
+ self.server_notices_room_topic: Optional[str] = None
self.server_notices_auto_join: bool = False
def read_config(self, config: JsonDict, **kwargs: Any) -> None:
@@ -63,4 +73,6 @@ class ServerNoticesConfig(Config):
self.server_notices_mxid_avatar_url = c.get("system_mxid_avatar_url", None)
# todo: i18n
self.server_notices_room_name = c.get("room_name", "Server Notices")
+ self.server_notices_room_avatar_url = c.get("room_avatar_url", None)
+ self.server_notices_room_topic = c.get("room_topic", None)
self.server_notices_auto_join = c.get("auto_join", False)
|