Fix some DETECTED VIOLATIONS in the config file (#7550)

consistency ftw
This commit is contained in:
Richard van der Hoff 2020-05-22 10:11:50 +01:00 committed by GitHub
parent d1ae1015ec
commit 66a564c859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 72 additions and 55 deletions

1
changelog.d/7550.misc Normal file
View File

@ -0,0 +1 @@
Fix some indentation inconsistencies in the sample config.

View File

@ -322,22 +322,27 @@ listeners:
# Used by phonehome stats to group together related servers. # Used by phonehome stats to group together related servers.
#server_context: context #server_context: context
# Resource-constrained homeserver Settings # Resource-constrained homeserver settings
# #
# If limit_remote_rooms.enabled is True, the room complexity will be # When this is enabled, the room "complexity" will be checked before a user
# checked before a user joins a new remote room. If it is above # joins a new remote room. If it is above the complexity limit, the server will
# limit_remote_rooms.complexity, it will disallow joining or # disallow joining, or will instantly leave.
# instantly leave.
# #
# limit_remote_rooms.complexity_error can be set to customise the text # Room complexity is an arbitrary measure based on factors such as the number of
# displayed to the user when a room above the complexity threshold has # users in the room.
# its join cancelled.
# #
# Uncomment the below lines to enable: limit_remote_rooms:
#limit_remote_rooms: # Uncomment to enable room complexity checking.
# enabled: true #
# complexity: 1.0 #enabled: true
# complexity_error: "This room is too complex."
# the limit above which rooms cannot be joined. The default is 1.0.
#
#complexity: 0.5
# override the error which is returned when the room is too complex.
#
#complexity_error: "This room is too complex."
# Whether to require a user to be in the room to add an alias to it. # Whether to require a user to be in the room to add an alias to it.
# Defaults to 'true'. # Defaults to 'true'.
@ -942,25 +947,28 @@ url_preview_accept_language:
## Captcha ## ## Captcha ##
# See docs/CAPTCHA_SETUP for full details of configuring this. # See docs/CAPTCHA_SETUP.md for full details of configuring this.
# This homeserver's ReCAPTCHA public key. # This homeserver's ReCAPTCHA public key. Must be specified if
# enable_registration_captcha is enabled.
# #
#recaptcha_public_key: "YOUR_PUBLIC_KEY" #recaptcha_public_key: "YOUR_PUBLIC_KEY"
# This homeserver's ReCAPTCHA private key. # This homeserver's ReCAPTCHA private key. Must be specified if
# enable_registration_captcha is enabled.
# #
#recaptcha_private_key: "YOUR_PRIVATE_KEY" #recaptcha_private_key: "YOUR_PRIVATE_KEY"
# Enables ReCaptcha checks when registering, preventing signup # Uncomment to enable ReCaptcha checks when registering, preventing signup
# unless a captcha is answered. Requires a valid ReCaptcha # unless a captcha is answered. Requires a valid ReCaptcha
# public/private key. # public/private key. Defaults to 'false'.
# #
#enable_registration_captcha: false #enable_registration_captcha: true
# The API endpoint to use for verifying m.login.recaptcha responses. # The API endpoint to use for verifying m.login.recaptcha responses.
# Defaults to "https://www.recaptcha.net/recaptcha/api/siteverify".
# #
#recaptcha_siteverify_api: "https://www.recaptcha.net/recaptcha/api/siteverify" #recaptcha_siteverify_api: "https://my.recaptcha.site"
## TURN ## ## TURN ##
@ -1104,7 +1112,7 @@ account_validity:
# If set, allows registration of standard or admin accounts by anyone who # If set, allows registration of standard or admin accounts by anyone who
# has the shared secret, even if registration is otherwise disabled. # has the shared secret, even if registration is otherwise disabled.
# #
# registration_shared_secret: <PRIVATE STRING> #registration_shared_secret: <PRIVATE STRING>
# Set the number of bcrypt rounds used to generate password hash. # Set the number of bcrypt rounds used to generate password hash.
# Larger numbers increase the work factor needed to generate the hash. # Larger numbers increase the work factor needed to generate the hash.
@ -1237,7 +1245,8 @@ metrics_flags:
#known_servers: true #known_servers: true
# Whether or not to report anonymized homeserver usage statistics. # Whether or not to report anonymized homeserver usage statistics.
# report_stats: true|false #
#report_stats: true|false
# The endpoint to report the anonymized homeserver usage statistics to. # The endpoint to report the anonymized homeserver usage statistics to.
# Defaults to https://matrix.org/report-usage-stats/push # Defaults to https://matrix.org/report-usage-stats/push
@ -1273,13 +1282,13 @@ metrics_flags:
# the registration_shared_secret is used, if one is given; otherwise, # the registration_shared_secret is used, if one is given; otherwise,
# a secret key is derived from the signing key. # a secret key is derived from the signing key.
# #
# macaroon_secret_key: <PRIVATE STRING> #macaroon_secret_key: <PRIVATE STRING>
# a secret which is used to calculate HMACs for form values, to stop # a secret which is used to calculate HMACs for form values, to stop
# falsification of values. Must be specified for the User Consent # falsification of values. Must be specified for the User Consent
# forms to work. # forms to work.
# #
# form_secret: <PRIVATE STRING> #form_secret: <PRIVATE STRING>
## Signing Keys ## ## Signing Keys ##
@ -1764,8 +1773,8 @@ email:
# Username/password for authentication to the SMTP server. By default, no # Username/password for authentication to the SMTP server. By default, no
# authentication is attempted. # authentication is attempted.
# #
# smtp_user: "exampleusername" #smtp_user: "exampleusername"
# smtp_pass: "examplepassword" #smtp_pass: "examplepassword"
# Uncomment the following to require TLS transport security for SMTP. # Uncomment the following to require TLS transport security for SMTP.
# By default, Synapse will connect over plain text, and will then switch to # By default, Synapse will connect over plain text, and will then switch to

View File

@ -32,23 +32,26 @@ class CaptchaConfig(Config):
def generate_config_section(self, **kwargs): def generate_config_section(self, **kwargs):
return """\ return """\
## Captcha ## ## Captcha ##
# See docs/CAPTCHA_SETUP for full details of configuring this. # See docs/CAPTCHA_SETUP.md for full details of configuring this.
# This homeserver's ReCAPTCHA public key. # This homeserver's ReCAPTCHA public key. Must be specified if
# enable_registration_captcha is enabled.
# #
#recaptcha_public_key: "YOUR_PUBLIC_KEY" #recaptcha_public_key: "YOUR_PUBLIC_KEY"
# This homeserver's ReCAPTCHA private key. # This homeserver's ReCAPTCHA private key. Must be specified if
# enable_registration_captcha is enabled.
# #
#recaptcha_private_key: "YOUR_PRIVATE_KEY" #recaptcha_private_key: "YOUR_PRIVATE_KEY"
# Enables ReCaptcha checks when registering, preventing signup # Uncomment to enable ReCaptcha checks when registering, preventing signup
# unless a captcha is answered. Requires a valid ReCaptcha # unless a captcha is answered. Requires a valid ReCaptcha
# public/private key. # public/private key. Defaults to 'false'.
# #
#enable_registration_captcha: false #enable_registration_captcha: true
# The API endpoint to use for verifying m.login.recaptcha responses. # The API endpoint to use for verifying m.login.recaptcha responses.
# Defaults to "https://www.recaptcha.net/recaptcha/api/siteverify".
# #
#recaptcha_siteverify_api: "https://www.recaptcha.net/recaptcha/api/siteverify" #recaptcha_siteverify_api: "https://my.recaptcha.site"
""" """

View File

@ -311,8 +311,8 @@ class EmailConfig(Config):
# Username/password for authentication to the SMTP server. By default, no # Username/password for authentication to the SMTP server. By default, no
# authentication is attempted. # authentication is attempted.
# #
# smtp_user: "exampleusername" #smtp_user: "exampleusername"
# smtp_pass: "examplepassword" #smtp_pass: "examplepassword"
# Uncomment the following to require TLS transport security for SMTP. # Uncomment the following to require TLS transport security for SMTP.
# By default, Synapse will connect over plain text, and will then switch to # By default, Synapse will connect over plain text, and will then switch to

View File

@ -175,8 +175,8 @@ class KeyConfig(Config):
) )
form_secret = 'form_secret: "%s"' % random_string_with_symbols(50) form_secret = 'form_secret: "%s"' % random_string_with_symbols(50)
else: else:
macaroon_secret_key = "# macaroon_secret_key: <PRIVATE STRING>" macaroon_secret_key = "#macaroon_secret_key: <PRIVATE STRING>"
form_secret = "# form_secret: <PRIVATE STRING>" form_secret = "#form_secret: <PRIVATE STRING>"
return ( return (
"""\ """\

View File

@ -93,10 +93,11 @@ class MetricsConfig(Config):
#known_servers: true #known_servers: true
# Whether or not to report anonymized homeserver usage statistics. # Whether or not to report anonymized homeserver usage statistics.
#
""" """
if report_stats is None: if report_stats is None:
res += "# report_stats: true|false\n" res += "#report_stats: true|false\n"
else: else:
res += "report_stats: %s\n" % ("true" if report_stats else "false") res += "report_stats: %s\n" % ("true" if report_stats else "false")

View File

@ -148,9 +148,7 @@ class RegistrationConfig(Config):
random_string_with_symbols(50), random_string_with_symbols(50),
) )
else: else:
registration_shared_secret = ( registration_shared_secret = "#registration_shared_secret: <PRIVATE STRING>"
"# registration_shared_secret: <PRIVATE STRING>"
)
return ( return (
"""\ """\

View File

@ -434,7 +434,7 @@ class ServerConfig(Config):
) )
self.limit_remote_rooms = LimitRemoteRoomsConfig( self.limit_remote_rooms = LimitRemoteRoomsConfig(
**config.get("limit_remote_rooms", {}) **(config.get("limit_remote_rooms") or {})
) )
bind_port = config.get("bind_port") bind_port = config.get("bind_port")
@ -895,22 +895,27 @@ class ServerConfig(Config):
# Used by phonehome stats to group together related servers. # Used by phonehome stats to group together related servers.
#server_context: context #server_context: context
# Resource-constrained homeserver Settings # Resource-constrained homeserver settings
# #
# If limit_remote_rooms.enabled is True, the room complexity will be # When this is enabled, the room "complexity" will be checked before a user
# checked before a user joins a new remote room. If it is above # joins a new remote room. If it is above the complexity limit, the server will
# limit_remote_rooms.complexity, it will disallow joining or # disallow joining, or will instantly leave.
# instantly leave.
# #
# limit_remote_rooms.complexity_error can be set to customise the text # Room complexity is an arbitrary measure based on factors such as the number of
# displayed to the user when a room above the complexity threshold has # users in the room.
# its join cancelled.
# #
# Uncomment the below lines to enable: limit_remote_rooms:
#limit_remote_rooms: # Uncomment to enable room complexity checking.
# enabled: true #
# complexity: 1.0 #enabled: true
# complexity_error: "This room is too complex."
# the limit above which rooms cannot be joined. The default is 1.0.
#
#complexity: 0.5
# override the error which is returned when the room is too complex.
#
#complexity_error: "This room is too complex."
# Whether to require a user to be in the room to add an alias to it. # Whether to require a user to be in the room to add an alias to it.
# Defaults to 'true'. # Defaults to 'true'.