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.
 
 

289 lines
10 KiB

  1. ---
  2. # This variables file wires together the various components (roles) used by the playbook.
  3. #
  4. # Roles used by playbook are pretty minimal and kept independent of one another as much as possible.
  5. # To deliver a turnkey fully-featured Matrix server, this playbook needs
  6. # to connect them all together. It does so by overriding role variables.
  7. #
  8. # You can also override ANY variable (seen here or in any given role),
  9. # by re-defining it in your own configuration file (`inventory/host_vars/matrix.<your-domain>`).
  10. ######################################################################
  11. #
  12. # matrix-base
  13. #
  14. ######################################################################
  15. matrix_identity_server_url: "{{ 'https://' + matrix_synapse_trusted_third_party_id_servers[0] if matrix_synapse_trusted_third_party_id_servers|length > 0 else None }}"
  16. ######################################################################
  17. #
  18. # /matrix-base
  19. #
  20. ######################################################################
  21. ######################################################################
  22. #
  23. # matrix-corporal
  24. #
  25. ######################################################################
  26. matrix_corporal_enabled: false
  27. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-corporal over the container network.
  28. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  29. # matrix-corporal's web-server ports to the local host (`127.0.0.1:41080` and `127.0.0.1:41081`).
  30. matrix_corporal_container_expose_ports: "{{ not matrix_nginx_proxy_enabled }}"
  31. matrix_corporal_systemd_required_services_list: |
  32. {{
  33. (['docker.service'])
  34. +
  35. (['matrix-synapse.service'])
  36. }}
  37. matrix_corporal_matrix_homeserver_api_endpoint: "http://matrix-synapse:8008"
  38. matrix_corporal_matrix_auth_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret }}"
  39. matrix_corporal_matrix_registration_shared_secret: "{{ matrix_synapse_registration_shared_secret }}"
  40. ######################################################################
  41. #
  42. # /matrix-corporal
  43. #
  44. ######################################################################
  45. ######################################################################
  46. #
  47. # matrix-coturn
  48. #
  49. ######################################################################
  50. matrix_coturn_enabled: true
  51. ######################################################################
  52. #
  53. # /matrix-coturn
  54. #
  55. ######################################################################
  56. ######################################################################
  57. #
  58. # matrix-mailer
  59. #
  60. ######################################################################
  61. # By default, this playbook sets up a postfix mailer server (running in a container).
  62. # This is so that Synapse can send email reminders for unread messages.
  63. # Other services (like mxisd), also use the mailer.
  64. matrix_mailer_enabled: true
  65. ######################################################################
  66. #
  67. # /matrix-mailer
  68. #
  69. ######################################################################
  70. ######################################################################
  71. #
  72. # matrix-mxisd
  73. #
  74. ######################################################################
  75. # By default, this playbook installs the mxisd identity server on the same domain as Synapse (`hostname_matrix`).
  76. # If you wish to use the public identity servers (matrix.org, vector.im) instead of your own you may wish to disable this.
  77. matrix_mxisd_enabled: true
  78. # Normally, matrix-nginx-proxy is enabled and nginx can reach mxisd over the container network.
  79. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  80. # mxisd's web-server port to the local host (`127.0.0.1:8090`).
  81. matrix_mxisd_container_expose_port: "{{ not matrix_nginx_proxy_enabled }}"
  82. # We enable Synapse integration via its Postgres database by default.
  83. # When using another Identity store, you might wish to disable this and define
  84. # your own configuration in `matrix_mxisd_configuration_extension_yaml`.
  85. matrix_mxisd_synapsesql_enabled: true
  86. matrix_mxisd_synapsesql_type: postgresql
  87. matrix_mxisd_synapsesql_connection: //{{ matrix_synapse_database_host }}/{{ matrix_synapse_database_database }}?user={{ matrix_synapse_database_user }}&password={{ matrix_synapse_database_password }}
  88. # By default, we send mail through the `matrix-mailer` service.
  89. matrix_mxid_threepid_medium_email_identity_from: "{{ matrix_mailer_sender_address }}"
  90. matrix_mxid_threepid_medium_email_connectors_smtp_host: "matrix-mailer"
  91. matrix_mxid_threepid_medium_email_connectors_smtp_port: 587
  92. matrix_mxid_threepid_medium_email_connectors_smtp_tls: 0
  93. matrix_mxisd_systemd_wanted_services_list: |
  94. {{
  95. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  96. +
  97. (['matrix-mailer.service'] if matrix_mailer_enabled else [])
  98. }}
  99. ######################################################################
  100. #
  101. # /matrix-mxisd
  102. #
  103. ######################################################################
  104. ######################################################################
  105. #
  106. # matrix-nginx-proxy
  107. #
  108. ######################################################################
  109. # By default, this playbook sets up a reverse-proxy nginx proxy server on port 80/443.
  110. # This is fine if you're dedicating the whole server to Matrix.
  111. # If that's not the case, you may wish to disable this and take care of proxying yourself.
  112. matrix_nginx_proxy_enabled: true
  113. matrix_nginx_proxy_matrix_client_api_addr_with_proxy_container: "{{ 'matrix-corporal:41080' if matrix_corporal_enabled else 'matrix-synapse:8008' }}"
  114. matrix_nginx_proxy_matrix_client_api_addr_sans_proxy_container: "{{ 'localhost:41080' if matrix_corporal_enabled else 'localhost:8008' }}"
  115. matrix_nginx_proxy_proxy_matrix_enabled: true
  116. matrix_nginx_proxy_proxy_riot_enabled: "{{ matrix_riot_web_enabled }}"
  117. matrix_nginx_proxy_systemd_wanted_services_list: |
  118. {{
  119. (['matrix-synapse.service'])
  120. +
  121. (['matrix-corporal.service'] if matrix_corporal_enabled else [])
  122. +
  123. (['matrix-mxisd.service'] if matrix_mxisd_enabled else [])
  124. +
  125. (['matrix-riot-web.service'] if matrix_riot_web_enabled else [])
  126. }}
  127. matrix_ssl_domains_to_obtain_certificates_for: |
  128. {{
  129. ([hostname_matrix])
  130. +
  131. ([hostname_riot] if matrix_riot_web_enabled else [])
  132. }}
  133. ######################################################################
  134. #
  135. # /matrix-nginx-proxy
  136. #
  137. ######################################################################
  138. ######################################################################
  139. #
  140. # matrix-postgres
  141. #
  142. ######################################################################
  143. matrix_postgres_enabled: true
  144. matrix_postgres_connection_hostname: "matrix-postgres"
  145. matrix_postgres_connection_username: "synapse"
  146. matrix_postgres_connection_password: "synapse-password"
  147. matrix_postgres_db_name: "homeserver"
  148. ######################################################################
  149. #
  150. # /matrix-postgres
  151. #
  152. ######################################################################
  153. ######################################################################
  154. #
  155. # matrix-riot-web
  156. #
  157. ######################################################################
  158. # By default, this playbook installs the Riot.IM web UI on the `hostname_riot` domain.
  159. # If you wish to connect to your Matrix server by other means, you may wish to disable this.
  160. matrix_riot_web_enabled: true
  161. # Normally, matrix-nginx-proxy is enabled and nginx can reach riot-web over the container network.
  162. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  163. # the riot-web HTTP port to the local host (`127.0.0.1:80`).
  164. matrix_riot_web_container_expose_port: "{{ not matrix_nginx_proxy_enabled }}"
  165. matrix_riot_web_default_hs_url: "{{ matrix_homeserver_url }}"
  166. matrix_riot_web_default_is_url: "{{ matrix_identity_server_url }}"
  167. ######################################################################
  168. #
  169. # /matrix-riot-web
  170. #
  171. ######################################################################
  172. ######################################################################
  173. #
  174. # matrix-synapse
  175. #
  176. ######################################################################
  177. # When mxisd is enabled, we can use it instead of the default public Identity servers.
  178. matrix_synapse_trusted_third_party_id_servers: "{{ [hostname_matrix] if matrix_mxisd_enabled else matrix_synapse_id_servers_public }}"
  179. # Normally, matrix-nginx-proxy is enabled and nginx can reach Synapse over the container network.
  180. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  181. # the Client/Server API's port to the local host (`127.0.0.1:8008`).
  182. matrix_synapse_container_expose_client_server_api_port: "{{ not matrix_nginx_proxy_enabled }}"
  183. matrix_synapse_database_host: "{{ matrix_postgres_connection_hostname }}"
  184. matrix_synapse_database_user: "{{ matrix_postgres_connection_username }}"
  185. matrix_synapse_database_password: "{{ matrix_postgres_connection_password }}"
  186. matrix_synapse_database_database: "{{ matrix_postgres_db_name }}"
  187. matrix_synapse_email_enabled: "{{ matrix_mailer_enabled }}"
  188. matrix_synapse_email_smtp_host: "matrix-mailer"
  189. matrix_synapse_email_smtp_port: 587
  190. matrix_synapse_email_smtp_require_transport_security: false
  191. matrix_synapse_email_notif_from: "Matrix <{{ matrix_mailer_sender_address }}>"
  192. matrix_synapse_email_riot_base_url: "https://{{ hostname_riot }}"
  193. matrix_synapse_turn_uris: |
  194. {{
  195. [
  196. 'turn:' + hostname_matrix + ':3478?transport=udp',
  197. 'turn:' + hostname_matrix + ':3478?transport=tcp',
  198. ]
  199. if matrix_coturn_enabled
  200. else []
  201. }}
  202. matrix_synapse_turn_shared_secret: "{{ matrix_coturn_turn_static_auth_secret if matrix_coturn_enabled else '' }}"
  203. matrix_synapse_systemd_required_services_list: |
  204. {{
  205. (['docker.service'])
  206. +
  207. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  208. +
  209. (['matrix-goofys'] if matrix_s3_media_store_enabled else [])
  210. }}
  211. matrix_synapse_systemd_wanted_services_list: |
  212. {{
  213. (['matrix-coturn.service'] if matrix_coturn_enabled else [])
  214. +
  215. (['matrix-mailer.service'] if matrix_mailer_enabled else [])
  216. }}
  217. ######################################################################
  218. #
  219. # /matrix-synapse
  220. #
  221. ######################################################################