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

Commit

Permalink
Attempt to make default config more consistent
Browse files Browse the repository at this point in the history
The general idea here is that config examples should just have a hash and no
extraneous whitespace, both to make it easier for people who don't understand
yaml, and to make the examples stand out from the comments.
  • Loading branch information
richvdh committed Feb 19, 2019
1 parent 49b58f0 commit 5f9bdf9
Show file tree
Hide file tree
Showing 24 changed files with 248 additions and 196 deletions.
1 change: 1 addition & 0 deletions synapse/config/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def default_config(cls, **kwargs):
## API Configuration ##
# A list of event types that will be included in the room_invite_state
#
room_invite_state_types:
- "{JoinRules}"
- "{CanonicalAlias}"
Expand Down
2 changes: 2 additions & 0 deletions synapse/config/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ def read_config(self, config):
def default_config(cls, **kwargs):
return """\
# A list of application service config file to use
#
app_service_config_files: []
# Whether or not to track application service IP addresses. Implicitly
# enables MAU tracking for application service users.
#
track_appservice_user_ips: False
"""

Expand Down
3 changes: 3 additions & 0 deletions synapse/config/captcha.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@ def default_config(self, **kwargs):
# See docs/CAPTCHA_SETUP for full details of configuring this.
# This Home Server's ReCAPTCHA public key.
#
recaptcha_public_key: "YOUR_PUBLIC_KEY"
# This Home Server's ReCAPTCHA private key.
#
recaptcha_private_key: "YOUR_PRIVATE_KEY"
# Enables ReCaptcha checks when registering, preventing signup
# unless a captcha is answered. Requires a valid ReCaptcha
# public/private key.
#
enable_registration_captcha: False
# A secret key used to bypass the captcha test entirely.
Expand Down
1 change: 1 addition & 0 deletions synapse/config/cas.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def read_config(self, config):
def default_config(self, config_dir_path, server_name, **kwargs):
return """
# Enable CAS for registration and login.
#
#cas_config:
# enabled: true
# server_url: "https://cas-server.com"
Expand Down
28 changes: 14 additions & 14 deletions synapse/config/consent_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@
# for an account. Has no effect unless `require_at_registration` is enabled.
# Defaults to "Privacy Policy".
#
# user_consent:
# template_dir: res/templates/privacy
# version: 1.0
# server_notice_content:
# msgtype: m.text
# body: >-
# To continue using this homeserver you must review and agree to the
# terms and conditions at %(consent_uri)s
# send_server_notice_to_guests: True
# block_events_error: >-
# To continue using this homeserver you must review and agree to the
# terms and conditions at %(consent_uri)s
# require_at_registration: False
# policy_name: Privacy Policy
#user_consent:
# template_dir: res/templates/privacy
# version: 1.0
# server_notice_content:
# msgtype: m.text
# body: >-
# To continue using this homeserver you must review and agree to the
# terms and conditions at %(consent_uri)s
# send_server_notice_to_guests: True
# block_events_error: >-
# To continue using this homeserver you must review and agree to the
# terms and conditions at %(consent_uri)s
# require_at_registration: False
# policy_name: Privacy Policy
#
"""

Expand Down
4 changes: 3 additions & 1 deletion synapse/config/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ def read_config(self, config):
def default_config(self, **kwargs):
return """\
# Whether to allow non server admins to create groups on this server
#
enable_group_creation: false
# If enabled, non server admins can only create groups with local parts
# starting with this prefix
# group_creation_prefix: "unofficial/"
#
#group_creation_prefix: "unofficial/"
"""
8 changes: 4 additions & 4 deletions synapse/config/jwt_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def default_config(self, **kwargs):
return """\
# The JWT needs to contain a globally unique "sub" (subject) claim.
#
# jwt_config:
# enabled: true
# secret: "a secret"
# algorithm: "HS256"
#jwt_config:
# enabled: true
# secret: "a secret"
# algorithm: "HS256"
"""
11 changes: 9 additions & 2 deletions synapse/config/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class KeyConfig(Config):
def read_config(self, config):
self.signing_key = self.read_signing_key(config["signing_key_path"])
self.old_signing_keys = self.read_old_signing_keys(
config["old_signing_keys"]
config.get("old_signing_keys", {})
)
self.key_refresh_interval = self.parse_duration(
config["key_refresh_interval"]
Expand Down Expand Up @@ -83,24 +83,29 @@ def default_config(self, config_dir_path, server_name, generate_secrets=False,
# a secret which is used to sign access tokens. If none is specified,
# the registration_shared_secret is used, if one is given; otherwise,
# a secret key is derived from the signing key.
#
%(macaroon_secret_key)s
# Used to enable access token expiration.
#
expire_access_token: False
# a secret which is used to calculate HMACs for form values, to stop
# falsification of values. Must be specified for the User Consent
# forms to work.
#
%(form_secret)s
## Signing Keys ##
# Path to the signing key to sign messages with
#
signing_key_path: "%(base_key_name)s.signing.key"
# The keys that the server used to sign messages with but won't use
# to sign new messages. E.g. it has lost its private key
old_signing_keys: {}
#
#old_signing_keys:
# "ed25519:auto":
# # Base64 encoded public key
# key: "The public part of your old signing key."
Expand All @@ -111,9 +116,11 @@ def default_config(self, config_dir_path, server_name, generate_secrets=False,
# Used to set the valid_until_ts in /key/v2 APIs.
# Determines how quickly servers will query to check which keys
# are still valid.
#
key_refresh_interval: "1d" # 1 Day.
# The trusted servers to download signing keys from.
#
perspectives:
servers:
"matrix.org":
Expand Down
1 change: 1 addition & 0 deletions synapse/config/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def default_config(self, config_dir_path, server_name, **kwargs):
log_config = os.path.join(config_dir_path, server_name + ".log.config")
return """
# A yaml python logging config file
#
log_config: "%(log_config)s"
""" % locals()

Expand Down
2 changes: 2 additions & 0 deletions synapse/config/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def default_config(self, report_stats=None, **kwargs):
## Metrics ###
# Enable collection and rendering of performance metrics
#
enable_metrics: False
# Enable sentry integration
Expand All @@ -55,6 +56,7 @@ def default_config(self, report_stats=None, **kwargs):
# this option the sentry server may therefore receive sensitive
# information, and it in turn may then diseminate sensitive information
# through insecure notification channels if so configured.
#
#sentry:
# dsn: "..."
"""
Expand Down
1 change: 1 addition & 0 deletions synapse/config/password.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def read_config(self, config):
def default_config(self, config_dir_path, server_name, **kwargs):
return """
# Enable password for login.
#
password_config:
enabled: true
# Uncomment and change to a secret random string for extra security.
Expand Down
28 changes: 14 additions & 14 deletions synapse/config/password_auth_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ def read_config(self, config):

def default_config(self, **kwargs):
return """\
# password_providers:
# - module: "ldap_auth_provider.LdapAuthProvider"
# config:
# enabled: true
# uri: "ldap://ldap.example.com:389"
# start_tls: true
# base: "ou=users,dc=example,dc=com"
# attributes:
# uid: "cn"
# mail: "email"
# name: "givenName"
# #bind_dn:
# #bind_password:
# #filter: "(objectClass=posixAccount)"
#password_providers:
# - module: "ldap_auth_provider.LdapAuthProvider"
# config:
# enabled: true
# uri: "ldap://ldap.example.com:389"
# start_tls: true
# base: "ou=users,dc=example,dc=com"
# attributes:
# uid: "cn"
# mail: "email"
# name: "givenName"
# #bind_dn:
# #bind_password:
# #filter: "(objectClass=posixAccount)"
"""
4 changes: 2 additions & 2 deletions synapse/config/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def default_config(self, config_dir_path, server_name, **kwargs):
# notification request includes the content of the event (other details
# like the sender are still included). For `event_id_only` push, it
# has no effect.
#
# For modern android devices the notification content will still appear
# because it is loaded by the app. iPhone, however will send a
# notification saying only that a message arrived and who it came from.
#
#push:
# include_content: true
# include_content: true
"""
7 changes: 7 additions & 0 deletions synapse/config/ratelimiting.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,34 @@ def default_config(self, **kwargs):
## Ratelimiting ##
# Number of messages a client can send per second
#
rc_messages_per_second: 0.2
# Number of message a client can send before being throttled
#
rc_message_burst_count: 10.0
# The federation window size in milliseconds
#
federation_rc_window_size: 1000
# The number of federation requests from a single server in a window
# before the server will delay processing the request.
#
federation_rc_sleep_limit: 10
# The duration in milliseconds to delay processing events from
# remote servers by if they go over the sleep limit.
#
federation_rc_sleep_delay: 500
# The maximum number of concurrent federation requests allowed
# from a single server
#
federation_rc_reject_limit: 50
# The number of federation requests to concurrently process from a
# single server
#
federation_rc_concurrent: 3
"""
36 changes: 21 additions & 15 deletions synapse/config/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,40 +70,43 @@ def default_config(self, generate_secrets=False, **kwargs):
# The user must provide all of the below types of 3PID when registering.
#
# registrations_require_3pid:
# - email
# - msisdn
#registrations_require_3pid:
# - email
# - msisdn
# Explicitly disable asking for MSISDNs from the registration
# flow (overrides registrations_require_3pid if MSISDNs are set as required)
#
# disable_msisdn_registration = True
#disable_msisdn_registration: True
# Mandate that users are only allowed to associate certain formats of
# 3PIDs with accounts on this server.
#
# allowed_local_3pids:
# - medium: email
# pattern: '.*@matrix\\.org'
# - medium: email
# pattern: '.*@vector\\.im'
# - medium: msisdn
# pattern: '\\+44'
#allowed_local_3pids:
# - medium: email
# pattern: '.*@matrix\\.org'
# - medium: email
# pattern: '.*@vector\\.im'
# - medium: msisdn
# pattern: '\\+44'
# If set, allows registration by anyone who also has the shared
# secret, even if registration is otherwise disabled.
#
%(registration_shared_secret)s
# Set the number of bcrypt rounds used to generate password hash.
# Larger numbers increase the work factor needed to generate the hash.
# The default number is 12 (which equates to 2^12 rounds).
# N.B. that increasing this will exponentially increase the time required
# to register or login - e.g. 24 => 2^24 rounds which will take >20 mins.
#
bcrypt_rounds: 12
# Allows users to register as guests without a password/email/etc, and
# participate in rooms hosted on this server which have been made
# accessible to anonymous users.
#
allow_guest_access: False
# The identity server which we suggest that clients should use when users log
Expand All @@ -112,27 +115,30 @@ def default_config(self, generate_secrets=False, **kwargs):
# (By default, no suggestion is made, so it is left up to the client.
# This setting is ignored unless public_baseurl is also set.)
#
# default_identity_server: https://matrix.org
#default_identity_server: https://matrix.org
# The list of identity servers trusted to verify third party
# identifiers by this server.
#
# Also defines the ID server which will be called when an account is
# deactivated (one will be picked arbitrarily).
#
trusted_third_party_id_servers:
- matrix.org
- vector.im
- matrix.org
- vector.im
# Users who register on this homeserver will automatically be joined
# to these rooms
#
#auto_join_rooms:
# - "#example:example.com"
# - "#example:example.com"
# Where auto_join_rooms are specified, setting this flag ensures that the
# the rooms exist by creating them when the first user on the
# homeserver registers.
# Setting to false means that if the rooms are not manually created,
# users cannot be auto-joined since they do not exist.
#
autocreate_auto_join_rooms: true
""" % locals()

Expand Down
Loading

0 comments on commit 5f9bdf9

Please sign in to comment.