| @@ -1,3 +1,12 @@ | |||
| # 2023-08-23 | |||
| ## mautrix-wsproxy support | |||
| Thanks to [Johan Swetzén](https://github.com/jswetzen)'s efforts (who finished what was started by [James Reilly](https://github.com/hanthor) and [Shreyas Ajjarapu](https://github.com/shreyasajj)), the playbook now supports bridging to Android SMS and Apple iMessage via the [mautrix-wsproxy](https://github.com/mautrix/wsproxy) service (in combination with a [mautrix-imessage](https://github.com/mautrix/imessage) bridge running on your Mac or Android phone). | |||
| See our [Setting up Mautrix wsproxy for bridging Android SMS or Apple iMessage](docs/configuring-playbook-bridge-mautrix-wsproxy.md) documentation page for getting started. | |||
| # 2023-07-24 | |||
| ## matrix-registration-bot usage changed | |||
| @@ -9,12 +18,14 @@ | |||
| * `matrix_bot_matrix_registration_bot_bot_access_token` | |||
| * `matrix_bot_matrix_registration_bot_api_token` | |||
| # 2023-07-21 | |||
| ## mautrix-gmessages support | |||
| Thanks to [Shreyas Ajjarapu](https://github.com/shreyasajj)'s efforts, the playbook now supports bridging to [Google Messages](https://messages.google.com/) via the [mautrix-gmessages](https://github.com/mautrix/gmessages) bridge. See our [Setting up Mautrix Google Messages bridging](docs/configuring-playbook-bridge-mautrix-gmessages.md) documentation page for getting started. | |||
| # 2023-07-17 | |||
| ## matrix-media-repo support | |||
| @@ -42,6 +42,7 @@ When you're done configuring DNS, proceed to [Configuring the playbook](configur | |||
| | [Etherpad](configuring-playbook-etherpad.md) collaborative text editor | CNAME | `etherpad` | - | - | - | `matrix.<your-domain>` | | |||
| | [Hydrogen](configuring-playbook-client-hydrogen.md) web client | CNAME | `hydrogen` | - | - | - | `matrix.<your-domain>` | | |||
| | [Cinny](configuring-playbook-client-cinny.md) web client | CNAME | `cinny` | - | - | - | `matrix.<your-domain>` | | |||
| | [wsproxy](configuring-playbook-bridge-mautrix-wsproxy.md) sms bridge | CNAME | `wsproxy` | - | - | - | `matrix.<your-domain>` | | |||
| | [Buscarron](configuring-playbook-bot-buscarron.md) helpdesk bot | CNAME | `buscarron` | - | - | - | `matrix.<your-domain>` | | |||
| | [Postmoogle](configuring-playbook-bot-postmoogle.md)/[Email2Matrix](configuring-playbook-email2matrix.md) email bridges | MX | `matrix` | 10 | 0 | - | `matrix.<your-domain>` | | |||
| | [Postmoogle](configuring-playbook-bot-postmoogle.md) email bridge | TXT | `matrix` | - | - | - | `v=spf1 ip4:<your-ip> -all` | | |||
| @@ -75,6 +76,8 @@ The `hydrogen.<your-domain>` subdomain may be necessary, because this playbook c | |||
| The `cinny.<your-domain>` subdomain may be necessary, because this playbook could install the [Cinny](https://github.com/ajbura/cinny) web client. The installation of cinny is disabled by default, it is not a core required component. To learn how to install it, see our [configuring cinny guide](configuring-playbook-client-cinny.md). If you do not wish to set up cinny, feel free to skip the `cinny.<your-domain>` DNS record. | |||
| The `wsproxy.<your-domain>` subdomain may be necessary, because this playbook could install the [wsproxy](https://github.com/mautrix/wsproxy) web client. The installation of wsproxy is disabled by default, it is not a core required component. To learn how to install it, see our [configuring wsproxy guide](configuring-playbook-bridge-mautrix-wsproxy.md). If you do not wish to set up wsproxy, feel free to skip the `wsproxy.<your-domain>` DNS record. | |||
| The `buscarron.<your-domain>` subdomain may be necessary, because this playbook could install the [buscarron](https://gitlab.com/etke.cc/buscarron) bot. The installation of buscarron is disabled by default, it is not a core required component. To learn how to install it, see our [configuring buscarron guide](configuring-playbook-bot-buscarron.md). If you do not wish to set up buscarron, feel free to skip the `buscarron.<your-domain>` DNS record. | |||
| ## `_matrix-identity._tcp` SRV record setup | |||
| @@ -0,0 +1,33 @@ | |||
| # Setting up Mautrix wsproxy (optional) | |||
| The playbook can install and configure [mautrix-wsproxy](https://github.com/mautrix/wsproxy) for you. | |||
| See the project's [documentation](https://github.com/mautrix/wsproxy#readme) to learn what it does and why it might be useful to you. | |||
| ## DNS | |||
| You need to create a `wsproxy.DOMAIN` DNS record pointing to your Matrix server (a `CNAME` pointing to `matrix.DOMAIN`) to use wsproxy. | |||
| The hostname is configurable via a `matrix_mautrix_wsproxy_hostname` variable. | |||
| ## Configuration | |||
| Use the following playbook configuration: | |||
| ```yaml | |||
| matrix_mautrix_wsproxy_enabled: true | |||
| matrix_mautrix_androidsms_appservice_token: 'secret token from bridge' | |||
| matrix_mautrix_androidsms_homeserver_token: 'secret token from bridge' | |||
| matrix_mautrix_imessage_appservice_token: 'secret token from bridge' | |||
| matrix_mautrix_imessage_homeserver_token: 'secret token from bridge' | |||
| matrix_mautrix_wsproxy_syncproxy_shared_secret: 'secret token from bridge' | |||
| ``` | |||
| Note that the tokens must match what is compiled into the [mautrix-imessage](https://github.com/mautrix/imessage) bridge running on your Mac or Android device. | |||
| ## Usage | |||
| Follow the [matrix-imessage documenation](https://docs.mau.fi/bridges/go/imessage/index.html) for running `android-sms` and/or `matrix-imessage` on your device(s). | |||
| @@ -130,6 +130,8 @@ When you're done with all the configuration you'd like to do, continue with [Ins | |||
| - [Setting up Mautrix Signal bridging](configuring-playbook-bridge-mautrix-signal.md) (optional) | |||
| - [Setting up Mautrix wsproxy for bridging Android SMS or Apple iMessage](configuring-playbook-bridge-mautrix-wsproxy.md) (optional) | |||
| - [Setting up Appservice IRC bridging](configuring-playbook-bridge-appservice-irc.md) (optional) | |||
| - [Setting up Appservice Discord bridging](configuring-playbook-bridge-appservice-discord.md) (optional) | |||
| @@ -105,6 +105,10 @@ matrix_homeserver_container_extra_arguments_auto: | | |||
| + | |||
| (['--mount type=bind,src=' + matrix_mautrix_whatsapp_config_path + '/registration.yaml,dst=/matrix-mautrix-whatsapp-registration.yaml,ro'] if matrix_mautrix_whatsapp_enabled else []) | |||
| + | |||
| (['--mount type=bind,src=' + matrix_mautrix_wsproxy_config_path + '/androidsms-registration.yaml,dst=/matrix-mautrix-androidsms-registration.yaml,ro'] if matrix_mautrix_wsproxy_enabled else []) | |||
| + | |||
| (['--mount type=bind,src=' + matrix_mautrix_wsproxy_config_path + '/imessage-registration.yaml,dst=/matrix-mautrix-imessage-registration.yaml,ro'] if matrix_mautrix_wsproxy_enabled else []) | |||
| + | |||
| (['--mount type=bind,src=' + matrix_mx_puppet_discord_config_path + '/registration.yaml,dst=/matrix-mx-puppet-discord-registration.yaml,ro'] if matrix_mx_puppet_discord_enabled else []) | |||
| + | |||
| (['--mount type=bind,src=' + matrix_mx_puppet_groupme_config_path + '/registration.yaml,dst=/matrix-mx-puppet-groupme-registration.yaml,ro'] if matrix_mx_puppet_groupme_enabled else []) | |||
| @@ -164,6 +168,10 @@ matrix_homeserver_app_service_config_files_auto: | | |||
| + | |||
| (['/matrix-mautrix-whatsapp-registration.yaml'] if matrix_mautrix_whatsapp_enabled else []) | |||
| + | |||
| (['/matrix-mautrix-androidsms-registration.yaml'] if matrix_mautrix_wsproxy_enabled else []) | |||
| + | |||
| (['/matrix-mautrix-imessage-registration.yaml'] if matrix_mautrix_wsproxy_enabled else []) | |||
| + | |||
| (['/matrix-mx-puppet-discord-registration.yaml'] if matrix_mx_puppet_discord_enabled else []) | |||
| + | |||
| (['/matrix-mx-puppet-groupme-registration.yaml'] if matrix_mx_puppet_groupme_enabled else []) | |||
| @@ -278,6 +286,10 @@ devture_systemd_service_manager_services_list_auto: | | |||
| + | |||
| ([{'name': 'matrix-mautrix-whatsapp.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mautrix-whatsapp']}] if matrix_mautrix_whatsapp_enabled else []) | |||
| + | |||
| ([{'name': 'matrix-mautrix-wsproxy.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mautrix-wsproxy']}] if matrix_mautrix_wsproxy_enabled else []) | |||
| + | |||
| ([{'name': 'matrix-mautrix-wsproxy-syncproxy.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mautrix-wsproxy-syncproxy']}] if matrix_mautrix_wsproxy_enabled else []) | |||
| + | |||
| ([{'name': 'matrix-mx-puppet-discord.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mx-puppet-discord']}] if matrix_mx_puppet_discord_enabled else []) | |||
| + | |||
| ([{'name': 'matrix-mx-puppet-groupme.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mx-puppet-groupme']}] if matrix_mx_puppet_groupme_enabled else []) | |||
| @@ -1204,6 +1216,53 @@ matrix_mautrix_gmessages_database_password: "{{ '%s' | format(matrix_homeserver_ | |||
| # | |||
| ###################################################################### | |||
| ###################################################################### | |||
| # | |||
| # matrix-bridge-mautrix-wsproxy | |||
| # | |||
| ###################################################################### | |||
| # We don't enable bridges by default. | |||
| matrix_mautrix_wsproxy_enabled: false | |||
| matrix_mautrix_wsproxy_systemd_required_services_list: | | |||
| {{ | |||
| ['docker.service'] | |||
| + | |||
| ['matrix-' + matrix_homeserver_implementation + '.service'] | |||
| + | |||
| ([devture_postgres_identifier ~ '.service'] if devture_postgres_enabled else []) | |||
| + | |||
| (['matrix-nginx-proxy.service'] if matrix_nginx_proxy_enabled else []) | |||
| }} | |||
| matrix_mautrix_wsproxy_homeserver_domain: "{{ matrix_domain }}" | |||
| matrix_mautrix_wsproxy_homeserver_address: "{{ matrix_homeserver_container_url }}" | |||
| matrix_mautrix_wsproxy_hostname: "wsproxy.{{ matrix_mautrix_wsproxy_homeserver_domain }}" | |||
| matrix_mautrix_wsproxy_container_additional_networks: | | |||
| {{ | |||
| ( | |||
| ([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else []) | |||
| + | |||
| ([matrix_nginx_proxy_container_network] if matrix_nginx_proxy_enabled and matrix_nginx_proxy_container_network != matrix_mautrix_wsproxy_container_network else []) | |||
| + | |||
| ([devture_postgres_container_network] if devture_postgres_enabled and devture_postgres_container_network != matrix_mautrix_wsproxy_container_network else []) | |||
| ) | unique | |||
| }} | |||
| matrix_mautrix_wsproxy_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" | |||
| matrix_mautrix_wsproxy_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" | |||
| matrix_mautrix_wsproxy_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" | |||
| matrix_mautrix_wsproxy_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" | |||
| ###################################################################### | |||
| # | |||
| # /matrix-bridge-mautrix-wsproxy | |||
| # | |||
| ###################################################################### | |||
| ###################################################################### | |||
| # | |||
| # matrix-bridge-mautrix-whatsapp | |||
| @@ -2698,6 +2757,7 @@ matrix_nginx_proxy_proxy_dimension_enabled: "{{ matrix_dimension_enabled and mat | |||
| matrix_nginx_proxy_proxy_rageshake_enabled: "{{ matrix_rageshake_enabled and matrix_playbook_reverse_proxy_type in ['playbook-managed-nginx', 'other-nginx-non-container'] }}" | |||
| matrix_nginx_proxy_proxy_etherpad_enabled: "{{ etherpad_enabled and not etherpad_nginx_proxy_dimension_integration_enabled and matrix_playbook_reverse_proxy_type in ['playbook-managed-nginx', 'other-nginx-non-container'] }}" | |||
| matrix_nginx_proxy_proxy_bot_go_neb_enabled: "{{ matrix_bot_go_neb_enabled and matrix_playbook_reverse_proxy_type in ['playbook-managed-nginx', 'other-nginx-non-container'] }}" | |||
| matrix_nginx_proxy_proxy_mautrix_wsproxy_enabled: "{{ matrix_mautrix_wsproxy_enabled and matrix_playbook_reverse_proxy_type in ['playbook-managed-nginx', 'other-nginx-non-container'] }}" | |||
| matrix_nginx_proxy_proxy_jitsi_enabled: "{{ jitsi_enabled and matrix_playbook_reverse_proxy_type in ['playbook-managed-nginx', 'other-nginx-non-container'] }}" | |||
| @@ -2837,6 +2897,8 @@ matrix_ssl_domains_to_obtain_certificates_for: | | |||
| + | |||
| ([matrix_server_fqn_sygnal] if matrix_sygnal_enabled else []) | |||
| + | |||
| ([matrix_server_fqn_mautrix_wsproxy] if matrix_mautrix_wsproxy_enabled else []) | |||
| + | |||
| ([ntfy_hostname] if ntfy_enabled else []) | |||
| + | |||
| ([matrix_server_fqn_rageshake] if matrix_rageshake_enabled else []) | |||
| @@ -3055,6 +3117,12 @@ devture_postgres_managed_databases_auto: | | |||
| 'password': matrix_mautrix_signal_database_password, | |||
| }] if (matrix_mautrix_signal_enabled and matrix_mautrix_signal_database_engine == 'postgres' and matrix_mautrix_signal_database_hostname == devture_postgres_connection_hostname) else []) | |||
| + | |||
| ([{ | |||
| 'name': matrix_mautrix_wsproxy_syncproxy_database_name, | |||
| 'username': matrix_mautrix_wsproxy_syncproxy_database_username, | |||
| 'password': matrix_mautrix_wsproxy_syncproxy_database_password, | |||
| }] if (matrix_mautrix_wsproxy_enabled and matrix_mautrix_wsproxy_syncproxy_database_engine == 'postgres' and matrix_mautrix_wsproxy_syncproxy_database_hostname == 'matrix-postgres') else []) | |||
| + | |||
| ([{ | |||
| 'name': matrix_mautrix_telegram_database_name, | |||
| 'username': matrix_mautrix_telegram_database_username, | |||
| @@ -93,6 +93,9 @@ matrix_server_fqn_grafana: "stats.{{ matrix_domain }}" | |||
| # This is where you access the Sygnal push gateway. | |||
| matrix_server_fqn_sygnal: "sygnal.{{ matrix_domain }}" | |||
| # This is where you access the mautrix wsproxy push gateway. | |||
| matrix_server_fqn_mautrix_wsproxy: "wsproxy.{{ matrix_domain }}" | |||
| # This is where you access the ntfy push notification service. | |||
| matrix_server_fqn_ntfy: "ntfy.{{ matrix_domain }}" | |||
| @@ -108,8 +108,9 @@ matrix_bot_buscarron_database_password: 'some-password' | |||
| matrix_bot_buscarron_database_hostname: '' | |||
| matrix_bot_buscarron_database_port: 5432 | |||
| matrix_bot_buscarron_database_name: 'buscarron' | |||
| matrix_bot_buscarron_database_sslmode: disable | |||
| matrix_bot_buscarron_database_connection_string: 'postgres://{{ matrix_bot_buscarron_database_username }}:{{ matrix_bot_buscarron_database_password }}@{{ matrix_bot_buscarron_database_hostname }}:{{ matrix_bot_buscarron_database_port }}/{{ matrix_bot_buscarron_database_name }}?sslmode=disable' | |||
| matrix_bot_buscarron_database_connection_string: 'postgres://{{ matrix_bot_buscarron_database_username }}:{{ matrix_bot_buscarron_database_password }}@{{ matrix_bot_buscarron_database_hostname }}:{{ matrix_bot_buscarron_database_port }}/{{ matrix_bot_buscarron_database_name }}?sslmode={{ matrix_bot_buscarron_database_sslmode }}' | |||
| matrix_bot_buscarron_storage_database: "{{ | |||
| { | |||
| @@ -105,8 +105,9 @@ matrix_bot_honoroit_database_password: 'some-password' | |||
| matrix_bot_honoroit_database_hostname: '' | |||
| matrix_bot_honoroit_database_port: 5432 | |||
| matrix_bot_honoroit_database_name: 'honoroit' | |||
| matrix_bot_honoroit_database_sslmode: disable | |||
| matrix_bot_honoroit_database_connection_string: 'postgres://{{ matrix_bot_honoroit_database_username }}:{{ matrix_bot_honoroit_database_password }}@{{ matrix_bot_honoroit_database_hostname }}:{{ matrix_bot_honoroit_database_port }}/{{ matrix_bot_honoroit_database_name }}?sslmode=disable' | |||
| matrix_bot_honoroit_database_connection_string: 'postgres://{{ matrix_bot_honoroit_database_username }}:{{ matrix_bot_honoroit_database_password }}@{{ matrix_bot_honoroit_database_hostname }}:{{ matrix_bot_honoroit_database_port }}/{{ matrix_bot_honoroit_database_name }}?sslmode={{ matrix_bot_honoroit_database_sslmode }}' | |||
| matrix_bot_honoroit_storage_database: "{{ | |||
| { | |||
| @@ -31,8 +31,9 @@ matrix_bot_maubot_database_password: ~ | |||
| matrix_bot_maubot_database_hostname: '' | |||
| matrix_bot_maubot_database_port: 5432 | |||
| matrix_bot_maubot_database_name: matrix_bot_maubot | |||
| matrix_bot_maubot_database_sslmode: disable | |||
| matrix_bot_maubot_database_connection_string: postgres://{{ matrix_bot_maubot_database_username }}:{{ matrix_bot_maubot_database_password }}@{{ matrix_bot_maubot_database_hostname }}:{{ matrix_bot_maubot_database_port }}/{{ matrix_bot_maubot_database_name }}?sslmode=disable | |||
| matrix_bot_maubot_database_connection_string: postgres://{{ matrix_bot_maubot_database_username }}:{{ matrix_bot_maubot_database_password }}@{{ matrix_bot_maubot_database_hostname }}:{{ matrix_bot_maubot_database_port }}/{{ matrix_bot_maubot_database_name }}?sslmode={{ matrix_bot_maubot_database_sslmode }} | |||
| matrix_bot_maubot_database_uri: "{{ | |||
| { | |||
| @@ -45,8 +45,9 @@ matrix_bot_postmoogle_database_password: 'some-password' | |||
| matrix_bot_postmoogle_database_hostname: '' | |||
| matrix_bot_postmoogle_database_port: 5432 | |||
| matrix_bot_postmoogle_database_name: 'postmoogle' | |||
| matrix_bot_postmoogle_database_sslmode: disable | |||
| matrix_bot_postmoogle_database_connection_string: 'postgres://{{ matrix_bot_postmoogle_database_username }}:{{ matrix_bot_postmoogle_database_password }}@{{ matrix_bot_postmoogle_database_hostname }}:{{ matrix_bot_postmoogle_database_port }}/{{ matrix_bot_postmoogle_database_name }}?sslmode=disable' | |||
| matrix_bot_postmoogle_database_connection_string: 'postgres://{{ matrix_bot_postmoogle_database_username }}:{{ matrix_bot_postmoogle_database_password }}@{{ matrix_bot_postmoogle_database_hostname }}:{{ matrix_bot_postmoogle_database_port }}/{{ matrix_bot_postmoogle_database_name }}?sslmode={{ matrix_bot_postmoogle_database_sslmode }}' | |||
| matrix_bot_postmoogle_storage_database: "{{ | |||
| { | |||
| @@ -33,10 +33,11 @@ matrix_appservice_irc_database_password: 'some-password' | |||
| matrix_appservice_irc_database_hostname: '' | |||
| matrix_appservice_irc_database_port: 5432 | |||
| matrix_appservice_irc_database_name: matrix_appservice_irc | |||
| matrix_appservice_irc_database_sslmode: disable | |||
| # This is just the Postgres connection string, if Postgres is used. | |||
| # Naming clashes with `matrix_appservice_irc_database_connectionString` somewhat. | |||
| matrix_appservice_irc_database_connection_string: 'postgresql://{{ matrix_appservice_irc_database_username }}:{{ matrix_appservice_irc_database_password }}@{{ matrix_appservice_irc_database_hostname }}:{{ matrix_appservice_irc_database_port }}/{{ matrix_appservice_irc_database_name }}?sslmode=disable' | |||
| matrix_appservice_irc_database_connection_string: 'postgresql://{{ matrix_appservice_irc_database_username }}:{{ matrix_appservice_irc_database_password }}@{{ matrix_appservice_irc_database_hostname }}:{{ matrix_appservice_irc_database_port }}/{{ matrix_appservice_irc_database_name }}?sslmode={{ matrix_appservice_irc_database_sslmode }}' | |||
| # This is what actually goes into `database.connectionString` for the bridge. | |||
| matrix_appservice_irc_database_connectionString: |- # noqa var-naming | |||
| @@ -61,10 +61,11 @@ matrix_appservice_slack_database_password: 'some-passsword' | |||
| matrix_appservice_slack_database_hostname: '' | |||
| matrix_appservice_slack_database_port: 5432 | |||
| matrix_appservice_slack_database_name: matrix_appservice_slack | |||
| matrix_appservice_slack_database_sslmode: disable | |||
| # This is just the Postgres connection string, if Postgres is used. | |||
| # Naming clashes with `matrix_appservice_slack_database_connectionString` somewhat. | |||
| matrix_appservice_slack_database_connection_string: 'postgresql://{{ matrix_appservice_slack_database_username }}:{{ matrix_appservice_slack_database_password }}@{{ matrix_appservice_slack_database_hostname }}:{{ matrix_appservice_slack_database_port }}/{{ matrix_appservice_slack_database_name }}?sslmode=disable' | |||
| matrix_appservice_slack_database_connection_string: 'postgresql://{{ matrix_appservice_slack_database_username }}:{{ matrix_appservice_slack_database_password }}@{{ matrix_appservice_slack_database_hostname }}:{{ matrix_appservice_slack_database_port }}/{{ matrix_appservice_slack_database_name }}?sslmode={{ matrix_appservice_slack_database_sslmode }}' | |||
| # This is what actually goes into `database.connectionString` for the bridge. | |||
| matrix_appservice_slack_database_connectionString: |- # noqa var-naming | |||
| @@ -61,8 +61,9 @@ matrix_beeper_linkedin_database_password: 'some-password' | |||
| matrix_beeper_linkedin_database_hostname: '' | |||
| matrix_beeper_linkedin_database_port: 5432 | |||
| matrix_beeper_linkedin_database_name: 'matrix_beeper_linkedin' | |||
| matrix_beeper_linkedin_database_sslmode: disable | |||
| matrix_beeper_linkedin_database_connection_string: 'postgresql://{{ matrix_beeper_linkedin_database_username }}:{{ matrix_beeper_linkedin_database_password }}@{{ matrix_beeper_linkedin_database_hostname }}:{{ matrix_beeper_linkedin_database_port }}/{{ matrix_beeper_linkedin_database_name }}?sslmode=disable' | |||
| matrix_beeper_linkedin_database_connection_string: 'postgresql://{{ matrix_beeper_linkedin_database_username }}:{{ matrix_beeper_linkedin_database_password }}@{{ matrix_beeper_linkedin_database_hostname }}:{{ matrix_beeper_linkedin_database_port }}/{{ matrix_beeper_linkedin_database_name }}?sslmode={{ matrix_beeper_linkedin_database_sslmode }}' | |||
| matrix_beeper_linkedin_appservice_database_type: "{{ | |||
| { | |||
| @@ -59,8 +59,9 @@ matrix_go_skype_bridge_database_password: 'some-password' | |||
| matrix_go_skype_bridge_database_hostname: '' | |||
| matrix_go_skype_bridge_database_port: 5432 | |||
| matrix_go_skype_bridge_database_name: 'matrix_go_skype_bridge' | |||
| matrix_go_skype_bridge_database_sslmode: disable | |||
| matrix_go_skype_bridge_database_connection_string: 'postgresql://{{ matrix_go_skype_bridge_database_username }}:{{ matrix_go_skype_bridge_database_password }}@{{ matrix_go_skype_bridge_database_hostname }}:{{ matrix_go_skype_bridge_database_port }}/{{ matrix_go_skype_bridge_database_name }}?sslmode=disable' | |||
| matrix_go_skype_bridge_database_connection_string: 'postgresql://{{ matrix_go_skype_bridge_database_username }}:{{ matrix_go_skype_bridge_database_password }}@{{ matrix_go_skype_bridge_database_hostname }}:{{ matrix_go_skype_bridge_database_port }}/{{ matrix_go_skype_bridge_database_name }}?sslmode={{ matrix_go_skype_bridge_database_sslmode }}' | |||
| matrix_go_skype_bridge_appservice_database_type: "{{ | |||
| { | |||
| @@ -70,8 +70,9 @@ matrix_mautrix_discord_database_password: 'some-password' | |||
| matrix_mautrix_discord_database_hostname: '' | |||
| matrix_mautrix_discord_database_port: 5432 | |||
| matrix_mautrix_discord_database_name: 'matrix_mautrix_discord' | |||
| matrix_mautrix_discord_database_sslmode: disable | |||
| matrix_mautrix_discord_database_connection_string: 'postgresql://{{ matrix_mautrix_discord_database_username }}:{{ matrix_mautrix_discord_database_password }}@{{ matrix_mautrix_discord_database_hostname }}:{{ matrix_mautrix_discord_database_port }}/{{ matrix_mautrix_discord_database_name }}?sslmode=disable' | |||
| matrix_mautrix_discord_database_connection_string: 'postgresql://{{ matrix_mautrix_discord_database_username }}:{{ matrix_mautrix_discord_database_password }}@{{ matrix_mautrix_discord_database_hostname }}:{{ matrix_mautrix_discord_database_port }}/{{ matrix_mautrix_discord_database_name }}?sslmode={{ matrix_mautrix_discord_database_sslmode }}' | |||
| matrix_mautrix_discord_appservice_database_type: "{{ | |||
| { | |||
| @@ -74,8 +74,9 @@ matrix_mautrix_gmessages_database_password: 'some-password' | |||
| matrix_mautrix_gmessages_database_hostname: '' | |||
| matrix_mautrix_gmessages_database_port: 5432 | |||
| matrix_mautrix_gmessages_database_name: 'matrix_mautrix_gmessages' | |||
| matrix_mautrix_gmessages_database_sslmode: disable | |||
| matrix_mautrix_gmessages_database_connection_string: 'postgresql://{{ matrix_mautrix_gmessages_database_username }}:{{ matrix_mautrix_gmessages_database_password }}@{{ matrix_mautrix_gmessages_database_hostname }}:{{ matrix_mautrix_gmessages_database_port }}/{{ matrix_mautrix_gmessages_database_name }}?sslmode=disable' | |||
| matrix_mautrix_gmessages_database_connection_string: 'postgresql://{{ matrix_mautrix_gmessages_database_username }}:{{ matrix_mautrix_gmessages_database_password }}@{{ matrix_mautrix_gmessages_database_hostname }}:{{ matrix_mautrix_gmessages_database_port }}/{{ matrix_mautrix_gmessages_database_name }}?sslmode={{ matrix_mautrix_gmessages_database_sslmode }}' | |||
| matrix_mautrix_gmessages_appservice_database_type: "{{ | |||
| { | |||
| @@ -66,8 +66,9 @@ matrix_mautrix_slack_database_password: 'some-password' | |||
| matrix_mautrix_slack_database_hostname: '' | |||
| matrix_mautrix_slack_database_port: 5432 | |||
| matrix_mautrix_slack_database_name: 'matrix_mautrix_slack' | |||
| matrix_mautrix_slack_database_sslmode: disable | |||
| matrix_mautrix_slack_database_connection_string: 'postgresql://{{ matrix_mautrix_slack_database_username }}:{{ matrix_mautrix_slack_database_password }}@{{ matrix_mautrix_slack_database_hostname }}:{{ matrix_mautrix_slack_database_port }}/{{ matrix_mautrix_slack_database_name }}?sslmode=disable' | |||
| matrix_mautrix_slack_database_connection_string: 'postgresql://{{ matrix_mautrix_slack_database_username }}:{{ matrix_mautrix_slack_database_password }}@{{ matrix_mautrix_slack_database_hostname }}:{{ matrix_mautrix_slack_database_port }}/{{ matrix_mautrix_slack_database_name }}?sslmode={{ matrix_mautrix_slack_database_sslmode }}' | |||
| matrix_mautrix_slack_appservice_database_type: "{{ | |||
| { | |||
| @@ -74,8 +74,9 @@ matrix_mautrix_whatsapp_database_password: 'some-password' | |||
| matrix_mautrix_whatsapp_database_hostname: '' | |||
| matrix_mautrix_whatsapp_database_port: 5432 | |||
| matrix_mautrix_whatsapp_database_name: 'matrix_mautrix_whatsapp' | |||
| matrix_mautrix_whatsapp_database_sslmode: disable | |||
| matrix_mautrix_whatsapp_database_connection_string: 'postgresql://{{ matrix_mautrix_whatsapp_database_username }}:{{ matrix_mautrix_whatsapp_database_password }}@{{ matrix_mautrix_whatsapp_database_hostname }}:{{ matrix_mautrix_whatsapp_database_port }}/{{ matrix_mautrix_whatsapp_database_name }}?sslmode=disable' | |||
| matrix_mautrix_whatsapp_database_connection_string: 'postgresql://{{ matrix_mautrix_whatsapp_database_username }}:{{ matrix_mautrix_whatsapp_database_password }}@{{ matrix_mautrix_whatsapp_database_hostname }}:{{ matrix_mautrix_whatsapp_database_port }}/{{ matrix_mautrix_whatsapp_database_name }}?sslmode={{ matrix_mautrix_whatsapp_database_sslmode }}' | |||
| matrix_mautrix_whatsapp_appservice_database_type: "{{ | |||
| { | |||
| @@ -0,0 +1,155 @@ | |||
| --- | |||
| # mautrix-wsproxy is a Matrix <-> websocket bridge | |||
| # See: https://github.com/mautrix/wsproxy | |||
| matrix_mautrix_wsproxy_enabled: true | |||
| matrix_mautrix_wsproxy_version: latest | |||
| # See: https://mau.dev/mautrix/wsproxy/container_registry | |||
| matrix_mautrix_wsproxy_docker_image: "dock.mau.dev/mautrix/wsproxy:{{ matrix_mautrix_wsproxy_version }}" | |||
| matrix_mautrix_wsproxy_docker_image_force_pull: "{{ matrix_mautrix_wsproxy_docker_image.endswith(':latest') }}" | |||
| matrix_mautrix_wsproxy_base_path: "{{ matrix_base_data_path }}/wsproxy" | |||
| matrix_mautrix_wsproxy_config_path: "{{ matrix_mautrix_wsproxy_base_path }}/config" | |||
| matrix_mautrix_wsproxy_homeserver_address: "{{ matrix_homeserver_container_url }}" | |||
| matrix_mautrix_wsproxy_homeserver_domain: "{{ matrix_domain }}" | |||
| matrix_mautrix_wsproxy_bind_port: false | |||
| matrix_mautrix_wsproxy_port: 29331 | |||
| matrix_mautrix_wsproxy_appservice_address: "http://matrix-mautrix-wsproxy:{{ matrix_mautrix_wsproxy_port }}" | |||
| matrix_mautrix_wsproxy_hostname: "" | |||
| # The base container network. It will be auto-created by this role if it doesn't exist already. | |||
| matrix_mautrix_wsproxy_container_network: matrix-mautrix-wsproxy | |||
| # matrix_mautrix_wsproxy_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container. | |||
| # See `../templates/labels.j2` for details. | |||
| # | |||
| # To inject your own other container labels, see `matrix_mautrix_wsproxy_container_labels_additional_labels`. | |||
| matrix_mautrix_wsproxy_container_labels_traefik_enabled: true | |||
| matrix_mautrix_wsproxy_container_labels_traefik_docker_network: "{{ matrix_mautrix_wsproxy_container_network }}" | |||
| matrix_mautrix_wsproxy_container_labels_traefik_hostname: "{{ matrix_mautrix_wsproxy_hostname }}" | |||
| # The path prefix must either be `/` or not end with a slash (e.g. `/wsproxy`). | |||
| matrix_mautrix_wsproxy_container_labels_traefik_rule: "Host(`{{ matrix_mautrix_wsproxy_container_labels_traefik_hostname }}`)" | |||
| matrix_mautrix_wsproxy_container_labels_traefik_priority: 0 | |||
| matrix_mautrix_wsproxy_container_labels_traefik_entrypoints: web-secure | |||
| matrix_mautrix_wsproxy_container_labels_traefik_tls: "{{ matrix_mautrix_wsproxy_container_labels_traefik_entrypoints != 'web' }}" | |||
| matrix_mautrix_wsproxy_container_labels_traefik_tls_certResolver: default # noqa var-naming | |||
| # Controls which additional headers to attach to all HTTP responses. | |||
| # To add your own headers, use `matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers_custom` | |||
| matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers_auto: {} | |||
| matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers_custom: {} | |||
| matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers: "{{ matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers_auto | combine(matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers_custom) }}" | |||
| # matrix_mautrix_wsproxy_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file. | |||
| # See `../templates/labels.j2` for details. | |||
| # | |||
| # Example: | |||
| # matrix_mautrix_wsproxy_container_labels_additional_labels: | | |||
| # my.label=1 | |||
| # another.label="here" | |||
| matrix_mautrix_wsproxy_container_labels_additional_labels: '' | |||
| # A list of extra arguments to pass to the container | |||
| matrix_mautrix_wsproxy_container_extra_arguments: [] | |||
| # List of systemd services that matrix-mautrix-wsproxy.service depends on. | |||
| matrix_mautrix_wsproxy_systemd_required_services_list: ['docker.service'] | |||
| # List of systemd services that matrix-mautrix-wsproxy.service wants | |||
| matrix_mautrix_wsproxy_systemd_wanted_services_list: [] | |||
| matrix_mautrix_androidsms_appservice_token: '' | |||
| matrix_mautrix_androidsms_homeserver_token: '' | |||
| matrix_mautrix_imessage_appservice_token: '' | |||
| matrix_mautrix_imessage_homeserver_token: '' | |||
| matrix_mautrix_androidsms_appservice_bot_username: androidsmsbot | |||
| matrix_mautrix_imessage_appservice_bot_username: imessagebot | |||
| # Default mautrix-wsproxy configuration template which covers the generic use case. | |||
| # You can customize it by controlling the various variables inside it. | |||
| # | |||
| # For a more advanced customization, you can extend the default (see `matrix_mautrix_wsproxy_configuration_extension_yaml`) | |||
| # or completely replace this variable with your own template. | |||
| matrix_mautrix_wsproxy_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" | |||
| matrix_mautrix_wsproxy_configuration_extension_yaml: | | |||
| # Your custom YAML configuration goes here. | |||
| # This configuration extends the default starting configuration (`matrix_mautrix_wsproxy_configuration_yaml`). | |||
| # | |||
| # You can override individual variables from the default configuration, or introduce new ones. | |||
| # | |||
| # If you need something more special, you can take full control by | |||
| # completely redefining `matrix_mautrix_wsproxy_configuration_yaml`. | |||
| matrix_mautrix_wsproxy_configuration_extension: "{{ matrix_mautrix_wsproxy_configuration_extension_yaml|from_yaml if matrix_mautrix_wsproxy_configuration_extension_yaml|from_yaml is mapping else {} }}" | |||
| # Holds the final configuration (a combination of the default and its extension). | |||
| # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_wsproxy_configuration_yaml`. | |||
| matrix_mautrix_wsproxy_configuration: "{{ matrix_mautrix_wsproxy_configuration_yaml|from_yaml|combine(matrix_mautrix_wsproxy_configuration_extension, recursive=True) }}" | |||
| matrix_mautrix_androidsms_registration_yaml: | | |||
| id: androidsms | |||
| url: {{ matrix_mautrix_wsproxy_appservice_address }} | |||
| as_token: "{{ matrix_mautrix_androidsms_appservice_token }}" | |||
| hs_token: "{{ matrix_mautrix_androidsms_homeserver_token }}" | |||
| sender_localpart: _bot_{{ matrix_mautrix_androidsms_appservice_bot_username }} | |||
| rate_limited: false | |||
| namespaces: | |||
| users: | |||
| - regex: '@androidsms_.+:{{ matrix_mautrix_wsproxy_homeserver_domain|regex_escape }}$' | |||
| exclusive: true | |||
| - exclusive: true | |||
| regex: '^@{{ matrix_mautrix_androidsms_appservice_bot_username|regex_escape }}:{{ matrix_mautrix_wsproxy_homeserver_domain|regex_escape }}$' | |||
| matrix_mautrix_androidsms_registration: "{{ matrix_mautrix_androidsms_registration_yaml|from_yaml }}" | |||
| matrix_mautrix_imessage_registration_yaml: | | |||
| id: imessage | |||
| url: {{ matrix_mautrix_wsproxy_appservice_address }} | |||
| as_token: "{{ matrix_mautrix_imessage_appservice_token }}" | |||
| hs_token: "{{ matrix_mautrix_imessage_homeserver_token }}" | |||
| sender_localpart: _bot_{{ matrix_mautrix_imessage_appservice_bot_username }} | |||
| rate_limited: false | |||
| namespaces: | |||
| users: | |||
| - regex: '@imessage_.+:{{ matrix_mautrix_wsproxy_homeserver_domain|regex_escape }}$' | |||
| exclusive: true | |||
| - exclusive: true | |||
| regex: '^@{{ matrix_mautrix_imessage_appservice_bot_username|regex_escape }}:{{ matrix_mautrix_wsproxy_homeserver_domain|regex_escape }}$' | |||
| matrix_mautrix_imessage_registration: "{{ matrix_mautrix_imessage_registration_yaml|from_yaml }}" | |||
| # Syncproxy-related configuration fields | |||
| matrix_mautrix_wsproxy_syncproxy_version: latest | |||
| # See: https://mau.dev/mautrix/wsproxy/container_registry | |||
| matrix_mautrix_wsproxy_syncproxy_docker_image: "dock.mau.dev/mautrix/syncproxy:{{ matrix_mautrix_wsproxy_syncproxy_version }}" | |||
| matrix_mautrix_wsproxy_syncproxy_docker_image_force_pull: "{{ matrix_mautrix_wsproxy_syncproxy_docker_image.endswith(':latest') }}" | |||
| matrix_mautrix_wsproxy_syncproxy_container_extra_arguments: [] | |||
| matrix_mautrix_wsproxy_syncproxy_systemd_required_services_list: ['docker.service', 'matrix-mautrix-wsproxy.service'] | |||
| matrix_mautrix_wsproxy_syncproxy_systemd_wanted_services_list: [] | |||
| matrix_mautrix_wsproxy_syncproxy_shared_secret: '' | |||
| matrix_mautrix_wsproxy_syncproxy_port: 29332 | |||
| matrix_mautrix_wsproxy_syncproxy_appservice_address: "http://matrix-mautrix-wsproxy-syncproxy:{{ matrix_mautrix_wsproxy_syncproxy_port }}" | |||
| # Database-related configuration fields | |||
| # | |||
| # This bridge supports Postgres and SQLite. | |||
| # | |||
| matrix_mautrix_wsproxy_syncproxy_database_engine: 'postgres' | |||
| matrix_mautrix_wsproxy_syncproxy_database_username: 'matrix_mautrix_wsproxy_syncproxy' | |||
| matrix_mautrix_wsproxy_syncproxy_database_password: 'some-password' | |||
| matrix_mautrix_wsproxy_syncproxy_database_hostname: 'matrix-postgres' | |||
| matrix_mautrix_wsproxy_syncproxy_database_port: 5432 | |||
| matrix_mautrix_wsproxy_syncproxy_database_name: 'matrix_mautrix_wsproxy_syncproxy' | |||
| matrix_mautrix_signal_wsproxy_syncproxy_connection_string: 'postgres://{{ matrix_mautrix_wsproxy_syncproxy_database_username }}:{{ matrix_mautrix_wsproxy_syncproxy_database_password }}@{{ matrix_mautrix_wsproxy_syncproxy_database_hostname }}:{{ matrix_mautrix_wsproxy_syncproxy_database_port }}/{{ matrix_mautrix_wsproxy_syncproxy_database_name }}' | |||
| @@ -0,0 +1,48 @@ | |||
| --- | |||
| - name: Fail if matrix-nginx-proxy role already executed | |||
| ansible.builtin.fail: | |||
| msg: >- | |||
| Trying to append Mautrix Wsproxy reverse-proxying configuration to matrix-nginx-proxy, | |||
| but it's pointless since the matrix-nginx-proxy role had already executed. | |||
| To fix this, please change the order of roles in your playbook, | |||
| so that the matrix-nginx-proxy role would run after the matrix-bridge-mautrix-wsproxy role. | |||
| when: matrix_nginx_proxy_role_executed | default(False) | bool | |||
| - tags: | |||
| - always | |||
| when: matrix_mautrix_wsproxy_enabled|bool | |||
| block: | |||
| - name: Generate Mautrix Wsproxy proxying configuration for matrix-nginx-proxy | |||
| ansible.builtin.set_fact: | |||
| matrix_mautrix_wsproxy_matrix_nginx_proxy_configuration: | | |||
| location ~ ^/(_matrix/wsproxy/.*) { | |||
| {% if matrix_nginx_proxy_enabled|default(False) %} | |||
| {# Use the embedded DNS resolver in Docker containers to discover the service #} | |||
| resolver 127.0.0.11 valid=5s; | |||
| set $backend "matrix-mautrix-wsproxy:29331"; | |||
| proxy_pass http://$backend; | |||
| {% else %} | |||
| {# Generic configuration for use outside of our container setup #} | |||
| proxy_pass http://127.0.0.1:29331; | |||
| {% endif %} | |||
| } | |||
| - name: Register Mautrix Wsproxy proxying configuration with matrix-nginx-proxy | |||
| ansible.builtin.set_fact: | |||
| matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | | |||
| {{ | |||
| matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) | |||
| + | |||
| [matrix_mautrix_wsproxy_matrix_nginx_proxy_configuration] | |||
| }} | |||
| - name: Warn about reverse-proxying if matrix-nginx-proxy not used | |||
| ansible.builtin.debug: | |||
| msg: >- | |||
| NOTE: You've enabled the Mautrix wsproxy bridge but are not using the matrix-nginx-proxy | |||
| reverse proxy. | |||
| Please make sure that you're proxying the `{{ matrix_mautrix_wsproxy_public_endpoint }}` | |||
| URL endpoint to the matrix-mautrix-wsproxy container. | |||
| You can expose the container's port using the `matrix_mautrix_wsproxy_container_http_host_bind_port` variable. | |||
| when: "matrix_mautrix_wsproxy_enabled|bool and matrix_nginx_proxy_enabled is not defined" | |||
| @@ -0,0 +1,29 @@ | |||
| --- | |||
| - tags: | |||
| - setup-all | |||
| - setup-nginx-proxy | |||
| - install-all | |||
| - install-nginx-proxy | |||
| block: | |||
| - when: matrix_mautrix_wsproxy_enabled | bool | |||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/inject_into_nginx_proxy.yml" | |||
| - tags: | |||
| - setup-all | |||
| - setup-mautrix-wsproxy | |||
| - install-all | |||
| - install-mautrix-wsproxy | |||
| block: | |||
| - when: matrix_mautrix_wsproxy_enabled | bool | |||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" | |||
| - when: matrix_mautrix_wsproxy_enabled | bool | |||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml" | |||
| - tags: | |||
| - setup-all | |||
| - setup-mautrix-wsproxy | |||
| block: | |||
| - when: not matrix_mautrix_wsproxy_enabled | bool | |||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" | |||
| @@ -0,0 +1,121 @@ | |||
| --- | |||
| # If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist. | |||
| # We don't want to fail in such cases. | |||
| - name: Fail if matrix-synapse role already executed | |||
| ansible.builtin.fail: | |||
| msg: >- | |||
| The matrix-bridge-mautrix-wsproxy role needs to execute before the matrix-synapse role. | |||
| when: "matrix_synapse_role_executed|default(False)" | |||
| - ansible.builtin.set_fact: | |||
| matrix_mautrix_wsproxy_requires_restart: false | |||
| - ansible.builtin.set_fact: | |||
| matrix_mautrix_wsproxy_syncproxy_requires_restart: false | |||
| - name: Ensure Mautrix wsproxy support files installed | |||
| ansible.builtin.template: | |||
| src: "{{ role_path }}/templates/{{ item }}.j2" | |||
| dest: "{{ matrix_mautrix_wsproxy_base_path }}/{{ item }}" | |||
| mode: 0640 | |||
| owner: "{{ matrix_user_username }}" | |||
| group: "{{ matrix_user_groupname }}" | |||
| with_items: | |||
| - syncproxy-env | |||
| - wsproxy-labels | |||
| - name: Ensure Mautrix wsproxy image is pulled | |||
| community.docker.docker_image: | |||
| name: "{{ matrix_mautrix_wsproxy_docker_image }}" | |||
| source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" | |||
| force_source: "{{ matrix_mautrix_wsproxy_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" | |||
| force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_wsproxy_docker_image_force_pull }}" | |||
| - name: Ensure Mautrix syncproxy image is pulled | |||
| community.docker.docker_image: | |||
| name: "{{ matrix_mautrix_wsproxy_syncproxy_docker_image }}" | |||
| source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" | |||
| force_source: "{{ matrix_mautrix_wsproxy_syncproxy_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" | |||
| force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_wsproxy_syncproxy_docker_image_force_pull }}" | |||
| - name: Ensure Mautrix wsproxy paths exists | |||
| ansible.builtin.file: | |||
| path: "{{ item }}" | |||
| state: directory | |||
| mode: 0750 | |||
| owner: "{{ matrix_user_username }}" | |||
| group: "{{ matrix_user_groupname }}" | |||
| with_items: | |||
| - "{{ matrix_mautrix_wsproxy_base_path }}" | |||
| - "{{ matrix_mautrix_wsproxy_config_path }}" | |||
| - name: Check if an old matrix state file exists | |||
| ansible.builtin.stat: | |||
| path: "{{ matrix_mautrix_wsproxy_base_path }}/mx-state.json" | |||
| register: matrix_mautrix_wsproxy_stat_mx_state | |||
| - name: Ensure mautrix-wsproxy config.yaml installed | |||
| ansible.builtin.copy: | |||
| content: "{{ matrix_mautrix_wsproxy_configuration|to_nice_yaml }}" | |||
| dest: "{{ matrix_mautrix_wsproxy_config_path }}/config.yaml" | |||
| mode: 0644 | |||
| owner: "{{ matrix_user_username }}" | |||
| group: "{{ matrix_user_groupname }}" | |||
| - name: Ensure mautrix-androidsms registration.yaml installed | |||
| ansible.builtin.copy: | |||
| content: "{{ matrix_mautrix_androidsms_registration|to_nice_yaml }}" | |||
| dest: "{{ matrix_mautrix_wsproxy_config_path }}/androidsms-registration.yaml" | |||
| mode: 0644 | |||
| owner: "{{ matrix_user_username }}" | |||
| group: "{{ matrix_user_groupname }}" | |||
| - name: Ensure mautrix-imessage registration.yaml installed | |||
| ansible.builtin.copy: | |||
| content: "{{ matrix_mautrix_imessage_registration|to_nice_yaml }}" | |||
| dest: "{{ matrix_mautrix_wsproxy_config_path }}/imessage-registration.yaml" | |||
| mode: 0644 | |||
| owner: "{{ matrix_user_username }}" | |||
| group: "{{ matrix_user_groupname }}" | |||
| - name: Ensure mautrix-wsproxy container network is created | |||
| community.general.docker_network: | |||
| name: "{{ matrix_mautrix_wsproxy_container_network }}" | |||
| driver: bridge | |||
| - name: Ensure matrix-mautrix-wsproxy.service installed | |||
| ansible.builtin.template: | |||
| src: "{{ role_path }}/templates/systemd/matrix-mautrix-wsproxy.service.j2" | |||
| dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-wsproxy.service" | |||
| mode: 0644 | |||
| register: matrix_mautrix_wsproxy_systemd_service_result | |||
| - name: Ensure systemd reloaded after matrix-mautrix-wsproxy.service installation | |||
| ansible.builtin.service: | |||
| daemon_reload: true | |||
| when: "matrix_mautrix_wsproxy_systemd_service_result.changed" | |||
| - name: Ensure matrix-mautrix-wsproxy.service restarted, if necessary | |||
| ansible.builtin.service: | |||
| name: "matrix-mautrix-wsproxy.service" | |||
| state: restarted | |||
| when: "matrix_mautrix_wsproxy_requires_restart|bool" | |||
| - name: Ensure matrix-mautrix-wsproxy-syncproxy.service installed | |||
| ansible.builtin.template: | |||
| src: "{{ role_path }}/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2" | |||
| dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-wsproxy-syncproxy.service" | |||
| mode: 0644 | |||
| register: matrix_mautrix_wsproxy_syncproxy_systemd_service_result | |||
| - name: Ensure systemd reloaded after matrix-mautrix-wsproxy-syncproxy.service installation | |||
| ansible.builtin.service: | |||
| daemon_reload: true | |||
| when: "matrix_mautrix_wsproxy_syncproxy_systemd_service_result.changed" | |||
| - name: Ensure matrix-mautrix-wsproxy-syncproxy.service restarted, if necessary | |||
| ansible.builtin.service: | |||
| name: "matrix-mautrix-wsproxy-syncproxy.service" | |||
| state: restarted | |||
| when: "matrix_mautrix_wsproxy_syncproxy_requires_restart|bool" | |||
| @@ -0,0 +1,47 @@ | |||
| --- | |||
| - name: Check existence of matrix-mautrix-wsproxy service | |||
| ansible.builtin.stat: | |||
| path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-wsproxy.service" | |||
| register: matrix_mautrix_wsproxy_service_stat | |||
| - name: Ensure matrix-mautrix-wsproxy is stopped | |||
| ansible.builtin.service: | |||
| name: matrix-mautrix-wsproxy | |||
| state: stopped | |||
| daemon_reload: true | |||
| when: "matrix_mautrix_wsproxy_service_stat.stat.exists" | |||
| - name: Ensure matrix-mautrix-wsproxy.service doesn't exist | |||
| ansible.builtin.file: | |||
| path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-wsproxy.service" | |||
| state: absent | |||
| when: "matrix_mautrix_wsproxy_service_stat.stat.exists" | |||
| - name: Ensure systemd reloaded after matrix-mautrix-wsproxy.service removal | |||
| ansible.builtin.service: | |||
| daemon_reload: true | |||
| when: "matrix_mautrix_wsproxy_service_stat.stat.exists" | |||
| - name: Check existence of matrix-mautrix-wsproxy-syncproxy service | |||
| ansible.builtin.stat: | |||
| path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-wsproxy-syncproxy.service" | |||
| register: matrix_mautrix_wsproxy_syncproxy_service_stat | |||
| - name: Ensure matrix-mautrix-wsproxy-syncproxy is stopped | |||
| ansible.builtin.service: | |||
| name: matrix-mautrix-wsproxy-syncproxy | |||
| state: stopped | |||
| daemon_reload: true | |||
| when: "matrix_mautrix_wsproxy_syncproxy_service_stat.stat.exists" | |||
| - name: Ensure matrix-mautrix-wsproxy-syncproxy.service doesn't exist | |||
| ansible.builtin.file: | |||
| path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-wsproxy-syncproxy.service" | |||
| state: absent | |||
| when: "matrix_mautrix_wsproxy_syncproxy_service_stat.stat.exists" | |||
| - name: Ensure systemd reloaded after matrix-mautrix-wsproxy-syncproxy.service removal | |||
| ansible.builtin.service: | |||
| daemon_reload: true | |||
| when: "matrix_mautrix_wsproxy_syncproxy_service_stat.stat.exists" | |||
| @@ -0,0 +1,13 @@ | |||
| --- | |||
| - name: Fail if required settings not defined | |||
| ansible.builtin.fail: | |||
| msg: >- | |||
| You need to define a required configuration setting (`{{ item }}`). | |||
| when: "vars[item] == ''" | |||
| with_items: | |||
| - "matrix_mautrix_androidsms_appservice_token" | |||
| - "matrix_mautrix_androidsms_homeserver_token" | |||
| - "matrix_mautrix_imessage_appservice_token" | |||
| - "matrix_mautrix_imessage_homeserver_token" | |||
| - "matrix_mautrix_wsproxy_syncproxy_shared_secret" | |||
| @@ -0,0 +1,14 @@ | |||
| listen_address: 0.0.0.0:29331 | |||
| appservices: | |||
| - id: androidsms | |||
| as: {{ matrix_mautrix_androidsms_appservice_token | to_json }} | |||
| hs: {{ matrix_mautrix_androidsms_homeserver_token | to_json }} | |||
| - id: imessage | |||
| as: {{ matrix_mautrix_imessage_appservice_token | to_json }} | |||
| hs: {{ matrix_mautrix_imessage_homeserver_token | to_json }} | |||
| sync_proxy: | |||
| # The URL that mautrix-wsproxy can use to reach mautrix-syncproxy | |||
| url: {{ matrix_mautrix_wsproxy_syncproxy_appservice_address | to_json }} | |||
| # The URL that mautrix-syncproxy can use to reach mautrix-wsproxy | |||
| wsproxy_url: {{ matrix_mautrix_wsproxy_appservice_address | to_json }} | |||
| shared_secret: {{ matrix_mautrix_wsproxy_syncproxy_shared_secret | to_json }} | |||
| @@ -0,0 +1,3 @@ | |||
| DATABASE_URL={{ matrix_mautrix_signal_wsproxy_syncproxy_connection_string }} | |||
| HOMESERVER_URL={{ matrix_homeserver_container_url }} | |||
| SHARED_SECRET={{ matrix_mautrix_wsproxy_syncproxy_shared_secret }} | |||
| @@ -0,0 +1,40 @@ | |||
| #jinja2: lstrip_blocks: "True" | |||
| [Unit] | |||
| Description=Matrix Mautrix wsproxy syncproxy | |||
| {% for service in matrix_mautrix_wsproxy_syncproxy_systemd_required_services_list %} | |||
| Requires={{ service }} | |||
| After={{ service }} | |||
| {% endfor %} | |||
| {% for service in matrix_mautrix_wsproxy_syncproxy_systemd_wanted_services_list %} | |||
| Wants={{ service }} | |||
| {% endfor %} | |||
| DefaultDependencies=no | |||
| [Service] | |||
| Type=simple | |||
| Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}" | |||
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-mautrix-wsproxy-syncproxy 2>/dev/null' | |||
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-wsproxy-syncproxy 2>/dev/null' | |||
| # Intentional delay, so that the homeserver (we likely depend on) can manage to start. | |||
| ExecStartPre={{ matrix_host_command_sleep }} 5 | |||
| ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name matrix-mautrix-wsproxy-syncproxy \ | |||
| --log-driver=none \ | |||
| --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ | |||
| --cap-drop=ALL \ | |||
| --network={{ matrix_docker_network }} \ | |||
| --env-file={{ matrix_mautrix_wsproxy_base_path }}/syncproxy-env \ | |||
| {% for arg in matrix_mautrix_wsproxy_syncproxy_container_extra_arguments %} | |||
| {{ arg }} \ | |||
| {% endfor %} | |||
| {{ matrix_mautrix_wsproxy_syncproxy_docker_image }} | |||
| ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-mautrix-wsproxy-syncproxy 2>/dev/null' | |||
| ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-wsproxy-syncproxy 2>/dev/null' | |||
| Restart=always | |||
| RestartSec=30 | |||
| SyslogIdentifier=matrix-mautrix-wsproxy-syncproxy | |||
| [Install] | |||
| WantedBy=multi-user.target | |||
| @@ -0,0 +1,51 @@ | |||
| #jinja2: lstrip_blocks: "True" | |||
| [Unit] | |||
| Description=Matrix Mautrix wsproxy bridge | |||
| {% for service in matrix_mautrix_wsproxy_systemd_required_services_list %} | |||
| Requires={{ service }} | |||
| After={{ service }} | |||
| {% endfor %} | |||
| {% for service in matrix_mautrix_wsproxy_systemd_wanted_services_list %} | |||
| Wants={{ service }} | |||
| {% endfor %} | |||
| DefaultDependencies=no | |||
| [Service] | |||
| Type=simple | |||
| Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}" | |||
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-mautrix-wsproxy 2>/dev/null' | |||
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-wsproxy 2>/dev/null' | |||
| # Intentional delay, so that the homeserver (we likely depend on) can manage to start. | |||
| ExecStartPre={{ matrix_host_command_sleep }} 5 | |||
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create --rm --name matrix-mautrix-wsproxy \ | |||
| --log-driver=none \ | |||
| --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ | |||
| --cap-drop=ALL \ | |||
| --network={{ matrix_docker_network }} \ | |||
| {% if matrix_mautrix_wsproxy_bind_port %} | |||
| -p {{ matrix_mautrix_wsproxy_port }}:29331 \ | |||
| {% endif %} | |||
| --mount type=bind,src={{ matrix_mautrix_wsproxy_config_path }},dst=/data \ | |||
| --label-file={{ matrix_mautrix_wsproxy_base_path }}/wsproxy-labels \ | |||
| {% for arg in matrix_mautrix_wsproxy_container_extra_arguments %} | |||
| {{ arg }} \ | |||
| {% endfor %} | |||
| {{ matrix_mautrix_wsproxy_docker_image }} \ | |||
| /usr/bin/mautrix-wsproxy -config /data/config.yaml | |||
| {% for network in matrix_mautrix_wsproxy_container_additional_networks %} | |||
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-wsproxy | |||
| {% endfor %} | |||
| ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-wsproxy | |||
| ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-mautrix-wsproxy 2>/dev/null' | |||
| ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-wsproxy 2>/dev/null' | |||
| Restart=always | |||
| RestartSec=30 | |||
| SyslogIdentifier=matrix-mautrix-wsproxy | |||
| [Install] | |||
| WantedBy=multi-user.target | |||
| @@ -0,0 +1,34 @@ | |||
| {% if matrix_mautrix_wsproxy_container_labels_traefik_enabled %} | |||
| traefik.enable=true | |||
| {% if matrix_mautrix_wsproxy_container_labels_traefik_docker_network %} | |||
| traefik.docker.network={{ matrix_mautrix_wsproxy_container_labels_traefik_docker_network }} | |||
| {% endif %} | |||
| {% set middlewares = [] %} | |||
| {% if matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers.keys() | length > 0 %} | |||
| {% for name, value in matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers.items() %} | |||
| traefik.http.middlewares.matrix-mautrix-wsproxy-add-headers.headers.customresponseheaders.{{ name }}={{ value }} | |||
| {% endfor %} | |||
| {% set middlewares = middlewares + ['matrix-mautrix-wsproxy-add-headers'] %} | |||
| {% endif %} | |||
| traefik.http.routers.matrix-mautrix-wsproxy.rule={{ matrix_mautrix_wsproxy_container_labels_traefik_rule }} | |||
| {% if matrix_mautrix_wsproxy_container_labels_traefik_priority | int > 0 %} | |||
| traefik.http.routers.matrix-mautrix-wsproxy.priority={{ matrix_mautrix_wsproxy_container_labels_traefik_priority }} | |||
| {% endif %} | |||
| traefik.http.routers.matrix-mautrix-wsproxy.service=matrix-mautrix-wsproxy | |||
| {% if middlewares | length > 0 %} | |||
| traefik.http.routers.matrix-mautrix-wsproxy.middlewares={{ middlewares | join(',') }} | |||
| {% endif %} | |||
| traefik.http.routers.matrix-mautrix-wsproxy.entrypoints={{ matrix_mautrix_wsproxy_container_labels_traefik_entrypoints }} | |||
| traefik.http.routers.matrix-mautrix-wsproxy.tls={{ matrix_mautrix_wsproxy_container_labels_traefik_tls | to_json }} | |||
| {% if matrix_mautrix_wsproxy_container_labels_traefik_tls %} | |||
| traefik.http.routers.matrix-mautrix-wsproxy.tls.certResolver={{ matrix_mautrix_wsproxy_container_labels_traefik_tls_certResolver }} | |||
| {% endif %} | |||
| traefik.http.services.matrix-mautrix-wsproxy.loadbalancer.server.port={{ matrix_mautrix_wsproxy_port }} | |||
| {% endif %} | |||
| {{ matrix_mautrix_wsproxy_container_labels_additional_labels }} | |||
| @@ -69,8 +69,9 @@ matrix_mx_puppet_discord_database_password: ~ | |||
| matrix_mx_puppet_discord_database_hostname: '' | |||
| matrix_mx_puppet_discord_database_port: 5432 | |||
| matrix_mx_puppet_discord_database_name: matrix_mx_puppet_discord | |||
| matrix_mx_puppet_discord_database_sslmode: disable | |||
| matrix_mx_puppet_discord_database_connection_string: 'postgresql://{{ matrix_mx_puppet_discord_database_username }}:{{ matrix_mx_puppet_discord_database_password }}@{{ matrix_mx_puppet_discord_database_hostname }}:{{ matrix_mx_puppet_discord_database_port }}/{{ matrix_mx_puppet_discord_database_name }}?sslmode=disable' | |||
| matrix_mx_puppet_discord_database_connection_string: 'postgresql://{{ matrix_mx_puppet_discord_database_username }}:{{ matrix_mx_puppet_discord_database_password }}@{{ matrix_mx_puppet_discord_database_hostname }}:{{ matrix_mx_puppet_discord_database_port }}/{{ matrix_mx_puppet_discord_database_name }}?sslmode={{ matrix_mx_puppet_discord_database_sslmode }}' | |||
| # Default configuration template which covers the generic use case. | |||
| # You can customize it by controlling the various variables inside it. | |||
| @@ -65,8 +65,9 @@ matrix_mx_puppet_groupme_database_password: ~ | |||
| matrix_mx_puppet_groupme_database_hostname: '' | |||
| matrix_mx_puppet_groupme_database_port: 5432 | |||
| matrix_mx_puppet_groupme_database_name: matrix_mx_puppet_groupme | |||
| matrix_mx_puppet_groupme_database_sslmode: disable | |||
| matrix_mx_puppet_groupme_database_connection_string: 'postgresql://{{ matrix_mx_puppet_groupme_database_username }}:{{ matrix_mx_puppet_groupme_database_password }}@{{ matrix_mx_puppet_groupme_database_hostname }}:{{ matrix_mx_puppet_groupme_database_port }}/{{ matrix_mx_puppet_groupme_database_name }}?sslmode=disable' | |||
| matrix_mx_puppet_groupme_database_connection_string: 'postgresql://{{ matrix_mx_puppet_groupme_database_username }}:{{ matrix_mx_puppet_groupme_database_password }}@{{ matrix_mx_puppet_groupme_database_hostname }}:{{ matrix_mx_puppet_groupme_database_port }}/{{ matrix_mx_puppet_groupme_database_name }}?sslmode={{ matrix_mx_puppet_groupme_database_sslmode }}' | |||
| # Default configuration template which covers the generic use case. | |||
| # You can customize it by controlling the various variables inside it. | |||
| @@ -59,8 +59,9 @@ matrix_mx_puppet_instagram_database_password: ~ | |||
| matrix_mx_puppet_instagram_database_hostname: '' | |||
| matrix_mx_puppet_instagram_database_port: 5432 | |||
| matrix_mx_puppet_instagram_database_name: matrix_mx_puppet_instagram | |||
| matrix_mx_puppet_instagram_database_sslmode: disable | |||
| matrix_mx_puppet_instagram_database_connection_string: 'postgresql://{{ matrix_mx_puppet_instagram_database_username }}:{{ matrix_mx_puppet_instagram_database_password }}@{{ matrix_mx_puppet_instagram_database_hostname }}:{{ matrix_mx_puppet_instagram_database_port }}/{{ matrix_mx_puppet_instagram_database_name }}?sslmode=disable' | |||
| matrix_mx_puppet_instagram_database_connection_string: 'postgresql://{{ matrix_mx_puppet_instagram_database_username }}:{{ matrix_mx_puppet_instagram_database_password }}@{{ matrix_mx_puppet_instagram_database_hostname }}:{{ matrix_mx_puppet_instagram_database_port }}/{{ matrix_mx_puppet_instagram_database_name }}?sslmode={{ matrix_mx_puppet_instagram_database_sslmode }}' | |||
| # Default configuration template which covers the generic use case. | |||
| # You can customize it by controlling the various variables inside it. | |||
| @@ -73,8 +73,9 @@ matrix_mx_puppet_slack_database_password: ~ | |||
| matrix_mx_puppet_slack_database_hostname: '' | |||
| matrix_mx_puppet_slack_database_port: 5432 | |||
| matrix_mx_puppet_slack_database_name: matrix_mx_puppet_slack | |||
| matrix_mx_puppet_slack_database_sslmode: disable | |||
| matrix_mx_puppet_slack_database_connection_string: 'postgresql://{{ matrix_mx_puppet_slack_database_username }}:{{ matrix_mx_puppet_slack_database_password }}@{{ matrix_mx_puppet_slack_database_hostname }}:{{ matrix_mx_puppet_slack_database_port }}/{{ matrix_mx_puppet_slack_database_name }}?sslmode=disable' | |||
| matrix_mx_puppet_slack_database_connection_string: 'postgresql://{{ matrix_mx_puppet_slack_database_username }}:{{ matrix_mx_puppet_slack_database_password }}@{{ matrix_mx_puppet_slack_database_hostname }}:{{ matrix_mx_puppet_slack_database_port }}/{{ matrix_mx_puppet_slack_database_name }}?sslmode={{ matrix_mx_puppet_slack_database_sslmode }}' | |||
| # Default configuration template which covers the generic use case. | |||
| # You can customize it by controlling the various variables inside it. | |||
| @@ -65,8 +65,9 @@ matrix_mx_puppet_steam_database_password: ~ | |||
| matrix_mx_puppet_steam_database_hostname: '' | |||
| matrix_mx_puppet_steam_database_port: 5432 | |||
| matrix_mx_puppet_steam_database_name: matrix_mx_puppet_steam | |||
| matrix_mx_puppet_steam_database_sslmode: disable | |||
| matrix_mx_puppet_steam_database_connection_string: 'postgresql://{{ matrix_mx_puppet_steam_database_username }}:{{ matrix_mx_puppet_steam_database_password }}@{{ matrix_mx_puppet_steam_database_hostname }}:{{ matrix_mx_puppet_steam_database_port }}/{{ matrix_mx_puppet_steam_database_name }}?sslmode=disable' | |||
| matrix_mx_puppet_steam_database_connection_string: 'postgresql://{{ matrix_mx_puppet_steam_database_username }}:{{ matrix_mx_puppet_steam_database_password }}@{{ matrix_mx_puppet_steam_database_hostname }}:{{ matrix_mx_puppet_steam_database_port }}/{{ matrix_mx_puppet_steam_database_name }}?sslmode={{ matrix_mx_puppet_steam_database_sslmode }}' | |||
| # Default configuration template which covers the generic use case. | |||
| # You can customize it by controlling the various variables inside it. | |||
| @@ -74,8 +74,9 @@ matrix_mx_puppet_twitter_database_password: ~ | |||
| matrix_mx_puppet_twitter_database_hostname: '' | |||
| matrix_mx_puppet_twitter_database_port: 5432 | |||
| matrix_mx_puppet_twitter_database_name: matrix_mx_puppet_twitter | |||
| matrix_mx_puppet_twitter_database_sslmode: disable | |||
| matrix_mx_puppet_twitter_database_connection_string: 'postgresql://{{ matrix_mx_puppet_twitter_database_username }}:{{ matrix_mx_puppet_twitter_database_password }}@{{ matrix_mx_puppet_twitter_database_hostname }}:{{ matrix_mx_puppet_twitter_database_port }}/{{ matrix_mx_puppet_twitter_database_name }}?sslmode=disable' | |||
| matrix_mx_puppet_twitter_database_connection_string: 'postgresql://{{ matrix_mx_puppet_twitter_database_username }}:{{ matrix_mx_puppet_twitter_database_password }}@{{ matrix_mx_puppet_twitter_database_hostname }}:{{ matrix_mx_puppet_twitter_database_port }}/{{ matrix_mx_puppet_twitter_database_name }}?sslmode={{ matrix_mx_puppet_twitter_database_sslmode }}' | |||
| # Default configuration template which covers the generic use case. | |||
| # You can customize it by controlling the various variables inside it. | |||
| @@ -10,7 +10,7 @@ matrix_dendrite_container_image_self_build_repo: "https://github.com/matrix-org/ | |||
| matrix_dendrite_docker_image_path: "matrixdotorg/dendrite-monolith" | |||
| matrix_dendrite_docker_image: "{{ matrix_dendrite_docker_image_name_prefix }}{{ matrix_dendrite_docker_image_path }}:{{ matrix_dendrite_docker_image_tag }}" | |||
| matrix_dendrite_docker_image_name_prefix: "{{ 'localhost/' if matrix_dendrite_container_image_self_build else matrix_container_global_registry_prefix }}" | |||
| matrix_dendrite_docker_image_tag: "v0.13.1" | |||
| matrix_dendrite_docker_image_tag: "v0.13.2" | |||
| matrix_dendrite_docker_image_force_pull: "{{ matrix_dendrite_docker_image.endswith(':latest') }}" | |||
| matrix_dendrite_base_path: "{{ matrix_base_data_path }}/dendrite" | |||
| @@ -156,6 +156,7 @@ matrix_dendrite_database_str: "postgresql://{{ matrix_dendrite_database_user }}: | |||
| matrix_dendrite_database_hostname: "" | |||
| matrix_dendrite_database_user: "dendrite" | |||
| matrix_dendrite_database_password: "itsasecret" | |||
| matrix_dendrite_database_sslmode: disable | |||
| matrix_dendrite_federation_api_database: "dendrite_federationapi" | |||
| matrix_dendrite_key_server_database: "dendrite_keyserver" | |||
| matrix_dendrite_media_api_database: "dendrite_mediaapi" | |||
| @@ -223,7 +223,7 @@ federation_api: | |||
| external_api: | |||
| listen: http://0.0.0.0:8072 | |||
| database: | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_federation_api_database }}?sslmode=disable | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_federation_api_database }}?sslmode={{ matrix_dendrite_database_sslmode }} | |||
| max_open_conns: 10 | |||
| max_idle_conns: 2 | |||
| conn_max_lifetime: -1 | |||
| @@ -266,7 +266,7 @@ key_server: | |||
| listen: http://0.0.0.0:7779 | |||
| connect: http://key_server:7779 | |||
| database: | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_key_server_database }}?sslmode=disable | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_key_server_database }}?sslmode={{ matrix_dendrite_database_sslmode }} | |||
| max_open_conns: 10 | |||
| max_idle_conns: 2 | |||
| conn_max_lifetime: -1 | |||
| @@ -279,7 +279,7 @@ media_api: | |||
| external_api: | |||
| listen: http://0.0.0.0:8074 | |||
| database: | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_media_api_database }}?sslmode=disable | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_media_api_database }}?sslmode={{ matrix_dendrite_database_sslmode }} | |||
| max_open_conns: 10 | |||
| max_idle_conns: 2 | |||
| conn_max_lifetime: -1 | |||
| @@ -318,7 +318,7 @@ mscs: | |||
| # - msc2946 (Spaces Summary, see https://github.com/matrix-org/matrix-doc/pull/2946) | |||
| mscs: [] | |||
| database: | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_mscs_database }}?sslmode=disable | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_mscs_database }}?sslmode={{ matrix_dendrite_database_sslmode }} | |||
| max_open_conns: 5 | |||
| max_idle_conns: 2 | |||
| conn_max_lifetime: -1 | |||
| @@ -329,7 +329,7 @@ room_server: | |||
| listen: http://0.0.0.0:7770 | |||
| connect: http://room_server:7770 | |||
| database: | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_room_database }}?sslmode=disable | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_room_database }}?sslmode={{ matrix_dendrite_database_sslmode }} | |||
| max_open_conns: 10 | |||
| max_idle_conns: 2 | |||
| conn_max_lifetime: -1 | |||
| @@ -342,7 +342,7 @@ sync_api: | |||
| external_api: | |||
| listen: http://0.0.0.0:8073 | |||
| database: | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_sync_api_database }}?sslmode=disable | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_sync_api_database }}?sslmode={{ matrix_dendrite_database_sslmode }} | |||
| max_open_conns: 10 | |||
| max_idle_conns: 2 | |||
| conn_max_lifetime: -1 | |||
| @@ -376,7 +376,7 @@ user_api: | |||
| listen: http://0.0.0.0:7781 | |||
| connect: http://user_api:7781 | |||
| account_database: | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_user_api_database }}?sslmode=disable | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_user_api_database }}?sslmode={{ matrix_dendrite_database_sslmode }} | |||
| max_open_conns: 10 | |||
| max_idle_conns: 2 | |||
| conn_max_lifetime: -1 | |||
| @@ -394,7 +394,7 @@ push_server: | |||
| listen: http://localhost:7782 | |||
| connect: http://localhost:7782 | |||
| database: | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_push_server_database }}?sslmode=disable | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_push_server_database }}?sslmode={{ matrix_dendrite_database_sslmode }} | |||
| max_open_conns: 10 | |||
| max_idle_conns: 2 | |||
| conn_max_lifetime: -1 | |||
| @@ -403,7 +403,7 @@ push_server: | |||
| # | |||
| relay_api: | |||
| database: | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_relay_api_database }}?sslmode=disable | |||
| connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_relay_api_database }}?sslmode={{ matrix_dendrite_database_sslmode }} | |||
| # Configuration for Opentracing. | |||
| # See https://github.com/matrix-org/dendrite/tree/master/docs/tracing for information on | |||
| @@ -112,9 +112,10 @@ matrix_media_repo_database_password: "your_password" | |||
| matrix_media_repo_database_hostname: "{{ devture_postgres_identifier }}" | |||
| matrix_media_repo_database_port: 5432 | |||
| matrix_media_repo_database_name: "matrix_media_repo" | |||
| matrix_media_repo_database_sslmode: disable | |||
| # Currently only "postgres" is supported. | |||
| matrix_media_repo_database_postgres: "postgres://{{ matrix_media_repo_database_username }}:{{ matrix_media_repo_database_password }}@{{ matrix_media_repo_database_hostname }}:{{ matrix_media_repo_database_port }}/{{ matrix_media_repo_database_name }}?sslmode=disable" | |||
| matrix_media_repo_database_postgres: "postgres://{{ matrix_media_repo_database_username }}:{{ matrix_media_repo_database_password }}@{{ matrix_media_repo_database_hostname }}:{{ matrix_media_repo_database_port }}/{{ matrix_media_repo_database_name }}?sslmode={{ matrix_media_repo_database_sslmode }}" | |||
| # The database pooling options | |||
| @@ -253,6 +253,10 @@ matrix_nginx_proxy_proxy_grafana_hostname: "{{ matrix_server_fqn_grafana }}" | |||
| matrix_nginx_proxy_proxy_sygnal_enabled: false | |||
| matrix_nginx_proxy_proxy_sygnal_hostname: "{{ matrix_server_fqn_sygnal }}" | |||
| # Controls whether proxying the mautrix wsproxy should be done. | |||
| matrix_nginx_proxy_proxy_mautrix_wsproxy_enabled: false | |||
| matrix_nginx_proxy_proxy_mautrix_wsproxy_hostname: "{{ matrix_server_fqn_mautrix_wsproxy }}" | |||
| # Controls whether proxying the ntfy domain should be done. | |||
| matrix_nginx_proxy_proxy_ntfy_enabled: false | |||
| matrix_nginx_proxy_proxy_ntfy_hostname: "{{ matrix_server_fqn_ntfy }}" | |||
| @@ -441,6 +445,9 @@ matrix_nginx_proxy_proxy_grafana_additional_server_configuration_blocks: [] | |||
| # A list of strings containing additional configuration blocks to add to Sygnal's server configuration (matrix-sygnal.conf). | |||
| matrix_nginx_proxy_proxy_sygnal_additional_server_configuration_blocks: [] | |||
| # A list of strings containing additional configuration blocks to add to mautrix wsproxy server configuration (matrix-mautrix-wsproxy.conf). | |||
| matrix_nginx_proxy_proxy_mautrix_wsproxy_additional_server_configuration_blocks: [] | |||
| # A list of strings containing additional configuration blocks to add to ntfy's server configuration (matrix-ntfy.conf). | |||
| matrix_nginx_proxy_proxy_ntfy_additional_server_configuration_blocks: [] | |||
| @@ -178,6 +178,13 @@ | |||
| mode: 0644 | |||
| when: matrix_nginx_proxy_proxy_ntfy_enabled | bool | |||
| - name: Ensure Matrix nginx-proxy configuration for mautrix wsproxy exists | |||
| ansible.builtin.template: | |||
| src: "{{ role_path }}/templates/nginx/conf.d/matrix-mautrix-wsproxy.conf.j2" | |||
| dest: "{{ matrix_nginx_proxy_confd_path }}/matrix-mautrix-wsproxy.conf" | |||
| mode: 0644 | |||
| when: matrix_nginx_proxy_proxy_mautrix_wsproxy_enabled|bool | |||
| - name: Ensure Matrix nginx-proxy configuration for Matrix domain exists | |||
| ansible.builtin.template: | |||
| src: "{{ role_path }}/templates/nginx/conf.d/matrix-domain.conf.j2" | |||
| @@ -334,6 +341,12 @@ | |||
| state: absent | |||
| when: "not matrix_nginx_proxy_proxy_ntfy_enabled | bool" | |||
| - name: Ensure Matrix nginx-proxy configuration for mautrix wsproxy deleted | |||
| ansible.builtin.file: | |||
| path: "{{ matrix_nginx_proxy_confd_path }}/matrix-mautrix-wsproxy.conf" | |||
| state: absent | |||
| when: "not matrix_nginx_proxy_proxy_mautrix_wsproxy_enabled|bool" | |||
| - name: Ensure Matrix nginx-proxy configuration for etherpad domain deleted | |||
| ansible.builtin.file: | |||
| path: "{{ matrix_nginx_proxy_confd_path }}/matrix-etherpad.conf" | |||
| @@ -0,0 +1,110 @@ | |||
| #jinja2: lstrip_blocks: "True" | |||
| {% macro render_vhost_directives() %} | |||
| gzip on; | |||
| gzip_types text/plain application/json application/javascript text/css image/x-icon font/ttf image/gif; | |||
| {% if matrix_nginx_proxy_hsts_preload_enabled %} | |||
| add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; | |||
| {% else %} | |||
| add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; | |||
| {% endif %} | |||
| add_header X-Content-Type-Options nosniff; | |||
| add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}"; | |||
| add_header X-Frame-Options SAMEORIGIN; | |||
| {% if matrix_nginx_proxy_floc_optout_enabled %} | |||
| add_header Permissions-Policy interest-cohort=() always; | |||
| {% endif %} | |||
| {% for configuration_block in matrix_nginx_proxy_proxy_mautrix_wsproxy_additional_server_configuration_blocks %} | |||
| {{- configuration_block }} | |||
| {% endfor %} | |||
| location / { | |||
| {% if matrix_nginx_proxy_enabled %} | |||
| {# Use the embedded DNS resolver in Docker containers to discover the service #} | |||
| resolver 127.0.0.11 valid=5s; | |||
| set $backend "wsproxy:29331"; | |||
| proxy_pass http://$backend; | |||
| {% else %} | |||
| {# Generic configuration for use outside of our container setup #} | |||
| proxy_pass http://127.0.0.1:29331; | |||
| {% endif %} | |||
| proxy_set_header Host $host; | |||
| proxy_set_header X-Forwarded-For $remote_addr; | |||
| proxy_set_header Upgrade $http_upgrade; | |||
| proxy_set_header Connection "upgrade"; | |||
| proxy_http_version 1.1; | |||
| proxy_send_timeout 1d; | |||
| proxy_read_timeout 1d; | |||
| tcp_nodelay on; | |||
| } | |||
| {% endmacro %} | |||
| server { | |||
| listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }}; | |||
| server_name {{ matrix_nginx_proxy_proxy_mautrix_wsproxy_hostname }}; | |||
| server_tokens off; | |||
| root /dev/null; | |||
| {% if matrix_nginx_proxy_https_enabled %} | |||
| location /.well-known/acme-challenge { | |||
| {% if matrix_nginx_proxy_enabled %} | |||
| {# Use the embedded DNS resolver in Docker containers to discover the service #} | |||
| resolver 127.0.0.11 valid=5s; | |||
| set $backend "matrix-certbot:8080"; | |||
| proxy_pass http://$backend; | |||
| {% else %} | |||
| {# Generic configuration for use outside of our container setup #} | |||
| proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }}; | |||
| {% endif %} | |||
| } | |||
| location / { | |||
| return 301 https://$http_host$request_uri; | |||
| } | |||
| {% else %} | |||
| {{ render_vhost_directives() }} | |||
| {% endif %} | |||
| } | |||
| {% if matrix_nginx_proxy_https_enabled %} | |||
| server { | |||
| listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2; | |||
| listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2; | |||
| server_name {{ matrix_nginx_proxy_proxy_mautrix_wsproxy_hostname }}; | |||
| server_tokens off; | |||
| root /dev/null; | |||
| ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_mautrix_wsproxy_hostname }}/fullchain.pem; | |||
| ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_mautrix_wsproxy_hostname }}/privkey.pem; | |||
| ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }}; | |||
| {% if matrix_nginx_proxy_ssl_ciphers != "" %} | |||
| ssl_ciphers {{ matrix_nginx_proxy_ssl_ciphers }}; | |||
| {% endif %} | |||
| ssl_prefer_server_ciphers {{ matrix_nginx_proxy_ssl_prefer_server_ciphers }}; | |||
| {% if matrix_nginx_proxy_ocsp_stapling_enabled %} | |||
| ssl_stapling on; | |||
| ssl_stapling_verify on; | |||
| ssl_trusted_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_mautrix_wsproxy_hostname }}/chain.pem; | |||
| {% endif %} | |||
| {% if matrix_nginx_proxy_ssl_session_tickets_off %} | |||
| ssl_session_tickets off; | |||
| {% endif %} | |||
| ssl_session_cache {{ matrix_nginx_proxy_ssl_session_cache }}; | |||
| ssl_session_timeout {{ matrix_nginx_proxy_ssl_session_timeout }}; | |||
| {{ render_vhost_directives() }} | |||
| } | |||
| {% endif %} | |||
| @@ -82,10 +82,11 @@ matrix_sliding_sync_environment_variable_syncv3_server: "{{ matrix_homeserver_ur | |||
| matrix_sliding_sync_environment_variable_syncv3_secret: '' | |||
| # Controls the SYNCV3_DB environment variable | |||
| matrix_sliding_sync_environment_variable_syncv3_db: 'user={{ matrix_sliding_sync_database_username }} password={{ matrix_sliding_sync_database_password }} host={{ matrix_sliding_sync_database_hostname }} port={{ matrix_sliding_sync_database_port }} dbname={{ matrix_sliding_sync_database_name }} sslmode=disable' | |||
| matrix_sliding_sync_environment_variable_syncv3_db: 'user={{ matrix_sliding_sync_database_username }} password={{ matrix_sliding_sync_database_password }} host={{ matrix_sliding_sync_database_hostname }} port={{ matrix_sliding_sync_database_port }} dbname={{ matrix_sliding_sync_database_name }} sslmode={{ matrix_sliding_sync_database_sslmode }}' | |||
| matrix_sliding_sync_database_username: 'matrix_sliding_sync' | |||
| matrix_sliding_sync_database_password: '' | |||
| matrix_sliding_sync_database_hostname: '' | |||
| matrix_sliding_sync_database_port: 5432 | |||
| matrix_sliding_sync_database_name: 'matrix_sliding_sync' | |||
| matrix_sliding_sync_database_sslmode: disable | |||
| @@ -61,6 +61,7 @@ | |||
| - custom/matrix-bridge-mautrix-telegram | |||
| - custom/matrix-bridge-mautrix-gmessages | |||
| - custom/matrix-bridge-mautrix-whatsapp | |||
| - custom/matrix-bridge-mautrix-wsproxy | |||
| - custom/matrix-bridge-mautrix-discord | |||
| - custom/matrix-bridge-mautrix-slack | |||
| - custom/matrix-bridge-mx-puppet-discord | |||