Skip to content
Snippets Groups Projects
  • realtyem's avatar
    6acb6d77
    Update worker docs to update preferred settings for pusher and federation_sender (#14493) · 6acb6d77
    realtyem authored
    * Fix one typo on line 3700(and apparently do something to other lines, no idea)
    
    * Update config_documentation.md with more information about how federation_senders and pushers settings can be handled.
    
    Specifically, that the instance map style of config does not require the special other variables that enable and disable functionality and that a single worker CAN be added to the map not only just two or more.
    
    * Extra line here for consistency and appearance.
    
    * Add link to sygnal repo.
    
    * Add deprecation notice to workers.md and point to the newer alternative method of defining this functionality.
    
    * Changelog
    
    * Correct version number of Synapse the deprecation is happening in.
    
    * Update quiet deprecation with simple notice and suggestion.
    Update worker docs to update preferred settings for pusher and federation_sender (#14493)
    realtyem authored
    * Fix one typo on line 3700(and apparently do something to other lines, no idea)
    
    * Update config_documentation.md with more information about how federation_senders and pushers settings can be handled.
    
    Specifically, that the instance map style of config does not require the special other variables that enable and disable functionality and that a single worker CAN be added to the map not only just two or more.
    
    * Extra line here for consistency and appearance.
    
    * Add link to sygnal repo.
    
    * Add deprecation notice to workers.md and point to the newer alternative method of defining this functionality.
    
    * Changelog
    
    * Correct version number of Synapse the deprecation is happening in.
    
    * Update quiet deprecation with simple notice and suggestion.
config_documentation.md 135.60 KiB

Configuring Synapse

This is intended as a guide to the Synapse configuration. The behavior of a Synapse instance can be modified through the many configuration settings documented here — each config option is explained, including what the default is, how to change the default and what sort of behaviour the setting governs. Also included is an example configuration for each setting. If you don't want to spend a lot of time thinking about options, the config as generated sets sensible defaults for all values. Do note however that the database defaults to SQLite, which is not recommended for production usage. You can read more on this subject here.

Config Conventions

Configuration options that take a time period can be set using a number followed by a letter. Letters have the following meanings:

  • s = second
  • m = minute
  • h = hour
  • d = day
  • w = week
  • y = year

For example, setting redaction_retention_period: 5m would remove redacted messages from the database after 5 minutes, rather than 5 months.

In addition, configuration options referring to size use the following suffixes:

  • M = MiB, or 1,048,576 bytes
  • K = KiB, or 1024 bytes

For example, setting max_avatar_size: 10M means that Synapse will not accept files larger than 10,485,760 bytes for a user avatar.

YAML

The configuration file is a YAML file, which means that certain syntax rules apply if you want your config file to be read properly. A few helpful things to know:

  • # before any option in the config will comment out that setting and either a default (if available) will be applied or Synapse will ignore the setting. Thus, in example #1 (closed) below, the setting will be read and applied, but in example #2 (closed) the setting will not be read and a default will be applied.

    Example #1 (closed):

    pid_file: DATADIR/homeserver.pid

    Example #2 (closed):

    #pid_file: DATADIR/homeserver.pid
  • Indentation matters! The indentation before a setting will determine whether a given setting is read as part of another setting, or considered on its own. Thus, in example #1 (closed), the enabled setting is read as a sub-option of the presence setting, and will be properly applied.

    However, the lack of indentation before the enabled setting in example #2 (closed) means that when reading the config, Synapse will consider both presence and enabled as different settings. In this case, presence has no value, and thus a default applied, and enabled is an option that Synapse doesn't recognize and thus ignores.

    Example #1 (closed):

    presence:
      enabled: false

    Example #2 (closed):

    presence:
    enabled: false

    In this manual, all top-level settings (ones with no indentation) are identified at the beginning of their section (i.e. "### example_setting") and the sub-options, if any, are identified and listed in the body of the section. In addition, each setting has an example of its usage, with the proper indentation shown.

Modules

Server admins can expand Synapse's functionality with external modules.

See here for more documentation on how to configure or create custom modules for Synapse.


modules

Use the module sub-option to add modules under this option to extend functionality. The module setting then has a sub-option, config, which can be used to define some configuration for the module.

Defaults to none.

Example configuration:

modules:
  - module: my_super_module.MySuperClass
    config:
      do_thing: true
  - module: my_other_super_module.SomeClass
    config: {}

Server

Define your homeserver name and other base options.


server_name

This sets the public-facing domain of the server.

The server_name name will appear at the end of usernames and room addresses created on your server. For example if the server_name was example.com, usernames on your server would be in the format @user:example.com

In most cases you should avoid using a matrix specific subdomain such as matrix.example.com or synapse.example.com as the server_name for the same reasons you wouldn't use user@email.example.com as your email address. See here for information on how to host Synapse on a subdomain while preserving a clean server_name.

The server_name cannot be changed later so it is important to configure this correctly before you start Synapse. It should be all lowercase and may contain an explicit port.