Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

856 wiersze
34 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. matrix_riot_jitsi_preferredDomain: "{{ matrix_server_fqn_jitsi if matrix_jitsi_enabled else '' }}"
  17. ######################################################################
  18. #
  19. # /matrix-base
  20. #
  21. ######################################################################
  22. ######################################################################
  23. #
  24. # matrix-architecture
  25. #
  26. ######################################################################
  27. matrix_architecture: "amd64"
  28. ######################################################################
  29. #
  30. # /matrix-architecture
  31. #
  32. ######################################################################
  33. ######################################################################
  34. #
  35. # matrix-bridge-appservice-discord
  36. #
  37. ######################################################################
  38. # We don't enable bridges by default.
  39. matrix_appservice_discord_enabled: false
  40. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-discord over the container network.
  41. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  42. # matrix-appservice-discord's client-server port to the local host.
  43. matrix_appservice_discord_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:9005' }}"
  44. # If the homeserver disables presence, it's likely better (less wasteful) to also disable presence on the bridge side.
  45. matrix_appservice_discord_bridge_disablePresence: "{{ matrix_synapse_use_presence }}"
  46. matrix_appservice_discord_systemd_required_services_list: |
  47. {{
  48. ['docker.service']
  49. +
  50. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  51. }}
  52. matrix_appservice_discord_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'discord.as.token') | to_uuid }}"
  53. matrix_appservice_discord_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'discord.hs.token') | to_uuid }}"
  54. ######################################################################
  55. #
  56. # /matrix-bridge-appservice-discord
  57. #
  58. ######################################################################
  59. ######################################################################
  60. #
  61. # matrix-appservice-webhooks
  62. #
  63. ######################################################################
  64. # We don't enable bridges by default.
  65. matrix_appservice_webhooks_enabled: false
  66. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-webhooks over the container network.
  67. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  68. # matrix-appservice-webhooks' client-server port to the local host.
  69. matrix_appservice_webhooks_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else ('127.0.0.1:' ~ matrix_appservice_webhooks_matrix_port) }}"
  70. matrix_appservice_webhooks_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'webhook.as.token') | to_uuid }}"
  71. matrix_appservice_webhooks_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'webhook.hs.token') | to_uuid }}"
  72. matrix_appservice_webhooks_id_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'webhook.id.token') | to_uuid }}"
  73. matrix_appservice_webhooks_systemd_required_services_list: |
  74. {{
  75. ['docker.service']
  76. +
  77. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  78. }}
  79. ######################################################################
  80. #
  81. # /matrix-appservice-webhooks
  82. #
  83. ######################################################################
  84. ######################################################################
  85. #
  86. # matrix-appservice-slack
  87. #
  88. ######################################################################
  89. # We don't enable bridges by default.
  90. matrix_appservice_slack_enabled: false
  91. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-slack over the container network.
  92. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  93. # matrix-appservice-slack's client-server port to the local host.
  94. matrix_appservice_slack_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else ('127.0.0.1:' ~ matrix_appservice_slack_slack_port) }}"
  95. matrix_appservice_slack_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'slack.as.token') | to_uuid }}"
  96. matrix_appservice_slack_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'slack.hs.token') | to_uuid }}"
  97. matrix_appservice_slack_id_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'slack.id.token') | to_uuid }}"
  98. matrix_appservice_slack_systemd_required_services_list: |
  99. {{
  100. ['docker.service']
  101. +
  102. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  103. }}
  104. ######################################################################
  105. #
  106. # /matrix-bridge-appservice-slack
  107. #
  108. ######################################################################
  109. ######################################################################
  110. #
  111. # matrix-bridge-appservice-irc
  112. #
  113. ######################################################################
  114. # We don't enable bridges by default.
  115. matrix_appservice_irc_enabled: false
  116. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-irc over the container network.
  117. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  118. # matrix-appservice-irc's client-server port to the local host.
  119. matrix_appservice_irc_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:9999' }}"
  120. # The IRC bridge docs say that if homeserver presence is disabled, it's better to also disable
  121. # IRC bridge presence, for performance reasons.
  122. matrix_appservice_irc_homeserver_enablePresence: "{{ matrix_synapse_use_presence }}"
  123. matrix_appservice_irc_systemd_required_services_list: |
  124. {{
  125. ['docker.service']
  126. +
  127. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  128. }}
  129. matrix_appservice_irc_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'irc.as.token') | to_uuid }}"
  130. matrix_appservice_irc_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'irc.hs.token') | to_uuid }}"
  131. ######################################################################
  132. #
  133. # /matrix-bridge-appservice-irc
  134. #
  135. ######################################################################
  136. ######################################################################
  137. #
  138. # matrix-bridge-mautrix-facebook
  139. #
  140. ######################################################################
  141. # We don't enable bridges by default.
  142. matrix_mautrix_facebook_enabled: false
  143. matrix_mautrix_facebook_container_image_self_build: "{{ matrix_architecture not in ['amd64', 'arm64'] }}"
  144. matrix_mautrix_facebook_systemd_required_services_list: |
  145. {{
  146. ['docker.service']
  147. +
  148. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  149. }}
  150. matrix_mautrix_facebook_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'fb.as.token') | to_uuid }}"
  151. matrix_mautrix_facebook_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'fb.hs.token') | to_uuid }}"
  152. matrix_mautrix_facebook_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  153. ######################################################################
  154. #
  155. # /matrix-bridge-mautrix-facebook
  156. #
  157. ######################################################################
  158. ######################################################################
  159. #
  160. # matrix-bridge-mautrix-hangouts
  161. #
  162. ######################################################################
  163. # We don't enable bridges by default.
  164. matrix_mautrix_hangouts_enabled: false
  165. matrix_mautrix_hangouts_container_image_self_build: "{{ matrix_architecture not in ['amd64', 'arm64'] }}"
  166. matrix_mautrix_hangouts_systemd_required_services_list: |
  167. {{
  168. ['docker.service']
  169. +
  170. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  171. }}
  172. matrix_mautrix_hangouts_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'ho.as.token') | to_uuid }}"
  173. matrix_mautrix_hangouts_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'ho.hs.token') | to_uuid }}"
  174. matrix_mautrix_hangouts_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  175. ######################################################################
  176. #
  177. # /matrix-bridge-mautrix-hangouts
  178. #
  179. ######################################################################
  180. ######################################################################
  181. #
  182. # matrix-bridge-mautrix-telegram
  183. #
  184. ######################################################################
  185. # We don't enable bridges by default.
  186. matrix_mautrix_telegram_enabled: false
  187. matrix_mautrix_telegram_systemd_required_services_list: |
  188. {{
  189. ['docker.service']
  190. +
  191. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  192. }}
  193. matrix_mautrix_telegram_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'telegr.as.token') | to_uuid }}"
  194. matrix_mautrix_telegram_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'telegr.hs.token') | to_uuid }}"
  195. matrix_mautrix_telegram_public_endpoint: "/{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'telegram') | to_uuid }}"
  196. matrix_mautrix_telegram_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:9006' }}"
  197. matrix_mautrix_telegram_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  198. ######################################################################
  199. #
  200. # /matrix-bridge-mautrix-telegram
  201. #
  202. ######################################################################
  203. ######################################################################
  204. #
  205. # matrix-bridge-mautrix-whatsapp
  206. #
  207. ######################################################################
  208. # We don't enable bridges by default.
  209. matrix_mautrix_whatsapp_enabled: false
  210. matrix_mautrix_whatsapp_systemd_required_services_list: |
  211. {{
  212. ['docker.service']
  213. +
  214. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  215. }}
  216. matrix_mautrix_whatsapp_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'whats.as.token') | to_uuid }}"
  217. matrix_mautrix_whatsapp_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'whats.hs.token') | to_uuid }}"
  218. matrix_mautrix_whatsapp_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  219. ######################################################################
  220. #
  221. # /matrix-bridge-mautrix-whatsapp
  222. #
  223. ######################################################################
  224. ######################################################################
  225. #
  226. # matrix-sms-bridge
  227. #
  228. ######################################################################
  229. # We don't enable bridges by default.
  230. matrix_sms_bridge_enabled: false
  231. matrix_sms_bridge_systemd_required_services_list: |
  232. {{
  233. ['docker.service']
  234. +
  235. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  236. }}
  237. matrix_sms_bridge_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'sms.as.token') | to_uuid }}"
  238. matrix_sms_bridge_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'sms.hs.token') | to_uuid }}"
  239. ######################################################################
  240. #
  241. # /matrix-sms-bridge
  242. #
  243. ######################################################################
  244. ######################################################################
  245. #
  246. # matrix-bridge-mx-puppet-skype
  247. #
  248. ######################################################################
  249. # We don't enable bridges by default.
  250. matrix_mx_puppet_skype_enabled: false
  251. matrix_mx_puppet_skype_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  252. matrix_mx_puppet_skype_systemd_required_services_list: |
  253. {{
  254. ['docker.service']
  255. +
  256. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  257. }}
  258. matrix_mx_puppet_skype_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'skype.as.tok') | to_uuid }}"
  259. matrix_mx_puppet_skype_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'skype.hs.tok') | to_uuid }}"
  260. matrix_mx_puppet_skype_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  261. ######################################################################
  262. #
  263. # /matrix-bridge-mx-puppet-skype
  264. #
  265. ######################################################################
  266. ######################################################################
  267. #
  268. # matrix-bridge-mx-puppet-slack
  269. #
  270. ######################################################################
  271. # We don't enable bridges by default.
  272. matrix_mx_puppet_slack_enabled: false
  273. matrix_mx_puppet_slack_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  274. matrix_mx_puppet_slack_systemd_required_services_list: |
  275. {{
  276. ['docker.service']
  277. +
  278. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  279. }}
  280. matrix_mx_puppet_slack_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxslk.as.tok') | to_uuid }}"
  281. matrix_mx_puppet_slack_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxslk.hs.tok') | to_uuid }}"
  282. matrix_mx_puppet_slack_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  283. ######################################################################
  284. #
  285. # /matrix-bridge-mx-puppet-slack
  286. #
  287. ######################################################################
  288. ######################################################################
  289. #
  290. # matrix-corporal
  291. #
  292. ######################################################################
  293. matrix_corporal_enabled: false
  294. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-corporal over the container network.
  295. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  296. # matrix-corporal's web-server ports to the local host.
  297. matrix_corporal_container_http_gateway_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:41080' }}"
  298. matrix_corporal_container_http_api_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:41081' }}"
  299. matrix_corporal_systemd_required_services_list: |
  300. {{
  301. (['docker.service'])
  302. +
  303. (['matrix-synapse.service'])
  304. }}
  305. matrix_corporal_matrix_homeserver_api_endpoint: "http://matrix-synapse:8008"
  306. matrix_corporal_matrix_auth_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret }}"
  307. matrix_corporal_matrix_registration_shared_secret: "{{ matrix_synapse_registration_shared_secret }}"
  308. ######################################################################
  309. #
  310. # /matrix-corporal
  311. #
  312. ######################################################################
  313. ######################################################################
  314. #
  315. # matrix-coturn
  316. #
  317. ######################################################################
  318. matrix_coturn_enabled: true
  319. matrix_coturn_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  320. matrix_coturn_turn_external_ip_address: "{{ ansible_host }}"
  321. matrix_coturn_tls_enabled: true
  322. matrix_coturn_tls_cert_path: "{{ matrix_ssl_config_dir_path }}/live/{{ matrix_server_fqn_matrix }}/fullchain.pem"
  323. matrix_coturn_tls_key_path: "{{ matrix_ssl_config_dir_path }}/live/{{ matrix_server_fqn_matrix }}/privkey.pem"
  324. matrix_coturn_container_additional_volumes:
  325. - src: "{{ matrix_ssl_config_dir_path }}"
  326. dst: "{{ matrix_ssl_config_dir_path }}"
  327. options: ro
  328. ######################################################################
  329. #
  330. # /matrix-coturn
  331. #
  332. ######################################################################
  333. ######################################################################
  334. #
  335. # matrix-dimension
  336. #
  337. ######################################################################
  338. matrix_dimension_enabled: false
  339. # Normally, matrix-nginx-proxy is enabled and nginx can reach Dimension over the container network.
  340. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  341. # the Dimension HTTP port to the local host.
  342. matrix_dimension_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8184' }}"
  343. matrix_integration_manager_rest_url: "{{ matrix_dimension_integrations_rest_url if matrix_dimension_enabled else None }}"
  344. matrix_integration_manager_ui_url: "{{ matrix_dimension_integrations_ui_url if matrix_dimension_enabled else None }}"
  345. matrix_dimension_homeserver_federationUrl: "http://matrix-synapse:{{ 8048 if matrix_synapse_federation_enabled|bool else 8008 }}"
  346. ######################################################################
  347. #
  348. # /matrix-dimension
  349. #
  350. ######################################################################
  351. ######################################################################
  352. #
  353. # matrix-email2matrix
  354. #
  355. ######################################################################
  356. matrix_email2matrix_enabled: false
  357. ######################################################################
  358. #
  359. # /matrix-email2matrix
  360. #
  361. ######################################################################
  362. ######################################################################
  363. #
  364. # matrix-jitsi
  365. #
  366. ######################################################################
  367. matrix_jitsi_enabled: false
  368. # Normally, matrix-nginx-proxy is enabled and nginx can reach jitsi/web over the container network.
  369. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  370. # the Jitsi HTTP port to the local host.
  371. matrix_jitsi_web_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:12080' }}"
  372. matrix_jitsi_jibri_xmpp_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'jibri') | to_uuid }}"
  373. matrix_jitsi_jicofo_auth_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'jicofo') | to_uuid }}"
  374. matrix_jitsi_jvb_auth_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'jvb') | to_uuid }}"
  375. matrix_jitsi_web_stun_servers: |
  376. {{
  377. [
  378. 'stun:' + matrix_server_fqn_matrix + ':5349',
  379. 'stun:' + matrix_server_fqn_matrix + ':3478',
  380. ]
  381. if matrix_coturn_enabled
  382. else [ 'stun:meet-jit-si-turnrelay.jitsi.net:443']
  383. }}
  384. ######################################################################
  385. #
  386. # /matrix-jitsi
  387. #
  388. ######################################################################
  389. ######################################################################
  390. #
  391. # matrix-mailer
  392. #
  393. ######################################################################
  394. # By default, this playbook sets up an exim mailer server (running in a container).
  395. # This is so that Synapse can send email reminders for unread messages.
  396. # Other services (like ma1sd), also use the mailer.
  397. matrix_mailer_enabled: true
  398. matrix_mailer_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  399. ######################################################################
  400. #
  401. # /matrix-mailer
  402. #
  403. ######################################################################
  404. ######################################################################
  405. #
  406. # matrix-ma1sd
  407. #
  408. ######################################################################
  409. # By default, this playbook installs the ma1sd identity server on the same domain as Synapse (`matrix_server_fqn_matrix`).
  410. # If you wish to use the public identity servers (matrix.org, vector.im) instead of your own you may wish to disable this.
  411. matrix_ma1sd_enabled: true
  412. matrix_ma1sd_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  413. # Normally, matrix-nginx-proxy is enabled and nginx can reach ma1sd over the container network.
  414. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  415. # ma1sd's web-server port.
  416. matrix_ma1sd_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8090' }}"
  417. # We enable Synapse integration via its Postgres database by default.
  418. # When using another Identity store, you might wish to disable this and define
  419. # your own configuration in `matrix_ma1sd_configuration_extension_yaml`.
  420. matrix_ma1sd_synapsesql_enabled: true
  421. matrix_ma1sd_synapsesql_type: postgresql
  422. matrix_ma1sd_synapsesql_connection: //{{ matrix_synapse_database_host }}/{{ matrix_synapse_database_database }}?user={{ matrix_synapse_database_user | urlencode() }}&password={{ matrix_synapse_database_password | urlencode() }}
  423. matrix_ma1sd_dns_overwrite_enabled: true
  424. matrix_ma1sd_dns_overwrite_homeserver_client_name: "{{ matrix_server_fqn_matrix }}"
  425. matrix_ma1sd_dns_overwrite_homeserver_client_value: "http://{{ 'matrix-corporal:41080' if matrix_corporal_enabled else 'matrix-synapse:8008' }}"
  426. # By default, we send mail through the `matrix-mailer` service.
  427. matrix_ma1sd_threepid_medium_email_identity_from: "{{ matrix_mailer_sender_address }}"
  428. matrix_ma1sd_threepid_medium_email_connectors_smtp_host: "matrix-mailer"
  429. matrix_ma1sd_threepid_medium_email_connectors_smtp_port: 8025
  430. matrix_ma1sd_threepid_medium_email_connectors_smtp_tls: 0
  431. matrix_ma1sd_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else false }}"
  432. matrix_ma1sd_systemd_wanted_services_list: |
  433. {{
  434. (['matrix-corporal.service'] if matrix_corporal_enabled else ['matrix-synapse.service'])
  435. +
  436. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  437. +
  438. (['matrix-mailer.service'] if matrix_mailer_enabled else [])
  439. }}
  440. ######################################################################
  441. #
  442. # /matrix-ma1sd
  443. #
  444. ######################################################################
  445. ######################################################################
  446. #
  447. # matrix-nginx-proxy
  448. #
  449. ######################################################################
  450. # By default, this playbook sets up a reverse-proxy nginx proxy server on TCP ports 80, 443 and 8448.
  451. # This is fine if you're dedicating the whole server to Matrix.
  452. # If that's not the case, you may wish to disable this and take care of proxying yourself.
  453. matrix_nginx_proxy_enabled: true
  454. matrix_nginx_proxy_proxy_matrix_client_api_addr_with_container: "{{ 'matrix-corporal:41080' if matrix_corporal_enabled else 'matrix-synapse:8008' }}"
  455. matrix_nginx_proxy_proxy_matrix_client_api_addr_sans_container: "{{ '127.0.0.1:41080' if matrix_corporal_enabled else '127.0.0.1:8008' }}"
  456. matrix_nginx_proxy_proxy_matrix_client_api_client_max_body_size_mb: "{{ matrix_synapse_max_upload_size_mb }}"
  457. matrix_nginx_proxy_proxy_matrix_enabled: true
  458. matrix_nginx_proxy_proxy_riot_enabled: "{{ matrix_riot_web_enabled }}"
  459. matrix_nginx_proxy_proxy_dimension_enabled: "{{ matrix_dimension_enabled }}"
  460. matrix_nginx_proxy_proxy_jitsi_enabled: "{{ matrix_jitsi_enabled }}"
  461. matrix_nginx_proxy_proxy_matrix_corporal_api_enabled: "{{ matrix_corporal_enabled and matrix_corporal_http_api_enabled }}"
  462. matrix_nginx_proxy_proxy_matrix_corporal_api_addr_with_container: "matrix-corporal:41081"
  463. matrix_nginx_proxy_proxy_matrix_corporal_api_addr_sans_container: "127.0.0.1:41081"
  464. matrix_nginx_proxy_proxy_matrix_identity_api_enabled: "{{ matrix_ma1sd_enabled }}"
  465. matrix_nginx_proxy_proxy_matrix_identity_api_addr_with_container: "matrix-ma1sd:8090"
  466. matrix_nginx_proxy_proxy_matrix_identity_api_addr_sans_container: "127.0.0.1:8090"
  467. # By default, we do TLS termination for the Matrix Federation API (port 8448) at matrix-nginx-proxy.
  468. matrix_nginx_proxy_proxy_matrix_federation_api_enabled: true
  469. matrix_nginx_proxy_proxy_matrix_federation_api_addr_with_container: "matrix-synapse:8048"
  470. matrix_nginx_proxy_proxy_matrix_federation_api_addr_sans_container: "127.0.0.1:8048"
  471. matrix_nginx_proxy_proxy_synapse_metrics: "{{ matrix_synapse_metrics_enabled }}"
  472. matrix_nginx_proxy_proxy_synapse_metrics_addr_with_container: "matrix-synapse:{{ matrix_synapse_metrics_port }}"
  473. matrix_nginx_proxy_proxy_synapse_metrics_addr_sans_container: "127.0.0.1:{{ matrix_synapse_metrics_port }}"
  474. # Not proxying the user directory search to the identity server by default anymore,
  475. # because it currently leaks data.
  476. # See: https://github.com/ma1uta/ma1sd/issues/44
  477. matrix_nginx_proxy_proxy_matrix_user_directory_search_enabled: false
  478. matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_with_container: "{{ matrix_nginx_proxy_proxy_matrix_identity_api_addr_with_container }}"
  479. matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_sans_container: "{{ matrix_nginx_proxy_proxy_matrix_identity_api_addr_sans_container }}"
  480. matrix_nginx_proxy_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else false }}"
  481. matrix_nginx_proxy_systemd_wanted_services_list: |
  482. {{
  483. (['matrix-synapse.service'])
  484. +
  485. (['matrix-corporal.service'] if matrix_corporal_enabled else [])
  486. +
  487. (['matrix-ma1sd.service'] if matrix_ma1sd_enabled else [])
  488. +
  489. (['matrix-riot-web.service'] if matrix_riot_web_enabled else [])
  490. }}
  491. matrix_ssl_domains_to_obtain_certificates_for: |
  492. {{
  493. ([matrix_server_fqn_matrix])
  494. +
  495. ([matrix_server_fqn_riot] if matrix_riot_web_enabled else [])
  496. +
  497. ([matrix_server_fqn_dimension] if matrix_dimension_enabled else [])
  498. +
  499. ([matrix_server_fqn_jitsi] if matrix_jitsi_enabled else [])
  500. +
  501. ([matrix_domain] if matrix_nginx_proxy_base_domain_serving_enabled else [])
  502. }}
  503. matrix_ssl_architecture: "{{ matrix_architecture }}"
  504. ######################################################################
  505. #
  506. # /matrix-nginx-proxy
  507. #
  508. ######################################################################
  509. ######################################################################
  510. #
  511. # matrix-postgres
  512. #
  513. ######################################################################
  514. matrix_postgres_enabled: true
  515. matrix_postgres_connection_hostname: "matrix-postgres"
  516. matrix_postgres_connection_username: "synapse"
  517. matrix_postgres_connection_password: "synapse-password"
  518. matrix_postgres_db_name: "homeserver"
  519. ######################################################################
  520. #
  521. # /matrix-postgres
  522. #
  523. ######################################################################
  524. ######################################################################
  525. #
  526. # matrix-riot-web
  527. #
  528. ######################################################################
  529. # By default, this playbook installs the Riot.IM web UI on the `matrix_server_fqn_riot` domain.
  530. # If you wish to connect to your Matrix server by other means, you may wish to disable this.
  531. matrix_riot_web_enabled: true
  532. matrix_riot_web_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  533. # Normally, matrix-nginx-proxy is enabled and nginx can reach riot-web over the container network.
  534. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  535. # the riot-web HTTP port to the local host.
  536. matrix_riot_web_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8765' }}"
  537. matrix_riot_web_default_hs_url: "{{ matrix_homeserver_url }}"
  538. matrix_riot_web_default_is_url: "{{ matrix_identity_server_url }}"
  539. # Use Dimension if enabled, otherwise fall back to Scalar
  540. matrix_riot_web_integrations_ui_url: "{{ matrix_dimension_integrations_ui_url if matrix_dimension_enabled else 'https://scalar.vector.im/' }}"
  541. matrix_riot_web_integrations_rest_url: "{{ matrix_dimension_integrations_rest_url if matrix_dimension_enabled else 'https://scalar.vector.im/api' }}"
  542. matrix_riot_web_integrations_widgets_urls: "{{ matrix_dimension_integrations_widgets_urls if matrix_dimension_enabled else ['https://scalar.vector.im/api'] }}"
  543. matrix_riot_web_integrations_jitsi_widget_url: "{{ matrix_dimension_integrations_jitsi_widget_url if matrix_dimension_enabled else 'https://scalar.vector.im/api/widgets/jitsi.html' }}"
  544. matrix_riot_web_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else false }}"
  545. matrix_riot_web_registration_enabled: "{{ matrix_synapse_enable_registration }}"
  546. matrix_riot_web_enable_presence_by_hs_url: |
  547. {{
  548. none
  549. if matrix_synapse_use_presence
  550. else {matrix_riot_web_default_hs_url: false}
  551. }}
  552. matrix_riot_web_welcome_user_id: ~
  553. matrix_riot_web_jitsi_preferredDomain: "{{ matrix_server_fqn_jitsi if matrix_jitsi_enabled else '' }}"
  554. ######################################################################
  555. #
  556. # /matrix-riot-web
  557. #
  558. ######################################################################
  559. ######################################################################
  560. #
  561. # matrix-synapse
  562. #
  563. ######################################################################
  564. matrix_synapse_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  565. # When ma1sd is enabled, we can use it instead of the default public Identity servers.
  566. matrix_synapse_trusted_third_party_id_servers: "{{ [matrix_server_fqn_matrix] if matrix_ma1sd_enabled else matrix_synapse_id_servers_public }}"
  567. # When ma1sd is enabled, we can use it to validate email addresses and phone numbers.
  568. # Synapse can validate email addresses by itself as well, but it's probably not what we want by default when we have an identity server.
  569. matrix_synapse_account_threepid_delegates_email: "{{ 'http://matrix-ma1sd:8090' if matrix_ma1sd_enabled else '' }}"
  570. matrix_synapse_account_threepid_delegates_msisdn: "{{ 'http://matrix-ma1sd:8090' if matrix_ma1sd_enabled else '' }}"
  571. # Normally, matrix-nginx-proxy is enabled and nginx can reach Synapse over the container network.
  572. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it,
  573. # you can expose Synapse's ports to the host.
  574. #
  575. # For exposing the Matrix Client API's port (plain HTTP) to the local host.
  576. matrix_synapse_container_client_api_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8008' }}"
  577. #
  578. # For exposing the Matrix Federation API's plain port (plain HTTP) to the local host.
  579. matrix_synapse_container_federation_api_plain_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8048' }}"
  580. #
  581. # For exposing the Matrix Federation API's TLS port (HTTPS) to the internet on all network interfaces.
  582. matrix_synapse_container_federation_api_tls_host_bind_port: "{{ '8448' if (matrix_synapse_federation_enabled and matrix_synapse_tls_federation_listener_enabled) else '' }}"
  583. #
  584. # For exposing the Synapse Metrics API's port (plain HTTP) to the local host.
  585. matrix_synapse_container_metrics_api_host_bind_port: "{{ '127.0.0.1:9100' if (matrix_synapse_metrics_enabled and not matrix_nginx_proxy_enabled) else '' }}"
  586. #
  587. # For exposing the Synapse Manhole port (plain HTTP) to the local host.
  588. matrix_synapse_container_manhole_api_host_bind_port: "{{ '127.0.0.1:9000' if matrix_synapse_manhole_enabled else '' }}"
  589. matrix_synapse_database_host: "{{ matrix_postgres_connection_hostname }}"
  590. matrix_synapse_database_user: "{{ matrix_postgres_connection_username }}"
  591. matrix_synapse_database_password: "{{ matrix_postgres_connection_password }}"
  592. matrix_synapse_database_database: "{{ matrix_postgres_db_name }}"
  593. # We do not enable TLS in Synapse by default.
  594. # TLS is handled by the matrix-nginx-proxy, which proxies the requests to Synapse.
  595. matrix_synapse_tls_federation_listener_enabled: false
  596. matrix_synapse_tls_certificate_path: ~
  597. matrix_synapse_tls_private_key_path: ~
  598. matrix_synapse_http_listener_resource_names: |
  599. {{
  600. ["client"]
  601. +
  602. ( ["openid"] if matrix_dimension_enabled and not matrix_synapse_federation_enabled else [] )
  603. }}
  604. matrix_synapse_email_enabled: "{{ matrix_mailer_enabled }}"
  605. matrix_synapse_email_smtp_host: "matrix-mailer"
  606. matrix_synapse_email_smtp_port: 8025
  607. matrix_synapse_email_smtp_require_transport_security: false
  608. matrix_synapse_email_notif_from: "Matrix <{{ matrix_mailer_sender_address }}>"
  609. # Even if TURN doesn't support TLS (it does by default),
  610. # it doesn't hurt to try a secure connection anyway.
  611. matrix_synapse_turn_uris: |
  612. {{
  613. [
  614. 'turns:' + matrix_server_fqn_matrix + '?transport=udp',
  615. 'turns:' + matrix_server_fqn_matrix + '?transport=tcp',
  616. 'turn:' + matrix_server_fqn_matrix + '?transport=udp',
  617. 'turn:' + matrix_server_fqn_matrix + '?transport=tcp',
  618. ]
  619. if matrix_coturn_enabled
  620. else []
  621. }}
  622. matrix_synapse_turn_shared_secret: "{{ matrix_coturn_turn_static_auth_secret if matrix_coturn_enabled else '' }}"
  623. matrix_synapse_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else false }}"
  624. matrix_synapse_systemd_required_services_list: |
  625. {{
  626. (['docker.service'])
  627. +
  628. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  629. +
  630. (['matrix-goofys'] if matrix_s3_media_store_enabled else [])
  631. }}
  632. matrix_synapse_systemd_wanted_services_list: |
  633. {{
  634. (['matrix-coturn.service'] if matrix_coturn_enabled else [])
  635. +
  636. (['matrix-mailer.service'] if matrix_mailer_enabled else [])
  637. }}
  638. ######################################################################
  639. #
  640. # /matrix-synapse
  641. #
  642. ######################################################################