Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1368 строки
58 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_server_fqn_matrix) if matrix_ma1sd_enabled else None }}"
  16. ######################################################################
  17. #
  18. # /matrix-base
  19. #
  20. ######################################################################
  21. ######################################################################
  22. #
  23. # matrix-bridge-appservice-discord
  24. #
  25. ######################################################################
  26. # We don't enable bridges by default.
  27. matrix_appservice_discord_enabled: false
  28. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-discord over the container network.
  29. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  30. # matrix-appservice-discord's client-server port to the local host.
  31. matrix_appservice_discord_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:9005' }}"
  32. # If the homeserver disables presence, it's likely better (less wasteful) to also disable presence on the bridge side.
  33. matrix_appservice_discord_bridge_disablePresence: "{{ matrix_synapse_use_presence }}"
  34. matrix_appservice_discord_systemd_required_services_list: |
  35. {{
  36. ['docker.service']
  37. +
  38. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  39. +
  40. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  41. }}
  42. matrix_appservice_discord_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'discord.as.token') | to_uuid }}"
  43. matrix_appservice_discord_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'discord.hs.token') | to_uuid }}"
  44. # We only make this use Postgres if our own Postgres server is enabled.
  45. # It's only then (for now) that we can automatically create the necessary database and user for this service.
  46. matrix_appservice_discord_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  47. matrix_appservice_discord_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'as.discord.db') | to_uuid }}"
  48. ######################################################################
  49. #
  50. # /matrix-bridge-appservice-discord
  51. #
  52. ######################################################################
  53. ######################################################################
  54. #
  55. # matrix-appservice-webhooks
  56. #
  57. ######################################################################
  58. # We don't enable bridges by default.
  59. matrix_appservice_webhooks_enabled: false
  60. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-webhooks over the container network.
  61. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  62. # matrix-appservice-webhooks' client-server port to the local host.
  63. matrix_appservice_webhooks_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else ('127.0.0.1:' ~ matrix_appservice_webhooks_matrix_port) }}"
  64. matrix_appservice_webhooks_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'webhook.as.token') | to_uuid }}"
  65. matrix_appservice_webhooks_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'webhook.hs.token') | to_uuid }}"
  66. matrix_appservice_webhooks_id_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'webhook.id.token') | to_uuid }}"
  67. matrix_appservice_webhooks_systemd_required_services_list: |
  68. {{
  69. ['docker.service']
  70. +
  71. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  72. }}
  73. ######################################################################
  74. #
  75. # /matrix-appservice-webhooks
  76. #
  77. ######################################################################
  78. ######################################################################
  79. #
  80. # matrix-appservice-slack
  81. #
  82. ######################################################################
  83. # We don't enable bridges by default.
  84. matrix_appservice_slack_enabled: false
  85. matrix_appservice_slack_container_self_build: "{{ matrix_architecture != 'amd64' }}"
  86. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-slack over the container network.
  87. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  88. # matrix-appservice-slack's client-server port to the local host.
  89. matrix_appservice_slack_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else ('127.0.0.1:' ~ matrix_appservice_slack_slack_port) }}"
  90. matrix_appservice_slack_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'slack.as.token') | to_uuid }}"
  91. matrix_appservice_slack_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'slack.hs.token') | to_uuid }}"
  92. matrix_appservice_slack_id_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'slack.id.token') | to_uuid }}"
  93. matrix_appservice_slack_systemd_required_services_list: |
  94. {{
  95. ['docker.service']
  96. +
  97. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  98. }}
  99. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  100. matrix_appservice_slack_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'nedb' }}"
  101. matrix_appservice_slack_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'as.slack.db') | to_uuid }}"
  102. ######################################################################
  103. #
  104. # /matrix-bridge-appservice-slack
  105. #
  106. ######################################################################
  107. ######################################################################
  108. #
  109. # matrix-bridge-appservice-irc
  110. #
  111. ######################################################################
  112. # We don't enable bridges by default.
  113. matrix_appservice_irc_enabled: false
  114. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-irc over the container network.
  115. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  116. # matrix-appservice-irc's client-server port to the local host.
  117. matrix_appservice_irc_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:9999' }}"
  118. # The IRC bridge docs say that if homeserver presence is disabled, it's better to also disable
  119. # IRC bridge presence, for performance reasons.
  120. matrix_appservice_irc_homeserver_enablePresence: "{{ matrix_synapse_use_presence }}"
  121. matrix_appservice_irc_systemd_required_services_list: |
  122. {{
  123. ['docker.service']
  124. +
  125. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  126. }}
  127. matrix_appservice_irc_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'irc.as.token') | to_uuid }}"
  128. matrix_appservice_irc_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'irc.hs.token') | to_uuid }}"
  129. matrix_appservice_irc_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'nedb' }}"
  130. matrix_appservice_irc_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'as.irc.db') | 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-postgres.service'] if matrix_postgres_enabled else [])
  151. }}
  152. matrix_mautrix_facebook_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'fb.as.token') | to_uuid }}"
  153. matrix_mautrix_facebook_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'fb.hs.token') | to_uuid }}"
  154. 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 '' }}"
  155. matrix_mautrix_facebook_bridge_presence: "{{ matrix_synapse_use_presence if matrix_synapse_enabled else true }}"
  156. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  157. matrix_mautrix_facebook_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  158. matrix_mautrix_facebook_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mau.fb.db') | to_uuid }}"
  159. ######################################################################
  160. #
  161. # /matrix-bridge-mautrix-facebook
  162. #
  163. ######################################################################
  164. ######################################################################
  165. #
  166. # matrix-bridge-mautrix-hangouts
  167. #
  168. ######################################################################
  169. # We don't enable bridges by default.
  170. matrix_mautrix_hangouts_enabled: false
  171. matrix_mautrix_hangouts_container_image_self_build: "{{ matrix_architecture not in ['amd64', 'arm64'] }}"
  172. matrix_mautrix_hangouts_systemd_required_services_list: |
  173. {{
  174. ['docker.service']
  175. +
  176. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  177. +
  178. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  179. }}
  180. matrix_mautrix_hangouts_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'ho.as.token') | to_uuid }}"
  181. matrix_mautrix_hangouts_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'ho.hs.token') | to_uuid }}"
  182. matrix_mautrix_hangouts_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:9007' }}"
  183. 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 '' }}"
  184. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  185. matrix_mautrix_hangouts_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  186. matrix_mautrix_hangouts_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mau.hangouts.db') | to_uuid }}"
  187. ######################################################################
  188. #
  189. # /matrix-bridge-mautrix-hangouts
  190. #
  191. ######################################################################
  192. ######################################################################
  193. #
  194. # matrix-bridge-mautrix-signal
  195. #
  196. ######################################################################
  197. # We don't enable bridges by default.
  198. matrix_mautrix_signal_enabled: false
  199. matrix_mautrix_signal_systemd_required_services_list: |
  200. {{
  201. ['docker.service']
  202. +
  203. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  204. +
  205. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  206. +
  207. ['matrix-mautrix-signal-daemon.service']
  208. }}
  209. matrix_mautrix_signal_homeserver_domain: '{{ matrix_domain }}'
  210. matrix_mautrix_signal_homeserver_address: "{{ 'http://matrix-synapse:8008' if matrix_synapse_enabled else '' }}"
  211. matrix_mautrix_signal_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'si.hs.token') | to_uuid }}"
  212. matrix_mautrix_signal_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'si.as.token') | to_uuid }}"
  213. matrix_mautrix_signal_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  214. matrix_mautrix_signal_database_engine: 'postgres'
  215. matrix_mautrix_signal_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mau.signal.db') | to_uuid }}"
  216. ######################################################################
  217. #
  218. # /matrix-bridge-mautrix-signal
  219. #
  220. ######################################################################
  221. ######################################################################
  222. #
  223. # matrix-bridge-mautrix-telegram
  224. #
  225. ######################################################################
  226. # We don't enable bridges by default.
  227. matrix_mautrix_telegram_enabled: false
  228. # Images are multi-arch (amd64 and arm64, but not arm32).
  229. matrix_mautrix_telegram_container_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}"
  230. matrix_mautrix_telegram_systemd_required_services_list: |
  231. {{
  232. ['docker.service']
  233. +
  234. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  235. +
  236. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  237. }}
  238. matrix_mautrix_telegram_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'telegr.as.token') | to_uuid }}"
  239. matrix_mautrix_telegram_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'telegr.hs.token') | to_uuid }}"
  240. matrix_mautrix_telegram_public_endpoint: "/{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'telegram') | to_uuid }}"
  241. matrix_mautrix_telegram_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:9006' }}"
  242. 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 '' }}"
  243. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  244. matrix_mautrix_telegram_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  245. matrix_mautrix_telegram_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mau.telegram.db') | to_uuid }}"
  246. ######################################################################
  247. #
  248. # /matrix-bridge-mautrix-telegram
  249. #
  250. ######################################################################
  251. ######################################################################
  252. #
  253. # matrix-bridge-mautrix-whatsapp
  254. #
  255. ######################################################################
  256. # We don't enable bridges by default.
  257. matrix_mautrix_whatsapp_enabled: false
  258. matrix_mautrix_whatsapp_systemd_required_services_list: |
  259. {{
  260. ['docker.service']
  261. +
  262. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  263. +
  264. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  265. }}
  266. matrix_mautrix_whatsapp_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'whats.as.token') | to_uuid }}"
  267. matrix_mautrix_whatsapp_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'whats.hs.token') | to_uuid }}"
  268. 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 '' }}"
  269. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  270. matrix_mautrix_whatsapp_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  271. matrix_mautrix_whatsapp_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mauwhatsapp.db') | to_uuid }}"
  272. ######################################################################
  273. #
  274. # /matrix-bridge-mautrix-whatsapp
  275. #
  276. ######################################################################
  277. ######################################################################
  278. #
  279. # matrix-sms-bridge
  280. #
  281. ######################################################################
  282. # We don't enable bridges by default.
  283. matrix_sms_bridge_enabled: false
  284. matrix_sms_bridge_systemd_required_services_list: |
  285. {{
  286. ['docker.service']
  287. +
  288. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  289. }}
  290. matrix_sms_bridge_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'sms.as.token') | to_uuid }}"
  291. matrix_sms_bridge_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'sms.hs.token') | to_uuid }}"
  292. ######################################################################
  293. #
  294. # /matrix-sms-bridge
  295. #
  296. ######################################################################
  297. ######################################################################
  298. #
  299. # matrix-bridge-mx-puppet-skype
  300. #
  301. ######################################################################
  302. # We don't enable bridges by default.
  303. matrix_mx_puppet_skype_enabled: false
  304. matrix_mx_puppet_skype_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  305. matrix_mx_puppet_skype_systemd_required_services_list: |
  306. {{
  307. ['docker.service']
  308. +
  309. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  310. +
  311. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  312. }}
  313. matrix_mx_puppet_skype_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'skype.as.tok') | to_uuid }}"
  314. matrix_mx_puppet_skype_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'skype.hs.tok') | to_uuid }}"
  315. 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 '' }}"
  316. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  317. matrix_mx_puppet_skype_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  318. matrix_mx_puppet_skype_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxpup.skype.db') | to_uuid }}"
  319. ######################################################################
  320. #
  321. # /matrix-bridge-mx-puppet-skype
  322. #
  323. ######################################################################
  324. ######################################################################
  325. #
  326. # matrix-bridge-mx-puppet-slack
  327. #
  328. ######################################################################
  329. # We don't enable bridges by default.
  330. matrix_mx_puppet_slack_enabled: false
  331. matrix_mx_puppet_slack_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  332. matrix_mx_puppet_slack_systemd_required_services_list: |
  333. {{
  334. ['docker.service']
  335. +
  336. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  337. +
  338. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  339. }}
  340. matrix_mx_puppet_slack_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxslk.as.tok') | to_uuid }}"
  341. matrix_mx_puppet_slack_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxslk.hs.tok') | to_uuid }}"
  342. 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 '' }}"
  343. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  344. matrix_mx_puppet_slack_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  345. matrix_mx_puppet_slack_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxpup.slack.db') | to_uuid }}"
  346. ######################################################################
  347. #
  348. # /matrix-bridge-mx-puppet-slack
  349. #
  350. ######################################################################
  351. ######################################################################
  352. #
  353. # matrix-bridge-mx-puppet-twitter
  354. #
  355. ######################################################################
  356. # We don't enable bridges by default.
  357. matrix_mx_puppet_twitter_enabled: false
  358. matrix_mx_puppet_twitter_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  359. matrix_mx_puppet_twitter_systemd_required_services_list: |
  360. {{
  361. ['docker.service']
  362. +
  363. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  364. +
  365. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  366. }}
  367. matrix_mx_puppet_twitter_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxtwt.as.tok') | to_uuid }}"
  368. matrix_mx_puppet_twitter_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxtwt.hs.tok') | to_uuid }}"
  369. matrix_mx_puppet_twitter_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  370. matrix_mx_puppet_twitter_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else ('127.0.0.1:' ~ matrix_mx_puppet_twitter_appservice_port) }}"
  371. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  372. matrix_mx_puppet_twitter_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  373. matrix_mx_puppet_twitter_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxpup.twitter.db') | to_uuid }}"
  374. ######################################################################
  375. #
  376. # /matrix-bridge-mx-puppet-twitter
  377. #
  378. ######################################################################
  379. ######################################################################
  380. #
  381. # matrix-bridge-mx-puppet-instagram
  382. #
  383. ######################################################################
  384. # We don't enable bridges by default.
  385. matrix_mx_puppet_instagram_enabled: false
  386. matrix_mx_puppet_instagram_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  387. matrix_mx_puppet_instagram_systemd_required_services_list: |
  388. {{
  389. ['docker.service']
  390. +
  391. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  392. +
  393. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  394. }}
  395. matrix_mx_puppet_instagram_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxig.as.tok') | to_uuid }}"
  396. matrix_mx_puppet_instagram_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxig.hs.tok') | to_uuid }}"
  397. matrix_mx_puppet_instagram_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  398. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  399. matrix_mx_puppet_instagram_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  400. matrix_mx_puppet_instagram_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxpup.ig.db') | to_uuid }}"
  401. ######################################################################
  402. #
  403. # /matrix-bridge-mx-puppet-instagram
  404. #
  405. ######################################################################
  406. ######################################################################
  407. #
  408. # matrix-bridge-mx-puppet-discord
  409. #
  410. ######################################################################
  411. # We don't enable bridges by default.
  412. matrix_mx_puppet_discord_enabled: false
  413. matrix_mx_puppet_discord_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  414. matrix_mx_puppet_discord_systemd_required_services_list: |
  415. {{
  416. ['docker.service']
  417. +
  418. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  419. +
  420. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  421. }}
  422. matrix_mx_puppet_discord_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxdsc.as.tok') | to_uuid }}"
  423. matrix_mx_puppet_discord_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxdsc.hs.tok') | to_uuid }}"
  424. matrix_mx_puppet_discord_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  425. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  426. matrix_mx_puppet_discord_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  427. matrix_mx_puppet_discord_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxpup.dsc.db') | to_uuid }}"
  428. ######################################################################
  429. #
  430. # /matrix-bridge-mx-puppet-discord
  431. #
  432. ######################################################################
  433. ######################################################################
  434. #
  435. # matrix-bridge-mx-puppet-steam
  436. #
  437. ######################################################################
  438. # We don't enable bridges by default.
  439. matrix_mx_puppet_steam_enabled: false
  440. matrix_mx_puppet_steam_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  441. matrix_mx_puppet_steam_systemd_required_services_list: |
  442. {{
  443. ['docker.service']
  444. +
  445. (['matrix-synapse.service'] if matrix_synapse_enabled else [])
  446. +
  447. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  448. }}
  449. matrix_mx_puppet_steam_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxste.as.tok') | to_uuid }}"
  450. matrix_mx_puppet_steam_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxste.hs.tok') | to_uuid }}"
  451. matrix_mx_puppet_steam_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}"
  452. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  453. matrix_mx_puppet_steam_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  454. matrix_mx_puppet_steam_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mxpup.steam.db') | to_uuid }}"
  455. ######################################################################
  456. #
  457. # /matrix-bridge-mx-puppet-steam
  458. #
  459. ######################################################################
  460. ######################################################################
  461. #
  462. # matrix-bot-matrix-reminder-bot
  463. #
  464. ######################################################################
  465. # We don't enable bots by default.
  466. matrix_bot_matrix_reminder_bot_enabled: false
  467. matrix_bot_matrix_reminder_bot_systemd_required_services_list: |
  468. {{
  469. ['docker.service']
  470. +
  471. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  472. }}
  473. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  474. matrix_bot_matrix_reminder_bot_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  475. matrix_bot_matrix_reminder_bot_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'reminder.bot.db') | to_uuid }}"
  476. ######################################################################
  477. #
  478. # /matrix-bot-matrix-reminder-bot
  479. #
  480. ######################################################################
  481. ######################################################################
  482. #
  483. # matrix-corporal
  484. #
  485. ######################################################################
  486. matrix_corporal_enabled: false
  487. matrix_corporal_container_image_self_build: "{{ matrix_architecture != 'amd64' }}"
  488. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-corporal over the container network.
  489. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  490. # matrix-corporal's web-server ports to the local host.
  491. matrix_corporal_container_http_gateway_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:41080' }}"
  492. matrix_corporal_container_http_api_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:41081' }}"
  493. matrix_corporal_systemd_required_services_list: |
  494. {{
  495. (['docker.service'])
  496. +
  497. (['matrix-synapse.service'])
  498. }}
  499. matrix_corporal_matrix_homeserver_api_endpoint: "http://matrix-synapse:8008"
  500. matrix_corporal_matrix_auth_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret }}"
  501. # This is only useful if there's REST auth provider to make use of it.
  502. matrix_corporal_http_gateway_internal_rest_auth_enabled: "{{ matrix_synapse_ext_password_provider_rest_auth_enabled }}"
  503. matrix_corporal_matrix_registration_shared_secret: "{{ matrix_synapse_registration_shared_secret }}"
  504. ######################################################################
  505. #
  506. # /matrix-corporal
  507. #
  508. ######################################################################
  509. ######################################################################
  510. #
  511. # matrix-coturn
  512. #
  513. ######################################################################
  514. matrix_coturn_enabled: true
  515. matrix_coturn_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  516. matrix_coturn_turn_external_ip_address: "{{ ansible_host }}"
  517. matrix_coturn_tls_enabled: "{{ matrix_ssl_retrieval_method != 'none' }}"
  518. matrix_coturn_tls_cert_path: "{{ matrix_ssl_config_dir_path }}/live/{{ matrix_server_fqn_matrix }}/fullchain.pem"
  519. matrix_coturn_tls_key_path: "{{ matrix_ssl_config_dir_path }}/live/{{ matrix_server_fqn_matrix }}/privkey.pem"
  520. matrix_coturn_container_additional_volumes: |
  521. {{
  522. ([] if matrix_ssl_retrieval_method == 'none' else [
  523. {
  524. 'src': matrix_ssl_config_dir_path,
  525. 'dst': matrix_ssl_config_dir_path,
  526. 'options': 'ro',
  527. }
  528. ])
  529. }}
  530. ######################################################################
  531. #
  532. # /matrix-coturn
  533. #
  534. ######################################################################
  535. ######################################################################
  536. #
  537. # matrix-dimension
  538. #
  539. ######################################################################
  540. matrix_dimension_enabled: false
  541. # Normally, matrix-nginx-proxy is enabled and nginx can reach Dimension over the container network.
  542. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  543. # the Dimension HTTP port to the local host.
  544. matrix_dimension_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8184' }}"
  545. matrix_integration_manager_rest_url: "{{ matrix_dimension_integrations_rest_url if matrix_dimension_enabled else None }}"
  546. matrix_integration_manager_ui_url: "{{ matrix_dimension_integrations_ui_url if matrix_dimension_enabled else None }}"
  547. matrix_dimension_systemd_required_services_list: |
  548. {{
  549. ['docker.service']
  550. +
  551. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  552. }}
  553. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  554. matrix_dimension_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  555. matrix_dimension_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'dimension.db') | to_uuid }}"
  556. ######################################################################
  557. #
  558. # /matrix-dimension
  559. #
  560. ######################################################################
  561. ######################################################################
  562. #
  563. # matrix-dynamic-dns
  564. #
  565. ######################################################################
  566. matrix_dynamic_dns_enabled: false
  567. ######################################################################
  568. #
  569. # /matrix-dynamic-dns
  570. #
  571. ######################################################################
  572. ######################################################################
  573. #
  574. # matrix-email2matrix
  575. #
  576. ######################################################################
  577. matrix_email2matrix_enabled: false
  578. ######################################################################
  579. #
  580. # /matrix-email2matrix
  581. #
  582. ######################################################################
  583. ######################################################################
  584. #
  585. # matrix-jitsi
  586. #
  587. ######################################################################
  588. matrix_jitsi_enabled: false
  589. # Normally, matrix-nginx-proxy is enabled and nginx can reach jitsi/web over the container network.
  590. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  591. # the Jitsi HTTP port to the local host.
  592. matrix_jitsi_web_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:12080' }}"
  593. matrix_jitsi_jvb_container_colibri_ws_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:12090' }}"
  594. matrix_jitsi_jibri_xmpp_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'jibri') | to_uuid }}"
  595. matrix_jitsi_jicofo_auth_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'jicofo') | to_uuid }}"
  596. matrix_jitsi_jvb_auth_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'jvb') | to_uuid }}"
  597. matrix_jitsi_web_stun_servers: |
  598. {{
  599. [
  600. 'stun:' + matrix_server_fqn_matrix + ':5349',
  601. 'stun:' + matrix_server_fqn_matrix + ':3478',
  602. ]
  603. if matrix_coturn_enabled
  604. else [ 'stun:meet-jit-si-turnrelay.jitsi.net:443']
  605. }}
  606. ######################################################################
  607. #
  608. # /matrix-jitsi
  609. #
  610. ######################################################################
  611. ######################################################################
  612. #
  613. # matrix-mailer
  614. #
  615. ######################################################################
  616. # By default, this playbook sets up an exim mailer server (running in a container).
  617. # This is so that Synapse can send email reminders for unread messages.
  618. # Other services (like ma1sd), also use the mailer.
  619. matrix_mailer_enabled: true
  620. matrix_mailer_container_image_self_build: "{{ matrix_architecture != 'amd64'}}"
  621. ######################################################################
  622. #
  623. # /matrix-mailer
  624. #
  625. ######################################################################
  626. ######################################################################
  627. #
  628. # matrix-ma1sd
  629. #
  630. ######################################################################
  631. # By default, this playbook installs the ma1sd identity server on the same domain as Synapse (`matrix_server_fqn_matrix`).
  632. # If you wish to use the public identity servers (matrix.org, vector.im) instead of your own you may wish to disable this.
  633. matrix_ma1sd_enabled: true
  634. # There's no prebuilt ma1sd image for the `arm32` architecture.
  635. # We're relying on self-building there.
  636. matrix_ma1sd_architecture: "{{
  637. {
  638. 'amd64': 'amd64',
  639. 'arm32': 'arm32',
  640. 'arm64': 'arm64',
  641. }[matrix_architecture]
  642. }}"
  643. matrix_ma1sd_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}"
  644. # Normally, matrix-nginx-proxy is enabled and nginx can reach ma1sd over the container network.
  645. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  646. # ma1sd's web-server port.
  647. matrix_ma1sd_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8090' }}"
  648. # We enable Synapse integration via its Postgres database by default.
  649. # When using another Identity store, you might wish to disable this and define
  650. # your own configuration in `matrix_ma1sd_configuration_extension_yaml`.
  651. matrix_ma1sd_synapsesql_enabled: true
  652. matrix_ma1sd_synapsesql_type: postgresql
  653. matrix_ma1sd_synapsesql_connection: //{{ matrix_synapse_database_host }}/{{ matrix_synapse_database_database }}?user={{ matrix_synapse_database_user | urlencode() }}&password={{ matrix_synapse_database_password | urlencode() }}
  654. matrix_ma1sd_dns_overwrite_enabled: true
  655. matrix_ma1sd_dns_overwrite_homeserver_client_name: "{{ matrix_server_fqn_matrix }}"
  656. matrix_ma1sd_dns_overwrite_homeserver_client_value: "http://{{ 'matrix-corporal:41080' if matrix_corporal_enabled else 'matrix-synapse:8008' }}"
  657. # By default, we send mail through the `matrix-mailer` service.
  658. matrix_ma1sd_threepid_medium_email_identity_from: "{{ matrix_mailer_sender_address }}"
  659. matrix_ma1sd_threepid_medium_email_connectors_smtp_host: "matrix-mailer"
  660. matrix_ma1sd_threepid_medium_email_connectors_smtp_port: 8025
  661. matrix_ma1sd_threepid_medium_email_connectors_smtp_tls: 0
  662. matrix_ma1sd_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}"
  663. matrix_ma1sd_systemd_required_services_list: |
  664. {{
  665. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  666. }}
  667. matrix_ma1sd_systemd_wanted_services_list: |
  668. {{
  669. (['matrix-corporal.service'] if matrix_corporal_enabled else ['matrix-synapse.service'])
  670. +
  671. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  672. +
  673. (['matrix-mailer.service'] if matrix_mailer_enabled else [])
  674. }}
  675. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  676. matrix_ma1sd_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  677. matrix_ma1sd_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'ma1sd.db') | to_uuid }}"
  678. ######################################################################
  679. #
  680. # /matrix-ma1sd
  681. #
  682. ######################################################################
  683. ######################################################################
  684. #
  685. # matrix-nginx-proxy
  686. #
  687. ######################################################################
  688. # By default, this playbook sets up a reverse-proxy nginx proxy server on TCP ports 80, 443 and 8448.
  689. # This is fine if you're dedicating the whole server to Matrix.
  690. # If that's not the case, you may wish to disable this and take care of proxying yourself.
  691. matrix_nginx_proxy_enabled: true
  692. matrix_nginx_proxy_proxy_matrix_client_api_addr_with_container: "{{ 'matrix-corporal:41080' if matrix_corporal_enabled else 'matrix-synapse:8008' }}"
  693. 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' }}"
  694. matrix_nginx_proxy_proxy_matrix_client_api_client_max_body_size_mb: "{{ matrix_synapse_max_upload_size_mb }}"
  695. matrix_nginx_proxy_proxy_matrix_client_api_forwarded_location_synapse_admin_api_enabled: "{{ matrix_synapse_admin_enabled }}"
  696. matrix_nginx_proxy_proxy_matrix_client_redirect_root_uri_to_domain: "{{ matrix_server_fqn_element if matrix_client_element_enabled else '' }}"
  697. matrix_nginx_proxy_proxy_matrix_enabled: true
  698. matrix_nginx_proxy_proxy_element_enabled: "{{ matrix_client_element_enabled }}"
  699. matrix_nginx_proxy_proxy_dimension_enabled: "{{ matrix_dimension_enabled }}"
  700. matrix_nginx_proxy_proxy_jitsi_enabled: "{{ matrix_jitsi_enabled }}"
  701. matrix_nginx_proxy_proxy_matrix_corporal_api_enabled: "{{ matrix_corporal_enabled and matrix_corporal_http_api_enabled }}"
  702. matrix_nginx_proxy_proxy_matrix_corporal_api_addr_with_container: "matrix-corporal:41081"
  703. matrix_nginx_proxy_proxy_matrix_corporal_api_addr_sans_container: "127.0.0.1:41081"
  704. matrix_nginx_proxy_proxy_matrix_identity_api_enabled: "{{ matrix_ma1sd_enabled }}"
  705. matrix_nginx_proxy_proxy_matrix_identity_api_addr_with_container: "matrix-ma1sd:8090"
  706. matrix_nginx_proxy_proxy_matrix_identity_api_addr_sans_container: "127.0.0.1:8090"
  707. # By default, we do TLS termination for the Matrix Federation API (port 8448) at matrix-nginx-proxy.
  708. # Unless this is handled there OR Synapse's federation listener port is disabled, we'll reverse-proxy.
  709. matrix_nginx_proxy_proxy_matrix_federation_api_enabled: "{{ matrix_synapse_federation_port_enabled and not matrix_synapse_tls_federation_listener_enabled }}"
  710. matrix_nginx_proxy_proxy_matrix_federation_api_addr_with_container: "matrix-synapse:8048"
  711. matrix_nginx_proxy_proxy_matrix_federation_api_addr_sans_container: "127.0.0.1:8048"
  712. matrix_nginx_proxy_container_federation_host_bind_port: "{{ matrix_federation_public_port }}"
  713. matrix_nginx_proxy_proxy_synapse_metrics: "{{ matrix_synapse_metrics_enabled }}"
  714. matrix_nginx_proxy_proxy_synapse_metrics_addr_with_container: "matrix-synapse:{{ matrix_synapse_metrics_port }}"
  715. matrix_nginx_proxy_proxy_synapse_metrics_addr_sans_container: "127.0.0.1:{{ matrix_synapse_metrics_port }}"
  716. matrix_nginx_proxy_proxy_matrix_user_directory_search_enabled: "{{ matrix_ma1sd_enabled }}"
  717. matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_with_container: "{{ matrix_nginx_proxy_proxy_matrix_identity_api_addr_with_container }}"
  718. matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_sans_container: "{{ matrix_nginx_proxy_proxy_matrix_identity_api_addr_sans_container }}"
  719. matrix_nginx_proxy_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}"
  720. matrix_nginx_proxy_systemd_wanted_services_list: |
  721. {{
  722. (['matrix-synapse.service'])
  723. +
  724. (['matrix-corporal.service'] if matrix_corporal_enabled else [])
  725. +
  726. (['matrix-ma1sd.service'] if matrix_ma1sd_enabled else [])
  727. +
  728. (['matrix-client-element.service'] if matrix_client_element_enabled else [])
  729. }}
  730. matrix_ssl_domains_to_obtain_certificates_for: |
  731. {{
  732. ([matrix_server_fqn_matrix])
  733. +
  734. ([matrix_server_fqn_element] if matrix_client_element_enabled else [])
  735. +
  736. ([matrix_nginx_proxy_proxy_riot_compat_redirect_hostname] if matrix_nginx_proxy_proxy_riot_compat_redirect_enabled else [])
  737. +
  738. ([matrix_server_fqn_dimension] if matrix_dimension_enabled else [])
  739. +
  740. ([matrix_server_fqn_jitsi] if matrix_jitsi_enabled else [])
  741. +
  742. ([matrix_domain] if matrix_nginx_proxy_base_domain_serving_enabled else [])
  743. }}
  744. matrix_ssl_architecture: "{{
  745. {
  746. 'amd64': 'amd64',
  747. 'arm32': 'arm32v6',
  748. 'arm64': 'arm64v8',
  749. }[matrix_architecture]
  750. }}"
  751. matrix_ssl_pre_obtaining_required_service_name: "{{ 'matrix-dynamic-dns' if matrix_dynamic_dns_enabled else '' }}"
  752. ######################################################################
  753. #
  754. # /matrix-nginx-proxy
  755. #
  756. ######################################################################
  757. ######################################################################
  758. #
  759. # matrix-postgres
  760. #
  761. ######################################################################
  762. matrix_postgres_enabled: true
  763. matrix_postgres_connection_hostname: "matrix-postgres"
  764. matrix_postgres_connection_username: "synapse"
  765. # Please note that the max length of the password is 99 characters
  766. matrix_postgres_connection_password: "synapse-password"
  767. matrix_postgres_db_name: "homeserver"
  768. matrix_postgres_pgloader_container_image_self_build: "{{ matrix_architecture != 'amd64' }}"
  769. matrix_postgres_additional_databases: |
  770. {{
  771. ([{
  772. 'name': matrix_ma1sd_database_name,
  773. 'username': matrix_ma1sd_database_username,
  774. 'password': matrix_ma1sd_database_password,
  775. }] if (matrix_ma1sd_enabled and matrix_ma1sd_database_engine == 'postgres' and matrix_ma1sd_database_hostname == 'matrix-postgres') else [])
  776. +
  777. ([{
  778. 'name': matrix_bot_matrix_reminder_bot_database_name,
  779. 'username': matrix_bot_matrix_reminder_bot_database_username,
  780. 'password': matrix_bot_matrix_reminder_bot_database_password,
  781. }] if (matrix_bot_matrix_reminder_bot_enabled and matrix_bot_matrix_reminder_bot_database_engine == 'postgres' and matrix_bot_matrix_reminder_bot_database_hostname == 'matrix-postgres') else [])
  782. +
  783. ([{
  784. 'name': matrix_registration_database_name,
  785. 'username': matrix_registration_database_username,
  786. 'password': matrix_registration_database_password,
  787. }] if (matrix_registration_enabled and matrix_registration_database_engine == 'postgres' and matrix_registration_database_hostname == 'matrix-postgres') else [])
  788. +
  789. ([{
  790. 'name': matrix_appservice_discord_database_name,
  791. 'username': matrix_appservice_discord_database_username,
  792. 'password': matrix_appservice_discord_database_password,
  793. }] if (matrix_appservice_discord_enabled and matrix_appservice_discord_database_engine == 'postgres' and matrix_appservice_discord_database_hostname == 'matrix-postgres') else [])
  794. +
  795. ([{
  796. 'name': matrix_appservice_slack_database_name,
  797. 'username': matrix_appservice_slack_database_username,
  798. 'password': matrix_appservice_slack_database_password,
  799. }] if (matrix_appservice_slack_enabled and matrix_appservice_slack_database_engine == 'postgres' and matrix_appservice_slack_database_hostname == 'matrix-postgres') else [])
  800. +
  801. ([{
  802. 'name': matrix_appservice_irc_database_name,
  803. 'username': matrix_appservice_irc_database_username,
  804. 'password': matrix_appservice_irc_database_password,
  805. }] if (matrix_appservice_irc_enabled and matrix_appservice_irc_database_engine == 'postgres' and matrix_appservice_irc_database_hostname == 'matrix-postgres') else [])
  806. +
  807. ([{
  808. 'name': matrix_mautrix_facebook_database_name,
  809. 'username': matrix_mautrix_facebook_database_username,
  810. 'password': matrix_mautrix_facebook_database_password,
  811. }] if (matrix_mautrix_facebook_enabled and matrix_mautrix_facebook_database_engine == 'postgres' and matrix_mautrix_facebook_database_hostname == 'matrix-postgres') else [])
  812. +
  813. ([{
  814. 'name': matrix_mautrix_hangouts_database_name,
  815. 'username': matrix_mautrix_hangouts_database_username,
  816. 'password': matrix_mautrix_hangouts_database_password,
  817. }] if (matrix_mautrix_hangouts_enabled and matrix_mautrix_hangouts_database_engine == 'postgres' and matrix_mautrix_hangouts_database_hostname == 'matrix-postgres') else [])
  818. +
  819. ([{
  820. 'name': matrix_mautrix_signal_database_name,
  821. 'username': matrix_mautrix_signal_database_username,
  822. 'password': matrix_mautrix_signal_database_password,
  823. }] if (matrix_mautrix_signal_enabled and matrix_mautrix_signal_database_engine == 'postgres' and matrix_mautrix_signal_database_hostname == 'matrix-postgres') else [])
  824. +
  825. ([{
  826. 'name': matrix_mautrix_telegram_database_name,
  827. 'username': matrix_mautrix_telegram_database_username,
  828. 'password': matrix_mautrix_telegram_database_password,
  829. }] if (matrix_mautrix_telegram_enabled and matrix_mautrix_telegram_database_engine == 'postgres' and matrix_mautrix_telegram_database_hostname == 'matrix-postgres') else [])
  830. +
  831. ([{
  832. 'name': matrix_mautrix_whatsapp_database_name,
  833. 'username': matrix_mautrix_whatsapp_database_username,
  834. 'password': matrix_mautrix_whatsapp_database_password,
  835. }] if (matrix_mautrix_whatsapp_enabled and matrix_mautrix_whatsapp_database_engine == 'postgres' and matrix_mautrix_whatsapp_database_hostname == 'matrix-postgres') else [])
  836. +
  837. ([{
  838. 'name': matrix_mx_puppet_skype_database_name,
  839. 'username': matrix_mx_puppet_skype_database_username,
  840. 'password': matrix_mx_puppet_skype_database_password,
  841. }] if (matrix_mx_puppet_skype_enabled and matrix_mx_puppet_skype_database_engine == 'postgres' and matrix_mx_puppet_skype_database_hostname == 'matrix-postgres') else [])
  842. +
  843. ([{
  844. 'name': matrix_mx_puppet_slack_database_name,
  845. 'username': matrix_mx_puppet_slack_database_username,
  846. 'password': matrix_mx_puppet_slack_database_password,
  847. }] if (matrix_mx_puppet_slack_enabled and matrix_mx_puppet_slack_database_engine == 'postgres' and matrix_mx_puppet_slack_database_hostname == 'matrix-postgres') else [])
  848. +
  849. ([{
  850. 'name': matrix_mx_puppet_twitter_database_name,
  851. 'username': matrix_mx_puppet_twitter_database_username,
  852. 'password': matrix_mx_puppet_twitter_database_password,
  853. }] if (matrix_mx_puppet_twitter_enabled and matrix_mx_puppet_twitter_database_engine == 'postgres' and matrix_mx_puppet_twitter_database_hostname == 'matrix-postgres') else [])
  854. +
  855. ([{
  856. 'name': matrix_mx_puppet_instagram_database_name,
  857. 'username': matrix_mx_puppet_instagram_database_username,
  858. 'password': matrix_mx_puppet_instagram_database_password,
  859. }] if (matrix_mx_puppet_instagram_enabled and matrix_mx_puppet_instagram_database_engine == 'postgres' and matrix_mx_puppet_instagram_database_hostname == 'matrix-postgres') else [])
  860. +
  861. ([{
  862. 'name': matrix_mx_puppet_discord_database_name,
  863. 'username': matrix_mx_puppet_discord_database_username,
  864. 'password': matrix_mx_puppet_discord_database_password,
  865. }] if (matrix_mx_puppet_discord_enabled and matrix_mx_puppet_discord_database_engine == 'postgres' and matrix_mx_puppet_discord_database_hostname == 'matrix-postgres') else [])
  866. +
  867. ([{
  868. 'name': matrix_mx_puppet_steam_database_name,
  869. 'username': matrix_mx_puppet_steam_database_username,
  870. 'password': matrix_mx_puppet_steam_database_password,
  871. }] if (matrix_mx_puppet_steam_enabled and matrix_mx_puppet_steam_database_engine == 'postgres' and matrix_mx_puppet_steam_database_hostname == 'matrix-postgres') else [])
  872. +
  873. ([{
  874. 'name': matrix_dimension_database_name,
  875. 'username': matrix_dimension_database_username,
  876. 'password': matrix_dimension_database_password,
  877. }] if (matrix_dimension_enabled and matrix_dimension_database_engine == 'postgres' and matrix_dimension_database_hostname == 'matrix-postgres') else [])
  878. }}
  879. matrix_postgres_import_roles_to_ignore: |
  880. {{
  881. [matrix_postgres_connection_username]
  882. +
  883. matrix_postgres_additional_databases|map(attribute='username')|list
  884. }}
  885. matrix_postgres_import_databases_to_ignore: |
  886. {{
  887. [matrix_postgres_db_name]
  888. +
  889. matrix_postgres_additional_databases|map(attribute='name')|list
  890. }}
  891. ######################################################################
  892. #
  893. # /matrix-postgres
  894. #
  895. ######################################################################
  896. ######################################################################
  897. #
  898. # matrix-client-element
  899. #
  900. ######################################################################
  901. # By default, this playbook installs the Element web UI on the `matrix_server_fqn_element` domain.
  902. # If you wish to connect to your Matrix server by other means, you may wish to disable this.
  903. matrix_client_element_enabled: true
  904. matrix_client_element_container_image_self_build: "{{ matrix_architecture != 'amd64' }}"
  905. # Normally, matrix-nginx-proxy is enabled and nginx can reach Element over the container network.
  906. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  907. # the Element HTTP port to the local host.
  908. matrix_client_element_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8765' }}"
  909. matrix_client_element_default_hs_url: "{{ matrix_homeserver_url }}"
  910. matrix_client_element_default_is_url: "{{ matrix_identity_server_url }}"
  911. # Use Dimension if enabled, otherwise fall back to Scalar
  912. matrix_client_element_integrations_ui_url: "{{ matrix_dimension_integrations_ui_url if matrix_dimension_enabled else 'https://scalar.vector.im/' }}"
  913. matrix_client_element_integrations_rest_url: "{{ matrix_dimension_integrations_rest_url if matrix_dimension_enabled else 'https://scalar.vector.im/api' }}"
  914. matrix_client_element_integrations_widgets_urls: "{{ matrix_dimension_integrations_widgets_urls if matrix_dimension_enabled else ['https://scalar.vector.im/api'] }}"
  915. matrix_client_element_integrations_jitsi_widget_url: "{{ matrix_dimension_integrations_jitsi_widget_url if matrix_dimension_enabled else 'https://scalar.vector.im/api/widgets/jitsi.html' }}"
  916. matrix_client_element_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}"
  917. matrix_client_element_registration_enabled: "{{ matrix_synapse_enable_registration }}"
  918. matrix_client_element_enable_presence_by_hs_url: |
  919. {{
  920. none
  921. if matrix_synapse_use_presence
  922. else {matrix_client_element_default_hs_url: false}
  923. }}
  924. matrix_client_element_welcome_user_id: ~
  925. matrix_client_element_jitsi_preferredDomain: "{{ matrix_server_fqn_jitsi if matrix_jitsi_enabled else '' }}"
  926. ######################################################################
  927. #
  928. # /matrix-client-element
  929. #
  930. ######################################################################
  931. ######################################################################
  932. #
  933. # matrix-synapse
  934. #
  935. ######################################################################
  936. matrix_synapse_container_image_self_build: "{{ matrix_architecture not in ['arm32', 'arm64', 'amd64'] }}"
  937. # When ma1sd is enabled, we can use it to validate email addresses and phone numbers.
  938. # 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.
  939. matrix_synapse_account_threepid_delegates_email: "{{ 'http://matrix-ma1sd:8090' if matrix_ma1sd_enabled else '' }}"
  940. matrix_synapse_account_threepid_delegates_msisdn: "{{ 'http://matrix-ma1sd:8090' if matrix_ma1sd_enabled else '' }}"
  941. # Normally, matrix-nginx-proxy is enabled and nginx can reach Synapse over the container network.
  942. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it,
  943. # you can expose Synapse's ports to the host.
  944. #
  945. # For exposing the Matrix Client API's port (plain HTTP) to the local host.
  946. matrix_synapse_container_client_api_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8008' }}"
  947. #
  948. # For exposing the Matrix Federation API's plain port (plain HTTP) to the local host.
  949. matrix_synapse_container_federation_api_plain_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8048' }}"
  950. #
  951. # For exposing the Matrix Federation API's TLS port (HTTPS) to the internet on all network interfaces.
  952. matrix_synapse_container_federation_api_tls_host_bind_port: "{{ matrix_federation_public_port if (matrix_synapse_federation_enabled and matrix_synapse_tls_federation_listener_enabled) else '' }}"
  953. #
  954. # For exposing the Synapse Metrics API's port (plain HTTP) to the local host.
  955. 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 '' }}"
  956. #
  957. # For exposing the Synapse Manhole port (plain HTTP) to the local host.
  958. matrix_synapse_container_manhole_api_host_bind_port: "{{ '127.0.0.1:9000' if matrix_synapse_manhole_enabled else '' }}"
  959. matrix_synapse_database_host: "{{ matrix_postgres_connection_hostname }}"
  960. matrix_synapse_database_user: "{{ matrix_postgres_connection_username }}"
  961. matrix_synapse_database_password: "{{ matrix_postgres_connection_password }}"
  962. matrix_synapse_database_database: "{{ matrix_postgres_db_name }}"
  963. # We do not enable TLS in Synapse by default.
  964. # TLS is handled by the matrix-nginx-proxy, which proxies the requests to Synapse.
  965. matrix_synapse_tls_federation_listener_enabled: false
  966. matrix_synapse_tls_certificate_path: ~
  967. matrix_synapse_tls_private_key_path: ~
  968. matrix_synapse_federation_port_openid_resource_required: "{{ not matrix_synapse_federation_enabled and (matrix_dimension_enabled or matrix_ma1sd_enabled) }}"
  969. matrix_synapse_email_enabled: "{{ matrix_mailer_enabled }}"
  970. matrix_synapse_email_smtp_host: "matrix-mailer"
  971. matrix_synapse_email_smtp_port: 8025
  972. matrix_synapse_email_smtp_require_transport_security: false
  973. matrix_synapse_email_notif_from: "Matrix <{{ matrix_mailer_sender_address }}>"
  974. # Even if TURN doesn't support TLS (it does by default),
  975. # it doesn't hurt to try a secure connection anyway.
  976. matrix_synapse_turn_uris: |
  977. {{
  978. [
  979. 'turns:' + matrix_server_fqn_matrix + '?transport=udp',
  980. 'turns:' + matrix_server_fqn_matrix + '?transport=tcp',
  981. 'turn:' + matrix_server_fqn_matrix + '?transport=udp',
  982. 'turn:' + matrix_server_fqn_matrix + '?transport=tcp',
  983. ]
  984. if matrix_coturn_enabled
  985. else []
  986. }}
  987. matrix_synapse_turn_shared_secret: "{{ matrix_coturn_turn_static_auth_secret if matrix_coturn_enabled else '' }}"
  988. matrix_synapse_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}"
  989. matrix_synapse_systemd_required_services_list: |
  990. {{
  991. (['docker.service'])
  992. +
  993. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  994. +
  995. (['matrix-goofys'] if matrix_s3_media_store_enabled else [])
  996. }}
  997. matrix_synapse_systemd_wanted_services_list: |
  998. {{
  999. (['matrix-coturn.service'] if matrix_coturn_enabled else [])
  1000. +
  1001. (['matrix-mailer.service'] if matrix_mailer_enabled else [])
  1002. }}
  1003. ######################################################################
  1004. #
  1005. # /matrix-synapse
  1006. #
  1007. ######################################################################
  1008. ######################################################################
  1009. #
  1010. # matrix-synapse-admin
  1011. #
  1012. ######################################################################
  1013. matrix_synapse_admin_enabled: false
  1014. # Normally, matrix-nginx-proxy is enabled and nginx can reach Synapse Admin over the container network.
  1015. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  1016. # Synapse Admin's HTTP port to the local host.
  1017. matrix_synapse_admin_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8766' }}"
  1018. matrix_synapse_admin_container_self_build: "{{ matrix_architecture != 'amd64' }}"
  1019. ######################################################################
  1020. #
  1021. # /matrix-synapse-admin
  1022. #
  1023. ######################################################################
  1024. ######################################################################
  1025. #
  1026. # matrix-registration
  1027. #
  1028. ######################################################################
  1029. matrix_registration_enabled: false
  1030. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-registration over the container network.
  1031. # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
  1032. # matrix-registration's HTTP port to the local host.
  1033. matrix_registration_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8767' }}"
  1034. matrix_registration_riot_instance: "{{ ('https://' + matrix_server_fqn_element) if matrix_client_element_enabled else 'https://riot.im/app/' }}"
  1035. matrix_registration_shared_secret: "{{ matrix_synapse_registration_shared_secret if matrix_synapse_enabled else '' }}"
  1036. matrix_registration_server_location: "{{ 'http://matrix-synapse:8008' if matrix_synapse_enabled else '' }}"
  1037. matrix_registration_api_validate_certs: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}"
  1038. matrix_registration_container_image_self_build: "{{ matrix_architecture != 'amd64' }}"
  1039. matrix_registration_systemd_required_services_list: |
  1040. {{
  1041. ['docker.service']
  1042. +
  1043. (['matrix-postgres.service'] if matrix_postgres_enabled else [])
  1044. }}
  1045. # Postgres is the default, except if not using `matrix_postgres` (internal postgres)
  1046. matrix_registration_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
  1047. matrix_registration_database_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'mx.registr.db') | to_uuid }}"
  1048. ######################################################################
  1049. #
  1050. # /matrix-registration
  1051. #
  1052. ######################################################################