· 6 years ago · Mar 09, 2020, 07:50 PM
1## Server ##
2
3# The domain name of the server, with optional explicit port.
4# This is used by remote servers to connect to this server,
5# e.g. matrix.org, localhost:8080, etc.
6# This is also the last part of your UserID.
7#
8#
9# This is set in /etc/matrix-synapse/conf.d/server_name.yaml for Debian installations.
10# server_name: "SERVERNAME"
11server_name: synapse.itliga.ru
12
13# When running as a daemon, the file to store the pid in
14#
15pid_file: "/var/run/matrix-synapse.pid"
16
17# The path to the web client which will be served at /_matrix/client/
18# if 'webclient' is configured under the 'listeners' configuration.
19#
20#web_client_location: "/path/to/web/root"
21
22# The public-facing base URL that clients use to access this HS
23# (not including _matrix/...). This is the same URL a user would
24# enter into the 'custom HS URL' field on their client. If you
25# use synapse with a reverse proxy, this should be the URL to reach
26# synapse via the proxy.
27#
28public_baseurl: https://synapse.itliga.ru/
29
30# Set the soft limit on the number of file descriptors synapse can use
31# Zero is used to indicate synapse should set the soft limit to the
32# hard limit.
33#
34#soft_file_limit: 0
35
36# Set to false to disable presence tracking on this homeserver.
37#
38use_presence: false
39
40# Whether to require authentication to retrieve profile data (avatars,
41# display names) of other users through the client API. Defaults to
42# 'false'. Note that profile data is also available via the federation
43# API, so this setting is of limited value if federation is enabled on
44# the server.
45#
46#require_auth_for_profile_requests: true
47
48# If set to 'false', requires authentication to access the server's public rooms
49# directory through the client API. Defaults to 'true'.
50#
51#allow_public_rooms_without_auth: false
52
53# If set to 'false', forbids any other homeserver to fetch the server's public
54# rooms directory via federation. Defaults to 'true'.
55#
56#allow_public_rooms_over_federation: false
57
58# The default room version for newly created rooms.
59#
60# Known room versions are listed here:
61# https://matrix.org/docs/spec/#complete-list-of-room-versions
62#
63# For example, for room version 1, default_room_version should be set
64# to "1".
65#
66default_room_version: "1"
67
68# The GC threshold parameters to pass to `gc.set_threshold`, if defined
69#
70#gc_thresholds: [700, 10, 10]
71
72# Set the limit on the returned events in the timeline in the get
73# and sync operations. The default value is -1, means no upper limit.
74#
75#filter_timeline_limit: 5000
76
77# Whether room invites to users on this server should be blocked
78# (except those sent by local server admins). The default is False.
79#
80#block_non_admin_invites: True
81
82# Room searching
83#
84# If disabled, new messages will not be indexed for searching and users
85# will receive errors when searching for messages. Defaults to enabled.
86#
87enable_search: true
88
89# Restrict federation to the following whitelist of domains.
90# N.B. we recommend also firewalling your federation listener to limit
91# inbound federation traffic as early as possible, rather than relying
92# purely on this application-layer restriction. If not specified, the
93# default is to whitelist everything.
94#
95federation_domain_whitelist:
96 - vector.im
97 - matrix.org
98# - lon.example.com
99# - nyc.example.com
100# - syd.example.com
101
102
103# Prevent federation requests from being sent to the following
104# blacklist IP address CIDR ranges. If this option is not specified, or
105# specified with an empty list, no ip range blacklist will be enforced.
106#
107# (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
108# listed here, since they correspond to unroutable addresses.)
109#
110federation_ip_range_blacklist:
111 - '127.0.0.0/8'
112 - '10.0.0.0/8'
113 - '172.16.0.0/12'
114 - '192.168.0.0/16'
115 - '100.64.0.0/10'
116 - '169.254.0.0/16'
117 - '::1/128'
118 - 'fe80::/64'
119 - 'fc00::/7'
120
121# List of ports that Synapse should listen on, their purpose and their
122# configuration.
123#
124# Options for each listener include:
125#
126# port: the TCP port to bind to
127#
128# bind_addresses: a list of local addresses to listen on. The default is
129# 'all local interfaces'.
130#
131# type: the type of listener. Normally 'http', but other valid options are:
132# 'manhole' (see docs/manhole.md),
133# 'metrics' (see docs/metrics-howto.rst),
134# 'replication' (see docs/workers.rst).
135#
136# tls: set to true to enable TLS for this listener. Will use the TLS
137# key/cert specified in tls_private_key_path / tls_certificate_path.
138#
139# x_forwarded: Only valid for an 'http' listener. Set to true to use the
140# X-Forwarded-For header as the client IP. Useful when Synapse is
141# behind a reverse-proxy.
142#
143# resources: Only valid for an 'http' listener. A list of resources to host
144# on this port. Options for each resource are:
145#
146# names: a list of names of HTTP resources. See below for a list of
147# valid resource names.
148#
149# compress: set to true to enable HTTP comression for this resource.
150#
151# additional_resources: Only valid for an 'http' listener. A map of
152# additional endpoints which should be loaded via dynamic modules.
153#
154# Valid resource names are:
155#
156# client: the client-server API (/_matrix/client), and the synapse admin
157# API (/_synapse/admin). Also implies 'media' and 'static'.
158#
159# consent: user consent forms (/_matrix/consent). See
160# docs/consent_tracking.md.
161#
162# federation: the server-server API (/_matrix/federation). Also implies
163# 'media', 'keys', 'openid'
164#
165# keys: the key discovery API (/_matrix/keys).
166#
167# media: the media API (/_matrix/media).
168#
169# metrics: the metrics interface. See docs/metrics-howto.rst.
170#
171# openid: OpenID authentication.
172#
173# replication: the HTTP replication API (/_synapse/replication). See
174# docs/workers.rst.
175#
176# static: static resources under synapse/static (/_matrix/static). (Mostly
177# useful for 'fallback authentication'.)
178#
179# webclient: A web client. Requires web_client_location to be set.
180#
181listeners:
182 # TLS-enabled listener: for when matrix traffic is sent directly to synapse.
183 #
184 # Disabled by default. To enable it, uncomment the following. (Note that you
185 # will also need to give Synapse a TLS key and certificate: see the TLS section
186 # below.)
187 #
188 - port: 8448
189 type: http
190 tls: true
191 resources:
192 - names: [client,federation]
193
194 # Unsecure HTTP listener: for when matrix traffic passes through a reverse proxy
195 # that unwraps TLS.
196 #
197 # If you plan to use a reverse proxy, please see
198 # https://github.com/matrix-org/synapse/blob/master/docs/reverse_proxy.rst.
199 #
200 - port: 8008
201 tls: false
202 bind_addresses: ['0.0.0.0']
203 type: http
204 x_forwarded: true
205
206 resources:
207 - names: [client, federation]
208 compress: false
209
210 # example additional_resources:
211 #
212 #additional_resources:
213 # "/_matrix/my/custom/endpoint":
214 # module: my_module.CustomRequestHandler
215 # config: {}
216
217 # Turn on the twisted ssh manhole service on localhost on the given
218 # port.
219 #
220 #- port: 9000
221 # bind_addresses: ['::1', '127.0.0.1']
222 # type: manhole
223
224
225## Homeserver blocking ##
226
227# How to reach the server admin, used in ResourceLimitError
228#
229#admin_contact: 'mailto:admin@server.com'
230
231# Global blocking
232#
233#hs_disabled: False
234#hs_disabled_message: 'Human readable reason for why the HS is blocked'
235#hs_disabled_limit_type: 'error code(str), to help clients decode reason'
236
237# Monthly Active User Blocking
238#
239# Used in cases where the admin or server owner wants to limit to the
240# number of monthly active users.
241#
242# 'limit_usage_by_mau' disables/enables monthly active user blocking. When
243# anabled and a limit is reached the server returns a 'ResourceLimitError'
244# with error type Codes.RESOURCE_LIMIT_EXCEEDED
245#
246# 'max_mau_value' is the hard limit of monthly active users above which
247# the server will start blocking user actions.
248#
249# 'mau_trial_days' is a means to add a grace period for active users. It
250# means that users must be active for this number of days before they
251# can be considered active and guards against the case where lots of users
252# sign up in a short space of time never to return after their initial
253# session.
254#
255#limit_usage_by_mau: False
256#max_mau_value: 50
257#mau_trial_days: 2
258
259# If enabled, the metrics for the number of monthly active users will
260# be populated, however no one will be limited. If limit_usage_by_mau
261# is true, this is implied to be true.
262#
263#mau_stats_only: False
264
265# Sometimes the server admin will want to ensure certain accounts are
266# never blocked by mau checking. These accounts are specified here.
267#
268#mau_limit_reserved_threepids:
269# - medium: 'email'
270# address: 'reserved_user@example.com'
271
272# Used by phonehome stats to group together related servers.
273#server_context: context
274
275# Whether to require a user to be in the room to add an alias to it.
276# Defaults to 'true'.
277#
278#require_membership_for_aliases: false
279
280# Whether to allow per-room membership profiles through the send of membership
281# events with profile information that differ from the target's global profile.
282# Defaults to 'true'.
283#
284#allow_per_room_profiles: false
285
286
287## TLS ##
288
289# PEM-encoded X509 certificate for TLS.
290# This certificate, as of Synapse 1.0, will need to be a valid and verifiable
291# certificate, signed by a recognised Certificate Authority.
292#
293# See 'ACME support' below to enable auto-provisioning this certificate via
294# Let's Encrypt.
295#
296# If supplying your own, be sure to use a `.pem` file that includes the
297# full certificate chain including any intermediate certificates (for
298# instance, if using certbot, use `fullchain.pem` as your certificate,
299# not `cert.pem`).
300#
301tls_certificate_path: "/etc/matrix-synapse/tls/fullchain.pem"
302
303# PEM-encoded private key for TLS
304#
305tls_private_key_path: "/etc/matrix-synapse/tls/privkey.pem"
306
307# Whether to verify TLS server certificates for outbound federation requests.
308#
309# Defaults to `true`. To disable certificate verification, uncomment the
310# following line.
311#
312# federation_verify_certificates: false
313
314# The minimum TLS version that will be used for outbound federation requests.
315#
316# Defaults to `1`. Configurable to `1`, `1.1`, `1.2`, or `1.3`. Note
317# that setting this value higher than `1.2` will prevent federation to most
318# of the public Matrix network: only configure it to `1.3` if you have an
319# entirely private federation setup and you can ensure TLS 1.3 support.
320#
321#federation_client_minimum_tls_version: 1.2
322
323# Skip federation certificate verification on the following whitelist
324# of domains.
325#
326# This setting should only be used in very specific cases, such as
327# federation over Tor hidden services and similar. For private networks
328# of homeservers, you likely want to use a private CA instead.
329#
330# Only effective if federation_verify_certicates is `true`.
331#
332#federation_certificate_verification_whitelist:
333# - lon.example.com
334# - *.domain.com
335# - *.onion
336
337# List of custom certificate authorities for federation traffic.
338#
339# This setting should only normally be used within a private network of
340# homeservers.
341#
342# Note that this list will replace those that are provided by your
343# operating environment. Certificates must be in PEM format.
344#
345#federation_custom_ca_list:
346# - myCA1.pem
347# - myCA2.pem
348# - myCA3.pem
349
350# ACME support: This will configure Synapse to request a valid TLS certificate
351# for your configured `server_name` via Let's Encrypt.
352#
353# Note that provisioning a certificate in this way requires port 80 to be
354# routed to Synapse so that it can complete the http-01 ACME challenge.
355# By default, if you enable ACME support, Synapse will attempt to listen on
356# port 80 for incoming http-01 challenges - however, this will likely fail
357# with 'Permission denied' or a similar error.
358#
359# There are a couple of potential solutions to this:
360#
361# * If you already have an Apache, Nginx, or similar listening on port 80,
362# you can configure Synapse to use an alternate port, and have your web
363# server forward the requests. For example, assuming you set 'port: 8009'
364# below, on Apache, you would write:
365#
366# ProxyPass /.well-known/acme-challenge http://localhost:8009/.well-known/acme-challenge
367#
368# * Alternatively, you can use something like `authbind` to give Synapse
369# permission to listen on port 80.
370#
371acme:
372 # ACME support is disabled by default. Uncomment the following line
373 # (and tls_certificate_path and tls_private_key_path above) to enable it.
374 #
375 #enabled: true
376
377 # Endpoint to use to request certificates. If you only want to test,
378 # use Let's Encrypt's staging url:
379 # https://acme-staging.api.letsencrypt.org/directory
380 #
381 #url: https://acme-v01.api.letsencrypt.org/directory
382
383 # Port number to listen on for the HTTP-01 challenge. Change this if
384 # you are forwarding connections through Apache/Nginx/etc.
385 #
386 #port: 80
387
388 # Local addresses to listen on for incoming connections.
389 # Again, you may want to change this if you are forwarding connections
390 # through Apache/Nginx/etc.
391 #
392 #bind_addresses: ['::', '0.0.0.0']
393
394 # How many days remaining on a certificate before it is renewed.
395 #
396 #reprovision_threshold: 30
397
398 # The domain that the certificate should be for. Normally this
399 # should be the same as your Matrix domain (i.e., 'server_name'), but,
400 # by putting a file at 'https://<server_name>/.well-known/matrix/server',
401 # you can delegate incoming traffic to another server. If you do that,
402 # you should give the target of the delegation here.
403 #
404 # For example: if your 'server_name' is 'example.com', but
405 # 'https://example.com/.well-known/matrix/server' delegates to
406 # 'matrix.example.com', you should put 'matrix.example.com' here.
407 #
408 # If not set, defaults to your 'server_name'.
409 #
410 #domain: matrix.example.com
411
412 # file to use for the account key. This will be generated if it doesn't
413 # exist.
414 #
415 # If unspecified, we will use CONFDIR/client.key.
416 #
417 account_key_file: /var/lib/matrix-synapse/acme_account.key
418
419# List of allowed TLS fingerprints for this server to publish along
420# with the signing keys for this server. Other matrix servers that
421# make HTTPS requests to this server will check that the TLS
422# certificates returned by this server match one of the fingerprints.
423#
424# Synapse automatically adds the fingerprint of its own certificate
425# to the list. So if federation traffic is handled directly by synapse
426# then no modification to the list is required.
427#
428# If synapse is run behind a load balancer that handles the TLS then it
429# will be necessary to add the fingerprints of the certificates used by
430# the loadbalancers to this list if they are different to the one
431# synapse is using.
432#
433# Homeservers are permitted to cache the list of TLS fingerprints
434# returned in the key responses up to the "valid_until_ts" returned in
435# key. It may be necessary to publish the fingerprints of a new
436# certificate and wait until the "valid_until_ts" of the previous key
437# responses have passed before deploying it.
438#
439# You can calculate a fingerprint from a given TLS listener via:
440# openssl s_client -connect $host:$port < /dev/null 2> /dev/null |
441# openssl x509 -outform DER | openssl sha256 -binary | base64 | tr -d '='
442# or by checking matrix.org/federationtester/api/report?server_name=$host
443#
444#tls_fingerprints: [{"sha256": "<base64_encoded_sha256_fingerprint>"}]
445
446
447
448## Database ##
449
450database:
451 # The database engine name
452 name: "sqlite3"
453 # Arguments to pass to the engine
454 args:
455 # Path to the database
456 database: "/var/lib/matrix-synapse/homeserver.db"
457
458# Number of events to cache in memory.
459#
460#event_cache_size: 10K
461
462
463## Logging ##
464
465# A yaml python logging config file
466#
467log_config: "/etc/matrix-synapse/log.yaml"
468
469
470## Ratelimiting ##
471
472# Ratelimiting settings for client actions (registration, login, messaging).
473#
474# Each ratelimiting configuration is made of two parameters:
475# - per_second: number of requests a client can send per second.
476# - burst_count: number of requests a client can send before being throttled.
477#
478# Synapse currently uses the following configurations:
479# - one for messages that ratelimits sending based on the account the client
480# is using
481# - one for registration that ratelimits registration requests based on the
482# client's IP address.
483# - one for login that ratelimits login requests based on the client's IP
484# address.
485# - one for login that ratelimits login requests based on the account the
486# client is attempting to log into.
487# - one for login that ratelimits login requests based on the account the
488# client is attempting to log into, based on the amount of failed login
489# attempts for this account.
490#
491# The defaults are as shown below.
492#
493#rc_message:
494# per_second: 0.2
495# burst_count: 10
496#
497#rc_registration:
498# per_second: 0.17
499# burst_count: 3
500#
501#rc_login:
502# address:
503# per_second: 0.17
504# burst_count: 3
505# account:
506# per_second: 0.17
507# burst_count: 3
508# failed_attempts:
509# per_second: 0.17
510# burst_count: 3
511
512
513# Ratelimiting settings for incoming federation
514#
515# The rc_federation configuration is made up of the following settings:
516# - window_size: window size in milliseconds
517# - sleep_limit: number of federation requests from a single server in
518# a window before the server will delay processing the request.
519# - sleep_delay: duration in milliseconds to delay processing events
520# from remote servers by if they go over the sleep limit.
521# - reject_limit: maximum number of concurrent federation requests
522# allowed from a single server
523# - concurrent: number of federation requests to concurrently process
524# from a single server
525#
526# The defaults are as shown below.
527#
528#rc_federation:
529# window_size: 1000
530# sleep_limit: 10
531# sleep_delay: 500
532# reject_limit: 50
533# concurrent: 3
534
535# Target outgoing federation transaction frequency for sending read-receipts,
536# per-room.
537#
538# If we end up trying to send out more read-receipts, they will get buffered up
539# into fewer transactions.
540#
541#federation_rr_transactions_per_room_per_second: 50
542
543
544
545# Directory where uploaded images and attachments are stored.
546#
547media_store_path: "/var/lib/matrix-synapse/media"
548
549# Media storage providers allow media to be stored in different
550# locations.
551#
552#media_storage_providers:
553# - module: file_system
554# # Whether to write new local files.
555# store_local: false
556# # Whether to write new remote media
557# store_remote: false
558# # Whether to block upload requests waiting for write to this
559# # provider to complete
560# store_synchronous: false
561# config:
562# directory: /mnt/some/other/directory
563
564# Directory where in-progress uploads are stored.
565#
566uploads_path: "/var/lib/matrix-synapse/uploads"
567
568# The largest allowed upload size in bytes
569#
570max_upload_size: 50M
571
572# Maximum number of pixels that will be thumbnailed
573#
574max_image_pixels: 32M
575
576# Whether to generate new thumbnails on the fly to precisely match
577# the resolution requested by the client. If true then whenever
578# a new resolution is requested by the client the server will
579# generate a new thumbnail. If false the server will pick a thumbnail
580# from a precalculated list.
581#
582#dynamic_thumbnails: false
583
584# List of thumbnails to precalculate when an image is uploaded.
585#
586#thumbnail_sizes:
587# - width: 32
588# height: 32
589# method: crop
590# - width: 96
591# height: 96
592# method: crop
593# - width: 320
594# height: 240
595# method: scale
596# - width: 640
597# height: 480
598# method: scale
599# - width: 800
600# height: 600
601# method: scale
602
603# Is the preview URL API enabled?
604#
605# 'false' by default: uncomment the following to enable it (and specify a
606# url_preview_ip_range_blacklist blacklist).
607#
608#url_preview_enabled: true
609
610# List of IP address CIDR ranges that the URL preview spider is denied
611# from accessing. There are no defaults: you must explicitly
612# specify a list for URL previewing to work. You should specify any
613# internal services in your network that you do not want synapse to try
614# to connect to, otherwise anyone in any Matrix room could cause your
615# synapse to issue arbitrary GET requests to your internal services,
616# causing serious security issues.
617#
618# (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
619# listed here, since they correspond to unroutable addresses.)
620#
621# This must be specified if url_preview_enabled is set. It is recommended that
622# you uncomment the following list as a starting point.
623#
624#url_preview_ip_range_blacklist:
625# - '127.0.0.0/8'
626# - '10.0.0.0/8'
627# - '172.16.0.0/12'
628# - '192.168.0.0/16'
629# - '100.64.0.0/10'
630# - '169.254.0.0/16'
631# - '::1/128'
632# - 'fe80::/64'
633# - 'fc00::/7'
634
635# List of IP address CIDR ranges that the URL preview spider is allowed
636# to access even if they are specified in url_preview_ip_range_blacklist.
637# This is useful for specifying exceptions to wide-ranging blacklisted
638# target IP ranges - e.g. for enabling URL previews for a specific private
639# website only visible in your network.
640#
641#url_preview_ip_range_whitelist:
642# - '192.168.1.1'
643
644# Optional list of URL matches that the URL preview spider is
645# denied from accessing. You should use url_preview_ip_range_blacklist
646# in preference to this, otherwise someone could define a public DNS
647# entry that points to a private IP address and circumvent the blacklist.
648# This is more useful if you know there is an entire shape of URL that
649# you know that will never want synapse to try to spider.
650#
651# Each list entry is a dictionary of url component attributes as returned
652# by urlparse.urlsplit as applied to the absolute form of the URL. See
653# https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit
654# The values of the dictionary are treated as an filename match pattern
655# applied to that component of URLs, unless they start with a ^ in which
656# case they are treated as a regular expression match. If all the
657# specified component matches for a given list item succeed, the URL is
658# blacklisted.
659#
660#url_preview_url_blacklist:
661# # blacklist any URL with a username in its URI
662# - username: '*'
663#
664# # blacklist all *.google.com URLs
665# - netloc: 'google.com'
666# - netloc: '*.google.com'
667#
668# # blacklist all plain HTTP URLs
669# - scheme: 'http'
670#
671# # blacklist http(s)://www.acme.com/foo
672# - netloc: 'www.acme.com'
673# path: '/foo'
674#
675# # blacklist any URL with a literal IPv4 address
676# - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'
677
678# The largest allowed URL preview spidering size in bytes
679#
680#max_spider_size: 10M
681
682
683## Captcha ##
684# See docs/CAPTCHA_SETUP for full details of configuring this.
685
686# This Home Server's ReCAPTCHA public key.
687#
688#recaptcha_public_key: "YOUR_PUBLIC_KEY"
689
690# This Home Server's ReCAPTCHA private key.
691#
692#recaptcha_private_key: "YOUR_PRIVATE_KEY"
693
694# Enables ReCaptcha checks when registering, preventing signup
695# unless a captcha is answered. Requires a valid ReCaptcha
696# public/private key.
697#
698#enable_registration_captcha: false
699
700# A secret key used to bypass the captcha test entirely.
701#
702#captcha_bypass_secret: "YOUR_SECRET_HERE"
703
704# The API endpoint to use for verifying m.login.recaptcha responses.
705#
706#recaptcha_siteverify_api: "https://www.recaptcha.net/recaptcha/api/siteverify"
707
708
709## TURN ##
710
711# The public URIs of the TURN server to give to clients
712#
713turn_uris: [ "turn:88.99.203.126:33478?transport=udp", "turn:88.99.203.126:33478?transport=tcp" ]
714
715# The shared secret used to compute passwords for the TURN server
716#
717#turn_shared_secret: "YOUR_SHARED_SECRET"
718turn_shared_secret: "UOVfAcl3sXdIV7G1IykW1zFC06BEPN33dNPz3x28oOLSLsYNC1ocQfiBiM7xKP4J"
719
720# The Username and password if the TURN server needs them and
721# does not use a token
722#
723#turn_username: "admin"
724#turn_password: "fedo$eeV@"
725
726# How long generated TURN credentials last
727#
728#turn_user_lifetime: 1h
729turn_user_lifetime: 1h
730
731# Whether guests should be allowed to use the TURN server.
732# This defaults to True, otherwise VoIP will be unreliable for guests.
733# However, it does introduce a slight security risk as it allows users to
734# connect to arbitrary endpoints without having first signed up for a
735# valid account (e.g. by passing a CAPTCHA).
736#
737turn_allow_guests: True
738
739
740## Registration ##
741#
742# Registration can be rate-limited using the parameters in the "Ratelimiting"
743# section of this file.
744
745# Enable registration for new users.
746#
747enable_registration: true
748
749# Optional account validity configuration. This allows for accounts to be denied
750# any request after a given period.
751#
752# ``enabled`` defines whether the account validity feature is enabled. Defaults
753# to False.
754#
755# ``period`` allows setting the period after which an account is valid
756# after its registration. When renewing the account, its validity period
757# will be extended by this amount of time. This parameter is required when using
758# the account validity feature.
759#
760# ``renew_at`` is the amount of time before an account's expiry date at which
761# Synapse will send an email to the account's email address with a renewal link.
762# This needs the ``email`` and ``public_baseurl`` configuration sections to be
763# filled.
764#
765# ``renew_email_subject`` is the subject of the email sent out with the renewal
766# link. ``%(app)s`` can be used as a placeholder for the ``app_name`` parameter
767# from the ``email`` section.
768#
769# Once this feature is enabled, Synapse will look for registered users without an
770# expiration date at startup and will add one to every account it found using the
771# current settings at that time.
772# This means that, if a validity period is set, and Synapse is restarted (it will
773# then derive an expiration date from the current validity period), and some time
774# after that the validity period changes and Synapse is restarted, the users'
775# expiration dates won't be updated unless their account is manually renewed. This
776# date will be randomly selected within a range [now + period - d ; now + period],
777# where d is equal to 10% of the validity period.
778#
779#account_validity:
780# enabled: True
781# period: 6w
782# renew_at: 1w
783# renew_email_subject: "Renew your %(app)s account"
784
785# The user must provide all of the below types of 3PID when registering.
786#
787#registrations_require_3pid:
788# - email
789# - msisdn
790
791# Explicitly disable asking for MSISDNs from the registration
792# flow (overrides registrations_require_3pid if MSISDNs are set as required)
793#
794#disable_msisdn_registration: true
795
796# Mandate that users are only allowed to associate certain formats of
797# 3PIDs with accounts on this server.
798#
799#allowed_local_3pids:
800# - medium: email
801# pattern: '.*@matrix\.org'
802# - medium: email
803# pattern: '.*@vector\.im'
804# - medium: msisdn
805# pattern: '\+44'
806
807# Enable 3PIDs lookup requests to identity servers from this server.
808#
809#enable_3pid_lookup: true
810
811# If set, allows registration of standard or admin accounts by anyone who
812# has the shared secret, even if registration is otherwise disabled.
813#
814# registration_shared_secret: <PRIVATE STRING>
815registration_shared_secret: "Q0GDCUCi2HI3MSAWxgRXKWOztMupdMnT"
816
817# Set the number of bcrypt rounds used to generate password hash.
818# Larger numbers increase the work factor needed to generate the hash.
819# The default number is 12 (which equates to 2^12 rounds).
820# N.B. that increasing this will exponentially increase the time required
821# to register or login - e.g. 24 => 2^24 rounds which will take >20 mins.
822#
823#bcrypt_rounds: 12
824
825# Allows users to register as guests without a password/email/etc, and
826# participate in rooms hosted on this server which have been made
827# accessible to anonymous users.
828#
829#allow_guest_access: false
830
831# The identity server which we suggest that clients should use when users log
832# in on this server.
833#
834# (By default, no suggestion is made, so it is left up to the client.
835# This setting is ignored unless public_baseurl is also set.)
836#
837#default_identity_server: https://matrix.org
838
839# The list of identity servers trusted to verify third party
840# identifiers by this server.
841#
842# Also defines the ID server which will be called when an account is
843# deactivated (one will be picked arbitrarily).
844#
845#trusted_third_party_id_servers:
846# - matrix.org
847# - vector.im
848
849# Users who register on this homeserver will automatically be joined
850# to these rooms
851#
852#auto_join_rooms:
853# - "#example:example.com"
854
855# Where auto_join_rooms are specified, setting this flag ensures that the
856# the rooms exist by creating them when the first user on the
857# homeserver registers.
858# Setting to false means that if the rooms are not manually created,
859# users cannot be auto-joined since they do not exist.
860#
861#autocreate_auto_join_rooms: true
862
863
864## Metrics ###
865
866# Enable collection and rendering of performance metrics
867#
868#enable_metrics: False
869
870# Enable sentry integration
871# NOTE: While attempts are made to ensure that the logs don't contain
872# any sensitive information, this cannot be guaranteed. By enabling
873# this option the sentry server may therefore receive sensitive
874# information, and it in turn may then diseminate sensitive information
875# through insecure notification channels if so configured.
876#
877#sentry:
878# dsn: "..."
879
880# Whether or not to report anonymized homeserver usage statistics.
881
882
883## API Configuration ##
884
885# A list of event types that will be included in the room_invite_state
886#
887#room_invite_state_types:
888# - "m.room.join_rules"
889# - "m.room.canonical_alias"
890# - "m.room.avatar"
891# - "m.room.encryption"
892# - "m.room.name"
893
894
895# A list of application service config files to use
896#
897#app_service_config_files:
898# - app_service_1.yaml
899# - app_service_2.yaml
900
901# Uncomment to enable tracking of application service IP addresses. Implicitly
902# enables MAU tracking for application service users.
903#
904#track_appservice_user_ips: True
905
906
907# a secret which is used to sign access tokens. If none is specified,
908# the registration_shared_secret is used, if one is given; otherwise,
909# a secret key is derived from the signing key.
910#
911# macaroon_secret_key: <PRIVATE STRING>
912
913# Used to enable access token expiration.
914#
915#expire_access_token: False
916
917# a secret which is used to calculate HMACs for form values, to stop
918# falsification of values. Must be specified for the User Consent
919# forms to work.
920#
921# form_secret: <PRIVATE STRING>
922
923## Signing Keys ##
924
925# Path to the signing key to sign messages with
926#
927signing_key_path: "/etc/matrix-synapse/homeserver.signing.key"
928
929# The keys that the server used to sign messages with but won't use
930# to sign new messages. E.g. it has lost its private key
931#
932#old_signing_keys:
933# "ed25519:auto":
934# # Base64 encoded public key
935# key: "The public part of your old signing key."
936# # Millisecond POSIX timestamp when the key expired.
937# expired_ts: 123456789123
938
939# How long key response published by this server is valid for.
940# Used to set the valid_until_ts in /key/v2 APIs.
941# Determines how quickly servers will query to check which keys
942# are still valid.
943#
944#key_refresh_interval: 1d
945
946# The trusted servers to download signing keys from.
947#
948# When we need to fetch a signing key, each server is tried in parallel.
949#
950# Normally, the connection to the key server is validated via TLS certificates.
951# Additional security can be provided by configuring a `verify key`, which
952# will make synapse check that the response is signed by that key.
953#
954# This setting supercedes an older setting named `perspectives`. The old format
955# is still supported for backwards-compatibility, but it is deprecated.
956#
957# Options for each entry in the list include:
958#
959# server_name: the name of the server. required.
960#
961# verify_keys: an optional map from key id to base64-encoded public key.
962# If specified, we will check that the response is signed by at least
963# one of the given keys.
964#
965# accept_keys_insecurely: a boolean. Normally, if `verify_keys` is unset,
966# and federation_verify_certificates is not `true`, synapse will refuse
967# to start, because this would allow anyone who can spoof DNS responses
968# to masquerade as the trusted key server. If you know what you are doing
969# and are sure that your network environment provides a secure connection
970# to the key server, you can set this to `true` to override this
971# behaviour.
972#
973# An example configuration might look like:
974#
975#trusted_key_servers:
976# - server_name: "my_trusted_server.example.com"
977# verify_keys:
978# "ed25519:auto": "abcdefghijklmnopqrstuvwxyzabcdefghijklmopqr"
979# - server_name: "my_other_trusted_server.example.com"
980#
981# The default configuration is:
982#
983#trusted_key_servers:
984# - server_name: "matrix.org"
985
986
987# Enable SAML2 for registration and login. Uses pysaml2.
988#
989# `sp_config` is the configuration for the pysaml2 Service Provider.
990# See pysaml2 docs for format of config.
991#
992# Default values will be used for the 'entityid' and 'service' settings,
993# so it is not normally necessary to specify them unless you need to
994# override them.
995#
996# Once SAML support is enabled, a metadata file will be exposed at
997# https://<server>:<port>/_matrix/saml2/metadata.xml, which you may be able to
998# use to configure your SAML IdP with. Alternatively, you can manually configure
999# the IdP to use an ACS location of
1000# https://<server>:<port>/_matrix/saml2/authn_response.
1001#
1002#saml2_config:
1003# sp_config:
1004# # point this to the IdP's metadata. You can use either a local file or
1005# # (preferably) a URL.
1006# metadata:
1007# #local: ["saml2/idp.xml"]
1008# remote:
1009# - url: https://our_idp/metadata.xml
1010#
1011# # By default, the user has to go to our login page first. If you'd like to
1012# # allow IdP-initiated login, set 'allow_unsolicited: True' in a
1013# # 'service.sp' section:
1014# #
1015# #service:
1016# # sp:
1017# # allow_unsolicited: True
1018#
1019# # The examples below are just used to generate our metadata xml, and you
1020# # may well not need it, depending on your setup. Alternatively you
1021# # may need a whole lot more detail - see the pysaml2 docs!
1022#
1023# description: ["My awesome SP", "en"]
1024# name: ["Test SP", "en"]
1025#
1026# organization:
1027# name: Example com
1028# display_name:
1029# - ["Example co", "en"]
1030# url: "http://example.com"
1031#
1032# contact_person:
1033# - given_name: Bob
1034# sur_name: "the Sysadmin"
1035# email_address": ["admin@example.com"]
1036# contact_type": technical
1037#
1038# # Instead of putting the config inline as above, you can specify a
1039# # separate pysaml2 configuration file:
1040# #
1041# config_path: "/etc/matrix-synapse/sp_conf.py"
1042#
1043# # the lifetime of a SAML session. This defines how long a user has to
1044# # complete the authentication process, if allow_unsolicited is unset.
1045# # The default is 5 minutes.
1046# #
1047# # saml_session_lifetime: 5m
1048
1049
1050
1051# Enable CAS for registration and login.
1052#
1053#cas_config:
1054# enabled: true
1055# server_url: "https://cas-server.com"
1056# service_url: "https://homeserver.domain.com:8448"
1057# #required_attributes:
1058# # name: value
1059
1060
1061# The JWT needs to contain a globally unique "sub" (subject) claim.
1062#
1063#jwt_config:
1064# enabled: true
1065# secret: "a secret"
1066# algorithm: "HS256"
1067
1068
1069password_config:
1070 # Uncomment to disable password login
1071 #
1072 #enabled: false
1073
1074 # Uncomment to disable authentication against the local password
1075 # database. This is ignored if `enabled` is false, and is only useful
1076 # if you have other password_providers.
1077 #
1078 #localdb_enabled: false
1079
1080 # Uncomment and change to a secret random string for extra security.
1081 # DO NOT CHANGE THIS AFTER INITIAL SETUP!
1082 #
1083 #pepper: "EVEN_MORE_SECRET"
1084
1085
1086
1087# Enable sending emails for password resets, notification events or
1088# account expiry notices
1089#
1090# If your SMTP server requires authentication, the optional smtp_user &
1091# smtp_pass variables should be used
1092#
1093#email:
1094# enable_notifs: false
1095# smtp_host: "localhost"
1096# smtp_port: 25 # SSL: 465, STARTTLS: 587
1097# smtp_user: "exampleusername"
1098# smtp_pass: "examplepassword"
1099# require_transport_security: False
1100# notif_from: "Your Friendly %(app)s Home Server <noreply@example.com>"
1101# app_name: Matrix
1102#
1103# # Enable email notifications by default
1104# #
1105# notif_for_new_users: True
1106#
1107# # Defining a custom URL for Riot is only needed if email notifications
1108# # should contain links to a self-hosted installation of Riot; when set
1109# # the "app_name" setting is ignored
1110# #
1111# riot_base_url: "http://localhost/riot"
1112#
1113# # Enable sending password reset emails via the configured, trusted
1114# # identity servers
1115# #
1116# # IMPORTANT! This will give a malicious or overtaken identity server
1117# # the ability to reset passwords for your users! Make absolutely sure
1118# # that you want to do this! It is strongly recommended that password
1119# # reset emails be sent by the homeserver instead
1120# #
1121# # If this option is set to false and SMTP options have not been
1122# # configured, resetting user passwords via email will be disabled
1123# #
1124# #trust_identity_server_for_password_resets: false
1125#
1126# # Configure the time that a validation email or text message code
1127# # will expire after sending
1128# #
1129# # This is currently used for password resets
1130# #
1131# #validation_token_lifetime: 1h
1132#
1133# # Template directory. All template files should be stored within this
1134# # directory. If not set, default templates from within the Synapse
1135# # package will be used
1136# #
1137# # For the list of default templates, please see
1138# # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
1139# #
1140# #template_dir: res/templates
1141#
1142# # Templates for email notifications
1143# #
1144# notif_template_html: notif_mail.html
1145# notif_template_text: notif_mail.txt
1146#
1147# # Templates for account expiry notices
1148# #
1149# expiry_template_html: notice_expiry.html
1150# expiry_template_text: notice_expiry.txt
1151#
1152# # Templates for password reset emails sent by the homeserver
1153# #
1154# #password_reset_template_html: password_reset.html
1155# #password_reset_template_text: password_reset.txt
1156#
1157# # Templates for password reset success and failure pages that a user
1158# # will see after attempting to reset their password
1159# #
1160# #password_reset_template_success_html: password_reset_success.html
1161# #password_reset_template_failure_html: password_reset_failure.html
1162
1163
1164#password_providers:
1165# - module: "ldap_auth_provider.LdapAuthProvider"
1166# config:
1167# enabled: true
1168# uri: "ldap://ldap.example.com:389"
1169# start_tls: true
1170# base: "ou=users,dc=example,dc=com"
1171# attributes:
1172# uid: "cn"
1173# mail: "email"
1174# name: "givenName"
1175# #bind_dn:
1176# #bind_password:
1177# #filter: "(objectClass=posixAccount)"
1178
1179
1180
1181# Clients requesting push notifications can either have the body of
1182# the message sent in the notification poke along with other details
1183# like the sender, or just the event ID and room ID (`event_id_only`).
1184# If clients choose the former, this option controls whether the
1185# notification request includes the content of the event (other details
1186# like the sender are still included). For `event_id_only` push, it
1187# has no effect.
1188#
1189# For modern android devices the notification content will still appear
1190# because it is loaded by the app. iPhone, however will send a
1191# notification saying only that a message arrived and who it came from.
1192#
1193push:
1194 include_content: true
1195
1196
1197#spam_checker:
1198# module: "my_custom_project.SuperSpamChecker"
1199# config:
1200# example_option: 'things'
1201
1202
1203# Uncomment to allow non-server-admin users to create groups on this server
1204#
1205enable_group_creation: true
1206
1207# If enabled, non server admins can only create groups with local parts
1208# starting with this prefix
1209#
1210#group_creation_prefix: "unofficial/"
1211
1212
1213
1214# User Directory configuration
1215#
1216# 'enabled' defines whether users can search the user directory. If
1217# false then empty responses are returned to all queries. Defaults to
1218# true.
1219#
1220# 'search_all_users' defines whether to search all users visible to your HS
1221# when searching the user directory, rather than limiting to users visible
1222# in public rooms. Defaults to false. If you set it True, you'll have to
1223# rebuild the user_directory search indexes, see
1224# https://github.com/matrix-org/synapse/blob/master/docs/user_directory.md
1225#
1226user_directory:
1227 enabled: true
1228 search_all_users: true
1229
1230
1231# User Consent configuration
1232#
1233# for detailed instructions, see
1234# https://github.com/matrix-org/synapse/blob/master/docs/consent_tracking.md
1235#
1236# Parts of this section are required if enabling the 'consent' resource under
1237# 'listeners', in particular 'template_dir' and 'version'.
1238#
1239# 'template_dir' gives the location of the templates for the HTML forms.
1240# This directory should contain one subdirectory per language (eg, 'en', 'fr'),
1241# and each language directory should contain the policy document (named as
1242# '<version>.html') and a success page (success.html).
1243#
1244# 'version' specifies the 'current' version of the policy document. It defines
1245# the version to be served by the consent resource if there is no 'v'
1246# parameter.
1247#
1248# 'server_notice_content', if enabled, will send a user a "Server Notice"
1249# asking them to consent to the privacy policy. The 'server_notices' section
1250# must also be configured for this to work. Notices will *not* be sent to
1251# guest users unless 'send_server_notice_to_guests' is set to true.
1252#
1253# 'block_events_error', if set, will block any attempts to send events
1254# until the user consents to the privacy policy. The value of the setting is
1255# used as the text of the error.
1256#
1257# 'require_at_registration', if enabled, will add a step to the registration
1258# process, similar to how captcha works. Users will be required to accept the
1259# policy before their account is created.
1260#
1261# 'policy_name' is the display name of the policy users will see when registering
1262# for an account. Has no effect unless `require_at_registration` is enabled.
1263# Defaults to "Privacy Policy".
1264#
1265#user_consent:
1266# template_dir: res/templates/privacy
1267# version: 1.0
1268# server_notice_content:
1269# msgtype: m.text
1270# body: >-
1271# To continue using this homeserver you must review and agree to the
1272# terms and conditions at %(consent_uri)s
1273# send_server_notice_to_guests: True
1274# block_events_error: >-
1275# To continue using this homeserver you must review and agree to the
1276# terms and conditions at %(consent_uri)s
1277# require_at_registration: False
1278# policy_name: Privacy Policy
1279#
1280
1281
1282
1283# Local statistics collection. Used in populating the room directory.
1284#
1285# 'bucket_size' controls how large each statistics timeslice is. It can
1286# be defined in a human readable short form -- e.g. "1d", "1y".
1287#
1288# 'retention' controls how long historical statistics will be kept for.
1289# It can be defined in a human readable short form -- e.g. "1d", "1y".
1290#
1291#
1292#stats:
1293# enabled: true
1294# bucket_size: 1d
1295# retention: 1y
1296
1297
1298# Server Notices room configuration
1299#
1300# Uncomment this section to enable a room which can be used to send notices
1301# from the server to users. It is a special room which cannot be left; notices
1302# come from a special "notices" user id.
1303#
1304# If you uncomment this section, you *must* define the system_mxid_localpart
1305# setting, which defines the id of the user which will be used to send the
1306# notices.
1307#
1308# It's also possible to override the room name, the display name of the
1309# "notices" user, and the avatar for the user.
1310#
1311#server_notices:
1312# system_mxid_localpart: notices
1313# system_mxid_display_name: "Server Notices"
1314# system_mxid_avatar_url: "mxc://server.com/oumMVlgDnLYFaPVkExemNVVZ"
1315# room_name: "Server Notices"
1316
1317
1318
1319# Uncomment to disable searching the public room list. When disabled
1320# blocks searching local and remote room lists for local and remote
1321# users by always returning an empty list for all queries.
1322#
1323enable_room_list_search: true
1324
1325# The `alias_creation` option controls who's allowed to create aliases
1326# on this server.
1327#
1328# The format of this option is a list of rules that contain globs that
1329# match against user_id, room_id and the new alias (fully qualified with
1330# server name). The action in the first rule that matches is taken,
1331# which can currently either be "allow" or "deny".
1332#
1333# Missing user_id/room_id/alias fields default to "*".
1334#
1335# If no rules match the request is denied. An empty list means no one
1336# can create aliases.
1337#
1338# Options for the rules include:
1339#
1340# user_id: Matches against the creator of the alias
1341# alias: Matches against the alias being created
1342# room_id: Matches against the room ID the alias is being pointed at
1343# action: Whether to "allow" or "deny" the request if the rule matches
1344#
1345# The default is:
1346#
1347#alias_creation_rules:
1348# - user_id: "*"
1349# alias: "*"
1350# room_id: "*"
1351# action: allow
1352
1353# The `room_list_publication_rules` option controls who can publish and
1354# which rooms can be published in the public room list.
1355#
1356# The format of this option is the same as that for
1357# `alias_creation_rules`.
1358#
1359# If the room has one or more aliases associated with it, only one of
1360# the aliases needs to match the alias rule. If there are no aliases
1361# then only rules with `alias: *` match.
1362#
1363# If no rules match the request is denied. An empty list means no one
1364# can publish rooms.
1365#
1366# Options for the rules include:
1367#
1368# user_id: Matches agaisnt the creator of the alias
1369# room_id: Matches against the room ID being published
1370# alias: Matches against any current local or canonical aliases
1371# associated with the room
1372# action: Whether to "allow" or "deny" the request if the rule matches
1373#
1374# The default is:
1375#
1376#room_list_publication_rules:
1377# - user_id: "*"
1378# alias: "*"
1379# room_id: "*"
1380# action: allow
1381
1382
1383# Server admins can define a Python module that implements extra rules for
1384# allowing or denying incoming events. In order to work, this module needs to
1385# override the methods defined in synapse/events/third_party_rules.py.
1386#
1387# This feature is designed to be used in closed federations only, where each
1388# participating server enforces the same rules.
1389#
1390#third_party_event_rules:
1391# module: "my_custom_project.SuperRulesSet"
1392# config:
1393# example_option: 'things'