Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

698 lines
22 KiB

  1. # vim:ft=yaml
  2. # PEM encoded X509 certificate for TLS.
  3. # You can replace the self-signed certificate that synapse
  4. # autogenerates on launch with your own SSL certificate + key pair
  5. # if you like. Any required intermediary certificates can be
  6. # appended after the primary certificate in hierarchical order.
  7. tls_certificate_path: "/data/{{ hostname_matrix }}.tls.crt"
  8. # PEM encoded private key for TLS
  9. tls_private_key_path: "/data/{{ hostname_matrix }}.tls.key"
  10. # PEM dh parameters for ephemeral keys
  11. tls_dh_params_path: "/data/{{ hostname_matrix }}.tls.dh"
  12. # Don't bind to the https port
  13. no_tls: False
  14. # List of allowed TLS fingerprints for this server to publish along
  15. # with the signing keys for this server. Other matrix servers that
  16. # make HTTPS requests to this server will check that the TLS
  17. # certificates returned by this server match one of the fingerprints.
  18. #
  19. # Synapse automatically adds the fingerprint of its own certificate
  20. # to the list. So if federation traffic is handled directly by synapse
  21. # then no modification to the list is required.
  22. #
  23. # If synapse is run behind a load balancer that handles the TLS then it
  24. # will be necessary to add the fingerprints of the certificates used by
  25. # the loadbalancers to this list if they are different to the one
  26. # synapse is using.
  27. #
  28. # Homeservers are permitted to cache the list of TLS fingerprints
  29. # returned in the key responses up to the "valid_until_ts" returned in
  30. # key. It may be necessary to publish the fingerprints of a new
  31. # certificate and wait until the "valid_until_ts" of the previous key
  32. # responses have passed before deploying it.
  33. #
  34. # You can calculate a fingerprint from a given TLS listener via:
  35. # openssl s_client -connect $host:$port < /dev/null 2> /dev/null |
  36. # openssl x509 -outform DER | openssl sha256 -binary | base64 | tr -d '='
  37. # or by checking matrix.org/federationtester/api/report?server_name=$host
  38. #
  39. tls_fingerprints: []
  40. # tls_fingerprints: [{"sha256": "<base64_encoded_sha256_fingerprint>"}]
  41. ## Server ##
  42. # The domain name of the server, with optional explicit port.
  43. # This is used by remote servers to connect to this server,
  44. # e.g. matrix.org, localhost:8080, etc.
  45. # This is also the last part of your UserID.
  46. server_name: "{{ hostname_identity }}"
  47. # When running as a daemon, the file to store the pid in
  48. pid_file: /homeserver.pid
  49. # CPU affinity mask. Setting this restricts the CPUs on which the
  50. # process will be scheduled. It is represented as a bitmask, with the
  51. # lowest order bit corresponding to the first logical CPU and the
  52. # highest order bit corresponding to the last logical CPU. Not all CPUs
  53. # may exist on a given system but a mask may specify more CPUs than are
  54. # present.
  55. #
  56. # For example:
  57. # 0x00000001 is processor #0,
  58. # 0x00000003 is processors #0 and #1,
  59. # 0xFFFFFFFF is all processors (#0 through #31).
  60. #
  61. # Pinning a Python process to a single CPU is desirable, because Python
  62. # is inherently single-threaded due to the GIL, and can suffer a
  63. # 30-40% slowdown due to cache blow-out and thread context switching
  64. # if the scheduler happens to schedule the underlying threads across
  65. # different cores. See
  66. # https://www.mirantis.com/blog/improve-performance-python-programs-restricting-single-cpu/.
  67. #
  68. # cpu_affinity: 0xFFFFFFFF
  69. # Whether to serve a web client from the HTTP/HTTPS root resource.
  70. web_client: False
  71. # The root directory to server for the above web client.
  72. # If left undefined, synapse will serve the matrix-angular-sdk web client.
  73. # Make sure matrix-angular-sdk is installed with pip if web_client is True
  74. # and web_client_location is undefined
  75. # web_client_location: "/path/to/web/root"
  76. # The public-facing base URL for the client API (not including _matrix/...)
  77. public_baseurl: https://{{ hostname_matrix }}/
  78. # Set the soft limit on the number of file descriptors synapse can use
  79. # Zero is used to indicate synapse should set the soft limit to the
  80. # hard limit.
  81. soft_file_limit: 0
  82. # The GC threshold parameters to pass to `gc.set_threshold`, if defined
  83. # gc_thresholds: [700, 10, 10]
  84. # Set the limit on the returned events in the timeline in the get
  85. # and sync operations. The default value is -1, means no upper limit.
  86. # filter_timeline_limit: 5000
  87. # Whether room invites to users on this server should be blocked
  88. # (except those sent by local server admins). The default is False.
  89. # block_non_admin_invites: True
  90. # Restrict federation to the following whitelist of domains.
  91. # N.B. we recommend also firewalling your federation listener to limit
  92. # inbound federation traffic as early as possible, rather than relying
  93. # purely on this application-layer restriction. If not specified, the
  94. # default is to whitelist everything.
  95. #
  96. # federation_domain_whitelist:
  97. # - lon.example.com
  98. # - nyc.example.com
  99. # - syd.example.com
  100. # List of ports that Synapse should listen on, their purpose and their
  101. # configuration.
  102. listeners:
  103. # Main HTTPS listener
  104. # For when matrix traffic is sent directly to synapse.
  105. -
  106. # The port to listen for HTTPS requests on.
  107. port: 8448
  108. # Local addresses to listen on.
  109. # On Linux and Mac OS, `::` will listen on all IPv4 and IPv6
  110. # addresses by default. For most other OSes, this will only listen
  111. # on IPv6.
  112. bind_addresses:
  113. - '::'
  114. - '0.0.0.0'
  115. # This is a 'http' listener, allows us to specify 'resources'.
  116. type: http
  117. tls: true
  118. # Use the X-Forwarded-For (XFF) header as the client IP and not the
  119. # actual client IP.
  120. x_forwarded: false
  121. # List of HTTP resources to serve on this listener.
  122. resources:
  123. -
  124. # List of resources to host on this listener.
  125. names:
  126. - client # The client-server APIs, both v1 and v2
  127. - webclient # The bundled webclient.
  128. # Should synapse compress HTTP responses to clients that support it?
  129. # This should be disabled if running synapse behind a load balancer
  130. # that can do automatic compression.
  131. compress: true
  132. - names: [federation] # Federation APIs
  133. compress: false
  134. # optional list of additional endpoints which can be loaded via
  135. # dynamic modules
  136. # additional_resources:
  137. # "/_matrix/my/custom/endpoint":
  138. # module: my_module.CustomRequestHandler
  139. # config: {}
  140. # Unsecure HTTP listener,
  141. # For when matrix traffic passes through loadbalancer that unwraps TLS.
  142. - port: 8008
  143. tls: false
  144. bind_addresses: ['::', '0.0.0.0']
  145. type: http
  146. x_forwarded: true
  147. resources:
  148. - names: [client, webclient]
  149. compress: true
  150. - names: [federation]
  151. compress: false
  152. # Turn on the twisted ssh manhole service on localhost on the given
  153. # port.
  154. # - port: 9000
  155. # bind_addresses: ['::1', '127.0.0.1']
  156. # type: manhole
  157. # Database configuration
  158. database:
  159. # The database engine name
  160. name: "psycopg2"
  161. args:
  162. user: "{{ matrix_postgres_connection_username }}"
  163. password: "{{ matrix_postgres_connection_password }}"
  164. database: "{{ matrix_postgres_db_name }}"
  165. host: "{{ matrix_postgres_connection_hostname }}"
  166. cp_min: 5
  167. cp_max: 10
  168. # Number of events to cache in memory.
  169. event_cache_size: "10K"
  170. # A yaml python logging config file
  171. log_config: "/data/{{ hostname_matrix }}.log.config"
  172. ## Ratelimiting ##
  173. # Number of messages a client can send per second
  174. rc_messages_per_second: 0.2
  175. # Number of message a client can send before being throttled
  176. rc_message_burst_count: 10.0
  177. # The federation window size in milliseconds
  178. federation_rc_window_size: 1000
  179. # The number of federation requests from a single server in a window
  180. # before the server will delay processing the request.
  181. federation_rc_sleep_limit: 10
  182. # The duration in milliseconds to delay processing events from
  183. # remote servers by if they go over the sleep limit.
  184. federation_rc_sleep_delay: 500
  185. # The maximum number of concurrent federation requests allowed
  186. # from a single server
  187. federation_rc_reject_limit: 50
  188. # The number of federation requests to concurrently process from a
  189. # single server
  190. federation_rc_concurrent: 3
  191. # Directory where uploaded images and attachments are stored.
  192. media_store_path: "/matrix-storage/media-store"
  193. # Media storage providers allow media to be stored in different
  194. # locations.
  195. # media_storage_providers:
  196. # - module: file_system
  197. # # Whether to write new local files.
  198. # store_local: false
  199. # # Whether to write new remote media
  200. # store_remote: false
  201. # # Whether to block upload requests waiting for write to this
  202. # # provider to complete
  203. # store_synchronous: false
  204. # config:
  205. # directory: /mnt/some/other/directory
  206. # Directory where in-progress uploads are stored.
  207. uploads_path: "/matrix-run/uploads"
  208. # The largest allowed upload size in bytes
  209. max_upload_size: "{{ matrix_synapse_max_upload_size_mb }}M"
  210. # Maximum number of pixels that will be thumbnailed
  211. max_image_pixels: "32M"
  212. # Whether to generate new thumbnails on the fly to precisely match
  213. # the resolution requested by the client. If true then whenever
  214. # a new resolution is requested by the client the server will
  215. # generate a new thumbnail. If false the server will pick a thumbnail
  216. # from a precalculated list.
  217. dynamic_thumbnails: false
  218. # List of thumbnail to precalculate when an image is uploaded.
  219. thumbnail_sizes:
  220. - width: 32
  221. height: 32
  222. method: crop
  223. - width: 96
  224. height: 96
  225. method: crop
  226. - width: 320
  227. height: 240
  228. method: scale
  229. - width: 640
  230. height: 480
  231. method: scale
  232. - width: 800
  233. height: 600
  234. method: scale
  235. # Is the preview URL API enabled? If enabled, you *must* specify
  236. # an explicit url_preview_ip_range_blacklist of IPs that the spider is
  237. # denied from accessing.
  238. url_preview_enabled: True
  239. # List of IP address CIDR ranges that the URL preview spider is denied
  240. # from accessing. There are no defaults: you must explicitly
  241. # specify a list for URL previewing to work. You should specify any
  242. # internal services in your network that you do not want synapse to try
  243. # to connect to, otherwise anyone in any Matrix room could cause your
  244. # synapse to issue arbitrary GET requests to your internal services,
  245. # causing serious security issues.
  246. #
  247. url_preview_ip_range_blacklist:
  248. - '127.0.0.0/8'
  249. - '10.0.0.0/8'
  250. - '172.16.0.0/12'
  251. - '192.168.0.0/16'
  252. - '100.64.0.0/10'
  253. - '169.254.0.0/16'
  254. - '::1/128'
  255. - 'fe80::/64'
  256. - 'fc00::/7'
  257. #
  258. # List of IP address CIDR ranges that the URL preview spider is allowed
  259. # to access even if they are specified in url_preview_ip_range_blacklist.
  260. # This is useful for specifying exceptions to wide-ranging blacklisted
  261. # target IP ranges - e.g. for enabling URL previews for a specific private
  262. # website only visible in your network.
  263. #
  264. # url_preview_ip_range_whitelist:
  265. # - '192.168.1.1'
  266. # Optional list of URL matches that the URL preview spider is
  267. # denied from accessing. You should use url_preview_ip_range_blacklist
  268. # in preference to this, otherwise someone could define a public DNS
  269. # entry that points to a private IP address and circumvent the blacklist.
  270. # This is more useful if you know there is an entire shape of URL that
  271. # you know that will never want synapse to try to spider.
  272. #
  273. # Each list entry is a dictionary of url component attributes as returned
  274. # by urlparse.urlsplit as applied to the absolute form of the URL. See
  275. # https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit
  276. # The values of the dictionary are treated as an filename match pattern
  277. # applied to that component of URLs, unless they start with a ^ in which
  278. # case they are treated as a regular expression match. If all the
  279. # specified component matches for a given list item succeed, the URL is
  280. # blacklisted.
  281. #
  282. # url_preview_url_blacklist:
  283. # # blacklist any URL with a username in its URI
  284. # - username: '*'
  285. #
  286. # # blacklist all *.google.com URLs
  287. # - netloc: 'google.com'
  288. # - netloc: '*.google.com'
  289. #
  290. # # blacklist all plain HTTP URLs
  291. # - scheme: 'http'
  292. #
  293. # # blacklist http(s)://www.acme.com/foo
  294. # - netloc: 'www.acme.com'
  295. # path: '/foo'
  296. #
  297. # # blacklist any URL with a literal IPv4 address
  298. # - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'
  299. # The largest allowed URL preview spidering size in bytes
  300. max_spider_size: "10M"
  301. ## Captcha ##
  302. # See docs/CAPTCHA_SETUP for full details of configuring this.
  303. # This Home Server's ReCAPTCHA public key.
  304. recaptcha_public_key: "YOUR_PUBLIC_KEY"
  305. # This Home Server's ReCAPTCHA private key.
  306. recaptcha_private_key: "YOUR_PRIVATE_KEY"
  307. # Enables ReCaptcha checks when registering, preventing signup
  308. # unless a captcha is answered. Requires a valid ReCaptcha
  309. # public/private key.
  310. enable_registration_captcha: False
  311. # A secret key used to bypass the captcha test entirely.
  312. #captcha_bypass_secret: "YOUR_SECRET_HERE"
  313. # The API endpoint to use for verifying m.login.recaptcha responses.
  314. recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify"
  315. ## Turn ##
  316. # The public URIs of the TURN server to give to clients
  317. turn_uris: ["turn:{{ hostname_matrix }}:3478?transport=udp", "turn:{{ hostname_matrix }}:3478?transport=tcp"]
  318. # The shared secret used to compute passwords for the TURN server
  319. turn_shared_secret: "{{ matrix_coturn_turn_static_auth_secret }}"
  320. # The Username and password if the TURN server needs them and
  321. # does not use a token
  322. #turn_username: "TURNSERVER_USERNAME"
  323. #turn_password: "TURNSERVER_PASSWORD"
  324. # How long generated TURN credentials last
  325. turn_user_lifetime: "1h"
  326. # Whether guests should be allowed to use the TURN server.
  327. # This defaults to True, otherwise VoIP will be unreliable for guests.
  328. # However, it does introduce a slight security risk as it allows users to
  329. # connect to arbitrary endpoints without having first signed up for a
  330. # valid account (e.g. by passing a CAPTCHA).
  331. turn_allow_guests: False
  332. ## Registration ##
  333. # Enable registration for new users.
  334. enable_registration: False
  335. # The user must provide all of the below types of 3PID when registering.
  336. #
  337. # registrations_require_3pid:
  338. # - email
  339. # - msisdn
  340. # Mandate that users are only allowed to associate certain formats of
  341. # 3PIDs with accounts on this server.
  342. #
  343. # allowed_local_3pids:
  344. # - medium: email
  345. # pattern: ".*@matrix\.org"
  346. # - medium: email
  347. # pattern: ".*@vector\.im"
  348. # - medium: msisdn
  349. # pattern: "\+44"
  350. # If set, allows registration by anyone who also has the shared
  351. # secret, even if registration is otherwise disabled.
  352. registration_shared_secret: "{{ matrix_synapse_registration_shared_secret }}"
  353. # Set the number of bcrypt rounds used to generate password hash.
  354. # Larger numbers increase the work factor needed to generate the hash.
  355. # The default number is 12 (which equates to 2^12 rounds).
  356. # N.B. that increasing this will exponentially increase the time required
  357. # to register or login - e.g. 24 => 2^24 rounds which will take >20 mins.
  358. bcrypt_rounds: 12
  359. # Allows users to register as guests without a password/email/etc, and
  360. # participate in rooms hosted on this server which have been made
  361. # accessible to anonymous users.
  362. allow_guest_access: False
  363. # The list of identity servers trusted to verify third party
  364. # identifiers by this server.
  365. trusted_third_party_id_servers:
  366. - matrix.org
  367. - vector.im
  368. - riot.im
  369. # Users who register on this homeserver will automatically be joined
  370. # to these rooms
  371. #auto_join_rooms:
  372. # - "#example:example.com"
  373. ## Metrics ###
  374. # Enable collection and rendering of performance metrics
  375. enable_metrics: False
  376. report_stats: False
  377. ## API Configuration ##
  378. # A list of event types that will be included in the room_invite_state
  379. room_invite_state_types:
  380. - "m.room.join_rules"
  381. - "m.room.canonical_alias"
  382. - "m.room.avatar"
  383. - "m.room.name"
  384. # A list of application service config file to use
  385. app_service_config_files: []
  386. macaroon_secret_key: "{{ matrix_synapse_macaroon_secret_key }}"
  387. # Used to enable access token expiration.
  388. expire_access_token: False
  389. # a secret which is used to calculate HMACs for form values, to stop
  390. # falsification of values
  391. form_secret: "{{ matrix_synapse_form_secret }}"
  392. ## Signing Keys ##
  393. # Path to the signing key to sign messages with
  394. signing_key_path: "/data/{{ hostname_matrix }}.signing.key"
  395. # The keys that the server used to sign messages with but won't use
  396. # to sign new messages. E.g. it has lost its private key
  397. old_signing_keys: {}
  398. # "ed25519:auto":
  399. # # Base64 encoded public key
  400. # key: "The public part of your old signing key."
  401. # # Millisecond POSIX timestamp when the key expired.
  402. # expired_ts: 123456789123
  403. # How long key response published by this server is valid for.
  404. # Used to set the valid_until_ts in /key/v2 APIs.
  405. # Determines how quickly servers will query to check which keys
  406. # are still valid.
  407. key_refresh_interval: "1d" # 1 Day.
  408. # The trusted servers to download signing keys from.
  409. perspectives:
  410. servers:
  411. "matrix.org":
  412. verify_keys:
  413. "ed25519:auto":
  414. key: "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw"
  415. # Enable SAML2 for registration and login. Uses pysaml2
  416. # config_path: Path to the sp_conf.py configuration file
  417. # idp_redirect_url: Identity provider URL which will redirect
  418. # the user back to /login/saml2 with proper info.
  419. # See pysaml2 docs for format of config.
  420. #saml2_config:
  421. # enabled: true
  422. # config_path: "/data/sp_conf.py"
  423. # idp_redirect_url: "http://{{ hostname_matrix }}/idp"
  424. # Enable CAS for registration and login.
  425. #cas_config:
  426. # enabled: true
  427. # server_url: "https://cas-server.com"
  428. # service_url: "https://homeserver.domain.com:8448"
  429. # #required_attributes:
  430. # # name: value
  431. # The JWT needs to contain a globally unique "sub" (subject) claim.
  432. #
  433. # jwt_config:
  434. # enabled: true
  435. # secret: "a secret"
  436. # algorithm: "HS256"
  437. # Enable password for login.
  438. password_config:
  439. enabled: true
  440. # Uncomment and change to a secret random string for extra security.
  441. # DO NOT CHANGE THIS AFTER INITIAL SETUP!
  442. #pepper: ""
  443. # Enable sending emails for notification events
  444. # Defining a custom URL for Riot is only needed if email notifications
  445. # should contain links to a self-hosted installation of Riot; when set
  446. # the "app_name" setting is ignored.
  447. #
  448. # If your SMTP server requires authentication, the optional smtp_user &
  449. # smtp_pass variables should be used
  450. #
  451. {% if matrix_mailer_enabled %}
  452. email:
  453. enable_notifs: true
  454. smtp_host: "matrix-mailer"
  455. smtp_port: 587
  456. require_transport_security: false
  457. notif_from: "Matrix <{{ matrix_mailer_sender_address }}>"
  458. app_name: Matrix
  459. template_dir: /synapse/res/templates
  460. notif_template_html: notif_mail.html
  461. notif_template_text: notif_mail.txt
  462. notif_for_new_users: True
  463. riot_base_url: "https://{{ hostname_riot }}"
  464. {% endif %}
  465. # password_providers:
  466. # - module: "ldap_auth_provider.LdapAuthProvider"
  467. # config:
  468. # enabled: true
  469. # uri: "ldap://ldap.example.com:389"
  470. # start_tls: true
  471. # base: "ou=users,dc=example,dc=com"
  472. # attributes:
  473. # uid: "cn"
  474. # mail: "email"
  475. # name: "givenName"
  476. # #bind_dn:
  477. # #bind_password:
  478. # #filter: "(objectClass=posixAccount)"
  479. # Clients requesting push notifications can either have the body of
  480. # the message sent in the notification poke along with other details
  481. # like the sender, or just the event ID and room ID (`event_id_only`).
  482. # If clients choose the former, this option controls whether the
  483. # notification request includes the content of the event (other details
  484. # like the sender are still included). For `event_id_only` push, it
  485. # has no effect.
  486. # For modern android devices the notification content will still appear
  487. # because it is loaded by the app. iPhone, however will send a
  488. # notification saying only that a message arrived and who it came from.
  489. #
  490. #push:
  491. # include_content: true
  492. # spam_checker:
  493. # module: "my_custom_project.SuperSpamChecker"
  494. # config:
  495. # example_option: 'things'
  496. # Whether to allow non server admins to create groups on this server
  497. enable_group_creation: false
  498. # If enabled, non server admins can only create groups with local parts
  499. # starting with this prefix
  500. # group_creation_prefix: "unofficial/"
  501. # User Directory configuration
  502. #
  503. # 'search_all_users' defines whether to search all users visible to your HS
  504. # when searching the user directory, rather than limiting to users visible
  505. # in public rooms. Defaults to false. If you set it True, you'll have to run
  506. # UPDATE user_directory_stream_pos SET stream_id = NULL;
  507. # on your database to tell it to rebuild the user_directory search indexes.
  508. #
  509. #user_directory:
  510. # search_all_users: false
  511. # User Consent configuration
  512. #
  513. # Parts of this section are required if enabling the 'consent' resource under
  514. # 'listeners', in particular 'template_dir' and 'version'.
  515. #
  516. # 'template_dir' gives the location of the templates for the HTML forms.
  517. # This directory should contain one subdirectory per language (eg, 'en', 'fr'),
  518. # and each language directory should contain the policy document (named as
  519. # '<version>.html') and a success page (success.html).
  520. #
  521. # 'version' specifies the 'current' version of the policy document. It defines
  522. # the version to be served by the consent resource if there is no 'v'
  523. # parameter.
  524. #
  525. # 'server_notice_content', if enabled, will send a user a "Server Notice"
  526. # asking them to consent to the privacy policy. The 'server_notices' section
  527. # must also be configured for this to work. Notices will *not* be sent to
  528. # guest users unless 'send_server_notice_to_guests' is set to true.
  529. #
  530. # 'block_events_error', if set, will block any attempts to send events
  531. # until the user consents to the privacy policy. The value of the setting is
  532. # used as the text of the error.
  533. #
  534. # user_consent:
  535. # template_dir: res/templates/privacy
  536. # version: 1.0
  537. # server_notice_content:
  538. # msgtype: m.text
  539. # body: >-
  540. # To continue using this homeserver you must review and agree to the
  541. # terms and conditions at %(consent_uri)s
  542. # send_server_notice_to_guests: True
  543. # block_events_error: >-
  544. # To continue using this homeserver you must review and agree to the
  545. # terms and conditions at %(consent_uri)s
  546. #
  547. # Server Notices room configuration
  548. #
  549. # Uncomment this section to enable a room which can be used to send notices
  550. # from the server to users. It is a special room which cannot be left; notices
  551. # come from a special "notices" user id.
  552. #
  553. # If you uncomment this section, you *must* define the system_mxid_localpart
  554. # setting, which defines the id of the user which will be used to send the
  555. # notices.
  556. #
  557. # It's also possible to override the room name, the display name of the
  558. # "notices" user, and the avatar for the user.
  559. #
  560. # server_notices:
  561. # system_mxid_localpart: notices
  562. # system_mxid_display_name: "Server Notices"
  563. # system_mxid_avatar_url: "mxc://server.com/oumMVlgDnLYFaPVkExemNVVZ"
  564. # room_name: "Server Notices"