1
0

homeserver.yaml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. # vim:ft=yaml
  2. ## TLS ##
  3. tls_certificate_path: "/data/{{ SYNAPSE_SERVER_NAME }}.tls.crt"
  4. tls_private_key_path: "/data/{{ SYNAPSE_SERVER_NAME }}.tls.key"
  5. tls_dh_params_path: "/data/{{ SYNAPSE_SERVER_NAME }}.tls.dh"
  6. no_tls: {{ "True" if SYNAPSE_NO_TLS else "False" }}
  7. tls_fingerprints: []
  8. ## Server ##
  9. server_name: "{{ SYNAPSE_SERVER_NAME }}"
  10. pid_file: /homeserver.pid
  11. web_client: False
  12. soft_file_limit: 0
  13. log_config: "/compiled/log.config"
  14. ## Ports ##
  15. listeners:
  16. {% if not SYNAPSE_NO_TLS %}
  17. -
  18. port: 8448
  19. bind_addresses: ['::']
  20. type: http
  21. tls: true
  22. x_forwarded: false
  23. resources:
  24. - names: [client]
  25. compress: true
  26. - names: [federation] # Federation APIs
  27. compress: false
  28. {% endif %}
  29. - port: 8008
  30. tls: false
  31. bind_addresses: ['::']
  32. type: http
  33. x_forwarded: false
  34. resources:
  35. - names: [client]
  36. compress: true
  37. - names: [federation]
  38. compress: false
  39. ## Database ##
  40. {% if POSTGRES_PASSWORD %}
  41. database:
  42. name: "psycopg2"
  43. args:
  44. user: "{{ POSTGRES_USER or "synapse" }}"
  45. password: "{{ POSTGRES_PASSWORD }}"
  46. database: "{{ POSTGRES_DB or "synapse" }}"
  47. host: "{{ POSTGRES_HOST or "db" }}"
  48. port: "{{ POSTGRES_PORT or "5432" }}"
  49. cp_min: 5
  50. cp_max: 10
  51. {% else %}
  52. database:
  53. name: "sqlite3"
  54. args:
  55. database: "/data/homeserver.db"
  56. {% endif %}
  57. ## Performance ##
  58. event_cache_size: "{{ SYNAPSE_EVENT_CACHE_SIZE or "10K" }}"
  59. ## Ratelimiting ##
  60. rc_messages_per_second: 0.2
  61. rc_message_burst_count: 10.0
  62. federation_rc_window_size: 1000
  63. federation_rc_sleep_limit: 10
  64. federation_rc_sleep_delay: 500
  65. federation_rc_reject_limit: 50
  66. federation_rc_concurrent: 3
  67. ## Files ##
  68. media_store_path: "/data/media"
  69. uploads_path: "/data/uploads"
  70. max_upload_size: "{{ SYNAPSE_MAX_UPLOAD_SIZE or "10M" }}"
  71. max_image_pixels: "32M"
  72. dynamic_thumbnails: false
  73. # List of thumbnail to precalculate when an image is uploaded.
  74. thumbnail_sizes:
  75. - width: 32
  76. height: 32
  77. method: crop
  78. - width: 96
  79. height: 96
  80. method: crop
  81. - width: 320
  82. height: 240
  83. method: scale
  84. - width: 640
  85. height: 480
  86. method: scale
  87. - width: 800
  88. height: 600
  89. method: scale
  90. url_preview_enabled: False
  91. max_spider_size: "10M"
  92. ## Captcha ##
  93. {% if SYNAPSE_RECAPTCHA_PUBLIC_KEY %}
  94. recaptcha_public_key: "{{ SYNAPSE_RECAPTCHA_PUBLIC_KEY }}"
  95. recaptcha_private_key: "{{ SYNAPSE_RECAPTCHA_PRIVATE_KEY }}"
  96. enable_registration_captcha: True
  97. recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify"
  98. {% else %}
  99. recaptcha_public_key: "YOUR_PUBLIC_KEY"
  100. recaptcha_private_key: "YOUR_PRIVATE_KEY"
  101. enable_registration_captcha: False
  102. recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify"
  103. {% endif %}
  104. ## Turn ##
  105. {% if SYNAPSE_TURN_URIS %}
  106. turn_uris:
  107. {% for uri in SYNAPSE_TURN_URIS.split(',') %} - "{{ uri }}"
  108. {% endfor %}
  109. turn_shared_secret: "{{ SYNAPSE_TURN_SECRET }}"
  110. turn_user_lifetime: "1h"
  111. turn_allow_guests: True
  112. {% else %}
  113. turn_uris: []
  114. turn_shared_secret: "YOUR_SHARED_SECRET"
  115. turn_user_lifetime: "1h"
  116. turn_allow_guests: True
  117. {% endif %}
  118. ## Registration ##
  119. enable_registration: {{ "True" if SYNAPSE_ENABLE_REGISTRATION else "False" }}
  120. registration_shared_secret: "{{ SYNAPSE_REGISTRATION_SHARED_SECRET }}"
  121. bcrypt_rounds: 12
  122. allow_guest_access: {{ "True" if SYNAPSE_ALLOW_GUEST else "False" }}
  123. enable_group_creation: true
  124. # The list of identity servers trusted to verify third party
  125. # identifiers by this server.
  126. #
  127. # Also defines the ID server which will be called when an account is
  128. # deactivated (one will be picked arbitrarily).
  129. trusted_third_party_id_servers:
  130. - matrix.org
  131. - vector.im
  132. ## Metrics ###
  133. {% if SYNAPSE_REPORT_STATS.lower() == "yes" %}
  134. enable_metrics: True
  135. report_stats: True
  136. {% else %}
  137. enable_metrics: False
  138. report_stats: False
  139. {% endif %}
  140. ## API Configuration ##
  141. room_invite_state_types:
  142. - "m.room.join_rules"
  143. - "m.room.canonical_alias"
  144. - "m.room.avatar"
  145. - "m.room.name"
  146. {% if SYNAPSE_APPSERVICES %}
  147. app_service_config_files:
  148. {% for appservice in SYNAPSE_APPSERVICES %} - "{{ appservice }}"
  149. {% endfor %}
  150. {% else %}
  151. app_service_config_files: []
  152. {% endif %}
  153. macaroon_secret_key: "{{ SYNAPSE_MACAROON_SECRET_KEY }}"
  154. expire_access_token: False
  155. ## Signing Keys ##
  156. signing_key_path: "/data/{{ SYNAPSE_SERVER_NAME }}.signing.key"
  157. old_signing_keys: {}
  158. key_refresh_interval: "1d" # 1 Day.
  159. # The trusted servers to download signing keys from.
  160. perspectives:
  161. servers:
  162. "matrix.org":
  163. verify_keys:
  164. "ed25519:auto":
  165. key: "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw"
  166. password_config:
  167. enabled: true
  168. {% if SYNAPSE_SMTP_HOST %}
  169. email:
  170. enable_notifs: false
  171. smtp_host: "{{ SYNAPSE_SMTP_HOST }}"
  172. smtp_port: {{ SYNAPSE_SMTP_PORT or "25" }}
  173. smtp_user: "{{ SYNAPSE_SMTP_USER }}"
  174. smtp_pass: "{{ SYNAPSE_SMTP_PASSWORD }}"
  175. require_transport_security: False
  176. notif_from: "{{ SYNAPSE_SMTP_FROM or "hostmaster@" + SYNAPSE_SERVER_NAME }}"
  177. app_name: Matrix
  178. # if template_dir is unset, uses the example templates that are part of
  179. # the Synapse distribution.
  180. #template_dir: res/templates
  181. notif_template_html: notif_mail.html
  182. notif_template_text: notif_mail.txt
  183. notif_for_new_users: True
  184. riot_base_url: "https://{{ SYNAPSE_SERVER_NAME }}"
  185. {% endif %}