homeserver.yaml 4.4 KB

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