Refer to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/4695#discussion_r2485317210 Signed-off-by: Suguru Hirahara <did🔑z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>pull/4695/head
| @@ -23,23 +23,23 @@ If you wish to adjust it, see the section [below](#adjusting-the-zulip-bridge-ur | |||||
| To enable the Zulip bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: | To enable the Zulip bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: | ||||
| ```yaml | ```yaml | ||||
| matrix_bridge_zulip_enabled: true | |||||
| matrix_zulip_bridge_enabled: true | |||||
| # Setting the owner is optional as the first local user to DM `@matrixzulipbridge:example.com` will be made the owner. | # Setting the owner is optional as the first local user to DM `@matrixzulipbridge:example.com` will be made the owner. | ||||
| # If you are not using a local user you must set it as otherwise you can't DM it at all. | # If you are not using a local user you must set it as otherwise you can't DM it at all. | ||||
| matrix_bridge_zulip_owner: "@alice:{{ matrix_domain }}" | |||||
| matrix_zulip_bridge_owner: "@alice:{{ matrix_domain }}" | |||||
| ``` | ``` | ||||
| ### Adjusting the Zulip bridge URL (optional) | ### Adjusting the Zulip bridge URL (optional) | ||||
| By tweaking the `matrix_bridge_zulip_hostname` and `matrix_bridge_zulip_path_prefix` variables, you can easily make the service available at a **different hostname and/or path** than the default one. | |||||
| By tweaking the `matrix_zulip_bridge_hostname` and `matrix_zulip_bridge_path_prefix` variables, you can easily make the service available at a **different hostname and/or path** than the default one. | |||||
| Example additional configuration for your `vars.yml` file: | Example additional configuration for your `vars.yml` file: | ||||
| ```yaml | ```yaml | ||||
| # Change the default hostname and path prefix | # Change the default hostname and path prefix | ||||
| matrix_bridge_zulip_hostname: zulip.example.com | |||||
| matrix_bridge_zulip_path_prefix: / | |||||
| matrix_zulip_bridge_hostname: zulip.example.com | |||||
| matrix_zulip_bridge_path_prefix: / | |||||
| ``` | ``` | ||||
| If you've changed the default hostname, you may need to create a CNAME record for the Zulip bridge domain (`zulip.example.com`), which targets `matrix.example.com`. | If you've changed the default hostname, you may need to create a CNAME record for the Zulip bridge domain (`zulip.example.com`), which targets `matrix.example.com`. | ||||
| @@ -118,7 +118,7 @@ matrix_homeserver_container_extra_arguments_auto: | | |||||
| + | + | ||||
| (['--mount type=bind,src=' + matrix_hookshot_base_path + '/registration.yml,dst=/hookshot-registration.yml,ro'] if matrix_hookshot_enabled else []) | (['--mount type=bind,src=' + matrix_hookshot_base_path + '/registration.yml,dst=/hookshot-registration.yml,ro'] if matrix_hookshot_enabled else []) | ||||
| + | + | ||||
| (['--mount type=bind,src=' + matrix_bridge_zulip_base_path + '/registration.yaml,dst=/matrixzulipbridge-registration.yaml,ro'] if matrix_bridge_zulip_enabled else []) | |||||
| (['--mount type=bind,src=' + matrix_zulip_bridge_base_path + '/registration.yaml,dst=/matrixzulipbridge-registration.yaml,ro'] if matrix_zulip_bridge_enabled else []) | |||||
| + | + | ||||
| (['--mount type=bind,src=' + matrix_mautrix_bluesky_config_path + '/registration.yaml,dst=/matrix-mautrix-bluesky-registration.yaml,ro'] if matrix_mautrix_bluesky_enabled else []) | (['--mount type=bind,src=' + matrix_mautrix_bluesky_config_path + '/registration.yaml,dst=/matrix-mautrix-bluesky-registration.yaml,ro'] if matrix_mautrix_bluesky_enabled else []) | ||||
| + | + | ||||
| @@ -195,7 +195,7 @@ matrix_homeserver_app_service_config_files_auto: | | |||||
| + | + | ||||
| (['/hookshot-registration.yml'] if matrix_hookshot_enabled else []) | (['/hookshot-registration.yml'] if matrix_hookshot_enabled else []) | ||||
| + | + | ||||
| (['/matrixzulipbridge-registration.yaml'] if matrix_bridge_zulip_enabled else []) | |||||
| (['/matrixzulipbridge-registration.yaml'] if matrix_zulip_bridge_enabled else []) | |||||
| + | + | ||||
| (['/matrix-mautrix-bluesky-registration.yaml'] if matrix_mautrix_bluesky_enabled else []) | (['/matrix-mautrix-bluesky-registration.yaml'] if matrix_mautrix_bluesky_enabled else []) | ||||
| + | + | ||||
| @@ -343,7 +343,7 @@ devture_systemd_service_manager_services_list_auto: | | |||||
| + | + | ||||
| ([{'name': 'matrix-hookshot.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'hookshot', 'bridge-hookshot']}] if matrix_hookshot_enabled else []) | ([{'name': 'matrix-hookshot.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'hookshot', 'bridge-hookshot']}] if matrix_hookshot_enabled else []) | ||||
| + | + | ||||
| ([{'name': 'matrix-bridge-zulip.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'matrixzulipbridge']}] if matrix_bridge_zulip_enabled else []) | |||||
| ([{'name': 'matrix-bridge-zulip.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'matrixzulipbridge']}] if matrix_zulip_bridge_enabled else []) | |||||
| + | + | ||||
| ([{'name': 'matrix-mautrix-bluesky.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mautrix-bluesky']}] if matrix_mautrix_bluesky_enabled else []) | ([{'name': 'matrix-mautrix-bluesky.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mautrix-bluesky']}] if matrix_mautrix_bluesky_enabled else []) | ||||
| + | + | ||||
| @@ -2383,38 +2383,38 @@ matrix_hookshot_public_hostname: "{{ matrix_server_fqn_matrix }}" | |||||
| ###################################################################### | ###################################################################### | ||||
| # We don't enable bridges by default. | # We don't enable bridges by default. | ||||
| matrix_bridge_zulip_enabled: false | |||||
| matrix_zulip_bridge_enabled: false | |||||
| matrix_bridge_zulip_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}" | |||||
| matrix_zulip_bridge_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}" | |||||
| matrix_bridge_zulip_systemd_required_services_list_auto: | | |||||
| matrix_zulip_bridge_systemd_required_services_list_auto: | | |||||
| {{ | {{ | ||||
| matrix_addons_homeserver_systemd_services_list | matrix_addons_homeserver_systemd_services_list | ||||
| }} | }} | ||||
| matrix_bridge_zulip_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_bridge_zulip_docker_image_registry_prefix_upstream_default }}" | |||||
| matrix_zulip_bridge_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_zulip_bridge_docker_image_registry_prefix_upstream_default }}" | |||||
| matrix_bridge_zulip_container_network: "{{ matrix_addons_container_network }}" | |||||
| matrix_zulip_bridge_container_network: "{{ matrix_addons_container_network }}" | |||||
| matrix_bridge_zulip_container_additional_networks_auto: |- | |||||
| matrix_zulip_bridge_container_additional_networks_auto: |- | |||||
| {{ | {{ | ||||
| ( | ( | ||||
| ([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network]) | ([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network]) | ||||
| + | + | ||||
| [matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_bridge_zulip_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] | |||||
| [matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_zulip_bridge_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] | |||||
| ) | unique | ) | unique | ||||
| }} | }} | ||||
| matrix_bridge_zulip_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" | |||||
| matrix_bridge_zulip_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" | |||||
| matrix_bridge_zulip_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}" | |||||
| matrix_bridge_zulip_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}" | |||||
| matrix_zulip_bridge_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" | |||||
| matrix_zulip_bridge_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" | |||||
| matrix_zulip_bridge_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}" | |||||
| matrix_zulip_bridge_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}" | |||||
| matrix_bridge_zulip_appservice_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'zulip.as.tok', rounds=655555) | to_uuid }}" | |||||
| matrix_zulip_bridge_appservice_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'zulip.as.tok', rounds=655555) | to_uuid }}" | |||||
| matrix_bridge_zulip_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'zulip.hs.tok', rounds=655555) | to_uuid }}" | |||||
| matrix_zulip_bridge_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'zulip.hs.tok', rounds=655555) | to_uuid }}" | |||||
| matrix_bridge_zulip_homeserver_url: "{{ matrix_addons_homeserver_client_api_url }}" | |||||
| matrix_zulip_bridge_homeserver_url: "{{ matrix_addons_homeserver_client_api_url }}" | |||||
| ###################################################################### | ###################################################################### | ||||
| # | # | ||||
| @@ -5349,7 +5349,7 @@ matrix_synapse_admin_config_asManagedUsers_auto: | | |||||
| ([ | ([ | ||||
| '^@zulipbot:'+(matrix_domain | regex_escape)+'$', | '^@zulipbot:'+(matrix_domain | regex_escape)+'$', | ||||
| '^@zulip_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', | '^@zulip_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', | ||||
| ] if matrix_bridge_zulip_enabled else []) | |||||
| ] if matrix_zulip_bridge_enabled else []) | |||||
| + | + | ||||
| ([ | ([ | ||||
| '^@hookshot:'+(matrix_domain | regex_escape)+'$', | '^@hookshot:'+(matrix_domain | regex_escape)+'$', | ||||
| @@ -12,106 +12,106 @@ | |||||
| # MatrixZulipBridge is a puppeting appservice bridge for Zulip | # MatrixZulipBridge is a puppeting appservice bridge for Zulip | ||||
| # Project source code URL: https://github.com/GearKite/MatrixZulipBridge | # Project source code URL: https://github.com/GearKite/MatrixZulipBridge | ||||
| matrix_bridge_zulip_enabled: true | |||||
| matrix_zulip_bridge_enabled: true | |||||
| matrix_bridge_zulip_scheme: https | |||||
| matrix_bridge_zulip_hostname: "{{ matrix_server_fqn_matrix }}" | |||||
| matrix_bridge_zulip_path_prefix: "/zulip" | |||||
| matrix_zulip_bridge_scheme: https | |||||
| matrix_zulip_bridge_hostname: "{{ matrix_server_fqn_matrix }}" | |||||
| matrix_zulip_bridge_path_prefix: "/zulip" | |||||
| # renovate: datasource=docker depName=ghcr.io/gearkite/matrixzulipbridge | # renovate: datasource=docker depName=ghcr.io/gearkite/matrixzulipbridge | ||||
| matrix_bridge_zulip_version: v0.4.1 | |||||
| matrix_bridge_zulip_docker_image: "{{ matrix_bridge_zulip_docker_image_registry_prefix }}gearkite/matrixzulipbridge:{{ matrix_bridge_zulip_version }}" | |||||
| matrix_bridge_zulip_docker_image_registry_prefix: "{{ matrix_bridge_zulip_docker_image_registry_prefix_upstream }}" | |||||
| matrix_bridge_zulip_docker_image_registry_prefix_upstream: "{{ matrix_bridge_zulip_docker_image_registry_prefix_upstream_default }}" | |||||
| matrix_bridge_zulip_docker_image_registry_prefix_upstream_default: ghcr.io/ | |||||
| matrix_bridge_zulip_docker_image_force_pull: "{{ matrix_bridge_zulip_docker_image.endswith(':latest') }}" | |||||
| matrix_zulip_bridge_version: v0.4.1 | |||||
| matrix_zulip_bridge_docker_image: "{{ matrix_zulip_bridge_docker_image_registry_prefix }}gearkite/matrixzulipbridge:{{ matrix_zulip_bridge_version }}" | |||||
| matrix_zulip_bridge_docker_image_registry_prefix: "{{ matrix_zulip_bridge_docker_image_registry_prefix_upstream }}" | |||||
| matrix_zulip_bridge_docker_image_registry_prefix_upstream: "{{ matrix_zulip_bridge_docker_image_registry_prefix_upstream_default }}" | |||||
| matrix_zulip_bridge_docker_image_registry_prefix_upstream_default: ghcr.io/ | |||||
| matrix_zulip_bridge_docker_image_force_pull: "{{ matrix_zulip_bridge_docker_image.endswith(':latest') }}" | |||||
| # Set this to your Matrix ID if you want to enforce the owner, otherwise first _local_ user becomes one | # Set this to your Matrix ID if you want to enforce the owner, otherwise first _local_ user becomes one | ||||
| matrix_bridge_zulip_owner: "" | |||||
| matrix_zulip_bridge_owner: "" | |||||
| matrix_bridge_zulip_base_path: "{{ matrix_base_data_path }}/zulip" | |||||
| matrix_zulip_bridge_base_path: "{{ matrix_base_data_path }}/zulip" | |||||
| matrix_bridge_zulip_container_network: "" | |||||
| matrix_zulip_bridge_container_network: "" | |||||
| # The port number in the container | # The port number in the container | ||||
| matrix_bridge_zulip_container_http_port: 9898 | |||||
| matrix_zulip_bridge_container_http_port: 9898 | |||||
| matrix_bridge_zulip_container_additional_networks: "{{ matrix_bridge_zulip_container_additional_networks_auto + matrix_bridge_zulip_container_additional_networks_custom }}" | |||||
| matrix_bridge_zulip_container_additional_networks_auto: [] | |||||
| matrix_bridge_zulip_container_additional_networks_custom: [] | |||||
| matrix_zulip_bridge_container_additional_networks: "{{ matrix_zulip_bridge_container_additional_networks_auto + matrix_zulip_bridge_container_additional_networks_custom }}" | |||||
| matrix_zulip_bridge_container_additional_networks_auto: [] | |||||
| matrix_zulip_bridge_container_additional_networks_custom: [] | |||||
| # Controls how long to wait for the container to stop gracefully before killing it. | # Controls how long to wait for the container to stop gracefully before killing it. | ||||
| # We use a small value here, because this container does not seem to handle the SIGTERM signal. | # We use a small value here, because this container does not seem to handle the SIGTERM signal. | ||||
| matrix_bridge_zulip_container_stop_grace_time_seconds: 1 | |||||
| matrix_zulip_bridge_container_stop_grace_time_seconds: 1 | |||||
| # matrix_bridge_zulip_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container. | |||||
| # matrix_zulip_bridge_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. | # See `../templates/labels.j2` for details. | ||||
| # | # | ||||
| # To inject your own other container labels, see `matrix_bridge_zulip_container_labels_additional_labels`. | |||||
| matrix_bridge_zulip_container_labels_traefik_enabled: true | |||||
| matrix_bridge_zulip_container_labels_traefik_docker_network: "{{ matrix_bridge_zulip_container_network }}" | |||||
| matrix_bridge_zulip_container_labels_traefik_hostname: "{{ matrix_bridge_zulip_hostname }}" | |||||
| matrix_bridge_zulip_container_labels_traefik_path_prefix: "{{ matrix_bridge_zulip_path_prefix }}" | |||||
| matrix_bridge_zulip_container_labels_traefik_entrypoints: web-secure | |||||
| matrix_bridge_zulip_container_labels_traefik_tls_certResolver: default # noqa var-naming | |||||
| # To inject your own other container labels, see `matrix_zulip_bridge_container_labels_additional_labels`. | |||||
| matrix_zulip_bridge_container_labels_traefik_enabled: true | |||||
| matrix_zulip_bridge_container_labels_traefik_docker_network: "{{ matrix_zulip_bridge_container_network }}" | |||||
| matrix_zulip_bridge_container_labels_traefik_hostname: "{{ matrix_zulip_bridge_hostname }}" | |||||
| matrix_zulip_bridge_container_labels_traefik_path_prefix: "{{ matrix_zulip_bridge_path_prefix }}" | |||||
| matrix_zulip_bridge_container_labels_traefik_entrypoints: web-secure | |||||
| matrix_zulip_bridge_container_labels_traefik_tls_certResolver: default # noqa var-naming | |||||
| # Controls if the media router is enabled | # Controls if the media router is enabled | ||||
| matrix_bridge_zulip_container_labels_traefik_media_enabled: true | |||||
| matrix_bridge_zulip_container_labels_traefik_media_hostname: "{{ matrix_bridge_zulip_container_labels_traefik_hostname }}" | |||||
| matrix_zulip_bridge_container_labels_traefik_media_enabled: true | |||||
| matrix_zulip_bridge_container_labels_traefik_media_hostname: "{{ matrix_zulip_bridge_container_labels_traefik_hostname }}" | |||||
| # The path prefix must either be `/` or not end with a slash (e.g. `/zulip`). | # The path prefix must either be `/` or not end with a slash (e.g. `/zulip`). | ||||
| matrix_bridge_zulip_container_labels_traefik_media_path_prefix: "{{ '' if matrix_bridge_zulip_container_labels_traefik_path_prefix == '/' else (matrix_bridge_zulip_container_labels_traefik_path_prefix) }}/_bridge_zulip/media" | |||||
| matrix_bridge_zulip_container_labels_traefik_media_rule: "Host(`{{ matrix_bridge_zulip_container_labels_traefik_media_hostname }}`){% if matrix_bridge_zulip_container_labels_traefik_media_path_prefix != '/' %} && PathPrefix(`{{ matrix_bridge_zulip_container_labels_traefik_media_path_prefix }}`){% endif %}" | |||||
| matrix_bridge_zulip_container_labels_traefik_media_priority: 0 | |||||
| matrix_bridge_zulip_container_labels_traefik_media_entrypoints: "{{ matrix_bridge_zulip_container_labels_traefik_entrypoints }}" | |||||
| matrix_bridge_zulip_container_labels_traefik_media_tls: "{{ matrix_bridge_zulip_container_labels_traefik_media_entrypoints != 'web' }}" | |||||
| matrix_bridge_zulip_container_labels_traefik_media_tls_certResolver: "{{ matrix_bridge_zulip_container_labels_traefik_tls_certResolver }}" # noqa var-naming | |||||
| # matrix_bridge_zulip_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file. | |||||
| matrix_zulip_bridge_container_labels_traefik_media_path_prefix: "{{ '' if matrix_zulip_bridge_container_labels_traefik_path_prefix == '/' else (matrix_zulip_bridge_container_labels_traefik_path_prefix) }}/_bridge_zulip/media" | |||||
| matrix_zulip_bridge_container_labels_traefik_media_rule: "Host(`{{ matrix_zulip_bridge_container_labels_traefik_media_hostname }}`){% if matrix_zulip_bridge_container_labels_traefik_media_path_prefix != '/' %} && PathPrefix(`{{ matrix_zulip_bridge_container_labels_traefik_media_path_prefix }}`){% endif %}" | |||||
| matrix_zulip_bridge_container_labels_traefik_media_priority: 0 | |||||
| matrix_zulip_bridge_container_labels_traefik_media_entrypoints: "{{ matrix_zulip_bridge_container_labels_traefik_entrypoints }}" | |||||
| matrix_zulip_bridge_container_labels_traefik_media_tls: "{{ matrix_zulip_bridge_container_labels_traefik_media_entrypoints != 'web' }}" | |||||
| matrix_zulip_bridge_container_labels_traefik_media_tls_certResolver: "{{ matrix_zulip_bridge_container_labels_traefik_tls_certResolver }}" # noqa var-naming | |||||
| # matrix_zulip_bridge_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file. | |||||
| # See `../templates/labels.j2` for details. | # See `../templates/labels.j2` for details. | ||||
| # | # | ||||
| # Example: | # Example: | ||||
| # matrix_bridge_zulip_container_labels_additional_labels: | | |||||
| # matrix_zulip_bridge_container_labels_additional_labels: | | |||||
| # my.label=1 | # my.label=1 | ||||
| # another.label="here" | # another.label="here" | ||||
| matrix_bridge_zulip_container_labels_additional_labels: '' | |||||
| matrix_zulip_bridge_container_labels_additional_labels: '' | |||||
| # A list of extra arguments to pass to the container | # A list of extra arguments to pass to the container | ||||
| matrix_bridge_zulip_container_extra_arguments: [] | |||||
| matrix_zulip_bridge_container_extra_arguments: [] | |||||
| # List of systemd services that service depends on. | # List of systemd services that service depends on. | ||||
| matrix_bridge_zulip_systemd_required_services_list: "{{ matrix_bridge_zulip_systemd_required_services_list_default + matrix_bridge_zulip_systemd_required_services_list_auto + matrix_bridge_zulip_systemd_required_services_list_custom }}" | |||||
| matrix_bridge_zulip_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" | |||||
| matrix_bridge_zulip_systemd_required_services_list_auto: [] | |||||
| matrix_bridge_zulip_systemd_required_services_list_custom: [] | |||||
| matrix_zulip_bridge_systemd_required_services_list: "{{ matrix_zulip_bridge_systemd_required_services_list_default + matrix_zulip_bridge_systemd_required_services_list_auto + matrix_zulip_bridge_systemd_required_services_list_custom }}" | |||||
| matrix_zulip_bridge_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" | |||||
| matrix_zulip_bridge_systemd_required_services_list_auto: [] | |||||
| matrix_zulip_bridge_systemd_required_services_list_custom: [] | |||||
| # List of systemd services that service wants | # List of systemd services that service wants | ||||
| matrix_bridge_zulip_systemd_wanted_services_list: [] | |||||
| matrix_zulip_bridge_systemd_wanted_services_list: [] | |||||
| matrix_bridge_zulip_homeserver_url: "" | |||||
| matrix_zulip_bridge_homeserver_url: "" | |||||
| matrix_bridge_zulip_appservice_token: '' | |||||
| matrix_bridge_zulip_homeserver_token: '' | |||||
| matrix_zulip_bridge_appservice_token: '' | |||||
| matrix_zulip_bridge_homeserver_token: '' | |||||
| matrix_bridge_zulip_config_media_url: "{{ matrix_bridge_zulip_scheme }}://{{ matrix_bridge_zulip_hostname }}" | |||||
| # This matches the hardcoded `DEFAULT_MEDIA_PATH` in MatrixZulipBridge, but uses `matrix_bridge_zulip_path_prefix` as the path prefix. | |||||
| matrix_zulip_bridge_config_media_url: "{{ matrix_zulip_bridge_scheme }}://{{ matrix_zulip_bridge_hostname }}" | |||||
| # This matches the hardcoded `DEFAULT_MEDIA_PATH` in MatrixZulipBridge, but uses `matrix_zulip_bridge_path_prefix` as the path prefix. | |||||
| # See: https://github.com/GearKite/MatrixZulipBridge/blob/2ba51f3da2ad8bd33460c953ef91a9cfc585a2d4/matrixzulipbridge/__main__.py#L87 | # See: https://github.com/GearKite/MatrixZulipBridge/blob/2ba51f3da2ad8bd33460c953ef91a9cfc585a2d4/matrixzulipbridge/__main__.py#L87 | ||||
| matrix_bridge_zulip_config_media_path: "{{ matrix_bridge_zulip_container_labels_traefik_media_path_prefix }}/v3/download/{netloc}{path}{filename}" | |||||
| matrix_bridge_zulip_config_media_key: "{{ matrix_bridge_zulip_homeserver_token }}" | |||||
| matrix_bridge_zulip_config_displayname: "MatrixZulipBridge" | |||||
| matrix_zulip_bridge_config_media_path: "{{ matrix_zulip_bridge_container_labels_traefik_media_path_prefix }}/v3/download/{netloc}{path}{filename}" | |||||
| matrix_zulip_bridge_config_media_key: "{{ matrix_zulip_bridge_homeserver_token }}" | |||||
| matrix_zulip_bridge_config_displayname: "MatrixZulipBridge" | |||||
| matrix_bridge_zulip_registration_yaml_bridge_zulip: | |||||
| media_url: "{{ matrix_bridge_zulip_config_media_url }}" | |||||
| media_path: "{{ matrix_bridge_zulip_config_media_path }}" | |||||
| media_key: "{{ matrix_bridge_zulip_config_media_key }}" | |||||
| displayname: "{{ matrix_bridge_zulip_config_displayname }}" | |||||
| matrix_zulip_bridge_registration_yaml_bridge_zulip: | |||||
| media_url: "{{ matrix_zulip_bridge_config_media_url }}" | |||||
| media_path: "{{ matrix_zulip_bridge_config_media_path }}" | |||||
| media_key: "{{ matrix_zulip_bridge_config_media_key }}" | |||||
| displayname: "{{ matrix_zulip_bridge_config_displayname }}" | |||||
| # Default registration file consumed by both the homeserver and MatrixZulipBridge. | # Default registration file consumed by both the homeserver and MatrixZulipBridge. | ||||
| # Besides registration information, it contains configuration (see the Zulip bridge key). | # Besides registration information, it contains configuration (see the Zulip bridge key). | ||||
| matrix_bridge_zulip_registration_yaml: | |||||
| matrix_zulip_bridge_registration_yaml: | |||||
| id: zulipbridge | id: zulipbridge | ||||
| url: http://matrix-bridge-zulip:{{ matrix_bridge_zulip_container_http_port }} | |||||
| as_token: "{{ matrix_bridge_zulip_appservice_token }}" | |||||
| hs_token: "{{ matrix_bridge_zulip_homeserver_token }}" | |||||
| url: http://matrix-bridge-zulip:{{ matrix_zulip_bridge_container_http_port }} | |||||
| as_token: "{{ matrix_zulip_bridge_appservice_token }}" | |||||
| hs_token: "{{ matrix_zulip_bridge_homeserver_token }}" | |||||
| rate_limited: false | rate_limited: false | ||||
| sender_localpart: zulipbridge | sender_localpart: zulipbridge | ||||
| namespaces: | namespaces: | ||||
| @@ -120,6 +120,6 @@ matrix_bridge_zulip_registration_yaml: | |||||
| exclusive: true | exclusive: true | ||||
| aliases: [] | aliases: [] | ||||
| rooms: [] | rooms: [] | ||||
| matrixzulipbridge: "{{ matrix_bridge_zulip_registration_yaml_bridge_zulip }}" | |||||
| matrixzulipbridge: "{{ matrix_zulip_bridge_registration_yaml_bridge_zulip }}" | |||||
| matrix_bridge_zulip_registration: "{{ matrix_bridge_zulip_registration_yaml | from_yaml }}" | |||||
| matrix_zulip_bridge_registration: "{{ matrix_zulip_bridge_registration_yaml | from_yaml }}" | |||||
| @@ -7,7 +7,7 @@ | |||||
| --- | --- | ||||
| - name: Perform the Zulip bridge installation tasks | - name: Perform the Zulip bridge installation tasks | ||||
| when: matrix_bridge_zulip_enabled | bool | |||||
| when: matrix_zulip_bridge_enabled | bool | |||||
| tags: | tags: | ||||
| - setup-all | - setup-all | ||||
| - setup-bridge-zulip | - setup-bridge-zulip | ||||
| @@ -20,7 +20,7 @@ | |||||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml" | ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml" | ||||
| - name: Perform the Zulip bridge uninstallation tasks | - name: Perform the Zulip bridge uninstallation tasks | ||||
| when: not matrix_bridge_zulip_enabled | bool | |||||
| when: not matrix_zulip_bridge_enabled | bool | |||||
| tags: | tags: | ||||
| - setup-all | - setup-all | ||||
| - setup-bridge-zulip | - setup-bridge-zulip | ||||
| @@ -11,10 +11,10 @@ | |||||
| --- | --- | ||||
| - name: Ensure the Zulip bridge image is pulled | - name: Ensure the Zulip bridge image is pulled | ||||
| community.docker.docker_image: | community.docker.docker_image: | ||||
| name: "{{ matrix_bridge_zulip_docker_image }}" | |||||
| name: "{{ matrix_zulip_bridge_docker_image }}" | |||||
| source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" | source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" | ||||
| force_source: "{{ matrix_bridge_zulip_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_bridge_zulip_docker_image_force_pull }}" | |||||
| force_source: "{{ matrix_zulip_bridge_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_zulip_bridge_docker_image_force_pull }}" | |||||
| register: result | register: result | ||||
| retries: "{{ devture_playbook_help_container_retries_count }}" | retries: "{{ devture_playbook_help_container_retries_count }}" | ||||
| delay: "{{ devture_playbook_help_container_retries_delay }}" | delay: "{{ devture_playbook_help_container_retries_delay }}" | ||||
| @@ -28,12 +28,12 @@ | |||||
| owner: "{{ matrix_user_name }}" | owner: "{{ matrix_user_name }}" | ||||
| group: "{{ matrix_group_name }}" | group: "{{ matrix_group_name }}" | ||||
| with_items: | with_items: | ||||
| - "{{ matrix_bridge_zulip_base_path }}" | |||||
| - "{{ matrix_zulip_bridge_base_path }}" | |||||
| - name: Ensure the Zulip bridge registration.yaml installed if provided | - name: Ensure the Zulip bridge registration.yaml installed if provided | ||||
| ansible.builtin.copy: | ansible.builtin.copy: | ||||
| content: "{{ matrix_bridge_zulip_registration | to_nice_yaml(indent=2, width=999999) }}" | |||||
| dest: "{{ matrix_bridge_zulip_base_path }}/registration.yaml" | |||||
| content: "{{ matrix_zulip_bridge_registration | to_nice_yaml(indent=2, width=999999) }}" | |||||
| dest: "{{ matrix_zulip_bridge_base_path }}/registration.yaml" | |||||
| mode: "0644" | mode: "0644" | ||||
| owner: "{{ matrix_user_name }}" | owner: "{{ matrix_user_name }}" | ||||
| group: "{{ matrix_group_name }}" | group: "{{ matrix_group_name }}" | ||||
| @@ -41,7 +41,7 @@ | |||||
| - name: Ensure the Zulip bridge support files installed | - name: Ensure the Zulip bridge support files installed | ||||
| ansible.builtin.template: | ansible.builtin.template: | ||||
| src: "{{ role_path }}/templates/{{ item }}.j2" | src: "{{ role_path }}/templates/{{ item }}.j2" | ||||
| dest: "{{ matrix_bridge_zulip_base_path }}/{{ item }}" | |||||
| dest: "{{ matrix_zulip_bridge_base_path }}/{{ item }}" | |||||
| mode: "0640" | mode: "0640" | ||||
| owner: "{{ matrix_user_name }}" | owner: "{{ matrix_user_name }}" | ||||
| group: "{{ matrix_group_name }}" | group: "{{ matrix_group_name }}" | ||||
| @@ -51,7 +51,7 @@ | |||||
| - name: Ensure the Zulip bridge container network is created | - name: Ensure the Zulip bridge container network is created | ||||
| community.general.docker_network: | community.general.docker_network: | ||||
| enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" | enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" | ||||
| name: "{{ matrix_bridge_zulip_container_network }}" | |||||
| name: "{{ matrix_zulip_bridge_container_network }}" | |||||
| driver: bridge | driver: bridge | ||||
| driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" | driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" | ||||
| @@ -9,9 +9,9 @@ | |||||
| - name: Check existence of matrix-bridge-zulip service | - name: Check existence of matrix-bridge-zulip service | ||||
| ansible.builtin.stat: | ansible.builtin.stat: | ||||
| path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bridge-zulip.service" | path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bridge-zulip.service" | ||||
| register: matrix_bridge_zulip_service_stat | |||||
| register: matrix_zulip_bridge_service_stat | |||||
| - when: matrix_bridge_zulip_service_stat.stat.exists | bool | |||||
| - when: matrix_zulip_bridge_service_stat.stat.exists | bool | |||||
| block: | block: | ||||
| - name: Ensure matrix-bridge-zulip is stopped | - name: Ensure matrix-bridge-zulip is stopped | ||||
| ansible.builtin.service: | ansible.builtin.service: | ||||
| @@ -10,5 +10,5 @@ | |||||
| You need to define a required configuration setting (`{{ item.name }}`). | You need to define a required configuration setting (`{{ item.name }}`). | ||||
| when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" | when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" | ||||
| with_items: | with_items: | ||||
| - {"name": "matrix_bridge_zulip_container_network", when: true} | |||||
| - {"name": "matrix_bridge_zulip_homeserver_url", when: true} | |||||
| - {"name": "matrix_zulip_bridge_container_network", when: true} | |||||
| - {"name": "matrix_zulip_bridge_homeserver_url", when: true} | |||||
| @@ -4,33 +4,33 @@ SPDX-FileCopyrightText: 2024 Slavi Pantaleev | |||||
| SPDX-License-Identifier: AGPL-3.0-or-later | SPDX-License-Identifier: AGPL-3.0-or-later | ||||
| #} | #} | ||||
| {% if matrix_bridge_zulip_container_labels_traefik_enabled %} | |||||
| {% if matrix_zulip_bridge_container_labels_traefik_enabled %} | |||||
| traefik.enable=true | traefik.enable=true | ||||
| {% if matrix_bridge_zulip_container_labels_traefik_docker_network %} | |||||
| traefik.docker.network={{ matrix_bridge_zulip_container_labels_traefik_docker_network }} | |||||
| {% if matrix_zulip_bridge_container_labels_traefik_docker_network %} | |||||
| traefik.docker.network={{ matrix_zulip_bridge_container_labels_traefik_docker_network }} | |||||
| {% endif %} | {% endif %} | ||||
| traefik.http.services.matrix-bridge-zulip.loadbalancer.server.port={{ matrix_bridge_zulip_container_http_port }} | |||||
| traefik.http.services.matrix-bridge-zulip.loadbalancer.server.port={{ matrix_zulip_bridge_container_http_port }} | |||||
| {% set middlewares = [] %} | {% set middlewares = [] %} | ||||
| {% if matrix_bridge_zulip_container_labels_traefik_path_prefix != '/' %} | |||||
| traefik.http.middlewares.matrix-bridge-zulip-strip-prefix.stripprefix.prefixes={{ matrix_bridge_zulip_container_labels_traefik_path_prefix }} | |||||
| {% if matrix_zulip_bridge_container_labels_traefik_path_prefix != '/' %} | |||||
| traefik.http.middlewares.matrix-bridge-zulip-strip-prefix.stripprefix.prefixes={{ matrix_zulip_bridge_container_labels_traefik_path_prefix }} | |||||
| {% set middlewares = middlewares + ['matrix-bridge-zulip-strip-prefix'] %} | {% set middlewares = middlewares + ['matrix-bridge-zulip-strip-prefix'] %} | ||||
| {% endif %} | {% endif %} | ||||
| {% if matrix_bridge_zulip_container_labels_traefik_media_enabled %} | |||||
| {% if matrix_zulip_bridge_container_labels_traefik_media_enabled %} | |||||
| ########################################################################## | ########################################################################## | ||||
| # # | # # | ||||
| # Media # | # Media # | ||||
| # # | # # | ||||
| ########################################################################## | ########################################################################## | ||||
| traefik.http.routers.matrix-bridge-zulip-media.rule={{ matrix_bridge_zulip_container_labels_traefik_media_rule }} | |||||
| traefik.http.routers.matrix-bridge-zulip-media.rule={{ matrix_zulip_bridge_container_labels_traefik_media_rule }} | |||||
| {% if matrix_bridge_zulip_container_labels_traefik_media_priority | int > 0 %} | |||||
| traefik.http.routers.matrix-bridge-zulip-media.priority={{ matrix_bridge_zulip_container_labels_traefik_media_priority }} | |||||
| {% if matrix_zulip_bridge_container_labels_traefik_media_priority | int > 0 %} | |||||
| traefik.http.routers.matrix-bridge-zulip-media.priority={{ matrix_zulip_bridge_container_labels_traefik_media_priority }} | |||||
| {% endif %} | {% endif %} | ||||
| {% if middlewares | length > 0 %} | {% if middlewares | length > 0 %} | ||||
| @@ -38,11 +38,11 @@ traefik.http.routers.matrix-bridge-zulip-media.middlewares={{ middlewares | join | |||||
| {% endif %} | {% endif %} | ||||
| traefik.http.routers.matrix-bridge-zulip-media.service=matrix-bridge-zulip | traefik.http.routers.matrix-bridge-zulip-media.service=matrix-bridge-zulip | ||||
| traefik.http.routers.matrix-bridge-zulip-media.entrypoints={{ matrix_bridge_zulip_container_labels_traefik_entrypoints }} | |||||
| traefik.http.routers.matrix-bridge-zulip-media.entrypoints={{ matrix_zulip_bridge_container_labels_traefik_entrypoints }} | |||||
| traefik.http.routers.matrix-bridge-zulip-media.tls={{ matrix_bridge_zulip_container_labels_traefik_media_tls | to_json }} | |||||
| {% if matrix_bridge_zulip_container_labels_traefik_media_entrypoints %} | |||||
| traefik.http.routers.matrix-bridge-zulip-media.tls.certResolver={{ matrix_bridge_zulip_container_labels_traefik_media_tls_certResolver }} | |||||
| traefik.http.routers.matrix-bridge-zulip-media.tls={{ matrix_zulip_bridge_container_labels_traefik_media_tls | to_json }} | |||||
| {% if matrix_zulip_bridge_container_labels_traefik_media_entrypoints %} | |||||
| traefik.http.routers.matrix-bridge-zulip-media.tls.certResolver={{ matrix_zulip_bridge_container_labels_traefik_media_tls_certResolver }} | |||||
| {% endif %} | {% endif %} | ||||
| ########################################################################## | ########################################################################## | ||||
| @@ -55,4 +55,4 @@ traefik.http.routers.matrix-bridge-zulip-media.tls.certResolver={{ matrix_bridge | |||||
| {% endif %} | {% endif %} | ||||
| {{ matrix_bridge_zulip_container_labels_additional_labels }} | |||||
| {{ matrix_zulip_bridge_container_labels_additional_labels }} | |||||
| @@ -8,11 +8,11 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| [Unit] | [Unit] | ||||
| Description=a puppeting appservice bridge for Zulip | Description=a puppeting appservice bridge for Zulip | ||||
| {% for service in matrix_bridge_zulip_systemd_required_services_list %} | |||||
| {% for service in matrix_zulip_bridge_systemd_required_services_list %} | |||||
| Requires={{ service }} | Requires={{ service }} | ||||
| After={{ service }} | After={{ service }} | ||||
| {% endfor %} | {% endfor %} | ||||
| {% for service in matrix_bridge_zulip_systemd_wanted_services_list %} | |||||
| {% for service in matrix_zulip_bridge_systemd_wanted_services_list %} | |||||
| Wants={{ service }} | Wants={{ service }} | ||||
| {% endfor %} | {% endfor %} | ||||
| DefaultDependencies=no | DefaultDependencies=no | ||||
| @@ -20,7 +20,7 @@ DefaultDependencies=no | |||||
| [Service] | [Service] | ||||
| Type=simple | Type=simple | ||||
| Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}" | Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}" | ||||
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ matrix_bridge_zulip_container_stop_grace_time_seconds }} matrix-bridge-zulip | |||||
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ matrix_zulip_bridge_container_stop_grace_time_seconds }} matrix-bridge-zulip | |||||
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bridge-zulip | ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bridge-zulip | ||||
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ | ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ | ||||
| @@ -29,28 +29,28 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ | |||||
| --log-driver=none \ | --log-driver=none \ | ||||
| --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ | --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ | ||||
| --cap-drop=ALL \ | --cap-drop=ALL \ | ||||
| --network={{ matrix_bridge_zulip_container_network }} \ | |||||
| --mount type=bind,src={{ matrix_bridge_zulip_base_path }},dst=/config \ | |||||
| --label-file={{ matrix_bridge_zulip_base_path }}/labels \ | |||||
| {% for arg in matrix_bridge_zulip_container_extra_arguments %} | |||||
| --network={{ matrix_zulip_bridge_container_network }} \ | |||||
| --mount type=bind,src={{ matrix_zulip_bridge_base_path }},dst=/config \ | |||||
| --label-file={{ matrix_zulip_bridge_base_path }}/labels \ | |||||
| {% for arg in matrix_zulip_bridge_container_extra_arguments %} | |||||
| {{ arg }} \ | {{ arg }} \ | ||||
| {% endfor %} | {% endfor %} | ||||
| {{ matrix_bridge_zulip_docker_image }} \ | |||||
| {% if matrix_bridge_zulip_owner %} | |||||
| -o {{ matrix_bridge_zulip_owner }} \ | |||||
| {{ matrix_zulip_bridge_docker_image }} \ | |||||
| {% if matrix_zulip_bridge_owner %} | |||||
| -o {{ matrix_zulip_bridge_owner }} \ | |||||
| {% endif %} | {% endif %} | ||||
| --config /config/registration.yaml \ | --config /config/registration.yaml \ | ||||
| --listen-address 0.0.0.0 \ | --listen-address 0.0.0.0 \ | ||||
| --listen-port {{ matrix_bridge_zulip_container_http_port }} \ | |||||
| {{ matrix_bridge_zulip_homeserver_url }} | |||||
| --listen-port {{ matrix_zulip_bridge_container_http_port }} \ | |||||
| {{ matrix_zulip_bridge_homeserver_url }} | |||||
| {% for network in matrix_bridge_zulip_container_additional_networks %} | |||||
| {% for network in matrix_zulip_bridge_container_additional_networks %} | |||||
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bridge-zulip | ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bridge-zulip | ||||
| {% endfor %} | {% endfor %} | ||||
| ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bridge-zulip | ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bridge-zulip | ||||
| ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ matrix_bridge_zulip_container_stop_grace_time_seconds }} matrix-bridge-zulip | |||||
| ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ matrix_zulip_bridge_container_stop_grace_time_seconds }} matrix-bridge-zulip | |||||
| ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bridge-zulip | ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bridge-zulip | ||||
| Restart=always | Restart=always | ||||
| RestartSec=30 | RestartSec=30 | ||||