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

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