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

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