From a54c643e130f1a9ccc92158f26a3d7e1f6d05ccc Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 7 Feb 2026 16:39:14 +0900 Subject: [PATCH] Replace `matrix-client-cinny` and `matrix_client_cinny` with `cinny` Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-client-cinny.md | 14 +- docs/self-building.md | 2 +- group_vars/matrix_servers | 36 ++--- roles/custom/matrix-base/defaults/main.yml | 2 +- .../matrix-client-cinny/defaults/main.yml | 152 +++++++++--------- .../custom/matrix-client-cinny/tasks/main.yml | 8 +- .../matrix-client-cinny/tasks/self_check.yml | 14 +- .../tasks/setup_install.yml | 44 ++--- .../tasks/setup_uninstall.yml | 18 +-- .../tasks/validate_config.yml | 32 ++-- .../templates/config.json.j2 | 14 +- .../matrix-client-cinny/templates/labels.j2 | 54 +++---- .../templates/nginx.conf.j2 | 2 +- .../systemd/matrix-client-cinny.service.j2 | 36 ++--- .../tasks/validate_config.yml | 19 ++- 15 files changed, 230 insertions(+), 217 deletions(-) diff --git a/docs/configuring-playbook-client-cinny.md b/docs/configuring-playbook-client-cinny.md index ac89f89a5..eea81f1a8 100644 --- a/docs/configuring-playbook-client-cinny.md +++ b/docs/configuring-playbook-client-cinny.md @@ -27,26 +27,26 @@ When setting, replace `example.com` with your own. To enable Cinny, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: ```yaml -matrix_client_cinny_enabled: true +cinny_enabled: true ``` ### Adjusting the Cinny URL (optional) -By tweaking the `matrix_client_cinny_hostname` variable, you can easily make the service available at a **different hostname** than the default one. +By tweaking the `cinny_hostname` variable, you can easily make the service available at a **different hostname** than the default one. Example additional configuration for your `vars.yml` file: ```yaml # Switch to a different domain (`app.example.com`) than the default one (`cinny.example.com`) -matrix_client_cinny_hostname: "app.{{ matrix_domain }}" +cinny_hostname: "app.{{ matrix_domain }}" # Expose under the /cinny subpath -# matrix_client_cinny_path_prefix: /cinny +# cinny_path_prefix: /cinny ``` After changing the domain, **you may need to adjust your DNS** records to point the Cinny domain to the Matrix server. -**Note**: while there is a `matrix_client_cinny_path_prefix` variable for changing the path where Cinny is served, overriding it is [not possible](https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3701), because Cinny requires an application rebuild (with a tweaked build config) to be functional under a custom path. You'd need to serve Cinny at a dedicated subdomain. +**Note**: while there is a `cinny_path_prefix` variable for changing the path where Cinny is served, overriding it is [not possible](https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3701), because Cinny requires an application rebuild (with a tweaked build config) to be functional under a custom path. You'd need to serve Cinny at a dedicated subdomain. ### Extending the configuration @@ -55,7 +55,7 @@ There are some additional things you may wish to configure about the component. Take a look at: - `roles/galaxy/cinny/defaults/main.yml` for some variables that you can customize via your `vars.yml` file -- `roles/galaxy/cinny/templates/config.json.j2` for the component's default configuration. You can override settings (even those that don't have dedicated playbook variables) using the `matrix_client_cinny_configuration_extension_json` variable +- `roles/galaxy/cinny/templates/config.json.j2` for the component's default configuration. You can override settings (even those that don't have dedicated playbook variables) using the `cinny_configuration_extension_json` variable ## Installing @@ -72,4 +72,4 @@ The shortcut commands with the [`just` program](just.md) are also available: `ju ## Troubleshooting -As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu matrix-client-cinny`. +As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu cinny`. diff --git a/docs/self-building.md b/docs/self-building.md index 74252dbb2..794a95d1b 100644 --- a/docs/self-building.md +++ b/docs/self-building.md @@ -29,7 +29,7 @@ Possibly outdated list of roles where self-building the Docker image is currentl - `matrix-synapse-admin` - `matrix-client-element` - `matrix-client-hydrogen` -- `matrix-client-cinny` +- `cinny` - `matrix-registration` - `matrix-coturn` - `matrix-corporal` diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index f578ce64c..0b024387a 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -344,7 +344,7 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': 'matrix-cactus-comments-client.service', 'priority': 2000, 'groups': ['matrix', 'cactus-comments-client']}] if matrix_cactus_comments_client_enabled else []) + - ([{'name': 'matrix-client-cinny.service', 'priority': 2000, 'groups': ['matrix', 'clients', 'cinny', 'client-cinny']}] if matrix_client_cinny_enabled else []) + ([{'name': 'cinny.service', 'priority': 2000, 'groups': ['matrix', 'clients', 'cinny', 'client-cinny']}] if cinny_enabled else []) + ([{'name': 'matrix-client-element.service', 'priority': 2000, 'groups': ['matrix', 'clients', 'element', 'client-element']}] if matrix_client_element_enabled else []) + @@ -4282,39 +4282,39 @@ matrix_client_hydrogen_self_check_validate_certificates: "{{ matrix_playbook_ssl ###################################################################### # -# matrix-client-cinny +# cinny # ###################################################################### -matrix_client_cinny_enabled: false +cinny_enabled: false -matrix_client_cinny_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_client_cinny_docker_image_registry_prefix_upstream_default }}" +cinny_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else cinny_docker_image_registry_prefix_upstream_default }}" -matrix_client_cinny_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}" +cinny_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}" -matrix_client_cinny_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '8080') if matrix_playbook_service_host_bind_interface_prefix else '' }}" +cinny_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '8080') if matrix_playbook_service_host_bind_interface_prefix else '' }}" -matrix_client_cinny_container_network: "{{ matrix_addons_container_network }}" +cinny_container_network: "{{ matrix_addons_container_network }}" -matrix_client_cinny_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_client_cinny_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] }}" +cinny_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if (cinny_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] }}" -matrix_client_cinny_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" -matrix_client_cinny_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" -matrix_client_cinny_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}" -matrix_client_cinny_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}" +cinny_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" +cinny_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" +cinny_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}" +cinny_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}" -matrix_client_cinny_container_labels_traefik_compression_middleware_enabled: "{{ matrix_playbook_reverse_proxy_traefik_middleware_compression_enabled }}" -matrix_client_cinny_container_labels_traefik_compression_middleware_name: "{{ matrix_playbook_reverse_proxy_traefik_middleware_compression_name if matrix_playbook_reverse_proxy_traefik_middleware_compression_enabled else '' }}" +cinny_container_labels_traefik_compression_middleware_enabled: "{{ matrix_playbook_reverse_proxy_traefik_middleware_compression_enabled }}" +cinny_container_labels_traefik_compression_middleware_name: "{{ matrix_playbook_reverse_proxy_traefik_middleware_compression_name if matrix_playbook_reverse_proxy_traefik_middleware_compression_enabled else '' }}" -matrix_client_cinny_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}" +cinny_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}" -matrix_client_cinny_default_hs_url: "{{ matrix_homeserver_url }}" +cinny_default_hs_url: "{{ matrix_homeserver_url }}" -matrix_client_cinny_self_check_validate_certificates: "{{ matrix_playbook_ssl_enabled }}" +cinny_self_check_validate_certificates: "{{ matrix_playbook_ssl_enabled }}" ###################################################################### # -# /matrix-client-cinny +# /cinny # ###################################################################### diff --git a/roles/custom/matrix-base/defaults/main.yml b/roles/custom/matrix-base/defaults/main.yml index 8b4eba5a7..81015235a 100644 --- a/roles/custom/matrix-base/defaults/main.yml +++ b/roles/custom/matrix-base/defaults/main.yml @@ -109,7 +109,7 @@ matrix_server_fqn_element: "element.{{ matrix_domain }}" # This is where you access the Hydrogen web client from (if enabled via matrix_client_hydrogen_enabled; disabled by default). matrix_server_fqn_hydrogen: "hydrogen.{{ matrix_domain }}" -# This is where you access the Cinny web client from (if enabled via matrix_client_cinny_enabled; disabled by default). +# This is where you access the Cinny web client from (if enabled via cinny_enabled; disabled by default). matrix_server_fqn_cinny: "cinny.{{ matrix_domain }}" # This is where you access the SchildiChat Web from (if enabled via matrix_client_schildichat_enabled; disabled by default). diff --git a/roles/custom/matrix-client-cinny/defaults/main.yml b/roles/custom/matrix-client-cinny/defaults/main.yml index 2b5283ce0..be5d14887 100644 --- a/roles/custom/matrix-client-cinny/defaults/main.yml +++ b/roles/custom/matrix-client-cinny/defaults/main.yml @@ -11,85 +11,85 @@ --- # Project source code URL: https://github.com/ajbura/cinny -matrix_client_cinny_enabled: true +cinny_enabled: true -matrix_client_cinny_container_image_self_build: false -matrix_client_cinny_container_image_self_build_repo: "https://github.com/ajbura/cinny.git" +cinny_container_image_self_build: false +cinny_container_image_self_build_repo: "https://github.com/ajbura/cinny.git" # renovate: datasource=docker depName=ajbura/cinny -matrix_client_cinny_version: v4.10.2 -matrix_client_cinny_docker_image: "{{ matrix_client_cinny_docker_image_registry_prefix }}ajbura/cinny:{{ matrix_client_cinny_version }}" -matrix_client_cinny_docker_image_registry_prefix: "{{ 'localhost/' if matrix_client_cinny_container_image_self_build else matrix_client_cinny_docker_image_registry_prefix_upstream }}" -matrix_client_cinny_docker_image_registry_prefix_upstream: "{{ matrix_client_cinny_docker_image_registry_prefix_upstream_default }}" -matrix_client_cinny_docker_image_registry_prefix_upstream_default: docker.io/ -matrix_client_cinny_docker_image_force_pull: "{{ matrix_client_cinny_docker_image.endswith(':latest') }}" +cinny_version: v4.10.2 +cinny_docker_image: "{{ cinny_docker_image_registry_prefix }}ajbura/cinny:{{ cinny_version }}" +cinny_docker_image_registry_prefix: "{{ 'localhost/' if cinny_container_image_self_build else cinny_docker_image_registry_prefix_upstream }}" +cinny_docker_image_registry_prefix_upstream: "{{ cinny_docker_image_registry_prefix_upstream_default }}" +cinny_docker_image_registry_prefix_upstream_default: docker.io/ +cinny_docker_image_force_pull: "{{ cinny_docker_image.endswith(':latest') }}" -matrix_client_cinny_data_path: "{{ matrix_base_data_path }}/client-cinny" -matrix_client_cinny_docker_src_files_path: "{{ matrix_client_cinny_data_path }}/docker-src" +cinny_data_path: "{{ matrix_base_data_path }}/client-cinny" +cinny_docker_src_files_path: "{{ cinny_data_path }}/docker-src" # The base container network -matrix_client_cinny_container_network: '' +cinny_container_network: '' # A list of additional container networks that the container would be connected to. # The role does not create these networks, so make sure they already exist. # Use this to expose this container to a reverse proxy, which runs in a different container network. -matrix_client_cinny_container_additional_networks: [] +cinny_container_additional_networks: [] # Controls whether the container exposes its HTTP port (tcp/8080 in the container). # # Takes an ":" or "" value (e.g. "127.0.0.1:8768"), or empty string to not expose. -matrix_client_cinny_container_http_host_bind_port: '' +cinny_container_http_host_bind_port: '' -# matrix_client_cinny_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container. +# cinny_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container. # See `../templates/labels.j2` for details. # -# To inject your own other container labels, see `matrix_client_cinny_container_labels_additional_labels`. -matrix_client_cinny_container_labels_traefik_enabled: true -matrix_client_cinny_container_labels_traefik_docker_network: "{{ matrix_client_cinny_container_network }}" -matrix_client_cinny_container_labels_traefik_hostname: "{{ matrix_client_cinny_hostname }}" +# To inject your own other container labels, see `cinny_container_labels_additional_labels`. +cinny_container_labels_traefik_enabled: true +cinny_container_labels_traefik_docker_network: "{{ cinny_container_network }}" +cinny_container_labels_traefik_hostname: "{{ cinny_hostname }}" # The path prefix must either be `/` or not end with a slash (e.g. `/cinny`). -matrix_client_cinny_container_labels_traefik_path_prefix: "{{ matrix_client_cinny_path_prefix }}" -matrix_client_cinny_container_labels_traefik_rule: "Host(`{{ matrix_client_cinny_container_labels_traefik_hostname }}`){% if matrix_client_cinny_container_labels_traefik_path_prefix != '/' %} && PathPrefix(`{{ matrix_client_cinny_container_labels_traefik_path_prefix }}`){% endif %}" -matrix_client_cinny_container_labels_traefik_priority: 0 -matrix_client_cinny_container_labels_traefik_entrypoints: web-secure -matrix_client_cinny_container_labels_traefik_tls: "{{ matrix_client_cinny_container_labels_traefik_entrypoints != 'web' }}" -matrix_client_cinny_container_labels_traefik_tls_certResolver: default # noqa var-naming +cinny_container_labels_traefik_path_prefix: "{{ cinny_path_prefix }}" +cinny_container_labels_traefik_rule: "Host(`{{ cinny_container_labels_traefik_hostname }}`){% if cinny_container_labels_traefik_path_prefix != '/' %} && PathPrefix(`{{ cinny_container_labels_traefik_path_prefix }}`){% endif %}" +cinny_container_labels_traefik_priority: 0 +cinny_container_labels_traefik_entrypoints: web-secure +cinny_container_labels_traefik_tls: "{{ cinny_container_labels_traefik_entrypoints != 'web' }}" +cinny_container_labels_traefik_tls_certResolver: default # noqa var-naming # Controls whether a compression middleware will be injected into the middlewares list. # This compression middleware is supposed to be defined elsewhere (using labels or a File provider, etc.) and is merely referenced by this router. -matrix_client_cinny_container_labels_traefik_compression_middleware_enabled: false -matrix_client_cinny_container_labels_traefik_compression_middleware_name: "" +cinny_container_labels_traefik_compression_middleware_enabled: false +cinny_container_labels_traefik_compression_middleware_name: "" # Controls which additional headers to attach to all HTTP responses. -# To add your own headers, use `matrix_client_cinny_container_labels_traefik_additional_response_headers_custom` -matrix_client_cinny_container_labels_traefik_additional_response_headers: "{{ matrix_client_cinny_container_labels_traefik_additional_response_headers_auto | combine(matrix_client_cinny_container_labels_traefik_additional_response_headers_custom) }}" -matrix_client_cinny_container_labels_traefik_additional_response_headers_auto: | +# To add your own headers, use `cinny_container_labels_traefik_additional_response_headers_custom` +cinny_container_labels_traefik_additional_response_headers: "{{ cinny_container_labels_traefik_additional_response_headers_auto | combine(cinny_container_labels_traefik_additional_response_headers_custom) }}" +cinny_container_labels_traefik_additional_response_headers_auto: | {{ {} - | combine ({'X-XSS-Protection': matrix_client_cinny_http_header_xss_protection} if matrix_client_cinny_http_header_xss_protection else {}) - | combine ({'X-Frame-Options': matrix_client_cinny_http_header_frame_options} if matrix_client_cinny_http_header_frame_options else {}) - | combine ({'X-Content-Type-Options': matrix_client_cinny_http_header_content_type_options} if matrix_client_cinny_http_header_content_type_options else {}) - | combine ({'Content-Security-Policy': matrix_client_cinny_http_header_content_security_policy} if matrix_client_cinny_http_header_content_security_policy else {}) - | combine ({'Permission-Policy': matrix_client_cinny_http_header_content_permission_policy} if matrix_client_cinny_http_header_content_permission_policy else {}) - | combine ({'Strict-Transport-Security': matrix_client_cinny_http_header_strict_transport_security} if matrix_client_cinny_http_header_strict_transport_security and matrix_client_cinny_container_labels_traefik_tls else {}) + | combine ({'X-XSS-Protection': cinny_http_header_xss_protection} if cinny_http_header_xss_protection else {}) + | combine ({'X-Frame-Options': cinny_http_header_frame_options} if cinny_http_header_frame_options else {}) + | combine ({'X-Content-Type-Options': cinny_http_header_content_type_options} if cinny_http_header_content_type_options else {}) + | combine ({'Content-Security-Policy': cinny_http_header_content_security_policy} if cinny_http_header_content_security_policy else {}) + | combine ({'Permission-Policy': cinny_http_header_content_permission_policy} if cinny_http_header_content_permission_policy else {}) + | combine ({'Strict-Transport-Security': cinny_http_header_strict_transport_security} if cinny_http_header_strict_transport_security and cinny_container_labels_traefik_tls else {}) }} -matrix_client_cinny_container_labels_traefik_additional_response_headers_custom: {} +cinny_container_labels_traefik_additional_response_headers_custom: {} -# matrix_client_cinny_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file. +# cinny_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file. # See `../templates/labels.j2` for details. # # Example: -# matrix_client_cinny_container_labels_additional_labels: | +# cinny_container_labels_additional_labels: | # my.label=1 # another.label="here" -matrix_client_cinny_container_labels_additional_labels: '' +cinny_container_labels_additional_labels: '' # A list of extra arguments to pass to the container -matrix_client_cinny_container_extra_arguments: [] +cinny_container_extra_arguments: [] -# List of systemd services that matrix-client-cinny.service depends on -matrix_client_cinny_systemd_required_services_list: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" +# List of systemd services that cinny.service depends on +cinny_systemd_required_services_list: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" # Specifies the value of the `X-XSS-Protection` header # Stops pages from loading when they detect reflected cross-site scripting (XSS) attacks. @@ -97,27 +97,27 @@ matrix_client_cinny_systemd_required_services_list: "{{ [devture_systemd_docker_ # Learn more about it is here: # - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection # - https://portswigger.net/web-security/cross-site-scripting/reflected -matrix_client_cinny_http_header_xss_protection: "1; mode=block" +cinny_http_header_xss_protection: "1; mode=block" # Specifies the value of the `X-Frame-Options` header which controls whether framing can happen. # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options -matrix_client_cinny_http_header_frame_options: SAMEORIGIN +cinny_http_header_frame_options: SAMEORIGIN # Specifies the value of the `X-Content-Type-Options` header. # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options -matrix_client_cinny_http_header_content_type_options: nosniff +cinny_http_header_content_type_options: nosniff # Specifies the value of the `Content-Security-Policy` header. # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy -matrix_client_cinny_http_header_content_security_policy: frame-ancestors 'self' +cinny_http_header_content_security_policy: frame-ancestors 'self' # Specifies the value of the `Permission-Policy` header. # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permission-Policy -matrix_client_cinny_http_header_content_permission_policy: "{{ 'interest-cohort=()' if matrix_client_cinny_floc_optout_enabled else '' }}" +cinny_http_header_content_permission_policy: "{{ 'interest-cohort=()' if cinny_floc_optout_enabled else '' }}" # Specifies the value of the `Strict-Transport-Security` header. # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security -matrix_client_cinny_http_header_strict_transport_security: "max-age=31536000; includeSubDomains{{ '; preload' if matrix_client_cinny_hsts_preload_enabled else '' }}" +cinny_http_header_strict_transport_security: "max-age=31536000; includeSubDomains{{ '; preload' if cinny_hsts_preload_enabled else '' }}" # Controls whether to send a "Permissions-Policy interest-cohort=();" header along with all responses # @@ -127,8 +127,8 @@ matrix_client_cinny_http_header_strict_transport_security: "max-age=31536000; in # - https://amifloced.org/ # # Of course, a better solution is to just stop using browsers (like Chrome), which participate in such tracking practices. -# See: `matrix_client_cinny_content_permission_policy` -matrix_client_cinny_floc_optout_enabled: true +# See: `cinny_content_permission_policy` +cinny_floc_optout_enabled: true # Controls if HSTS preloading is enabled # @@ -139,71 +139,71 @@ matrix_client_cinny_floc_optout_enabled: true # - https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security # - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security # - https://hstspreload.org/#opt-in -# See: `matrix_client_cinny_http_header_strict_transport_security` -matrix_client_cinny_hsts_preload_enabled: false +# See: `cinny_http_header_strict_transport_security` +cinny_hsts_preload_enabled: false -matrix_client_cinny_scheme: https +cinny_scheme: https # The hostname at which Cinny is served. # Only works with with Traefik reverse-proxying. -matrix_client_cinny_hostname: "{{ matrix_server_fqn_cinny }}" +cinny_hostname: "{{ matrix_server_fqn_cinny }}" # The path at which Cinny is exposed. # This value must either be `/` or not end with a slash (e.g. `/cinny`). -matrix_client_cinny_path_prefix: / +cinny_path_prefix: / # Controls whether the self-check feature should validate SSL certificates. -matrix_client_cinny_self_check_validate_certificates: true +cinny_self_check_validate_certificates: true # Default homeserver URL to use in the `config.json` file. -# See `matrix_client_cinny_config_homeserverList`. -matrix_client_cinny_default_hs_url: "" +# See `cinny_config_homeserverList`. +cinny_default_hs_url: "" # Controls whether the Cinny access log is enabled -matrix_client_cinny_access_log_enabled: true +cinny_access_log_enabled: true # Controls the `defaultHomeserver` value in the `config.json` file. -matrix_client_cinny_config_defaultHomeserver: 0 # noqa var-naming +cinny_config_defaultHomeserver: 0 # noqa var-naming # Controls the `homeserverList` value in the `config.json` file. -matrix_client_cinny_config_homeserverList: "{{ [matrix_client_cinny_default_hs_url] }}" # noqa var-naming +cinny_config_homeserverList: "{{ [cinny_default_hs_url] }}" # noqa var-naming # Controls the `allowCustomHomeservers` value in the `config.json` file. -matrix_client_cinny_config_allowCustomHomeservers: true # noqa var-naming +cinny_config_allowCustomHomeservers: true # noqa var-naming # Controls the `featuredCommunities.spaces` value in the `config.json` file. -matrix_client_cinny_config_featuredCommunities_spaces: [] # noqa var-naming +cinny_config_featuredCommunities_spaces: [] # noqa var-naming # Controls the `featuredCommunities.rooms` value in the `config.json` file. -matrix_client_cinny_config_featuredCommunities_rooms: [] # noqa var-naming +cinny_config_featuredCommunities_rooms: [] # noqa var-naming # Controls the `featuredCommunities.servers` value in the `config.json` file. -matrix_client_cinny_config_featuredCommunities_servers: ["matrix.org"] # noqa var-naming +cinny_config_featuredCommunities_servers: ["matrix.org"] # noqa var-naming # Controls the `featuredCommunities.openAsDefault` value in the `config.json` file. -matrix_client_cinny_config_featuredCommunities_openAsDefault: false # noqa var-naming +cinny_config_featuredCommunities_openAsDefault: false # noqa var-naming # Default Cinny configuration template which covers the generic use case. # You can customize it by controlling the various variables inside it. # -# For a more advanced customization, you can extend the default (see `matrix_client_cinny_configuration_extension_json`) +# For a more advanced customization, you can extend the default (see `cinny_configuration_extension_json`) # or completely replace this variable with your own template. # # The side-effect of this lookup is that Ansible would even parse the JSON for us, returning a dict. # This is unlike what it does when looking up YAML template files (no automatic parsing there). -matrix_client_cinny_configuration_default: "{{ lookup('template', 'templates/config.json.j2', convert_data=False) | from_json }}" +cinny_configuration_default: "{{ lookup('template', 'templates/config.json.j2', convert_data=False) | from_json }}" -# Your custom JSON configuration for Cinny should go to `matrix_client_cinny_configuration_extension_json`. -# This configuration extends the default starting configuration (`matrix_client_cinny_configuration_default`). +# Your custom JSON configuration for Cinny should go to `cinny_configuration_extension_json`. +# This configuration extends the default starting configuration (`cinny_configuration_default`). # # 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_client_cinny_configuration_default`. -matrix_client_cinny_configuration_extension_json: '{}' +# completely redefining `cinny_configuration_default`. +cinny_configuration_extension_json: '{}' -matrix_client_cinny_configuration_extension: "{{ matrix_client_cinny_configuration_extension_json | from_json if matrix_client_cinny_configuration_extension_json | from_json is mapping else {} }}" +cinny_configuration_extension: "{{ cinny_configuration_extension_json | from_json if cinny_configuration_extension_json | from_json is mapping else {} }}" # Holds the final Cinny configuration (a combination of the default and its extension). -# You most likely don't need to touch this variable. Instead, see `matrix_client_cinny_configuration_default`. -matrix_client_cinny_configuration: "{{ matrix_client_cinny_configuration_default | combine(matrix_client_cinny_configuration_extension, recursive=True) }}" +# You most likely don't need to touch this variable. Instead, see `cinny_configuration_default`. +cinny_configuration: "{{ cinny_configuration_default | combine(cinny_configuration_extension, recursive=True) }}" diff --git a/roles/custom/matrix-client-cinny/tasks/main.yml b/roles/custom/matrix-client-cinny/tasks/main.yml index 935b4ee03..75dd88185 100644 --- a/roles/custom/matrix-client-cinny/tasks/main.yml +++ b/roles/custom/matrix-client-cinny/tasks/main.yml @@ -12,21 +12,21 @@ - install-all - install-client-cinny block: - - when: matrix_client_cinny_enabled | bool + - when: cinny_enabled | bool ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" - - when: matrix_client_cinny_enabled | bool + - when: cinny_enabled | bool ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml" - tags: - setup-all - setup-client-cinny block: - - when: not matrix_client_cinny_enabled | bool + - when: not cinny_enabled | bool ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - tags: - self-check block: - - when: matrix_client_cinny_enabled | bool + - when: cinny_enabled | bool ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check.yml" diff --git a/roles/custom/matrix-client-cinny/tasks/self_check.yml b/roles/custom/matrix-client-cinny/tasks/self_check.yml index 054fdf87e..5f57db7b2 100644 --- a/roles/custom/matrix-client-cinny/tasks/self_check.yml +++ b/roles/custom/matrix-client-cinny/tasks/self_check.yml @@ -7,14 +7,14 @@ --- - ansible.builtin.set_fact: - matrix_client_cinny_url_endpoint_public: "{{ matrix_client_cinny_scheme }}://{{ matrix_client_cinny_hostname }}{{ matrix_client_cinny_path_prefix }}/config.json" + cinny_url_endpoint_public: "{{ cinny_scheme }}://{{ cinny_hostname }}{{ cinny_path_prefix }}/config.json" - name: Check Cinny ansible.builtin.uri: - url: "{{ matrix_client_cinny_url_endpoint_public }}" + url: "{{ cinny_url_endpoint_public }}" follow_redirects: none - validate_certs: "{{ matrix_client_cinny_self_check_validate_certificates }}" - register: matrix_client_cinny_self_check_result + validate_certs: "{{ cinny_self_check_validate_certificates }}" + register: cinny_self_check_result check_mode: false ignore_errors: true delegate_to: 127.0.0.1 @@ -22,9 +22,9 @@ - name: Fail if Cinny not working ansible.builtin.fail: - msg: "Failed checking Cinny is up at `{{ matrix_client_cinny_hostname }}` (checked endpoint: `{{ matrix_client_cinny_url_endpoint_public }}`). Is Cinny running? Is port 443 open in your firewall? Full error: {{ matrix_client_cinny_self_check_result }}" - when: "matrix_client_cinny_self_check_result.failed or 'json' not in matrix_client_cinny_self_check_result" + msg: "Failed checking Cinny is up at `{{ cinny_hostname }}` (checked endpoint: `{{ cinny_url_endpoint_public }}`). Is Cinny running? Is port 443 open in your firewall? Full error: {{ cinny_self_check_result }}" + when: "cinny_self_check_result.failed or 'json' not in cinny_self_check_result" - name: Report working Cinny ansible.builtin.debug: - msg: "Cinny at `{{ matrix_client_cinny_hostname }}` is working (checked endpoint: `{{ matrix_client_cinny_url_endpoint_public }}`)" + msg: "Cinny at `{{ cinny_hostname }}` is working (checked endpoint: `{{ cinny_url_endpoint_public }}`)" diff --git a/roles/custom/matrix-client-cinny/tasks/setup_install.yml b/roles/custom/matrix-client-cinny/tasks/setup_install.yml index 80bff534c..5972a1bf1 100644 --- a/roles/custom/matrix-client-cinny/tasks/setup_install.yml +++ b/roles/custom/matrix-client-cinny/tasks/setup_install.yml @@ -16,17 +16,17 @@ owner: "{{ matrix_user_name }}" group: "{{ matrix_group_name }}" with_items: - - {path: "{{ matrix_client_cinny_data_path }}", when: true} - - {path: "{{ matrix_client_cinny_docker_src_files_path }}", when: "{{ matrix_client_cinny_container_image_self_build }}"} + - {path: "{{ cinny_data_path }}", when: true} + - {path: "{{ cinny_docker_src_files_path }}", when: "{{ cinny_container_image_self_build }}"} when: "item.when | bool" - name: Ensure Cinny Docker image is pulled community.docker.docker_image: - name: "{{ matrix_client_cinny_docker_image }}" + name: "{{ cinny_docker_image }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" - force_source: "{{ matrix_client_cinny_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_client_cinny_docker_image_force_pull }}" - when: "not matrix_client_cinny_container_image_self_build | bool" + force_source: "{{ cinny_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 cinny_docker_image_force_pull }}" + when: "not cinny_container_image_self_build | bool" register: result retries: "{{ devture_playbook_help_container_retries_count }}" delay: "{{ devture_playbook_help_container_retries_delay }}" @@ -34,19 +34,19 @@ - name: Ensure Cinny repository is present on self-build ansible.builtin.git: - repo: "{{ matrix_client_cinny_container_image_self_build_repo }}" - dest: "{{ matrix_client_cinny_docker_src_files_path }}" - version: "{{ matrix_client_cinny_docker_image.split(':')[1] }}" + repo: "{{ cinny_container_image_self_build_repo }}" + dest: "{{ cinny_docker_src_files_path }}" + version: "{{ cinny_docker_image.split(':')[1] }}" force: "yes" become: true become_user: "{{ matrix_user_name }}" - register: matrix_client_cinny_git_pull_results - when: "matrix_client_cinny_container_image_self_build | bool" + register: cinny_git_pull_results + when: "cinny_container_image_self_build | bool" - name: Ensure Cinny configuration installed ansible.builtin.copy: - content: "{{ matrix_client_cinny_configuration | to_nice_json }}" - dest: "{{ matrix_client_cinny_data_path }}/config.json" + content: "{{ cinny_configuration | to_nice_json }}" + dest: "{{ cinny_data_path }}/config.json" mode: 0644 owner: "{{ matrix_user_name }}" group: "{{ matrix_group_name }}" @@ -54,7 +54,7 @@ - name: Ensure Cinny additional config files installed ansible.builtin.template: src: "{{ item.src }}" - dest: "{{ matrix_client_cinny_data_path }}/{{ item.name }}" + dest: "{{ cinny_data_path }}/{{ item.name }}" mode: 0644 owner: "{{ matrix_user_name }}" group: "{{ matrix_group_name }}" @@ -64,24 +64,24 @@ - name: Ensure Cinny Docker image is built community.docker.docker_image: - name: "{{ matrix_client_cinny_docker_image }}" + name: "{{ cinny_docker_image }}" source: build - force_source: "{{ matrix_client_cinny_git_pull_results.changed }}" + force_source: "{{ cinny_git_pull_results.changed }}" build: dockerfile: Dockerfile - path: "{{ matrix_client_cinny_docker_src_files_path }}" + path: "{{ cinny_docker_src_files_path }}" pull: true - when: "matrix_client_cinny_container_image_self_build | bool" + when: "cinny_container_image_self_build | bool" - name: Ensure Cinny container network is created community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" - name: "{{ matrix_client_cinny_container_network }}" + name: "{{ cinny_container_network }}" driver: bridge driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" -- name: Ensure matrix-client-cinny.service installed +- name: Ensure cinny.service installed ansible.builtin.template: - src: "{{ role_path }}/templates/systemd/matrix-client-cinny.service.j2" - dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-cinny.service" + src: "{{ role_path }}/templates/systemd/cinny.service.j2" + dest: "{{ devture_systemd_docker_base_systemd_path }}/cinny.service" mode: 0644 diff --git a/roles/custom/matrix-client-cinny/tasks/setup_uninstall.yml b/roles/custom/matrix-client-cinny/tasks/setup_uninstall.yml index 7a8b5f1bc..8492dfbdd 100644 --- a/roles/custom/matrix-client-cinny/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-client-cinny/tasks/setup_uninstall.yml @@ -6,26 +6,26 @@ # SPDX-License-Identifier: AGPL-3.0-or-later --- -- name: Check existence of matrix-client-cinny.service +- name: Check existence of cinny.service ansible.builtin.stat: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-cinny.service" - register: matrix_client_cinny_service_stat + path: "{{ devture_systemd_docker_base_systemd_path }}/cinny.service" + register: cinny_service_stat -- when: matrix_client_cinny_service_stat.stat.exists | bool +- when: cinny_service_stat.stat.exists | bool block: - - name: Ensure matrix-client-cinny is stopped + - name: Ensure cinny is stopped ansible.builtin.service: - name: matrix-client-cinny + name: cinny state: stopped enabled: false daemon_reload: true - - name: Ensure matrix-client-cinny.service doesn't exist + - name: Ensure cinny.service doesn't exist ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-cinny.service" + path: "{{ devture_systemd_docker_base_systemd_path }}/cinny.service" state: absent - name: Ensure Cinny paths doesn't exist ansible.builtin.file: - path: "{{ matrix_client_cinny_data_path }}" + path: "{{ cinny_data_path }}" state: absent diff --git a/roles/custom/matrix-client-cinny/tasks/validate_config.yml b/roles/custom/matrix-client-cinny/tasks/validate_config.yml index 84719ed47..5d5739321 100644 --- a/roles/custom/matrix-client-cinny/tasks/validate_config.yml +++ b/roles/custom/matrix-client-cinny/tasks/validate_config.yml @@ -10,9 +10,9 @@ You need to define a required configuration setting (`{{ item }}`) to use Cinny. when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - - {'name': 'matrix_client_cinny_default_hs_url', when: true} - - {'name': 'matrix_client_cinny_container_network', when: true} - - {'name': 'matrix_client_cinny_container_labels_traefik_compression_middleware_name', when: "{{ matrix_client_cinny_container_labels_traefik_compression_middleware_enabled }}"} + - {'name': 'cinny_default_hs_url', when: true} + - {'name': 'cinny_container_network', when: true} + - {'name': 'cinny_container_labels_traefik_compression_middleware_name', when: "{{ cinny_container_labels_traefik_compression_middleware_enabled }}"} - name: (Deprecation) Catch and report renamed Cinny variables ansible.builtin.fail: @@ -20,32 +20,32 @@ The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - - {'old': 'matrix_client_cinny_container_image_name_prefix', 'new': 'matrix_client_cinny_container_image_registry_prefix'} + - {'old': 'cinny_container_image_name_prefix', 'new': 'cinny_container_image_registry_prefix'} -- name: Fail if matrix_client_cinny_path_prefix is not / +- name: Fail if cinny_path_prefix is not / ansible.builtin.fail: msg: >- - `matrix_client_cinny_path_prefix` is set to `{{ matrix_client_cinny_path_prefix }}` in your configuration, but Cinny no longer supports hosting under a path prefix without an application rebuild. - Consider removing your `matrix_client_cinny_path_prefix` override and adjusting the Cinny hostname via `matrix_server_fqn_cinny` or `matrix_client_cinny_hostname`. + `cinny_path_prefix` is set to `{{ cinny_path_prefix }}` in your configuration, but Cinny no longer supports hosting under a path prefix without an application rebuild. + Consider removing your `cinny_path_prefix` override and adjusting the Cinny hostname via `matrix_server_fqn_cinny` or `cinny_hostname`. See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3701 - when: "matrix_client_cinny_path_prefix != '/'" + when: "cinny_path_prefix != '/'" -- when: matrix_client_cinny_container_labels_traefik_enabled | bool +- when: cinny_container_labels_traefik_enabled | bool block: - - name: Fail if required matrix-client-cinny Traefik settings not defined + - name: Fail if required cinny Traefik settings not defined ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). when: "lookup('vars', item, default='') == ''" with_items: - - matrix_client_cinny_container_labels_traefik_hostname - - matrix_client_cinny_container_labels_traefik_path_prefix + - cinny_container_labels_traefik_hostname + - cinny_container_labels_traefik_path_prefix # We ensure it doesn't end with a slash, because we handle both (slash and no-slash). - # Knowing that `matrix_client_cinny_container_labels_traefik_path_prefix` does not end with a slash + # Knowing that `cinny_container_labels_traefik_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_client_cinny_container_labels_traefik_path_prefix ends with a slash + - name: Fail if cinny_container_labels_traefik_path_prefix ends with a slash ansible.builtin.fail: msg: >- - matrix_client_cinny_container_labels_traefik_path_prefix (`{{ matrix_client_cinny_container_labels_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/cinny`). - when: "matrix_client_cinny_container_labels_traefik_path_prefix != '/' and matrix_client_cinny_container_labels_traefik_path_prefix[-1] == '/'" + cinny_container_labels_traefik_path_prefix (`{{ cinny_container_labels_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/cinny`). + when: "cinny_container_labels_traefik_path_prefix != '/' and cinny_container_labels_traefik_path_prefix[-1] == '/'" diff --git a/roles/custom/matrix-client-cinny/templates/config.json.j2 b/roles/custom/matrix-client-cinny/templates/config.json.j2 index 6c2b14313..34f51a3aa 100644 --- a/roles/custom/matrix-client-cinny/templates/config.json.j2 +++ b/roles/custom/matrix-client-cinny/templates/config.json.j2 @@ -1,11 +1,11 @@ { - "defaultHomeserver": {{ matrix_client_cinny_config_defaultHomeserver | to_json }}, - "homeserverList": {{ matrix_client_cinny_config_homeserverList | to_json }}, - "allowCustomHomeservers": {{ matrix_client_cinny_config_allowCustomHomeservers | to_json }}, + "defaultHomeserver": {{ cinny_config_defaultHomeserver | to_json }}, + "homeserverList": {{ cinny_config_homeserverList | to_json }}, + "allowCustomHomeservers": {{ cinny_config_allowCustomHomeservers | to_json }}, "featuredCommunities": { - "spaces": {{ matrix_client_cinny_config_featuredCommunities_spaces | to_json }}, - "rooms": {{ matrix_client_cinny_config_featuredCommunities_rooms | to_json }}, - "servers": {{ matrix_client_cinny_config_featuredCommunities_servers | to_json }}, - "openAsDefault": {{ matrix_client_cinny_config_featuredCommunities_openAsDefault | to_json }} + "spaces": {{ cinny_config_featuredCommunities_spaces | to_json }}, + "rooms": {{ cinny_config_featuredCommunities_rooms | to_json }}, + "servers": {{ cinny_config_featuredCommunities_servers | to_json }}, + "openAsDefault": {{ cinny_config_featuredCommunities_openAsDefault | to_json }} } } diff --git a/roles/custom/matrix-client-cinny/templates/labels.j2 b/roles/custom/matrix-client-cinny/templates/labels.j2 index 17e4057d0..b3841ef89 100644 --- a/roles/custom/matrix-client-cinny/templates/labels.j2 +++ b/roles/custom/matrix-client-cinny/templates/labels.j2 @@ -4,53 +4,53 @@ SPDX-FileCopyrightText: 2023 - 2024 Slavi Pantaleev SPDX-License-Identifier: AGPL-3.0-or-later #} -{% if matrix_client_cinny_container_labels_traefik_enabled %} +{% if cinny_container_labels_traefik_enabled %} traefik.enable=true -{% if matrix_client_cinny_container_labels_traefik_docker_network %} -traefik.docker.network={{ matrix_client_cinny_container_labels_traefik_docker_network }} +{% if cinny_container_labels_traefik_docker_network %} +traefik.docker.network={{ cinny_container_labels_traefik_docker_network }} {% endif %} -traefik.http.services.matrix-client-cinny.loadbalancer.server.port=8080 +traefik.http.services.cinny.loadbalancer.server.port=8080 {% set middlewares = [] %} -{% if matrix_client_cinny_container_labels_traefik_compression_middleware_enabled %} -{% set middlewares = middlewares + [matrix_client_cinny_container_labels_traefik_compression_middleware_name] %} +{% if cinny_container_labels_traefik_compression_middleware_enabled %} +{% set middlewares = middlewares + [cinny_container_labels_traefik_compression_middleware_name] %} {% endif %} -{% if matrix_client_cinny_container_labels_traefik_path_prefix != '/' %} -traefik.http.middlewares.matrix-client-cinny-slashless-redirect.redirectregex.regex=({{ matrix_client_cinny_container_labels_traefik_path_prefix | quote }})$ -traefik.http.middlewares.matrix-client-cinny-slashless-redirect.redirectregex.replacement=${1}/ -{% set middlewares = middlewares + ['matrix-client-cinny-slashless-redirect'] %} +{% if cinny_container_labels_traefik_path_prefix != '/' %} +traefik.http.middlewares.cinny-slashless-redirect.redirectregex.regex=({{ cinny_container_labels_traefik_path_prefix | quote }})$ +traefik.http.middlewares.cinny-slashless-redirect.redirectregex.replacement=${1}/ +{% set middlewares = middlewares + ['cinny-slashless-redirect'] %} {% endif %} -{% if matrix_client_cinny_container_labels_traefik_path_prefix != '/' %} -traefik.http.middlewares.matrix-client-cinny-strip-prefix.stripprefix.prefixes={{ matrix_client_cinny_container_labels_traefik_path_prefix }} -{% set middlewares = middlewares + ['matrix-client-cinny-strip-prefix'] %} +{% if cinny_container_labels_traefik_path_prefix != '/' %} +traefik.http.middlewares.cinny-strip-prefix.stripprefix.prefixes={{ cinny_container_labels_traefik_path_prefix }} +{% set middlewares = middlewares + ['cinny-strip-prefix'] %} {% endif %} -{% if matrix_client_cinny_container_labels_traefik_additional_response_headers.keys() | length > 0 %} -{% for name, value in matrix_client_cinny_container_labels_traefik_additional_response_headers.items() %} -traefik.http.middlewares.matrix-client-cinny-add-headers.headers.customresponseheaders.{{ name }}={{ value }} +{% if cinny_container_labels_traefik_additional_response_headers.keys() | length > 0 %} +{% for name, value in cinny_container_labels_traefik_additional_response_headers.items() %} +traefik.http.middlewares.cinny-add-headers.headers.customresponseheaders.{{ name }}={{ value }} {% endfor %} -{% set middlewares = middlewares + ['matrix-client-cinny-add-headers'] %} +{% set middlewares = middlewares + ['cinny-add-headers'] %} {% endif %} -traefik.http.routers.matrix-client-cinny.rule={{ matrix_client_cinny_container_labels_traefik_rule }} -{% if matrix_client_cinny_container_labels_traefik_priority | int > 0 %} -traefik.http.routers.matrix-client-cinny.priority={{ matrix_client_cinny_container_labels_traefik_priority }} +traefik.http.routers.cinny.rule={{ cinny_container_labels_traefik_rule }} +{% if cinny_container_labels_traefik_priority | int > 0 %} +traefik.http.routers.cinny.priority={{ cinny_container_labels_traefik_priority }} {% endif %} -traefik.http.routers.matrix-client-cinny.service=matrix-client-cinny +traefik.http.routers.cinny.service=cinny {% if middlewares | length > 0 %} -traefik.http.routers.matrix-client-cinny.middlewares={{ middlewares | join(',') }} +traefik.http.routers.cinny.middlewares={{ middlewares | join(',') }} {% endif %} -traefik.http.routers.matrix-client-cinny.entrypoints={{ matrix_client_cinny_container_labels_traefik_entrypoints }} -traefik.http.routers.matrix-client-cinny.tls={{ matrix_client_cinny_container_labels_traefik_tls | to_json }} -{% if matrix_client_cinny_container_labels_traefik_tls %} -traefik.http.routers.matrix-client-cinny.tls.certResolver={{ matrix_client_cinny_container_labels_traefik_tls_certResolver }} +traefik.http.routers.cinny.entrypoints={{ cinny_container_labels_traefik_entrypoints }} +traefik.http.routers.cinny.tls={{ cinny_container_labels_traefik_tls | to_json }} +{% if cinny_container_labels_traefik_tls %} +traefik.http.routers.cinny.tls.certResolver={{ cinny_container_labels_traefik_tls_certResolver }} {% endif %} {% endif %} -{{ matrix_client_cinny_container_labels_additional_labels }} +{{ cinny_container_labels_additional_labels }} diff --git a/roles/custom/matrix-client-cinny/templates/nginx.conf.j2 b/roles/custom/matrix-client-cinny/templates/nginx.conf.j2 index a8cc8da68..4958b3caa 100644 --- a/roles/custom/matrix-client-cinny/templates/nginx.conf.j2 +++ b/roles/custom/matrix-client-cinny/templates/nginx.conf.j2 @@ -35,7 +35,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - {% if matrix_client_cinny_access_log_enabled %} + {% if cinny_access_log_enabled %} access_log /var/log/nginx/access.log main; {% else %} access_log off; diff --git a/roles/custom/matrix-client-cinny/templates/systemd/matrix-client-cinny.service.j2 b/roles/custom/matrix-client-cinny/templates/systemd/matrix-client-cinny.service.j2 index 0275ee8c7..44fbbfe70 100644 --- a/roles/custom/matrix-client-cinny/templates/systemd/matrix-client-cinny.service.j2 +++ b/roles/custom/matrix-client-cinny/templates/systemd/matrix-client-cinny.service.j2 @@ -1,7 +1,7 @@ #jinja2: lstrip_blocks: True [Unit] Description=Matrix Cinny Client -{% for service in matrix_client_cinny_systemd_required_services_list %} +{% for service in cinny_systemd_required_services_list %} Requires={{ service }} After={{ service }} {% endfor %} @@ -10,41 +10,41 @@ DefaultDependencies=no [Service] Type=simple Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}" -ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-client-cinny 2>/dev/null || true' -ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-cinny 2>/dev/null || true' +ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} cinny 2>/dev/null || true' +ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm cinny 2>/dev/null || true' ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --rm \ - --name=matrix-client-cinny \ + --name=cinny \ --log-driver=none \ --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ --cap-drop=ALL \ --read-only \ - --network={{ matrix_client_cinny_container_network }} \ - {% if matrix_client_cinny_container_http_host_bind_port %} - -p {{ matrix_client_cinny_container_http_host_bind_port }}:8080 \ + --network={{ cinny_container_network }} \ + {% if cinny_container_http_host_bind_port %} + -p {{ cinny_container_http_host_bind_port }}:8080 \ {% endif %} - --label-file={{ matrix_client_cinny_data_path }}/labels \ + --label-file={{ cinny_data_path }}/labels \ --tmpfs=/tmp:rw,noexec,nosuid,size=10m \ - --mount type=bind,src={{ matrix_client_cinny_data_path }}/nginx.conf,dst=/etc/nginx/nginx.conf,ro \ - --mount type=bind,src={{ matrix_client_cinny_data_path }}/config.json,dst=/app/config.json,ro \ - {% for arg in matrix_client_cinny_container_extra_arguments %} + --mount type=bind,src={{ cinny_data_path }}/nginx.conf,dst=/etc/nginx/nginx.conf,ro \ + --mount type=bind,src={{ cinny_data_path }}/config.json,dst=/app/config.json,ro \ + {% for arg in cinny_container_extra_arguments %} {{ arg }} \ {% endfor %} - {{ matrix_client_cinny_docker_image }} + {{ cinny_docker_image }} -{% for network in matrix_client_cinny_container_additional_networks %} -ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-cinny +{% for network in cinny_container_additional_networks %} +ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} cinny {% endfor %} -ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-cinny +ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach cinny -ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-client-cinny 2>/dev/null || true' -ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-cinny 2>/dev/null || true' +ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} cinny 2>/dev/null || true' +ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm cinny 2>/dev/null || true' Restart=always RestartSec=30 -SyslogIdentifier=matrix-client-cinny +SyslogIdentifier=cinny [Install] WantedBy=multi-user.target diff --git a/roles/custom/matrix_playbook_migration/tasks/validate_config.yml b/roles/custom/matrix_playbook_migration/tasks/validate_config.yml index f9989385d..067bdce76 100644 --- a/roles/custom/matrix_playbook_migration/tasks/validate_config.yml +++ b/roles/custom/matrix_playbook_migration/tasks/validate_config.yml @@ -1,6 +1,6 @@ -# SPDX-FileCopyrightText: 2022 - 2025 Slavi Pantaleev -# SPDX-FileCopyrightText: 2024 - 2025 MDAD project contributors -# SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara +# SPDX-FileCopyrightText: 2022-2025 Slavi Pantaleev +# SPDX-FileCopyrightText: 2024, 2025 MDAD project contributors +# SPDX-FileCopyrightText: 2024-2026 Suguru Hirahara # # SPDX-License-Identifier: AGPL-3.0-or-later @@ -558,6 +558,19 @@ The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_bot_chatgpt_.+', wantlist=True) | join(', ') }} when: "lookup('ansible.builtin.varnames', '^matrix_bot_chatgpt_.+', wantlist=True) | length > 0" +- name: (Deprecation) Catch and report matrix-client-cinny variables + ansible.builtin.fail: + msg: |- + The matrix-client-cinny role in the playbook now lives under the MASH organization (https://github.com/mother-of-all-self-hosting/ansible-role-cinny). + The new role is pretty much the same, but uses differently named variables. + + Please rename all `matrix_client_cinny_`-prefixed variables (`matrix_client_cinny_*` -> `cinny_*`) on your configuration file (vars.yml). + + After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so. + + The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^matrix_client_cinny_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^matrix_client_cinny_.+', wantlist=True) | length > 0" + - name: (Deprecation) Catch and report mautrix-facebook variables ansible.builtin.fail: msg: |-