summary refs log tree commit diff
path: root/synapse/config/_base.py
diff options
context:
space:
mode:
authorShay <hillerys@element.io>2022-06-14 07:53:42 -0700
committerGitHub <noreply@github.com>2022-06-14 07:53:42 -0700
commit493c2fc44abcf3457953cc2f6f23509ff7855253 (patch)
treef429a75b187fdd0449bc1a460ce730b6d2b2ccd2 /synapse/config/_base.py
parentRename delta to apply in the proper schema version. (#13050) (diff)
downloadsynapse-493c2fc44abcf3457953cc2f6f23509ff7855253.tar.xz
Remove code generating comments in configuration file (#12941)
Diffstat (limited to 'synapse/config/_base.py')
-rw-r--r--synapse/config/_base.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/config/_base.py b/synapse/config/_base.py
index 42364fc133..095eca16c5 100644
--- a/synapse/config/_base.py
+++ b/synapse/config/_base.py
@@ -18,6 +18,7 @@ import argparse
 import errno
 import logging
 import os
+import re
 from collections import OrderedDict
 from hashlib import sha256
 from textwrap import dedent
@@ -123,7 +124,10 @@ CONFIG_FILE_HEADER = """\
 # should have the same indentation.
 #
 # [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
-
+#
+# For more information on how to configure Synapse, including a complete accounting of
+# each option, go to docs/usage/configuration/config_documentation.md or
+# https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html
 """
 
 
@@ -470,7 +474,7 @@ class RootConfig:
             The yaml config file
         """
 
-        return CONFIG_FILE_HEADER + "\n\n".join(
+        conf = CONFIG_FILE_HEADER + "\n".join(
             dedent(conf)
             for conf in self.invoke_all(
                 "generate_config_section",
@@ -485,6 +489,8 @@ class RootConfig:
                 tls_private_key_path=tls_private_key_path,
             ).values()
         )
+        conf = re.sub("\n{2,}", "\n", conf)
+        return conf
 
     @classmethod
     def load_config(