Part of adopting a uniform naming policy for bridge variables, where the variable prefix matches the role directory name. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>pull/5434/head
| @@ -20,9 +20,9 @@ See the project's [documentation](https://github.com/matrix-org/matrix-appservic | |||
| To enable the bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: | |||
| ```yaml | |||
| matrix_appservice_irc_enabled: true | |||
| matrix_bridge_appservice_irc_enabled: true | |||
| matrix_appservice_irc_ircService_servers: | |||
| matrix_bridge_appservice_irc_ircService_servers: | |||
| irc.example.com: | |||
| name: "ExampleNet" | |||
| port: 6697 | |||
| @@ -76,7 +76,7 @@ There are some additional things you may wish to configure about the bridge. | |||
| Take a look at: | |||
| - `roles/custom/matrix-bridge-appservice-irc/defaults/main.yml` for some variables that you can customize via your `vars.yml` file | |||
| - `roles/custom/matrix-bridge-appservice-irc/templates/config.yaml.j2` for the bridge's default configuration. You can override settings (even those that don't have dedicated playbook variables) using the `matrix_appservice_irc_configuration_extension_yaml` variable | |||
| - `roles/custom/matrix-bridge-appservice-irc/templates/config.yaml.j2` for the bridge's default configuration. You can override settings (even those that don't have dedicated playbook variables) using the `matrix_bridge_appservice_irc_configuration_extension_yaml` variable | |||
| ## Installing | |||
| @@ -104,7 +104,7 @@ As with all other services, you can find the logs in [systemd-journald](https:// | |||
| The default logging level for this component is `debug`, and the log is output to the console only. If you want to change the verbosity or enable logging to a file, add the following configuration to your `vars.yml` file (adapt to your needs) and re-run the playbook: | |||
| ```yaml | |||
| matrix_appservice_irc_configuration_extension_yaml: | | |||
| matrix_bridge_appservice_irc_configuration_extension_yaml: | | |||
| logging: | |||
| # Level to log on console/logfile. | |||
| # Valid values: error, warn, info, debug | |||
| @@ -100,7 +100,7 @@ matrix_homeserver_container_extra_arguments_auto: | | |||
| + | |||
| (['--mount type=bind,src=' + matrix_appservice_double_puppet_config_path + '/registration.yaml,dst=/matrix-appservice-double-puppet-registration.yaml,ro'] if matrix_appservice_double_puppet_enabled else []) | |||
| + | |||
| (['--mount type=bind,src=' + matrix_appservice_irc_config_path + '/registration.yaml,dst=/matrix-appservice-irc-registration.yaml,ro'] if matrix_appservice_irc_enabled else []) | |||
| (['--mount type=bind,src=' + matrix_bridge_appservice_irc_config_path + '/registration.yaml,dst=/matrix-appservice-irc-registration.yaml,ro'] if matrix_bridge_appservice_irc_enabled else []) | |||
| + | |||
| (['--mount type=bind,src=' + matrix_beeper_linkedin_config_path + '/registration.yaml,dst=/matrix-beeper-linkedin-registration.yaml,ro'] if matrix_beeper_linkedin_enabled else []) | |||
| + | |||
| @@ -159,7 +159,7 @@ matrix_homeserver_app_service_config_files_auto: | | |||
| + | |||
| (['/matrix-appservice-double-puppet-registration.yaml'] if matrix_appservice_double_puppet_enabled else []) | |||
| + | |||
| (['/matrix-appservice-irc-registration.yaml'] if matrix_appservice_irc_enabled else []) | |||
| (['/matrix-appservice-irc-registration.yaml'] if matrix_bridge_appservice_irc_enabled else []) | |||
| + | |||
| (['/matrix-beeper-linkedin-registration.yaml'] if matrix_beeper_linkedin_enabled else []) | |||
| + | |||
| @@ -366,9 +366,9 @@ devture_systemd_service_manager_services_list_auto: | | |||
| ([{ | |||
| 'name': 'matrix-appservice-irc.service', | |||
| 'priority': 2000, | |||
| 'restart_necessary': (matrix_appservice_irc_restart_necessary | bool), | |||
| 'restart_necessary': (matrix_bridge_appservice_irc_restart_necessary | bool), | |||
| 'groups': ['matrix', 'bridges', 'appservice-irc'], | |||
| }] if matrix_appservice_irc_enabled else []) | |||
| }] if matrix_bridge_appservice_irc_enabled else []) | |||
| + | |||
| ([{ | |||
| 'name': 'matrix-beeper-linkedin.service', | |||
| @@ -1224,54 +1224,54 @@ matrix_bridge_appservice_discord_database_password: "{{ (matrix_homeserver_gener | |||
| ###################################################################### | |||
| # We don't enable bridges by default. | |||
| matrix_appservice_irc_enabled: false | |||
| matrix_bridge_appservice_irc_enabled: false | |||
| matrix_appservice_irc_systemd_required_services_list_auto: | | |||
| matrix_bridge_appservice_irc_systemd_required_services_list_auto: | | |||
| {{ | |||
| matrix_addons_homeserver_systemd_services_list | |||
| + | |||
| ([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_appservice_irc_database_hostname == postgres_connection_hostname) else []) | |||
| ([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_bridge_appservice_irc_database_hostname == postgres_connection_hostname) else []) | |||
| }} | |||
| matrix_appservice_irc_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_appservice_irc_container_image_registry_prefix_upstream_default }}" | |||
| matrix_bridge_appservice_irc_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_bridge_appservice_irc_container_image_registry_prefix_upstream_default }}" | |||
| matrix_appservice_irc_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" | |||
| matrix_bridge_appservice_irc_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" | |||
| matrix_appservice_irc_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '9999') if matrix_playbook_service_host_bind_interface_prefix else '' }}" | |||
| matrix_bridge_appservice_irc_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '9999') if matrix_playbook_service_host_bind_interface_prefix else '' }}" | |||
| matrix_appservice_irc_container_network: "{{ matrix_addons_container_network }}" | |||
| matrix_bridge_appservice_irc_container_network: "{{ matrix_addons_container_network }}" | |||
| matrix_appservice_irc_container_additional_networks_auto: |- | |||
| matrix_bridge_appservice_irc_container_additional_networks_auto: |- | |||
| {{ | |||
| ( | |||
| ([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network]) | |||
| + | |||
| ([postgres_container_network] if (postgres_enabled and matrix_appservice_irc_database_hostname == postgres_connection_hostname and matrix_appservice_irc_container_network != postgres_container_network) else []) | |||
| ([postgres_container_network] if (postgres_enabled and matrix_bridge_appservice_irc_database_hostname == postgres_connection_hostname and matrix_bridge_appservice_irc_container_network != postgres_container_network) else []) | |||
| + | |||
| [matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_appservice_irc_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] | |||
| [matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_bridge_appservice_irc_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] | |||
| ) | unique | |||
| }} | |||
| # The IRC bridge docs say that if homeserver presence is disabled, it's better to also disable | |||
| # IRC bridge presence, for performance reasons. | |||
| matrix_appservice_irc_homeserver_enablePresence: "{{ matrix_synapse_presence_enabled if matrix_homeserver_implementation == 'synapse' else true }}" | |||
| matrix_bridge_appservice_irc_homeserver_enablePresence: "{{ matrix_synapse_presence_enabled if matrix_homeserver_implementation == 'synapse' else true }}" | |||
| matrix_appservice_irc_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':irc.as.token') | hash('sha512') | to_uuid }}" | |||
| matrix_bridge_appservice_irc_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':irc.as.token') | hash('sha512') | to_uuid }}" | |||
| matrix_appservice_irc_homeserver_url: "{{ matrix_addons_homeserver_client_api_url }}" | |||
| matrix_appservice_irc_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':irc.hs.token') | hash('sha512') | to_uuid }}" | |||
| matrix_bridge_appservice_irc_homeserver_url: "{{ matrix_addons_homeserver_client_api_url }}" | |||
| matrix_bridge_appservice_irc_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':irc.hs.token') | hash('sha512') | to_uuid }}" | |||
| matrix_appservice_irc_database_engine: "{{ 'postgres' if postgres_enabled else 'nedb' }}" | |||
| matrix_appservice_irc_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}" | |||
| matrix_appservice_irc_database_password: "{{ (matrix_homeserver_generic_secret_key + ':as.irc.db') | hash('sha512') | to_uuid }}" | |||
| matrix_appservice_irc_database_container_network: "{{ postgres_container_network if postgres_enabled else '' }}" | |||
| matrix_bridge_appservice_irc_database_engine: "{{ 'postgres' if postgres_enabled else 'nedb' }}" | |||
| matrix_bridge_appservice_irc_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}" | |||
| matrix_bridge_appservice_irc_database_password: "{{ (matrix_homeserver_generic_secret_key + ':as.irc.db') | hash('sha512') | to_uuid }}" | |||
| matrix_bridge_appservice_irc_database_container_network: "{{ postgres_container_network if postgres_enabled else '' }}" | |||
| matrix_appservice_irc_ircService_mediaProxy_publicUrl_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}" # noqa var-naming | |||
| matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}" # noqa var-naming | |||
| matrix_appservice_irc_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" | |||
| matrix_appservice_irc_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" | |||
| matrix_appservice_irc_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}" | |||
| matrix_appservice_irc_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}" # noqa var-naming | |||
| matrix_bridge_appservice_irc_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" | |||
| matrix_bridge_appservice_irc_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" | |||
| matrix_bridge_appservice_irc_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}" | |||
| matrix_bridge_appservice_irc_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}" # noqa var-naming | |||
| ###################################################################### | |||
| # | |||
| @@ -4153,10 +4153,10 @@ postgres_managed_databases_auto: | | |||
| }] if (matrix_appservice_draupnir_for_all_enabled and matrix_appservice_draupnir_for_all_database_hostname == postgres_connection_hostname) else []) | |||
| + | |||
| ([{ | |||
| 'name': matrix_appservice_irc_database_name, | |||
| 'username': matrix_appservice_irc_database_username, | |||
| 'password': matrix_appservice_irc_database_password, | |||
| }] if (matrix_appservice_irc_enabled and matrix_appservice_irc_database_engine == 'postgres' and matrix_appservice_irc_database_hostname == postgres_connection_hostname) else []) | |||
| 'name': matrix_bridge_appservice_irc_database_name, | |||
| 'username': matrix_bridge_appservice_irc_database_username, | |||
| 'password': matrix_bridge_appservice_irc_database_password, | |||
| }] if (matrix_bridge_appservice_irc_enabled and matrix_bridge_appservice_irc_database_engine == 'postgres' and matrix_bridge_appservice_irc_database_hostname == postgres_connection_hostname) else []) | |||
| + | |||
| ([{ | |||
| 'name': matrix_beeper_linkedin_database_name, | |||
| @@ -23,70 +23,70 @@ | |||
| # Matrix Appservice IRC is a Matrix <-> IRC bridge | |||
| # Project source code URL: https://github.com/matrix-org/matrix-appservice-irc | |||
| matrix_appservice_irc_enabled: true | |||
| matrix_bridge_appservice_irc_enabled: true | |||
| matrix_appservice_irc_container_image_self_build: false | |||
| matrix_appservice_irc_container_repo: "https://github.com/matrix-org/matrix-appservice-irc.git" | |||
| matrix_appservice_irc_container_repo_version: "{{ 'master' if matrix_appservice_irc_version == 'latest' else matrix_appservice_irc_version }}" | |||
| matrix_appservice_irc_container_src_files_path: "{{ matrix_base_data_path }}/appservice-irc/docker-src" | |||
| matrix_bridge_appservice_irc_container_image_self_build: false | |||
| matrix_bridge_appservice_irc_container_repo: "https://github.com/matrix-org/matrix-appservice-irc.git" | |||
| matrix_bridge_appservice_irc_container_repo_version: "{{ 'master' if matrix_bridge_appservice_irc_version == 'latest' else matrix_bridge_appservice_irc_version }}" | |||
| matrix_bridge_appservice_irc_container_src_files_path: "{{ matrix_base_data_path }}/appservice-irc/docker-src" | |||
| # matrix_appservice_irc_version used to contain the full Docker image tag (e.g. `release-X.X.X`). | |||
| # matrix_bridge_appservice_irc_version used to contain the full Docker image tag (e.g. `release-X.X.X`). | |||
| # It's a bare version number now. We try to somewhat retain compatibility below. | |||
| # renovate: datasource=docker depName=docker.io/matrixdotorg/matrix-appservice-irc | |||
| matrix_appservice_irc_version: 4.0.0 | |||
| matrix_appservice_irc_container_image: "{{ matrix_appservice_irc_container_image_registry_prefix }}matrixdotorg/matrix-appservice-irc:{{ matrix_appservice_irc_container_image_tag }}" | |||
| matrix_appservice_irc_container_image_registry_prefix: "{{ 'localhost/' if matrix_appservice_irc_container_image_self_build else matrix_appservice_irc_container_image_registry_prefix_upstream }}" | |||
| matrix_appservice_irc_container_image_registry_prefix_upstream: "{{ matrix_appservice_irc_container_image_registry_prefix_upstream_default }}" | |||
| matrix_appservice_irc_container_image_registry_prefix_upstream_default: docker.io/ | |||
| matrix_appservice_irc_container_image_tag: "{{ 'latest' if matrix_appservice_irc_version == 'latest' else ('release-' + matrix_appservice_irc_version) }}" | |||
| matrix_bridge_appservice_irc_version: 4.0.0 | |||
| matrix_bridge_appservice_irc_container_image: "{{ matrix_bridge_appservice_irc_container_image_registry_prefix }}matrixdotorg/matrix-appservice-irc:{{ matrix_bridge_appservice_irc_container_image_tag }}" | |||
| matrix_bridge_appservice_irc_container_image_registry_prefix: "{{ 'localhost/' if matrix_bridge_appservice_irc_container_image_self_build else matrix_bridge_appservice_irc_container_image_registry_prefix_upstream }}" | |||
| matrix_bridge_appservice_irc_container_image_registry_prefix_upstream: "{{ matrix_bridge_appservice_irc_container_image_registry_prefix_upstream_default }}" | |||
| matrix_bridge_appservice_irc_container_image_registry_prefix_upstream_default: docker.io/ | |||
| matrix_bridge_appservice_irc_container_image_tag: "{{ 'latest' if matrix_bridge_appservice_irc_version == 'latest' else ('release-' + matrix_bridge_appservice_irc_version) }}" | |||
| matrix_appservice_irc_base_path: "{{ matrix_base_data_path }}/appservice-irc" | |||
| matrix_appservice_irc_config_path: "{{ matrix_appservice_irc_base_path }}/config" | |||
| matrix_appservice_irc_data_path: "{{ matrix_appservice_irc_base_path }}/data" | |||
| matrix_bridge_appservice_irc_base_path: "{{ matrix_base_data_path }}/appservice-irc" | |||
| matrix_bridge_appservice_irc_config_path: "{{ matrix_bridge_appservice_irc_base_path }}/config" | |||
| matrix_bridge_appservice_irc_data_path: "{{ matrix_bridge_appservice_irc_base_path }}/data" | |||
| matrix_appservice_irc_homeserver_url: "" | |||
| matrix_appservice_irc_homeserver_domain: '{{ matrix_domain }}' | |||
| matrix_bridge_appservice_irc_homeserver_url: "" | |||
| matrix_bridge_appservice_irc_homeserver_domain: '{{ matrix_domain }}' | |||
| # ircService.mediaProxy configuration for serving publicly accessible URLs to authenticated Matrix media | |||
| matrix_appservice_irc_ircService_mediaProxy_bindPort: 11111 # noqa var-naming | |||
| matrix_appservice_irc_ircService_mediaProxy_publicUrl_scheme: https # noqa var-naming | |||
| matrix_appservice_irc_ircService_mediaProxy_publicUrl_hostname: '{{ matrix_server_fqn_matrix }}' # noqa var-naming | |||
| matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix: '/irc/' # noqa var-naming | |||
| matrix_appservice_irc_ircService_mediaProxy_publicUrl: "{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_scheme }}://{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_hostname }}{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix }}" # noqa var-naming | |||
| matrix_appservice_irc_homeserver_enablePresence: true # noqa var-naming | |||
| matrix_appservice_irc_appservice_address: 'http://matrix-appservice-irc:9999' | |||
| matrix_appservice_irc_database_engine: nedb | |||
| matrix_appservice_irc_database_username: matrix_appservice_irc | |||
| 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 | |||
| matrix_bridge_appservice_irc_ircService_mediaProxy_bindPort: 11111 # noqa var-naming | |||
| matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_scheme: https # noqa var-naming | |||
| matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_hostname: '{{ matrix_server_fqn_matrix }}' # noqa var-naming | |||
| matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix: '/irc/' # noqa var-naming | |||
| matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl: "{{ matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_scheme }}://{{ matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_hostname }}{{ matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix }}" # noqa var-naming | |||
| matrix_bridge_appservice_irc_homeserver_enablePresence: true # noqa var-naming | |||
| matrix_bridge_appservice_irc_appservice_address: 'http://matrix-appservice-irc:9999' | |||
| matrix_bridge_appservice_irc_database_engine: nedb | |||
| matrix_bridge_appservice_irc_database_username: matrix_appservice_irc | |||
| matrix_bridge_appservice_irc_database_password: 'some-password' | |||
| matrix_bridge_appservice_irc_database_hostname: '' | |||
| matrix_bridge_appservice_irc_database_port: 5432 | |||
| matrix_bridge_appservice_irc_database_name: matrix_appservice_irc | |||
| matrix_bridge_appservice_irc_database_sslmode: disable | |||
| # The name of the container network to use when importing a NeDB database into Postgres. | |||
| # For Postgres not working in a container, this can be left empty. | |||
| matrix_appservice_irc_database_container_network: '' | |||
| matrix_bridge_appservice_irc_database_container_network: '' | |||
| # 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={{ matrix_appservice_irc_database_sslmode }}' | |||
| # Naming clashes with `matrix_bridge_appservice_irc_database_connectionString` somewhat. | |||
| matrix_bridge_appservice_irc_database_connection_string: 'postgresql://{{ matrix_bridge_appservice_irc_database_username }}:{{ matrix_bridge_appservice_irc_database_password }}@{{ matrix_bridge_appservice_irc_database_hostname }}:{{ matrix_bridge_appservice_irc_database_port }}/{{ matrix_bridge_appservice_irc_database_name }}?sslmode={{ matrix_bridge_appservice_irc_database_sslmode }}' | |||
| # This is what actually goes into `database.connectionString` for the bridge. | |||
| matrix_appservice_irc_database_connectionString: |- # noqa var-naming | |||
| matrix_bridge_appservice_irc_database_connectionString: |- # noqa var-naming | |||
| {{ | |||
| { | |||
| 'nedb': 'nedb:///data', | |||
| 'postgres': matrix_appservice_irc_database_connection_string, | |||
| }[matrix_appservice_irc_database_engine] | |||
| 'postgres': matrix_bridge_appservice_irc_database_connection_string, | |||
| }[matrix_bridge_appservice_irc_database_engine] | |||
| }} | |||
| matrix_appservice_irc_ircService_servers: [] # noqa var-naming | |||
| matrix_bridge_appservice_irc_ircService_servers: [] # noqa var-naming | |||
| # Example of `matrix_appservice_irc_ircService_servers` with one server (and all its options): | |||
| # Example of `matrix_bridge_appservice_irc_ircService_servers` with one server (and all its options): | |||
| # | |||
| # matrix_appservice_irc_ircService_servers: | |||
| # matrix_bridge_appservice_irc_ircService_servers: | |||
| # # The address of the server to connect to. | |||
| # irc.example.com: | |||
| # # A human-readable short name. This is used to label IRC status rooms | |||
| @@ -471,68 +471,68 @@ matrix_appservice_irc_ircService_servers: [] # noqa var-naming | |||
| # Controls whether the matrix-appservice-irc container exposes its HTTP port (tcp/9999 in the container). | |||
| # | |||
| # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9999"), or empty string to not expose. | |||
| matrix_appservice_irc_container_http_host_bind_port: '' | |||
| matrix_bridge_appservice_irc_container_http_host_bind_port: '' | |||
| # Controls whether the matrix-appservice-irc container exposes its media proxy HTTP port. | |||
| # | |||
| # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:11111"), or empty string to not expose. | |||
| matrix_appservice_irc_container_media_proxy_host_bind_port: '' | |||
| matrix_bridge_appservice_irc_container_media_proxy_host_bind_port: '' | |||
| matrix_appservice_irc_container_network: "" | |||
| matrix_bridge_appservice_irc_container_network: "" | |||
| matrix_appservice_irc_container_additional_networks: "{{ matrix_appservice_irc_container_additional_networks_auto + matrix_appservice_irc_container_additional_networks_custom }}" | |||
| matrix_appservice_irc_container_additional_networks_auto: [] | |||
| matrix_appservice_irc_container_additional_networks_custom: [] | |||
| matrix_bridge_appservice_irc_container_additional_networks: "{{ matrix_bridge_appservice_irc_container_additional_networks_auto + matrix_bridge_appservice_irc_container_additional_networks_custom }}" | |||
| matrix_bridge_appservice_irc_container_additional_networks_auto: [] | |||
| matrix_bridge_appservice_irc_container_additional_networks_custom: [] | |||
| # A list of extra arguments to pass to the container | |||
| matrix_appservice_irc_container_extra_arguments: [] | |||
| matrix_bridge_appservice_irc_container_extra_arguments: [] | |||
| # matrix_appservice_irc_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container. | |||
| # To inject your own other container labels, see `matrix_appservice_irc_container_labels_additional_labels`. | |||
| matrix_appservice_irc_container_labels_traefik_enabled: true | |||
| matrix_appservice_irc_container_labels_traefik_docker_network: "{{ matrix_appservice_irc_container_network }}" | |||
| matrix_appservice_irc_container_labels_traefik_entrypoints: web-secure | |||
| matrix_appservice_irc_container_labels_traefik_tls_certResolver: default # noqa var-naming | |||
| # matrix_bridge_appservice_irc_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container. | |||
| # To inject your own other container labels, see `matrix_bridge_appservice_irc_container_labels_additional_labels`. | |||
| matrix_bridge_appservice_irc_container_labels_traefik_enabled: true | |||
| matrix_bridge_appservice_irc_container_labels_traefik_docker_network: "{{ matrix_bridge_appservice_irc_container_network }}" | |||
| matrix_bridge_appservice_irc_container_labels_traefik_entrypoints: web-secure | |||
| matrix_bridge_appservice_irc_container_labels_traefik_tls_certResolver: default # noqa var-naming | |||
| # Controls whether Traefik labels for the media proxy will be applied | |||
| matrix_appservice_irc_container_labels_media_proxy_enabled: true | |||
| matrix_bridge_appservice_irc_container_labels_media_proxy_enabled: true | |||
| # Derived from publicUrl_pathPrefix, stripping any trailing slash (unless it's just "/") | |||
| matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix: "{{ '/' if matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix == '/' else matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix.rstrip('/') }}" | |||
| matrix_appservice_irc_container_labels_media_proxy_traefik_rule: "Host(`{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_hostname }}`) && PathPrefix(`{{ matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix }}`)" | |||
| matrix_appservice_irc_container_labels_media_proxy_traefik_priority: 2000 | |||
| matrix_appservice_irc_container_labels_media_proxy_traefik_entrypoints: "{{ matrix_appservice_irc_container_labels_traefik_entrypoints }}" | |||
| matrix_appservice_irc_container_labels_media_proxy_traefik_tls: "{{ matrix_appservice_irc_container_labels_media_proxy_traefik_entrypoints != 'web' }}" | |||
| matrix_appservice_irc_container_labels_media_proxy_traefik_tls_certResolver: "{{ matrix_appservice_irc_container_labels_traefik_tls_certResolver }}" # noqa var-naming | |||
| matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix: "{{ '/' if matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix == '/' else matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix.rstrip('/') }}" | |||
| matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_rule: "Host(`{{ matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_hostname }}`) && PathPrefix(`{{ matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix }}`)" | |||
| matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_priority: 2000 | |||
| matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_entrypoints: "{{ matrix_bridge_appservice_irc_container_labels_traefik_entrypoints }}" | |||
| matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_tls: "{{ matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_entrypoints != 'web' }}" | |||
| matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_tls_certResolver: "{{ matrix_bridge_appservice_irc_container_labels_traefik_tls_certResolver }}" # noqa var-naming | |||
| # matrix-appservice-irc container additional labels | |||
| matrix_appservice_irc_container_labels_additional_labels: '' | |||
| matrix_bridge_appservice_irc_container_labels_additional_labels: '' | |||
| # List of systemd services that matrix-appservice-irc.service depends on. | |||
| matrix_appservice_irc_systemd_required_services_list: "{{ matrix_appservice_irc_systemd_required_services_list_default + matrix_appservice_irc_systemd_required_services_list_auto + matrix_appservice_irc_systemd_required_services_list_custom }}" | |||
| matrix_appservice_irc_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" | |||
| matrix_appservice_irc_systemd_required_services_list_auto: [] | |||
| matrix_appservice_irc_systemd_required_services_list_custom: [] | |||
| matrix_bridge_appservice_irc_systemd_required_services_list: "{{ matrix_bridge_appservice_irc_systemd_required_services_list_default + matrix_bridge_appservice_irc_systemd_required_services_list_auto + matrix_bridge_appservice_irc_systemd_required_services_list_custom }}" | |||
| matrix_bridge_appservice_irc_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" | |||
| matrix_bridge_appservice_irc_systemd_required_services_list_auto: [] | |||
| matrix_bridge_appservice_irc_systemd_required_services_list_custom: [] | |||
| # List of systemd services that matrix-appservice-irc.service wants | |||
| matrix_appservice_irc_systemd_wanted_services_list: [] | |||
| matrix_bridge_appservice_irc_systemd_wanted_services_list: [] | |||
| matrix_appservice_irc_appservice_token: '' | |||
| matrix_appservice_irc_homeserver_token: '' | |||
| matrix_bridge_appservice_irc_appservice_token: '' | |||
| matrix_bridge_appservice_irc_homeserver_token: '' | |||
| matrix_appservice_irc_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" | |||
| matrix_bridge_appservice_irc_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" | |||
| matrix_appservice_irc_configuration_extension_yaml: | | |||
| matrix_bridge_appservice_irc_configuration_extension_yaml: | | |||
| # Your custom YAML configuration for Appservice IRC servers goes here. | |||
| # This configuration extends the default starting configuration (`matrix_appservice_irc_configuration_yaml`). | |||
| # This configuration extends the default starting configuration (`matrix_bridge_appservice_irc_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_appservice_irc_configuration_yaml`. | |||
| # completely redefining `matrix_bridge_appservice_irc_configuration_yaml`. | |||
| matrix_appservice_irc_configuration_extension: "{{ matrix_appservice_irc_configuration_extension_yaml | from_yaml if matrix_appservice_irc_configuration_extension_yaml | from_yaml is mapping else {} }}" | |||
| matrix_bridge_appservice_irc_configuration_extension: "{{ matrix_bridge_appservice_irc_configuration_extension_yaml | from_yaml if matrix_bridge_appservice_irc_configuration_extension_yaml | from_yaml is mapping else {} }}" | |||
| matrix_appservice_irc_configuration: "{{ matrix_appservice_irc_configuration_yaml | from_yaml | combine(matrix_appservice_irc_configuration_extension, recursive=True) }}" | |||
| matrix_bridge_appservice_irc_configuration: "{{ matrix_bridge_appservice_irc_configuration_yaml | from_yaml | combine(matrix_bridge_appservice_irc_configuration_extension, recursive=True) }}" | |||
| # The original registration.yaml file generated by AppService IRC is merged with this config override, | |||
| # to produce the final registration.yaml file ultimately used by both the bridge and the homeserver. | |||
| @@ -542,14 +542,14 @@ matrix_appservice_irc_configuration: "{{ matrix_appservice_irc_configuration_yam | |||
| # - always having the same AS/HS token and appservice ID in the registration.yaml file | |||
| # | |||
| # Learn more about this in `setup_install.yml` | |||
| matrix_appservice_irc_registration_override_yaml: | | |||
| matrix_bridge_appservice_irc_registration_override_yaml: | | |||
| id: appservice-irc | |||
| as_token: "{{ matrix_appservice_irc_appservice_token }}" | |||
| hs_token: "{{ matrix_appservice_irc_homeserver_token }}" | |||
| as_token: "{{ matrix_bridge_appservice_irc_appservice_token }}" | |||
| hs_token: "{{ matrix_bridge_appservice_irc_homeserver_token }}" | |||
| matrix_appservice_irc_registration_override: "{{ matrix_appservice_irc_registration_override_yaml | from_yaml }}" | |||
| matrix_bridge_appservice_irc_registration_override: "{{ matrix_bridge_appservice_irc_registration_override_yaml | from_yaml }}" | |||
| # matrix_appservice_irc_restart_necessary controls whether the service | |||
| # matrix_bridge_appservice_irc_restart_necessary controls whether the service | |||
| # will be restarted (when true) or merely started (when false) by the | |||
| # systemd service manager role (when conditional restart is enabled). | |||
| # | |||
| @@ -557,4 +557,4 @@ matrix_appservice_irc_registration_override: "{{ matrix_appservice_irc_registrat | |||
| # any configuration files, the systemd service file, or the container image changed. | |||
| # The default of `false` means "no restart needed" — appropriate when the role's | |||
| # installation tasks haven't run (e.g., due to --tags skipping them). | |||
| matrix_appservice_irc_restart_necessary: false | |||
| matrix_bridge_appservice_irc_restart_necessary: false | |||
| @@ -12,15 +12,15 @@ | |||
| - install-all | |||
| - install-appservice-irc | |||
| block: | |||
| - when: matrix_appservice_irc_enabled | bool | |||
| - when: matrix_bridge_appservice_irc_enabled | bool | |||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" | |||
| - when: matrix_appservice_irc_enabled | bool | |||
| - when: matrix_bridge_appservice_irc_enabled | bool | |||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml" | |||
| - tags: | |||
| - setup-all | |||
| - setup-appservice-irc | |||
| block: | |||
| - when: not matrix_appservice_irc_enabled | bool | |||
| - when: not matrix_bridge_appservice_irc_enabled | bool | |||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" | |||
| @@ -38,13 +38,13 @@ | |||
| - name: Check existence of matrix-appservice-irc service | |||
| ansible.builtin.stat: | |||
| path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-irc.service" | |||
| register: matrix_appservice_irc_service_stat | |||
| register: matrix_bridge_appservice_irc_service_stat | |||
| - name: Ensure matrix-appservice-irc is stopped | |||
| ansible.builtin.service: | |||
| name: matrix-appservice-irc | |||
| state: stopped | |||
| when: "matrix_appservice_irc_service_stat.stat.exists" | |||
| when: "matrix_bridge_appservice_irc_service_stat.stat.exists" | |||
| - name: Import appservice-irc NeDB database into Postgres | |||
| ansible.builtin.command: | |||
| @@ -53,25 +53,25 @@ | |||
| --rm | |||
| --user={{ matrix_user_uid }}:{{ matrix_user_gid }} | |||
| --cap-drop=ALL | |||
| {% if matrix_appservice_irc_database_container_network %} | |||
| --network={{ matrix_appservice_irc_database_container_network }} | |||
| {% if matrix_bridge_appservice_irc_database_container_network %} | |||
| --network={{ matrix_bridge_appservice_irc_database_container_network }} | |||
| {% endif %} | |||
| --mount type=bind,src={{ matrix_appservice_irc_data_path }},dst=/data | |||
| --mount type=bind,src={{ matrix_bridge_appservice_irc_data_path }},dst=/data | |||
| --entrypoint=/bin/sh | |||
| {{ matrix_appservice_irc_container_image }} | |||
| {{ matrix_bridge_appservice_irc_container_image }} | |||
| -c | |||
| '/usr/local/bin/node /app/lib/scripts/migrate-db-to-pgres.js --dbdir /data --privateKey /data/passkey.pem --connectionString {{ matrix_appservice_irc_database_connection_string }}' | |||
| register: matrix_appservice_irc_import_nedb_to_postgres_result | |||
| changed_when: matrix_appservice_irc_import_nedb_to_postgres_result.rc == 0 | |||
| '/usr/local/bin/node /app/lib/scripts/migrate-db-to-pgres.js --dbdir /data --privateKey /data/passkey.pem --connectionString {{ matrix_bridge_appservice_irc_database_connection_string }}' | |||
| register: matrix_bridge_appservice_irc_import_nedb_to_postgres_result | |||
| changed_when: matrix_bridge_appservice_irc_import_nedb_to_postgres_result.rc == 0 | |||
| - name: Archive NeDB database files | |||
| ansible.builtin.command: | |||
| cmd: "mv {{ matrix_appservice_irc_data_path }}/{{ item }} {{ matrix_appservice_irc_data_path }}/{{ item }}.backup" | |||
| cmd: "mv {{ matrix_bridge_appservice_irc_data_path }}/{{ item }} {{ matrix_bridge_appservice_irc_data_path }}/{{ item }}.backup" | |||
| with_items: | |||
| - rooms.db | |||
| - users.db | |||
| register: matrix_appservice_irc_import_nedb_to_postgres_move_result | |||
| changed_when: matrix_appservice_irc_import_nedb_to_postgres_move_result.rc == 0 | |||
| register: matrix_bridge_appservice_irc_import_nedb_to_postgres_move_result | |||
| changed_when: matrix_bridge_appservice_irc_import_nedb_to_postgres_move_result.rc == 0 | |||
| - name: Inject result | |||
| ansible.builtin.set_fact: | |||
| @@ -80,6 +80,6 @@ | |||
| devture_playbook_runtime_messages_list | default([]) | |||
| + | |||
| [ | |||
| "Note: Your appservice-irc database files have been imported into Postgres. The original database files have been moved from `" + matrix_appservice_irc_data_path + "/*.db` to `" + matrix_appservice_irc_data_path + "/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files." | |||
| "Note: Your appservice-irc database files have been imported into Postgres. The original database files have been moved from `" + matrix_bridge_appservice_irc_data_path + "/*.db` to `" + matrix_bridge_appservice_irc_data_path + "/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files." | |||
| ] | |||
| }} | |||
| @@ -26,18 +26,18 @@ | |||
| owner: "{{ matrix_user_name }}" | |||
| group: "{{ matrix_group_name }}" | |||
| with_items: | |||
| - {path: "{{ matrix_appservice_irc_base_path }}", when: true} | |||
| - {path: "{{ matrix_appservice_irc_config_path }}", when: true} | |||
| - {path: "{{ matrix_appservice_irc_data_path }}", when: true} | |||
| - {path: "{{ matrix_appservice_irc_container_src_files_path }}", when: "{{ matrix_appservice_irc_container_image_self_build }}"} | |||
| - {path: "{{ matrix_bridge_appservice_irc_base_path }}", when: true} | |||
| - {path: "{{ matrix_bridge_appservice_irc_config_path }}", when: true} | |||
| - {path: "{{ matrix_bridge_appservice_irc_data_path }}", when: true} | |||
| - {path: "{{ matrix_bridge_appservice_irc_container_src_files_path }}", when: "{{ matrix_bridge_appservice_irc_container_image_self_build }}"} | |||
| when: item.when | bool | |||
| - name: Check if an old passkey file already exists | |||
| ansible.builtin.stat: | |||
| path: "{{ matrix_appservice_irc_base_path }}/passkey.pem" | |||
| register: matrix_appservice_irc_stat_passkey | |||
| path: "{{ matrix_bridge_appservice_irc_base_path }}/passkey.pem" | |||
| register: matrix_bridge_appservice_irc_stat_passkey | |||
| - when: "matrix_appservice_irc_stat_passkey.stat.exists" | |||
| - when: "matrix_bridge_appservice_irc_stat_passkey.stat.exists" | |||
| block: | |||
| - name: (Data relocation) Ensure matrix-appservice-irc.service is stopped | |||
| ansible.builtin.service: | |||
| @@ -48,104 +48,104 @@ | |||
| - name: (Data relocation) Move AppService IRC passkey.pem file to ./data directory | |||
| ansible.builtin.command: | |||
| cmd: "mv {{ matrix_appservice_irc_base_path }}/passkey.pem {{ matrix_appservice_irc_data_path }}/passkey.pem" | |||
| register: matrix_appservice_irc_move_passkey_result | |||
| changed_when: matrix_appservice_irc_move_passkey_result.rc == 0 | |||
| cmd: "mv {{ matrix_bridge_appservice_irc_base_path }}/passkey.pem {{ matrix_bridge_appservice_irc_data_path }}/passkey.pem" | |||
| register: matrix_bridge_appservice_irc_move_passkey_result | |||
| changed_when: matrix_bridge_appservice_irc_move_passkey_result.rc == 0 | |||
| - name: (Data relocation) Move AppService IRC database files to ./data directory | |||
| ansible.builtin.command: | |||
| cmd: "mv {{ matrix_appservice_irc_base_path }}/{{ item }} {{ matrix_appservice_irc_data_path }}/{{ item }}" | |||
| register: matrix_appservice_irc_move_dbs_result | |||
| changed_when: matrix_appservice_irc_move_dbs_result.rc == 0 | |||
| cmd: "mv {{ matrix_bridge_appservice_irc_base_path }}/{{ item }} {{ matrix_bridge_appservice_irc_data_path }}/{{ item }}" | |||
| register: matrix_bridge_appservice_irc_move_dbs_result | |||
| changed_when: matrix_bridge_appservice_irc_move_dbs_result.rc == 0 | |||
| with_items: | |||
| - rooms.db | |||
| - users.db | |||
| failed_when: false | |||
| - ansible.builtin.set_fact: | |||
| matrix_appservice_irc_migration_requires_restart: false | |||
| matrix_bridge_appservice_irc_migration_requires_restart: false | |||
| - when: "matrix_appservice_irc_database_engine == 'postgres'" | |||
| - when: "matrix_bridge_appservice_irc_database_engine == 'postgres'" | |||
| block: | |||
| - name: Check if a nedb database already exists | |||
| ansible.builtin.stat: | |||
| path: "{{ matrix_appservice_irc_data_path }}/users.db" | |||
| register: matrix_appservice_irc_nedb_database_path_local_stat_result | |||
| path: "{{ matrix_bridge_appservice_irc_data_path }}/users.db" | |||
| register: matrix_bridge_appservice_irc_nedb_database_path_local_stat_result | |||
| - when: "matrix_appservice_irc_nedb_database_path_local_stat_result.stat.exists | bool" | |||
| - when: "matrix_bridge_appservice_irc_nedb_database_path_local_stat_result.stat.exists | bool" | |||
| block: | |||
| - ansible.builtin.include_tasks: "{{ role_path }}/tasks/migrate_nedb_to_postgres.yml" | |||
| - ansible.builtin.set_fact: | |||
| matrix_appservice_irc_migration_requires_restart: true | |||
| matrix_bridge_appservice_irc_migration_requires_restart: true | |||
| - name: Ensure Appservice IRC image is pulled | |||
| community.docker.docker_image_pull: | |||
| name: "{{ matrix_appservice_irc_container_image }}" | |||
| name: "{{ matrix_bridge_appservice_irc_container_image }}" | |||
| pull: always | |||
| when: "matrix_appservice_irc_enabled | bool and not matrix_appservice_irc_container_image_self_build | bool" | |||
| register: matrix_appservice_irc_container_image_pull_result | |||
| when: "matrix_bridge_appservice_irc_enabled | bool and not matrix_bridge_appservice_irc_container_image_self_build | bool" | |||
| register: matrix_bridge_appservice_irc_container_image_pull_result | |||
| retries: "{{ devture_playbook_help_container_retries_count }}" | |||
| delay: "{{ devture_playbook_help_container_retries_delay }}" | |||
| until: matrix_appservice_irc_container_image_pull_result is not failed | |||
| until: matrix_bridge_appservice_irc_container_image_pull_result is not failed | |||
| - name: Ensure matrix-appservice-irc repository is present when self-building | |||
| ansible.builtin.git: | |||
| repo: "{{ matrix_appservice_irc_container_repo }}" | |||
| version: "{{ matrix_appservice_irc_container_repo_version }}" | |||
| dest: "{{ matrix_appservice_irc_container_src_files_path }}" | |||
| repo: "{{ matrix_bridge_appservice_irc_container_repo }}" | |||
| version: "{{ matrix_bridge_appservice_irc_container_repo_version }}" | |||
| dest: "{{ matrix_bridge_appservice_irc_container_src_files_path }}" | |||
| force: "yes" | |||
| become: true | |||
| become_user: "{{ matrix_user_name }}" | |||
| register: matrix_appservice_irc_git_pull_results | |||
| when: "matrix_appservice_irc_enabled | bool and matrix_appservice_irc_container_image_self_build | bool" | |||
| register: matrix_bridge_appservice_irc_git_pull_results | |||
| when: "matrix_bridge_appservice_irc_enabled | bool and matrix_bridge_appservice_irc_container_image_self_build | bool" | |||
| - name: Ensure matrix-appservice-irc Docker image is built | |||
| community.docker.docker_image_build: | |||
| name: "{{ matrix_appservice_irc_container_image }}" | |||
| name: "{{ matrix_bridge_appservice_irc_container_image }}" | |||
| dockerfile: Dockerfile | |||
| path: "{{ matrix_appservice_irc_container_src_files_path }}" | |||
| path: "{{ matrix_bridge_appservice_irc_container_src_files_path }}" | |||
| pull: true | |||
| rebuild: "{{ 'always' if matrix_appservice_irc_git_pull_results.changed | bool else 'never' }}" | |||
| when: "matrix_appservice_irc_enabled | bool and matrix_appservice_irc_container_image_self_build | bool and matrix_appservice_irc_git_pull_results.changed" | |||
| register: matrix_appservice_irc_container_image_build_result | |||
| rebuild: "{{ 'always' if matrix_bridge_appservice_irc_git_pull_results.changed | bool else 'never' }}" | |||
| when: "matrix_bridge_appservice_irc_enabled | bool and matrix_bridge_appservice_irc_container_image_self_build | bool and matrix_bridge_appservice_irc_git_pull_results.changed" | |||
| register: matrix_bridge_appservice_irc_container_image_build_result | |||
| - name: Ensure Matrix Appservice IRC config installed | |||
| ansible.builtin.copy: | |||
| content: "{{ matrix_appservice_irc_configuration | to_nice_yaml(indent=2, width=999999) }}" | |||
| dest: "{{ matrix_appservice_irc_config_path }}/config.yaml" | |||
| content: "{{ matrix_bridge_appservice_irc_configuration | to_nice_yaml(indent=2, width=999999) }}" | |||
| dest: "{{ matrix_bridge_appservice_irc_config_path }}/config.yaml" | |||
| mode: '0644' | |||
| owner: "{{ matrix_user_name }}" | |||
| group: "{{ matrix_group_name }}" | |||
| register: matrix_appservice_irc_config_result | |||
| register: matrix_bridge_appservice_irc_config_result | |||
| - name: Ensure Matrix Appservice IRC labels file installed | |||
| ansible.builtin.template: | |||
| src: "{{ role_path }}/templates/labels.j2" | |||
| dest: "{{ matrix_appservice_irc_base_path }}/labels" | |||
| dest: "{{ matrix_bridge_appservice_irc_base_path }}/labels" | |||
| mode: '0644' | |||
| owner: "{{ matrix_user_name }}" | |||
| group: "{{ matrix_group_name }}" | |||
| register: matrix_appservice_irc_labels_result | |||
| register: matrix_bridge_appservice_irc_labels_result | |||
| - name: Generate Appservice IRC passkey if it doesn't exist | |||
| ansible.builtin.shell: | |||
| cmd: "{{ matrix_host_command_openssl }} genpkey -out {{ matrix_appservice_irc_data_path }}/passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:2048" | |||
| creates: "{{ matrix_appservice_irc_data_path }}/passkey.pem" | |||
| cmd: "{{ matrix_host_command_openssl }} genpkey -out {{ matrix_bridge_appservice_irc_data_path }}/passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:2048" | |||
| creates: "{{ matrix_bridge_appservice_irc_data_path }}/passkey.pem" | |||
| become: true | |||
| become_user: "{{ matrix_user_name }}" | |||
| - name: Check if an authenticated media signing key exists | |||
| ansible.builtin.stat: | |||
| path: "{{ matrix_appservice_irc_data_path }}/auth-media.jwk" | |||
| register: matrix_appservice_irc_stat_auth_media_key | |||
| path: "{{ matrix_bridge_appservice_irc_data_path }}/auth-media.jwk" | |||
| register: matrix_bridge_appservice_irc_stat_auth_media_key | |||
| - when: not matrix_appservice_irc_stat_auth_media_key.stat.exists | |||
| - when: not matrix_bridge_appservice_irc_stat_auth_media_key.stat.exists | |||
| block: | |||
| - name: Generate IRC appservice signing key for authenticated media | |||
| community.docker.docker_container: | |||
| name: "create-auth-media-jwk-key" | |||
| image: "{{ matrix_appservice_irc_container_image }}" | |||
| image: "{{ matrix_bridge_appservice_irc_container_image }}" | |||
| cleanup: true | |||
| network_mode: none | |||
| entrypoint: "/usr/local/bin/node" | |||
| @@ -160,12 +160,12 @@ | |||
| } | |||
| main().then(() => process.exit(0)).catch(err => { throw err });" | |||
| detach: false | |||
| register: matrix_appservice_irc_jwk_result | |||
| register: matrix_bridge_appservice_irc_jwk_result | |||
| - name: Write auth media signing key to file | |||
| ansible.builtin.copy: | |||
| content: "{{ matrix_appservice_irc_jwk_result.container.Output }}" | |||
| dest: "{{ matrix_appservice_irc_data_path }}/auth-media.jwk" | |||
| content: "{{ matrix_bridge_appservice_irc_jwk_result.container.Output }}" | |||
| dest: "{{ matrix_bridge_appservice_irc_data_path }}/auth-media.jwk" | |||
| mode: "0644" | |||
| owner: "{{ matrix_user_name }}" | |||
| group: "{{ matrix_group_name }}" | |||
| @@ -174,7 +174,7 @@ | |||
| # Fix it. | |||
| - name: (Migration) Ensure Appservice IRC passkey permissions are okay | |||
| ansible.builtin.file: | |||
| path: "{{ matrix_appservice_irc_data_path }}/passkey.pem" | |||
| path: "{{ matrix_bridge_appservice_irc_data_path }}/passkey.pem" | |||
| mode: '0644' | |||
| owner: "{{ matrix_user_name }}" | |||
| group: "{{ matrix_group_name }}" | |||
| @@ -203,10 +203,10 @@ | |||
| {{ devture_systemd_docker_base_host_command_docker }} run --rm --name matrix-appservice-irc-gen | |||
| --user={{ matrix_user_uid }}:{{ matrix_user_gid }} | |||
| --cap-drop=ALL | |||
| --mount type=bind,src={{ matrix_appservice_irc_config_path }},dst=/config | |||
| --mount type=bind,src={{ matrix_appservice_irc_data_path }},dst=/data | |||
| --mount type=bind,src={{ matrix_bridge_appservice_irc_config_path }},dst=/config | |||
| --mount type=bind,src={{ matrix_bridge_appservice_irc_data_path }},dst=/data | |||
| --entrypoint=/bin/bash | |||
| {{ matrix_appservice_irc_container_image }} | |||
| {{ matrix_bridge_appservice_irc_container_image }} | |||
| -c | |||
| 'node app.js | |||
| -r | |||
| @@ -218,37 +218,37 @@ | |||
| - name: Read Appservice IRC registration-template.yaml | |||
| ansible.builtin.slurp: | |||
| src: "{{ matrix_appservice_irc_config_path }}/registration-template.yaml" | |||
| register: matrix_appservice_irc_registration_template_slurp | |||
| src: "{{ matrix_bridge_appservice_irc_config_path }}/registration-template.yaml" | |||
| register: matrix_bridge_appservice_irc_registration_template_slurp | |||
| - name: Remove unnecessary Appservice IRC registration-template.yaml | |||
| ansible.builtin.file: | |||
| path: "{{ matrix_appservice_irc_config_path }}/registration-template.yaml" | |||
| path: "{{ matrix_bridge_appservice_irc_config_path }}/registration-template.yaml" | |||
| state: absent | |||
| changed_when: false | |||
| - name: Parse registration-template.yaml | |||
| ansible.builtin.set_fact: | |||
| matrix_appservice_irc_registration_template: "{{ matrix_appservice_irc_registration_template_slurp['content'] | b64decode | from_yaml }}" | |||
| matrix_bridge_appservice_irc_registration_template: "{{ matrix_bridge_appservice_irc_registration_template_slurp['content'] | b64decode | from_yaml }}" | |||
| - name: Combine registration-template.yaml and own registration override config | |||
| ansible.builtin.set_fact: | |||
| matrix_appservice_irc_registration: "{{ matrix_appservice_irc_registration_template | combine(matrix_appservice_irc_registration_override, recursive=True) }}" | |||
| matrix_bridge_appservice_irc_registration: "{{ matrix_bridge_appservice_irc_registration_template | combine(matrix_bridge_appservice_irc_registration_override, recursive=True) }}" | |||
| - name: Ensure Appservice IRC registration.yaml installed | |||
| ansible.builtin.copy: | |||
| content: "{{ matrix_appservice_irc_registration | to_nice_yaml(indent=2, width=999999) }}" | |||
| dest: "{{ matrix_appservice_irc_config_path }}/registration.yaml" | |||
| content: "{{ matrix_bridge_appservice_irc_registration | to_nice_yaml(indent=2, width=999999) }}" | |||
| dest: "{{ matrix_bridge_appservice_irc_config_path }}/registration.yaml" | |||
| mode: '0644' | |||
| owner: "{{ matrix_user_name }}" | |||
| group: "{{ matrix_group_name }}" | |||
| register: matrix_appservice_irc_registration_result | |||
| register: matrix_bridge_appservice_irc_registration_result | |||
| - name: Ensure matrix-appservice-irc container network is created | |||
| when: matrix_appservice_irc_container_network != 'host' | |||
| when: matrix_bridge_appservice_irc_container_network != 'host' | |||
| community.general.docker_network: | |||
| enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" | |||
| name: "{{ matrix_appservice_irc_container_network }}" | |||
| name: "{{ matrix_bridge_appservice_irc_container_network }}" | |||
| driver: bridge | |||
| driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" | |||
| @@ -257,19 +257,19 @@ | |||
| src: "{{ role_path }}/templates/systemd/matrix-appservice-irc.service.j2" | |||
| dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-irc.service" | |||
| mode: '0644' | |||
| register: matrix_appservice_irc_systemd_service_result | |||
| register: matrix_bridge_appservice_irc_systemd_service_result | |||
| - name: Determine whether matrix-appservice-irc needs a restart | |||
| ansible.builtin.set_fact: | |||
| matrix_appservice_irc_restart_necessary: >- | |||
| matrix_bridge_appservice_irc_restart_necessary: >- | |||
| {{ | |||
| matrix_appservice_irc_migration_requires_restart | default(false) | |||
| or matrix_appservice_irc_config_result.changed | default(false) | |||
| or matrix_appservice_irc_labels_result.changed | default(false) | |||
| or matrix_appservice_irc_registration_result.changed | default(false) | |||
| or matrix_appservice_irc_systemd_service_result.changed | default(false) | |||
| or matrix_appservice_irc_container_image_pull_result.changed | default(false) | |||
| or matrix_appservice_irc_container_image_build_result.changed | default(false) | |||
| matrix_bridge_appservice_irc_migration_requires_restart | default(false) | |||
| or matrix_bridge_appservice_irc_config_result.changed | default(false) | |||
| or matrix_bridge_appservice_irc_labels_result.changed | default(false) | |||
| or matrix_bridge_appservice_irc_registration_result.changed | default(false) | |||
| or matrix_bridge_appservice_irc_systemd_service_result.changed | default(false) | |||
| or matrix_bridge_appservice_irc_container_image_pull_result.changed | default(false) | |||
| or matrix_bridge_appservice_irc_container_image_build_result.changed | default(false) | |||
| }} | |||
| - name: Ensure matrix-appservice-irc.service restarted, if necessary | |||
| @@ -277,4 +277,4 @@ | |||
| name: "matrix-appservice-irc.service" | |||
| state: restarted | |||
| daemon_reload: true | |||
| when: "matrix_appservice_irc_migration_requires_restart | bool" | |||
| when: "matrix_bridge_appservice_irc_migration_requires_restart | bool" | |||
| @@ -9,9 +9,9 @@ | |||
| - name: Check existence of matrix-appservice-irc service | |||
| ansible.builtin.stat: | |||
| path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-irc.service" | |||
| register: matrix_appservice_irc_service_stat | |||
| register: matrix_bridge_appservice_irc_service_stat | |||
| - when: matrix_appservice_irc_service_stat.stat.exists | bool | |||
| - when: matrix_bridge_appservice_irc_service_stat.stat.exists | bool | |||
| block: | |||
| - name: Ensure matrix-appservice-irc is stopped | |||
| ansible.builtin.service: | |||
| @@ -13,20 +13,20 @@ | |||
| Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). | |||
| when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" | |||
| with_items: | |||
| - {'old': 'matrix_appservice_irc_container_expose_client_server_api_port', 'new': '<superseded by matrix_appservice_irc_container_http_host_bind_port>'} | |||
| - {'old': 'matrix_appservice_irc_container_self_build', 'new': 'matrix_appservice_irc_container_image_self_build'} | |||
| - {'old': 'matrix_appservice_irc_docker_image_name_prefix', 'new': 'matrix_appservice_irc_container_image_registry_prefix'} | |||
| - {'old': 'matrix_appservice_irc_homeserver_media_url', 'new': '<removed; media proxying now uses matrix_appservice_irc_ircService_mediaProxy_publicUrl>'} | |||
| - {'old': 'matrix_appservice_irc_docker_image', 'new': 'matrix_appservice_irc_container_image'} | |||
| - {'old': 'matrix_appservice_irc_docker_image_force_pull', 'new': 'matrix_appservice_irc_container_image_force_pull'} | |||
| - {'old': 'matrix_appservice_irc_docker_image_registry_prefix', 'new': 'matrix_appservice_irc_container_image_registry_prefix'} | |||
| - {'old': 'matrix_appservice_irc_docker_image_registry_prefix_upstream', 'new': 'matrix_appservice_irc_container_image_registry_prefix_upstream'} | |||
| - {'old': 'matrix_appservice_irc_docker_image_registry_prefix_upstream_default', 'new': 'matrix_appservice_irc_container_image_registry_prefix_upstream_default'} | |||
| - {'old': 'matrix_appservice_irc_docker_image_tag', 'new': 'matrix_appservice_irc_container_image_tag'} | |||
| - {'old': 'matrix_appservice_irc_docker_repo', 'new': 'matrix_appservice_irc_container_repo'} | |||
| - {'old': 'matrix_appservice_irc_docker_repo_version', 'new': 'matrix_appservice_irc_container_repo_version'} | |||
| - {'old': 'matrix_appservice_irc_docker_src_files_path', 'new': 'matrix_appservice_irc_container_src_files_path'} | |||
| - {'old': 'matrix_appservice_irc_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'} | |||
| - {'old': 'matrix_bridge_appservice_irc_container_expose_client_server_api_port', 'new': '<superseded by matrix_bridge_appservice_irc_container_http_host_bind_port>'} | |||
| - {'old': 'matrix_bridge_appservice_irc_container_self_build', 'new': 'matrix_bridge_appservice_irc_container_image_self_build'} | |||
| - {'old': 'matrix_bridge_appservice_irc_docker_image_name_prefix', 'new': 'matrix_bridge_appservice_irc_container_image_registry_prefix'} | |||
| - {'old': 'matrix_bridge_appservice_irc_homeserver_media_url', 'new': '<removed; media proxying now uses matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl>'} | |||
| - {'old': 'matrix_bridge_appservice_irc_docker_image', 'new': 'matrix_bridge_appservice_irc_container_image'} | |||
| - {'old': 'matrix_bridge_appservice_irc_docker_image_force_pull', 'new': 'matrix_bridge_appservice_irc_container_image_force_pull'} | |||
| - {'old': 'matrix_bridge_appservice_irc_docker_image_registry_prefix', 'new': 'matrix_bridge_appservice_irc_container_image_registry_prefix'} | |||
| - {'old': 'matrix_bridge_appservice_irc_docker_image_registry_prefix_upstream', 'new': 'matrix_bridge_appservice_irc_container_image_registry_prefix_upstream'} | |||
| - {'old': 'matrix_bridge_appservice_irc_docker_image_registry_prefix_upstream_default', 'new': 'matrix_bridge_appservice_irc_container_image_registry_prefix_upstream_default'} | |||
| - {'old': 'matrix_bridge_appservice_irc_docker_image_tag', 'new': 'matrix_bridge_appservice_irc_container_image_tag'} | |||
| - {'old': 'matrix_bridge_appservice_irc_docker_repo', 'new': 'matrix_bridge_appservice_irc_container_repo'} | |||
| - {'old': 'matrix_bridge_appservice_irc_docker_repo_version', 'new': 'matrix_bridge_appservice_irc_container_repo_version'} | |||
| - {'old': 'matrix_bridge_appservice_irc_docker_src_files_path', 'new': 'matrix_bridge_appservice_irc_container_src_files_path'} | |||
| - {'old': 'matrix_bridge_appservice_irc_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'} | |||
| - name: Fail if required appservice-irc settings not defined | |||
| ansible.builtin.fail: | |||
| @@ -34,16 +34,16 @@ | |||
| You need to define a required configuration setting (`{{ item.name }}`). | |||
| when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" | |||
| with_items: | |||
| - {'name': 'matrix_appservice_irc_appservice_token', when: true} | |||
| - {'name': 'matrix_appservice_irc_homeserver_url', when: true} | |||
| - {'name': 'matrix_appservice_irc_homeserver_token', when: true} | |||
| - {'name': 'matrix_appservice_irc_database_hostname', when: "{{ matrix_appservice_irc_database_engine == 'postgres' }}"} | |||
| - {'name': 'matrix_appservice_irc_container_network', when: true} | |||
| - {'name': 'matrix_bridge_appservice_irc_appservice_token', when: true} | |||
| - {'name': 'matrix_bridge_appservice_irc_homeserver_url', when: true} | |||
| - {'name': 'matrix_bridge_appservice_irc_homeserver_token', when: true} | |||
| - {'name': 'matrix_bridge_appservice_irc_database_hostname', when: "{{ matrix_bridge_appservice_irc_database_engine == 'postgres' }}"} | |||
| - {'name': 'matrix_bridge_appservice_irc_container_network', when: true} | |||
| # Our base configuration (`matrix_appservice_irc_configuration_yaml`) is not enough to | |||
| # Our base configuration (`matrix_bridge_appservice_irc_configuration_yaml`) is not enough to | |||
| # let the playbook run without errors. | |||
| # | |||
| # Unless the final configuration (`matrix_appservice_irc_configuration`) contains an `ircService` definition, | |||
| # Unless the final configuration (`matrix_bridge_appservice_irc_configuration`) contains an `ircService` definition, | |||
| # we'd fail generating the registration.yaml file with a non-helpful error. | |||
| # | |||
| # This is a safety check to ensure we fail earlier and in a nicer way. | |||
| @@ -52,30 +52,30 @@ | |||
| ansible.builtin.fail: | |||
| msg: >- | |||
| Your Appservice IRC configuration is incomplete (lacking an `ircService.servers` configuration). | |||
| You need to define one or more servers by either using `matrix_appservice_irc_ircService_servers` | |||
| or by extending the base configuration with additional configuration in `matrix_appservice_irc_configuration_extension_yaml`. | |||
| Overriding the whole bridge's configuration (`matrix_appservice_irc_configuration`) is yet another possibility. | |||
| when: "matrix_appservice_irc_configuration.ircService.servers | length == 0" | |||
| You need to define one or more servers by either using `matrix_bridge_appservice_irc_ircService_servers` | |||
| or by extending the base configuration with additional configuration in `matrix_bridge_appservice_irc_configuration_extension_yaml`. | |||
| Overriding the whole bridge's configuration (`matrix_bridge_appservice_irc_configuration`) is yet another possibility. | |||
| when: "matrix_bridge_appservice_irc_configuration.ircService.servers | length == 0" | |||
| - name: Fail if matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix does not start with a slash | |||
| - name: Fail if matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix does not start with a slash | |||
| ansible.builtin.fail: | |||
| msg: >- | |||
| matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix (`{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix }}`) must start with a slash (e.g. `/` or `/irc/`). | |||
| when: "matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix[0] != '/'" | |||
| matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix (`{{ matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix }}`) must start with a slash (e.g. `/` or `/irc/`). | |||
| when: "matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix[0] != '/'" | |||
| - name: Fail if matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix does not end with a slash | |||
| - name: Fail if matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix does not end with a slash | |||
| ansible.builtin.fail: | |||
| msg: >- | |||
| matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix (`{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix }}`) must end with a slash (e.g. `/` or `/irc/`). | |||
| when: "matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix[-1] != '/'" | |||
| matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix (`{{ matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix }}`) must end with a slash (e.g. `/` or `/irc/`). | |||
| when: "matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix[-1] != '/'" | |||
| - when: matrix_appservice_irc_container_labels_traefik_enabled | bool | |||
| - when: matrix_bridge_appservice_irc_container_labels_traefik_enabled | bool | |||
| block: | |||
| # We ensure it doesn't end with a slash, because we handle both (slash and no-slash). | |||
| # Knowing that the path_prefix does not end with a slash ensures we know how to set these routes up | |||
| # without having to do "does it end with a slash" checks elsewhere. | |||
| - name: Fail if matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix ends with a slash | |||
| - name: Fail if matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix ends with a slash | |||
| ansible.builtin.fail: | |||
| msg: >- | |||
| matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix (`{{ matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/irc`). | |||
| when: "matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix != '/' and matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix[-1] == '/'" | |||
| matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix (`{{ matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/irc`). | |||
| when: "matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix != '/' and matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix[-1] == '/'" | |||
| @@ -7,7 +7,7 @@ | |||
| # Unless otherwise specified, these keys CANNOT be hot-reloaded. | |||
| homeserver: | |||
| # The URL to the home server for client-server API calls | |||
| url: "{{ matrix_appservice_irc_homeserver_url }}" | |||
| url: "{{ matrix_bridge_appservice_irc_homeserver_url }}" | |||
| # Drop Matrix messages which are older than this number of seconds, according to | |||
| # the event's origin_server_ts. | |||
| @@ -24,12 +24,12 @@ homeserver: | |||
| # The 'domain' part for user IDs on this home server. Usually (but not always) | |||
| # is the "domain name" part of the HS URL. | |||
| domain: "{{ matrix_appservice_irc_homeserver_domain }}" | |||
| domain: "{{ matrix_bridge_appservice_irc_homeserver_domain }}" | |||
| # Should presence be enabled for Matrix clients on this bridge. If disabled on the | |||
| # homeserver then it should also be disabled here to avoid excess traffic. | |||
| # Default: true | |||
| enablePresence: {{ matrix_appservice_irc_homeserver_enablePresence|to_json }} | |||
| enablePresence: {{ matrix_bridge_appservice_irc_homeserver_enablePresence|to_json }} | |||
| # Which port should the appservice bind to. Can be overridden by the one provided in the | |||
| # command line! Optional. | |||
| @@ -62,7 +62,7 @@ ircService: | |||
| # All server keys can be hot-reloaded, however existing IRC connections | |||
| # will not have changes applied to them. | |||
| servers: {{ matrix_appservice_irc_ircService_servers|to_json }} | |||
| servers: {{ matrix_bridge_appservice_irc_ircService_servers|to_json }} | |||
| # present relevant UI to the user. MSC2346 | |||
| bridgeInfoState: | |||
| @@ -141,9 +141,9 @@ ircService: | |||
| # How long should the generated URLs be valid for | |||
| ttlSeconds: 604800 | |||
| # The port for the media proxy to listen on | |||
| bindPort: {{ matrix_appservice_irc_ircService_mediaProxy_bindPort | to_json }} | |||
| bindPort: {{ matrix_bridge_appservice_irc_ircService_mediaProxy_bindPort | to_json }} | |||
| # The publicly accessible URL to the media proxy | |||
| publicUrl: {{ matrix_appservice_irc_ircService_mediaProxy_publicUrl | to_json }} | |||
| publicUrl: {{ matrix_bridge_appservice_irc_ircService_mediaProxy_publicUrl | to_json }} | |||
| # Options here are generally only applicable to large-scale bridges and may have | |||
| # consequences greater than other options in this configuration file. | |||
| @@ -162,8 +162,8 @@ advanced: | |||
| # This key CANNOT be hot-reloaded. | |||
| database: | |||
| # database engine (must be 'postgres' or 'nedb'). Default: nedb | |||
| engine: {{ matrix_appservice_irc_database_engine|to_json }} | |||
| engine: {{ matrix_bridge_appservice_irc_database_engine|to_json }} | |||
| # Either a PostgreSQL connection string, or a path to the NeDB storage directory. | |||
| # For postgres, it must start with postgres:// | |||
| # For NeDB, it must start with nedb://. The path is relative to the project directory. | |||
| connectionString: {{ matrix_appservice_irc_database_connectionString | to_json }} | |||
| connectionString: {{ matrix_bridge_appservice_irc_database_connectionString | to_json }} | |||
| @@ -6,14 +6,14 @@ SPDX-FileCopyrightText: 2026 Slavi Pantaleev | |||
| SPDX-License-Identifier: AGPL-3.0-or-later | |||
| #} | |||
| {% if matrix_appservice_irc_container_labels_traefik_enabled and matrix_appservice_irc_container_labels_media_proxy_enabled %} | |||
| {% if matrix_bridge_appservice_irc_container_labels_traefik_enabled and matrix_bridge_appservice_irc_container_labels_media_proxy_enabled %} | |||
| traefik.enable=true | |||
| {% if matrix_appservice_irc_container_labels_traefik_docker_network %} | |||
| traefik.docker.network={{ matrix_appservice_irc_container_labels_traefik_docker_network }} | |||
| {% if matrix_bridge_appservice_irc_container_labels_traefik_docker_network %} | |||
| traefik.docker.network={{ matrix_bridge_appservice_irc_container_labels_traefik_docker_network }} | |||
| {% endif %} | |||
| traefik.http.services.matrix-appservice-irc-media-proxy.loadbalancer.server.port={{ matrix_appservice_irc_ircService_mediaProxy_bindPort }} | |||
| traefik.http.services.matrix-appservice-irc-media-proxy.loadbalancer.server.port={{ matrix_bridge_appservice_irc_ircService_mediaProxy_bindPort }} | |||
| ############################################################ | |||
| # # | |||
| @@ -23,34 +23,34 @@ traefik.http.services.matrix-appservice-irc-media-proxy.loadbalancer.server.port | |||
| {% set middlewares = [] %} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.rule={{ matrix_appservice_irc_container_labels_media_proxy_traefik_rule }} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.rule={{ matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_rule }} | |||
| {% if matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix != '/' %} | |||
| traefik.http.middlewares.matrix-appservice-irc-media-proxy-slashless-redirect.redirectregex.regex=({{ matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix | quote }})$ | |||
| {% if matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix != '/' %} | |||
| traefik.http.middlewares.matrix-appservice-irc-media-proxy-slashless-redirect.redirectregex.regex=({{ matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix | quote }})$ | |||
| traefik.http.middlewares.matrix-appservice-irc-media-proxy-slashless-redirect.redirectregex.replacement=${1}/ | |||
| {% set middlewares = middlewares + ['matrix-appservice-irc-media-proxy-slashless-redirect'] %} | |||
| {% endif %} | |||
| {% if matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix != '/' %} | |||
| traefik.http.middlewares.matrix-appservice-irc-media-proxy-strip-prefix.stripprefix.prefixes={{ matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix }} | |||
| {% if matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix != '/' %} | |||
| traefik.http.middlewares.matrix-appservice-irc-media-proxy-strip-prefix.stripprefix.prefixes={{ matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_path_prefix }} | |||
| {% set middlewares = middlewares + ['matrix-appservice-irc-media-proxy-strip-prefix'] %} | |||
| {% endif %} | |||
| {% if matrix_appservice_irc_container_labels_media_proxy_traefik_priority | int > 0 %} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.priority={{ matrix_appservice_irc_container_labels_media_proxy_traefik_priority }} | |||
| {% if matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_priority | int > 0 %} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.priority={{ matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_priority }} | |||
| {% endif %} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.service=matrix-appservice-irc-media-proxy | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.entrypoints={{ matrix_appservice_irc_container_labels_media_proxy_traefik_entrypoints }} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.entrypoints={{ matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_entrypoints }} | |||
| {% if middlewares | length > 0 %} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.middlewares={{ middlewares | join(',') }} | |||
| {% endif %} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.tls={{ matrix_appservice_irc_container_labels_media_proxy_traefik_tls | to_json }} | |||
| {% if matrix_appservice_irc_container_labels_media_proxy_traefik_tls %} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.tls.certResolver={{ matrix_appservice_irc_container_labels_media_proxy_traefik_tls_certResolver }} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.tls={{ matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_tls | to_json }} | |||
| {% if matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_tls %} | |||
| traefik.http.routers.matrix-appservice-irc-media-proxy.tls.certResolver={{ matrix_bridge_appservice_irc_container_labels_media_proxy_traefik_tls_certResolver }} | |||
| {% endif %} | |||
| ############################################################ | |||
| @@ -60,4 +60,4 @@ traefik.http.routers.matrix-appservice-irc-media-proxy.tls.certResolver={{ matri | |||
| ############################################################ | |||
| {% endif %} | |||
| {{ matrix_appservice_irc_container_labels_additional_labels }} | |||
| {{ matrix_bridge_appservice_irc_container_labels_additional_labels }} | |||
| @@ -1,11 +1,11 @@ | |||
| #jinja2: lstrip_blocks: True | |||
| [Unit] | |||
| Description=Matrix Appservice IRC bridge | |||
| {% for service in matrix_appservice_irc_systemd_required_services_list %} | |||
| {% for service in matrix_bridge_appservice_irc_systemd_required_services_list %} | |||
| Requires={{ service }} | |||
| After={{ service }} | |||
| {% endfor %} | |||
| {% for service in matrix_appservice_irc_systemd_wanted_services_list %} | |||
| {% for service in matrix_bridge_appservice_irc_systemd_wanted_services_list %} | |||
| Wants={{ service }} | |||
| {% endfor %} | |||
| DefaultDependencies=no | |||
| @@ -22,25 +22,25 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ | |||
| --log-driver=none \ | |||
| --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ | |||
| --cap-drop=ALL \ | |||
| --network={{ matrix_appservice_irc_container_network }} \ | |||
| {% if matrix_appservice_irc_container_http_host_bind_port %} | |||
| -p {{ matrix_appservice_irc_container_http_host_bind_port }}:9999 \ | |||
| --network={{ matrix_bridge_appservice_irc_container_network }} \ | |||
| {% if matrix_bridge_appservice_irc_container_http_host_bind_port %} | |||
| -p {{ matrix_bridge_appservice_irc_container_http_host_bind_port }}:9999 \ | |||
| {% endif %} | |||
| {% if matrix_appservice_irc_container_media_proxy_host_bind_port %} | |||
| -p {{ matrix_appservice_irc_container_media_proxy_host_bind_port }}:{{ matrix_appservice_irc_ircService_mediaProxy_bindPort }} \ | |||
| {% if matrix_bridge_appservice_irc_container_media_proxy_host_bind_port %} | |||
| -p {{ matrix_bridge_appservice_irc_container_media_proxy_host_bind_port }}:{{ matrix_bridge_appservice_irc_ircService_mediaProxy_bindPort }} \ | |||
| {% endif %} | |||
| --mount type=bind,src={{ matrix_appservice_irc_config_path }},dst=/config \ | |||
| --mount type=bind,src={{ matrix_appservice_irc_data_path }},dst=/data \ | |||
| --label-file={{ matrix_appservice_irc_base_path }}/labels \ | |||
| {% for arg in matrix_appservice_irc_container_extra_arguments %} | |||
| --mount type=bind,src={{ matrix_bridge_appservice_irc_config_path }},dst=/config \ | |||
| --mount type=bind,src={{ matrix_bridge_appservice_irc_data_path }},dst=/data \ | |||
| --label-file={{ matrix_bridge_appservice_irc_base_path }}/labels \ | |||
| {% for arg in matrix_bridge_appservice_irc_container_extra_arguments %} | |||
| {{ arg }} \ | |||
| {% endfor %} | |||
| --entrypoint=/bin/bash \ | |||
| {{ matrix_appservice_irc_container_image }} \ | |||
| {{ matrix_bridge_appservice_irc_container_image }} \ | |||
| -c 'node app.js -c /config/config.yaml -f /config/registration.yaml -p 9999' | |||
| {% if matrix_appservice_irc_container_network != 'host' %} | |||
| {% for network in matrix_appservice_irc_container_additional_networks %} | |||
| {% if matrix_bridge_appservice_irc_container_network != 'host' %} | |||
| {% for network in matrix_bridge_appservice_irc_container_additional_networks %} | |||
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-irc | |||
| {% endfor %} | |||
| {% endif %} | |||