homeserver.yaml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. {% endif %}
  7. ## Server ##
  8. server_name: "{{ SYNAPSE_SERVER_NAME }}"
  9. pid_file: /homeserver.pid
  10. web_client: False
  11. soft_file_limit: 0
  12. log_config: "{{ SYNAPSE_LOG_CONFIG }}"
  13. ## Ports ##
  14. listeners:
  15. {% if not SYNAPSE_NO_TLS %}
  16. -
  17. port: 8448
  18. bind_addresses: ['::']
  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. # Allow configuring in case we want to reverse proxy 8008
  29. # using another process in the same container
  30. - port: {{ SYNAPSE_HTTP_PORT or 8008 }}
  31. tls: false
  32. bind_addresses: ['::']
  33. type: http
  34. x_forwarded: false
  35. resources:
  36. - names: [client]
  37. compress: true
  38. - names: [federation]
  39. compress: false
  40. ## Database ##
  41. {% if POSTGRES_PASSWORD %}
  42. database:
  43. name: "psycopg2"
  44. args:
  45. user: "{{ POSTGRES_USER or "synapse" }}"
  46. password: "{{ POSTGRES_PASSWORD }}"
  47. database: "{{ POSTGRES_DB or "synapse" }}"
  48. host: "{{ POSTGRES_HOST or "db" }}"
  49. port: "{{ POSTGRES_PORT or "5432" }}"
  50. cp_min: 5
  51. cp_max: 10
  52. {% else %}
  53. database:
  54. name: "sqlite3"
  55. args:
  56. database: "/data/homeserver.db"
  57. {% endif %}
  58. ## Performance ##
  59. event_cache_size: "{{ SYNAPSE_EVENT_CACHE_SIZE or "10K" }}"
  60. ## Ratelimiting ##
  61. rc_messages_per_second: 0.2
  62. rc_message_burst_count: 10.0
  63. federation_rc_window_size: 1000
  64. federation_rc_sleep_limit: 10
  65. federation_rc_sleep_delay: 500
  66. federation_rc_reject_limit: 50
  67. federation_rc_concurrent: 3
  68. ## Files ##
  69. media_store_path: "/data/media"
  70. max_upload_size: "{{ SYNAPSE_MAX_UPLOAD_SIZE or "50M" }}"
  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. ## Metrics ###
  125. {% if SYNAPSE_REPORT_STATS.lower() == "yes" %}
  126. enable_metrics: True
  127. report_stats: True
  128. {% else %}
  129. enable_metrics: False
  130. report_stats: False
  131. {% endif %}
  132. ## API Configuration ##
  133. {% if SYNAPSE_APPSERVICES %}
  134. app_service_config_files:
  135. {% for appservice in SYNAPSE_APPSERVICES %} - "{{ appservice }}"
  136. {% endfor %}
  137. {% endif %}
  138. macaroon_secret_key: "{{ SYNAPSE_MACAROON_SECRET_KEY }}"
  139. expire_access_token: False
  140. ## Signing Keys ##
  141. signing_key_path: "/data/{{ SYNAPSE_SERVER_NAME }}.signing.key"
  142. old_signing_keys: {}
  143. key_refresh_interval: "1d" # 1 Day.
  144. # The trusted servers to download signing keys from.
  145. trusted_key_servers:
  146. - server_name: matrix.org
  147. verify_keys:
  148. "ed25519:auto": "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw"
  149. password_config:
  150. enabled: true