homeserver.yaml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. ## Ports ##
  14. listeners:
  15. {% if not SYNAPSE_NO_TLS %}
  16. -
  17. port: 8448
  18. bind_addresses: ['0.0.0.0']
  19. type: http
  20. tls: true
  21. x_forwarded: false
  22. resources:
  23. - names: [client]
  24. compress: true
  25. - names: [federation] # Federation APIs
  26. compress: false
  27. {% endif %}
  28. - port: 8008
  29. tls: false
  30. bind_addresses: ['0.0.0.0']
  31. type: http
  32. x_forwarded: false
  33. resources:
  34. - names: [client]
  35. compress: true
  36. - names: [federation]
  37. compress: false
  38. ## Database ##
  39. {% if POSTGRES_PASSWORD %}
  40. database:
  41. name: "psycopg2"
  42. args:
  43. user: "{{ POSTGRES_USER or "synapse" }}"
  44. password: "{{ POSTGRES_PASSWORD }}"
  45. database: "{{ POSTGRES_DB or "synapse" }}"
  46. host: "{{ POSTGRES_HOST or "db" }}"
  47. port: "{{ POSTGRES_PORT or "5432" }}"
  48. cp_min: 5
  49. cp_max: 10
  50. {% else %}
  51. database:
  52. name: "sqlite3"
  53. args:
  54. database: "/data/homeserver.db"
  55. {% endif %}
  56. ## Performance ##
  57. event_cache_size: "{{ SYNAPSE_EVENT_CACHE_SIZE or "10K" }}"
  58. verbose: 0
  59. log_file: "/data/homeserver.log"
  60. log_config: "/compiled/log.config"
  61. ## Ratelimiting ##
  62. rc_messages_per_second: 0.2
  63. rc_message_burst_count: 10.0
  64. federation_rc_window_size: 1000
  65. federation_rc_sleep_limit: 10
  66. federation_rc_sleep_delay: 500
  67. federation_rc_reject_limit: 50
  68. federation_rc_concurrent: 3
  69. ## Files ##
  70. media_store_path: "/data/media"
  71. uploads_path: "/data/uploads"
  72. max_upload_size: "10M"
  73. max_image_pixels: "32M"
  74. dynamic_thumbnails: false
  75. # List of thumbnail to precalculate when an image is uploaded.
  76. thumbnail_sizes:
  77. - width: 32
  78. height: 32
  79. method: crop
  80. - width: 96
  81. height: 96
  82. method: crop
  83. - width: 320
  84. height: 240
  85. method: scale
  86. - width: 640
  87. height: 480
  88. method: scale
  89. - width: 800
  90. height: 600
  91. method: scale
  92. url_preview_enabled: False
  93. max_spider_size: "10M"
  94. ## Captcha ##
  95. {% if SYNAPSE_RECAPTCHA_PUBLIC_KEY %}
  96. recaptcha_public_key: "{{ SYNAPSE_RECAPTCHA_PUBLIC_KEY }}"
  97. recaptcha_private_key: "{{ SYNAPSE_RECAPTCHA_PRIVATE_KEY }}"
  98. enable_registration_captcha: True
  99. recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify"
  100. {% else %}
  101. recaptcha_public_key: "YOUR_PUBLIC_KEY"
  102. recaptcha_private_key: "YOUR_PRIVATE_KEY"
  103. enable_registration_captcha: False
  104. recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify"
  105. {% endif %}
  106. ## Turn ##
  107. {% if SYNAPSE_TURN_URIS %}
  108. turn_uris:
  109. {% for uri in SYNAPSE_TURN_URIS.split(',') %} - "{{ uri }}"
  110. {% endfor %}
  111. turn_shared_secret: "{{ SYNAPSE_TURN_SECRET }}"
  112. turn_user_lifetime: "1h"
  113. turn_allow_guests: True
  114. {% else %}
  115. turn_uris: []
  116. turn_shared_secret: "YOUR_SHARED_SECRET"
  117. turn_user_lifetime: "1h"
  118. turn_allow_guests: True
  119. {% endif %}
  120. ## Registration ##
  121. enable_registration: {{ "True" if SYNAPSE_ENABLE_REGISTRATION else "False" }}
  122. registration_shared_secret: "{{ SYNAPSE_REGISTRATION_SHARED_SECRET }}"
  123. bcrypt_rounds: 12
  124. allow_guest_access: {{ "True" if SYNAPSE_ALLOW_GUEST else "False" }}
  125. enable_group_creation: true
  126. # The list of identity servers trusted to verify third party
  127. # identifiers by this server.
  128. trusted_third_party_id_servers:
  129. - matrix.org
  130. - vector.im
  131. - riot.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. template_dir: res/templates
  179. notif_template_html: notif_mail.html
  180. notif_template_text: notif_mail.txt
  181. notif_for_new_users: True
  182. riot_base_url: "https://{{ SYNAPSE_SERVER_NAME }}"
  183. {% endif %}