Skip to content
Snippets Groups Projects
sample_config.yaml 47.6 KiB
Newer Older
#       one of the given keys.
#
#    accept_keys_insecurely: a boolean. Normally, if `verify_keys` is unset,
#       and federation_verify_certificates is not `true`, synapse will refuse
#       to start, because this would allow anyone who can spoof DNS responses
#       to masquerade as the trusted key server. If you know what you are doing
#       and are sure that your network environment provides a secure connection
#       to the key server, you can set this to `true` to override this
#       behaviour.
#
# An example configuration might look like:
#
#trusted_key_servers:
#  - server_name: "my_trusted_server.example.com"
#    verify_keys:
#      "ed25519:auto": "abcdefghijklmnopqrstuvwxyzabcdefghijklmopqr"
#  - server_name: "my_other_trusted_server.example.com"
#
# The default configuration is:
#
#trusted_key_servers:
#  - server_name: "matrix.org"


# Enable SAML2 for registration and login. Uses pysaml2.
#
# `sp_config` is the configuration for the pysaml2 Service Provider.
# See pysaml2 docs for format of config.
#
# Default values will be used for the 'entityid' and 'service' settings,
# so it is not normally necessary to specify them unless you need to
# override them.
#
# Once SAML support is enabled, a metadata file will be exposed at
# https://<server>:<port>/_matrix/saml2/metadata.xml, which you may be able to
# use to configure your SAML IdP with. Alternatively, you can manually configure
# the IdP to use an ACS location of
# https://<server>:<port>/_matrix/saml2/authn_response.
#
#saml2_config:
#  sp_config:
#    # point this to the IdP's metadata. You can use either a local file or
#    # (preferably) a URL.
#    metadata:
#      #local: ["saml2/idp.xml"]
#      remote:
#        - url: https://our_idp/metadata.xml
#
#    # By default, the user has to go to our login page first. If you'd like to
#    # allow IdP-initiated login, set 'allow_unsolicited: True' in a
#    # 'service.sp' section:
#    #service:
#    #  sp:
#    #    allow_unsolicited: True
#
#    # The examples below are just used to generate our metadata xml, and you
#    # may well not need it, depending on your setup. Alternatively you
#    # may need a whole lot more detail - see the pysaml2 docs!
#
#    description: ["My awesome SP", "en"]
#    name: ["Test SP", "en"]
#
#    organization:
#      name: Example com
#      display_name:
#        - ["Example co", "en"]
#      url: "http://example.com"
#
#    contact_person:
#      - given_name: Bob
#        sur_name: "the Sysadmin"
#        email_address": ["admin@example.com"]
#        contact_type": technical
#
#  # Instead of putting the config inline as above, you can specify a
#  # separate pysaml2 configuration file:
#  #
#  config_path: "CONFDIR/sp_conf.py"
#
#  # the lifetime of a SAML session. This defines how long a user has to
#  # complete the authentication process, if allow_unsolicited is unset.
#  # The default is 5 minutes.
#  #
#  # saml_session_lifetime: 5m



# Enable CAS for registration and login.
#
#cas_config:
#   enabled: true
#   server_url: "https://cas-server.com"
#   service_url: "https://homeserver.domain.com:8448"
#   #required_attributes:
#   #    name: value


# The JWT needs to contain a globally unique "sub" (subject) claim.
#
#jwt_config:
#   enabled: true
#   secret: "a secret"
#   algorithm: "HS256"


password_config:
   # Uncomment to disable password login
   #
   #enabled: false

   # Uncomment to disable authentication against the local password
   # database. This is ignored if `enabled` is false, and is only useful
   # if you have other password_providers.
   #
   #localdb_enabled: false

   # Uncomment and change to a secret random string for extra security.
   # DO NOT CHANGE THIS AFTER INITIAL SETUP!
# Enable sending emails for password resets, notification events or
# account expiry notices
#
# If your SMTP server requires authentication, the optional smtp_user &
# smtp_pass variables should be used
#
#email:
#   enable_notifs: false
#   smtp_host: "localhost"
#   smtp_user: "exampleusername"
#   smtp_pass: "examplepassword"
#   require_transport_security: False
#   notif_from: "Your Friendly %(app)s Home Server <noreply@example.com>"
#   app_name: Matrix
#   notif_for_new_users: True
#
#   # Defining a custom URL for Riot is only needed if email notifications
#   # should contain links to a self-hosted installation of Riot; when set
#   # the "app_name" setting is ignored
#   riot_base_url: "http://localhost/riot"
#
#   # Enable sending password reset emails via the configured, trusted
#   # identity servers
#   #
#   # IMPORTANT! This will give a malicious or overtaken identity server
#   # the ability to reset passwords for your users! Make absolutely sure
#   # that you want to do this! It is strongly recommended that password
#   # reset emails be sent by the homeserver instead
#   #
#   # If this option is set to false and SMTP options have not been
#   # configured, resetting user passwords via email will be disabled
#   #trust_identity_server_for_password_resets: false
#
#   # Configure the time that a validation email or text message code
#   # will expire after sending
#   #
#   # This is currently used for password resets
#   #validation_token_lifetime: 1h
#
#   # Template directory. All template files should be stored within this
#   # directory. If not set, default templates from within the Synapse
#   # package will be used
#   #
#   # For the list of default templates, please see
#   # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
#   notif_template_html: notif_mail.html
#   notif_template_text: notif_mail.txt
#   expiry_template_html: notice_expiry.html
#   expiry_template_text: notice_expiry.txt
#
#   # Templates for password reset emails sent by the homeserver
#   #
#   #password_reset_template_html: password_reset.html
#   #password_reset_template_text: password_reset.txt
#
#   # Templates for password reset success and failure pages that a user
#   # will see after attempting to reset their password
#   #
#   #password_reset_template_success_html: password_reset_success.html
#   #password_reset_template_failure_html: password_reset_failure.html


#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)"



# Clients requesting push notifications can either have the body of
# the message sent in the notification poke along with other details
# like the sender, or just the event ID and room ID (`event_id_only`).
# If clients choose the former, this option controls whether the
# 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


#spam_checker:
#  module: "my_custom_project.SuperSpamChecker"
#  config:
#    example_option: 'things'


# Uncomment to allow non-server-admin users to create groups on this server

# If enabled, non server admins can only create groups with local parts
# starting with this prefix
#
#group_creation_prefix: "unofficial/"



# User Directory configuration
#
Erik Johnston's avatar
Erik Johnston committed
# 'enabled' defines whether users can search the user directory. If
# false then empty responses are returned to all queries. Defaults to
# true.
#
# 'search_all_users' defines whether to search all users visible to your HS
# when searching the user directory, rather than limiting to users visible
Amber Brown's avatar
Amber Brown committed
# in public rooms.  Defaults to false.  If you set it True, you'll have to
# rebuild the user_directory search indexes, see
# https://github.com/matrix-org/synapse/blob/master/docs/user_directory.md
Erik Johnston's avatar
Erik Johnston committed
#  enabled: true
#  search_all_users: false


# User Consent configuration
#
# for detailed instructions, see
# https://github.com/matrix-org/synapse/blob/master/docs/consent_tracking.md
#
# Parts of this section are required if enabling the 'consent' resource under
# 'listeners', in particular 'template_dir' and 'version'.
#
# 'template_dir' gives the location of the templates for the HTML forms.
# This directory should contain one subdirectory per language (eg, 'en', 'fr'),
# and each language directory should contain the policy document (named as
# '<version>.html') and a success page (success.html).
#
# 'version' specifies the 'current' version of the policy document. It defines
# the version to be served by the consent resource if there is no 'v'
# parameter.
#
# 'server_notice_content', if enabled, will send a user a "Server Notice"
# asking them to consent to the privacy policy. The 'server_notices' section
# must also be configured for this to work. Notices will *not* be sent to
# guest users unless 'send_server_notice_to_guests' is set to true.
#
# 'block_events_error', if set, will block any attempts to send events
# until the user consents to the privacy policy. The value of the setting is
# used as the text of the error.
#
# 'require_at_registration', if enabled, will add a step to the registration
# process, similar to how captcha works. Users will be required to accept the
# policy before their account is created.
#
# 'policy_name' is the display name of the policy users will see when registering
# 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
#


Amber Brown's avatar
Amber Brown committed

# Local statistics collection. Used in populating the room directory.
#
# 'bucket_size' controls how large each statistics timeslice is. It can
# be defined in a human readable short form -- e.g. "1d", "1y".
#
# 'retention' controls how long historical statistics will be kept for.
# It can be defined in a human readable short form -- e.g. "1d", "1y".
#
#
#stats:
#   enabled: true
#   bucket_size: 1d
#   retention: 1y


# Server Notices room configuration
#
# Uncomment this section to enable a room which can be used to send notices
# from the server to users. It is a special room which cannot be left; notices
# come from a special "notices" user id.
#
# If you uncomment this section, you *must* define the system_mxid_localpart
# setting, which defines the id of the user which will be used to send the
# notices.
#
# It's also possible to override the room name, the display name of the
# "notices" user, and the avatar for the user.
#
#server_notices:
#  system_mxid_localpart: notices
#  system_mxid_display_name: "Server Notices"
#  system_mxid_avatar_url: "mxc://server.com/oumMVlgDnLYFaPVkExemNVVZ"
#  room_name: "Server Notices"



Erik Johnston's avatar
Erik Johnston committed
# Uncomment to disable searching the public room list. When disabled
# blocks searching local and remote room lists for local and remote
# users by always returning an empty list for all queries.
Erik Johnston's avatar
Erik Johnston committed
#enable_room_list_search: false
# The `alias_creation` option controls who's allowed to create aliases
# on this server.
#
# The format of this option is a list of rules that contain globs that
# match against user_id, room_id and the new alias (fully qualified with
# server name). The action in the first rule that matches is taken,
# which can currently either be "allow" or "deny".
#
# Missing user_id/room_id/alias fields default to "*".
#
# If no rules match the request is denied. An empty list means no one
# can create aliases.
#
# Options for the rules include:
#
#   user_id: Matches against the creator of the alias
#   alias: Matches against the alias being created
#   room_id: Matches against the room ID the alias is being pointed at
#   action: Whether to "allow" or "deny" the request if the rule matches
#
# The default is:
#
#alias_creation_rules:
#  - user_id: "*"
#    alias: "*"
#    room_id: "*"
#    action: allow

# The `room_list_publication_rules` option controls who can publish and
# which rooms can be published in the public room list.
#
# The format of this option is the same as that for
# `alias_creation_rules`.
#
# If the room has one or more aliases associated with it, only one of
# the aliases needs to match the alias rule. If there are no aliases
# then only rules with `alias: *` match.
#
# If no rules match the request is denied. An empty list means no one
# can publish rooms.
#
# Options for the rules include:
#
#   user_id: Matches agaisnt the creator of the alias
#   room_id: Matches against the room ID being published
#   alias: Matches against any current local or canonical aliases
#            associated with the room
#   action: Whether to "allow" or "deny" the request if the rule matches
#
# The default is:
#
#room_list_publication_rules:
#  - user_id: "*"
#    alias: "*"
#    room_id: "*"
#    action: allow


# Server admins can define a Python module that implements extra rules for
# allowing or denying incoming events. In order to work, this module needs to
# override the methods defined in synapse/events/third_party_rules.py.
#
# This feature is designed to be used in closed federations only, where each
# participating server enforces the same rules.
#
#third_party_event_rules:
#  module: "my_custom_project.SuperRulesSet"
#  config:
#    example_option: 'things'

# These settings enable opentracing, which implements distributed tracing.
# This allows you to observe the causal chains of events across servers
# including requests, key lookups etc., across any server running
# synapse or any other other services which supports opentracing
# (specifically those implemented with Jaeger).
#
opentracing:
    # tracing is disabled by default. Uncomment the following line to enable it.
    #
    #enabled: true

    # The list of homeservers we wish to send and receive span contexts and span baggage.
    # See docs/opentracing.rst
    # This is a list of regexes which are matched against the server_name of the
    # homeserver.
    #
    # By defult, it is empty, so no servers are matched.
    #
    #homeserver_whitelist:
    #  - ".*"

    # Jaeger can be configured to sample traces at different rates.
    # All configuration options provided by Jaeger can be set here.
    # Jaeger's configuration mostly related to trace sampling which
    # is documented here:
    # https://www.jaegertracing.io/docs/1.13/sampling/.
    #
    #jaeger_config:
    #  sampler:
    #    type: const
    #    param: 1

    #  Logging whether spans were started and reported
    #
    #  logging:
    #    false