7 Commits

Autor SHA1 Nachricht Datum
  D4GU f5b722b13d
Add commet webclient support (#4997) vor 18 Stunden
  renovate[bot] c0be489796 chore(deps): update dependency imagesize to v2 vor 19 Stunden
  renovate[bot] 2d1be91ac2 chore(deps): update dependency linkify-it-py to v2.1.0 vor 2 Tagen
  renovate[bot] bd809f16f3 chore(deps): update dependency uc-micro-py to v2 vor 2 Tagen
  tripleawwy 58bf4fe34b fix: conditionally include m.identity_server in Element Web config.json vor 1 Tag
  renovate[bot] a787993aaf chore(deps): update dependency imagesize to v1.5.0 vor 1 Tag
  Slavi Pantaleev d5ffc94916 Add support for the Sable client (Cinny fork) vor 23 Stunden
21 geänderte Dateien mit 578 neuen und 5 gelöschten Zeilen
  1. +1
    -1
      .codespellrc
  2. +1
    -0
      README.md
  3. +71
    -0
      docs/configuring-playbook-client-sable.md
  4. +2
    -0
      docs/configuring-playbook.md
  5. +1
    -0
      docs/container-images.md
  6. +1
    -0
      docs/self-building.md
  7. +74
    -0
      group_vars/matrix_servers
  8. +3
    -3
      i18n/requirements.txt
  9. +3
    -0
      requirements.yml
  10. +3
    -0
      roles/custom/matrix-base/defaults/main.yml
  11. +102
    -0
      roles/custom/matrix-client-commet/defaults/main.yml
  12. +30
    -0
      roles/custom/matrix-client-commet/tasks/main.yml
  13. +116
    -0
      roles/custom/matrix-client-commet/tasks/setup_install.yml
  14. +29
    -0
      roles/custom/matrix-client-commet/tasks/setup_uninstall.yml
  15. +12
    -0
      roles/custom/matrix-client-commet/templates/env.j2
  16. +3
    -0
      roles/custom/matrix-client-commet/templates/global_config.json.j2
  17. +3
    -0
      roles/custom/matrix-client-commet/templates/global_config.json.j2.license
  18. +60
    -0
      roles/custom/matrix-client-commet/templates/labels.j2
  19. +58
    -0
      roles/custom/matrix-client-commet/templates/systemd/matrix-client-commet.service.j2
  20. +3
    -1
      roles/custom/matrix-client-element/templates/config.json.j2
  21. +2
    -0
      setup.yml

+ 1
- 1
.codespellrc Datei anzeigen

@@ -1,2 +1,2 @@
[codespell]
ignore-words-list = aNULL,brose,doub,Udo,re-use,re-used,registr,shema
ignore-words-list = aNULL,brose,doub,Udo,re-use,re-used,registr,shema,commet,Commet

+ 1
- 0
README.md Datei anzeigen

@@ -64,6 +64,7 @@ Web clients for Matrix that you can host on your own domains.
| [Element Web](https://github.com/element-hq/element-web) | ✅ | Default Matrix web client, configured to connect to your own Synapse server | [Link](docs/configuring-playbook-client-element-web.md) |
| [Hydrogen](https://github.com/element-hq/hydrogen-web) | ❌ | Lightweight Matrix client with legacy and mobile browser support | [Link](docs/configuring-playbook-client-hydrogen.md) |
| [Cinny](https://github.com/ajbura/cinny) | ❌ | Simple, elegant and secure web client | [Link](docs/configuring-playbook-client-cinny.md) |
| [Sable](https://github.com/7w1/sable) | ❌ | Simple, elegant and secure web client | [Link](docs/configuring-playbook-client-sable.md) |
| [SchildiChat Web](https://schildi.chat/) | ❌ | Based on Element Web, with a more traditional instant messaging experience | [Link](docs/configuring-playbook-client-schildichat-web.md) |
| [FluffyChat Web](https://fluffychat.im/) | ❌ | The cutest messenger in Matrix | [Link](docs/configuring-playbook-client-fluffychat-web.md) |



+ 71
- 0
docs/configuring-playbook-client-sable.md Datei anzeigen

@@ -0,0 +1,71 @@
<!--
SPDX-FileCopyrightText: 2022 MDAD project contributors
SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara
SPDX-FileCopyrightText: 2024 - 2026 Slavi Pantaleev

SPDX-License-Identifier: AGPL-3.0-or-later
-->

# Setting up Sable (optional)

The playbook can install and configure the [Sable](https://github.com/7w1/sable) Matrix web client for you.

Sable is a web client focusing primarily on simple, elegant and secure interface. It can be installed alongside or instead of [Element Web](./configuring-playbook-client-element-web.md), [Cinny](./configuring-playbook-client-cinny.md) and others.

## Adjusting DNS records

By default, this playbook installs Sable on the `sable.` subdomain (`sable.example.com`) and requires you to create a CNAME record for `sable`, which targets `matrix.example.com`.

When setting, replace `example.com` with your own.

## Adjusting the playbook configuration

To enable Sable, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:

```yaml
sable_enabled: true
```

### Adjusting the Sable URL (optional)

By tweaking the `sable_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 (`sable.example.com`)
sable_hostname: "app.{{ matrix_domain }}"

# Expose under the /sable subpath
# sable_path_prefix: /sable
```

After changing the domain, **you may need to adjust your DNS** records to point the Sable domain to the Matrix server.

**Note**: while there is a `sable_path_prefix` variable for changing the path where Sable is served, overriding it is [not possible](https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3701), because Sable requires an application rebuild (with a tweaked build config) to be functional under a custom path. You'd need to serve Sable at a dedicated subdomain.

### Extending the configuration

There are some additional things you may wish to configure about the component.

Take a look at:

- `roles/galaxy/sable/defaults/main.yml` for some variables that you can customize via your `vars.yml` file
- `roles/galaxy/sable/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 `sable_configuration_extension_json` variable

## Installing

After configuring the playbook and [adjusting your DNS records](#adjusting-dns-records), run the playbook with [playbook tags](playbook-tags.md) as below:

<!-- NOTE: let this conservative command run (instead of install-all) to make it clear that failure of the command means something is clearly broken. -->
```sh
ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start
```

The shortcut commands with the [`just` program](just.md) are also available: `just install-all` or `just setup-all`

`just install-all` is useful for maintaining your setup quickly ([2x-5x faster](../CHANGELOG.md#2x-5x-performance-improvements-in-playbook-runtime) than `just setup-all`) when its components remain unchanged. If you adjust your `vars.yml` to remove other components, you'd need to run `just setup-all`, or these components will still remain installed. Note these shortcuts run the `ensure-matrix-users-created` tag too.

## 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-sable`.

+ 2
- 0
docs/configuring-playbook.md Datei anzeigen

@@ -87,6 +87,8 @@ Web clients for Matrix that you can host on your own domains.

- [Setting up Cinny](configuring-playbook-client-cinny.md), if you've enabled [Cinny](https://github.com/ajbura/cinny), a web client focusing primarily on simple, elegant and secure interface

- [Setting up Sable](configuring-playbook-client-sable.md), if you've enabled [Sable](https://github.com/7w1/sable), a web client focusing primarily on simple, elegant and secure interface

- [Setting up SchildiChat Web](configuring-playbook-client-schildichat-web.md), if you've enabled [SchildiChat Web](https://schildi.chat/), a web client based on [Element Web](https://element.io/) with some extras and tweaks

- [Setting up FluffyChat Web](configuring-playbook-client-fluffychat-web.md), if you've enabled [FluffyChat Web](https://github.com/krille-chan/fluffychat), a cute cross-platform messenger (web, iOS, Android) for Matrix written in [Flutter](https://flutter.dev/)


+ 1
- 0
docs/container-images.md Datei anzeigen

@@ -39,6 +39,7 @@ Web clients for Matrix that you can host on your own domains.
| [Element Web](configuring-playbook-client-element-web.md) | [vectorim/element-web](https://hub.docker.com/r/vectorim/element-web/) | ✅ | Default Matrix web client, configured to connect to your own Synapse server |
| [Hydrogen](configuring-playbook-client-hydrogen.md) | [element-hq/hydrogen-web](https://ghcr.io/element-hq/hydrogen-web) | ❌ | Lightweight Matrix client with legacy and mobile browser support |
| [Cinny](configuring-playbook-client-cinny.md) | [ajbura/cinny](https://hub.docker.com/r/ajbura/cinny) | ❌ | Simple, elegant and secure web client |
| [Sable](configuring-playbook-client-sable.md) | [7w1/sable](https://ghcr.io/7w1/sable) | ❌ | Simple, elegant and secure web client |
| [SchildiChat Web](configuring-playbook-client-schildichat-web.md) | [etke.cc/schildichat-web](https://ghcr.io/etkecc/schildichat-web) | ❌ | Based on Element Web, with a more traditional instant messaging experience |

## Server Components


+ 1
- 0
docs/self-building.md Datei anzeigen

@@ -30,6 +30,7 @@ Possibly outdated list of roles where self-building the Docker image is currentl
- `matrix-client-element`
- `hydrogen`
- `cinny`
- `sable`
- `matrix-registration`
- `coturn`
- `matrix-corporal`


+ 74
- 0
group_vars/matrix_servers Datei anzeigen

@@ -576,6 +576,13 @@ devture_systemd_service_manager_services_list_auto: |
'groups': ['matrix', 'clients', 'cinny', 'client-cinny'],
}] if cinny_enabled else [])
+
([{
'name': (sable_identifier + '.service'),
'priority': 2000,
'restart_necessary': (sable_restart_necessary | bool),
'groups': ['matrix', 'clients', 'sable', 'client-sable'],
}] if sable_enabled else [])
+
([{
'name': 'matrix-client-element.service',
'priority': 2000,
@@ -597,6 +604,13 @@ devture_systemd_service_manager_services_list_auto: |
'groups': ['matrix', 'clients', 'schildichat', 'client-schildichat'],
}] if matrix_client_schildichat_enabled else [])
+
([{
'name': 'matrix-client-commet.service',
'priority': 2000,
'restart_necessary': (matrix_client_commet_restart_necessary | bool),
'groups': ['matrix', 'clients', 'commet', 'client-commet'],
}] if matrix_client_commet_enabled else [])
+
([{
'name': 'matrix-client-fluffychat.service',
'priority': 2000,
@@ -4385,6 +4399,18 @@ matrix_client_element_container_additional_networks: "{{ [matrix_playbook_revers

matrix_client_element_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
matrix_client_element_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"

matrix_client_commet_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '8766') if matrix_playbook_service_host_bind_interface_prefix else '' }}"

matrix_client_commet_container_network: "{{ matrix_addons_container_network }}"

matrix_client_commet_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_client_commet_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] }}"

matrix_client_commet_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
matrix_client_commet_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
matrix_client_commet_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
matrix_client_commet_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"

matrix_client_element_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
matrix_client_element_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"

@@ -4523,6 +4549,54 @@ cinny_hostname: "{{ matrix_server_fqn_cinny }}"
#
######################################################################

######################################################################
#
# sable
#
######################################################################

sable_enabled: false

sable_identifier: matrix-client-sable

sable_uid: "{{ matrix_user_uid }}"
sable_gid: "{{ matrix_user_gid }}"

sable_container_image_registry_prefix: "{{ 'localhost/' if sable_container_image_self_build else sable_container_image_registry_prefix_upstream }}"
sable_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else sable_container_image_registry_prefix_upstream_default }}"

sable_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}"

sable_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '8771') if matrix_playbook_service_host_bind_interface_prefix else '' }}"

sable_container_network: "{{ matrix_addons_container_network }}"

sable_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if (sable_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] }}"

sable_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
sable_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
sable_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
sable_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"

sable_container_labels_traefik_compression_middleware_enabled: "{{ matrix_playbook_reverse_proxy_traefik_middleware_compression_enabled }}"
sable_container_labels_traefik_compression_middleware_name: "{{ matrix_playbook_reverse_proxy_traefik_middleware_compression_name if matrix_playbook_reverse_proxy_traefik_middleware_compression_enabled else '' }}"

sable_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}"

sable_default_hs_url: "{{ matrix_homeserver_url }}"

sable_self_check_validate_certificates: "{{ matrix_playbook_ssl_enabled }}"

sable_base_path: "{{ matrix_base_data_path }}/client-sable"

sable_hostname: "{{ matrix_server_fqn_sable }}"

######################################################################
#
# /sable
#
######################################################################

######################################################################
#
# matrix-client-schildichat


+ 3
- 3
i18n/requirements.txt Datei anzeigen

@@ -5,9 +5,9 @@ charset-normalizer==3.4.4
click==8.3.1
docutils==0.22.4
idna==3.11
imagesize==1.4.1
imagesize==2.0.0
Jinja2==3.1.6
linkify-it-py==2.0.3
linkify-it-py==2.1.0
markdown-it-py==4.0.0
MarkupSafe==3.0.3
mdit-py-plugins==0.5.0
@@ -29,5 +29,5 @@ sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
tabulate==0.9.0
uc-micro-py==1.0.3
uc-micro-py==2.0.0
urllib3==2.6.3

+ 3
- 0
requirements.yml Datei anzeigen

@@ -74,6 +74,9 @@
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-postgres-exporter.git
version: v0.19.1-0
name: prometheus_postgres_exporter
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-sable.git
version: v1.3.0-0
name: sable
- src: git+https://github.com/devture/com.devture.ansible.role.systemd_docker_base.git
version: v1.5.0-0
name: systemd_docker_base


+ 3
- 0
roles/custom/matrix-base/defaults/main.yml Datei anzeigen

@@ -116,6 +116,9 @@ matrix_server_fqn_hydrogen: "hydrogen.{{ matrix_domain }}"
# 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 Sable web client from (if enabled via sable_enabled; disabled by default).
matrix_server_fqn_sable: "sable.{{ matrix_domain }}"

# This is where you access the SchildiChat Web from (if enabled via matrix_client_schildichat_enabled; disabled by default).
matrix_server_fqn_schildichat: "schildichat.{{ matrix_domain }}"



+ 102
- 0
roles/custom/matrix-client-commet/defaults/main.yml Datei anzeigen

@@ -0,0 +1,102 @@
# SPDX-FileCopyrightText: 2026 MDAD project contributors
#
# SPDX-License-Identifier: AGPL-3.0-or-later

---
# Project source code URL: https://github.com/commetchat/commet

matrix_client_commet_enabled: true

# The git branch, tag, or SHA to build from
matrix_client_commet_version: "main"

# The hostname at which Commet is served (e.g. commet.example.com)
matrix_client_commet_hostname: ""

# The path at which Commet is exposed.
# This value must either be `/` or not end with a slash (e.g. `/commet`).
matrix_client_commet_path_prefix: /

matrix_client_commet_base_path: "{{ matrix_base_data_path }}/client-commet"
matrix_client_commet_container_src_path: "{{ matrix_client_commet_base_path }}/container-src"
matrix_client_commet_config_path: "{{ matrix_client_commet_base_path }}/config"

# Set to false to pull a pre-built image from a registry instead of building on the server.
matrix_client_commet_container_image_self_build: true

# Self-build settings (used when matrix_client_commet_container_image_self_build: true)
matrix_client_commet_container_image_self_build_repo: "https://github.com/commetchat/commet.git"
# Populated automatically after git clone in setup_install.yml
matrix_client_commet_container_image_self_build_git_hash: ""
matrix_client_commet_container_image_self_build_version_tag: "{{ matrix_client_commet_version }}"
matrix_client_commet_container_image: "localhost/matrix-client-commet:{{ matrix_client_commet_version }}"

# The in-container port nginx listens on
matrix_client_commet_container_port: 8080

# Optionally expose the container port on the host.
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8765"), or empty string to not expose.
matrix_client_commet_container_http_host_bind_port: ""

# The base container network
matrix_client_commet_container_network: ""

# Additional container networks the container is connected to.
# The role does not create these networks, so make sure they already exist.
matrix_client_commet_container_additional_networks: []

# Runtime configuration — mounted into the container, not baked into the image
matrix_client_commet_default_homeserver: "matrix.org"

# ---------------------------------------------------------------------------
# Traefik labels
# ---------------------------------------------------------------------------
matrix_client_commet_container_labels_traefik_enabled: true
matrix_client_commet_container_labels_traefik_docker_network: "{{ matrix_client_commet_container_network }}"
matrix_client_commet_container_labels_traefik_hostname: "{{ matrix_client_commet_hostname }}"
# The path prefix must either be `/` or not end with a slash (e.g. `/commet`).
matrix_client_commet_container_labels_traefik_path_prefix: "{{ matrix_client_commet_path_prefix }}"
matrix_client_commet_container_labels_traefik_rule: "Host(`{{ matrix_client_commet_container_labels_traefik_hostname }}`){% if matrix_client_commet_container_labels_traefik_path_prefix != '/' %} && PathPrefix(`{{ matrix_client_commet_container_labels_traefik_path_prefix }}`){% endif %}"
matrix_client_commet_container_labels_traefik_priority: 0
matrix_client_commet_container_labels_traefik_entrypoints: web-secure
matrix_client_commet_container_labels_traefik_tls: "{{ matrix_client_commet_container_labels_traefik_entrypoints != 'web' }}"
matrix_client_commet_container_labels_traefik_tls_certResolver: default # noqa var-naming

# Controls whether a compression middleware will be injected into the middlewares list.
matrix_client_commet_container_labels_traefik_compression_middleware_enabled: false
matrix_client_commet_container_labels_traefik_compression_middleware_name: ""

# Additional response headers (auto-built from security header variables below)
matrix_client_commet_container_labels_traefik_additional_response_headers: "{{ matrix_client_commet_container_labels_traefik_additional_response_headers_auto | combine(matrix_client_commet_container_labels_traefik_additional_response_headers_custom) }}"
matrix_client_commet_container_labels_traefik_additional_response_headers_auto: |
{{
{}
| combine({'X-XSS-Protection': matrix_client_commet_http_header_xss_protection} if matrix_client_commet_http_header_xss_protection else {})
| combine({'X-Content-Type-Options': matrix_client_commet_http_header_content_type_options} if matrix_client_commet_http_header_content_type_options else {})
| combine({'Content-Security-Policy': matrix_client_commet_http_header_content_security_policy} if matrix_client_commet_http_header_content_security_policy else {})
| combine({'Strict-Transport-Security': matrix_client_commet_http_header_strict_transport_security} if matrix_client_commet_http_header_strict_transport_security and matrix_client_commet_container_labels_traefik_tls else {})
}}
matrix_client_commet_container_labels_traefik_additional_response_headers_custom: {}

# Additional container labels (multiline string)
matrix_client_commet_container_labels_additional_labels: ""

# Extra arguments to pass to docker create
matrix_client_commet_container_extra_arguments: []

# ---------------------------------------------------------------------------
# HTTP security headers
# ---------------------------------------------------------------------------
matrix_client_commet_http_header_xss_protection: "1; mode=block"
matrix_client_commet_http_header_content_type_options: nosniff
matrix_client_commet_http_header_content_security_policy: "frame-ancestors 'self'"
matrix_client_commet_http_header_strict_transport_security: "max-age=31536000; includeSubDomains"

# ---------------------------------------------------------------------------
# Systemd
# ---------------------------------------------------------------------------
matrix_client_commet_systemd_required_services_list: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"

# matrix_client_commet_restart_necessary is automatically set during installation
# to signal whether the service should be restarted after setup.
matrix_client_commet_restart_necessary: false

+ 30
- 0
roles/custom/matrix-client-commet/tasks/main.yml Datei anzeigen

@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: 2026 MDAD project contributors
#
# SPDX-License-Identifier: AGPL-3.0-or-later

---

- tags:
- setup-all
- setup-client-commet
- install-all
- install-client-commet
block:
- when: matrix_client_commet_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"

- tags:
- setup-all
- setup-client-commet
block:
- when: not matrix_client_commet_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"

- tags:
- self-check
block:
- when: matrix_client_commet_enabled | bool
ansible.builtin.debug:
msg: >-
Commet is running at
https://{{ matrix_client_commet_hostname }}{{ matrix_client_commet_path_prefix }}

+ 116
- 0
roles/custom/matrix-client-commet/tasks/setup_install.yml Datei anzeigen

@@ -0,0 +1,116 @@
# SPDX-FileCopyrightText: 2025 Nikita Chernyi
# SPDX-FileCopyrightText: 2026 MDAD project contributors
#
# SPDX-License-Identifier: AGPL-3.0-or-later

---

- name: Ensure Commet paths exist
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: "0750"
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
with_items:
- "{{ matrix_client_commet_base_path }}"
- "{{ matrix_client_commet_config_path }}"

- name: Ensure Commet container image is pulled
community.docker.docker_image:
name: "{{ matrix_client_commet_container_image }}"
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_client_commet_container_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_commet_container_image_force_pull }}"
when: "not matrix_client_commet_container_image_self_build | bool"
register: matrix_client_commet_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: matrix_client_commet_image_pull_result is not failed

- when: "matrix_client_commet_container_image_self_build | bool"
block:
- name: Check Commet git repository metadata exists
ansible.builtin.stat:
path: "{{ matrix_client_commet_container_src_path }}/.git/config"
register: matrix_client_commet_git_config_file_stat

- name: Remove Commet source directory if git remote is misconfigured
ansible.builtin.file:
path: "{{ matrix_client_commet_container_src_path }}"
state: absent
when: not matrix_client_commet_git_config_file_stat.stat.exists
become: true

- name: Ensure Commet repository is present on self-build
ansible.builtin.git:
repo: "{{ matrix_client_commet_container_image_self_build_repo }}"
dest: "{{ matrix_client_commet_container_src_path }}"
version: "{{ matrix_client_commet_version }}"
force: "yes"
become: true
become_user: "{{ matrix_user_name }}"
register: matrix_client_commet_git_pull_results

- name: Set git hash fact
ansible.builtin.set_fact:
matrix_client_commet_container_image_self_build_git_hash: "{{ matrix_client_commet_git_pull_results.after }}"

- name: Ensure Commet container image is built
ansible.builtin.command:
cmd: |-
{{ devture_systemd_docker_base_host_command_docker }} buildx build
--tag={{ matrix_client_commet_container_image }}
--build-arg GIT_HASH={{ matrix_client_commet_container_image_self_build_git_hash }}
--build-arg VERSION_TAG={{ matrix_client_commet_container_image_self_build_version_tag }}
--build-arg BUILD_DATE={{ ansible_date_time.epoch }}
--file={{ matrix_client_commet_container_src_path }}/Dockerfile
{{ matrix_client_commet_container_src_path }}
changed_when: true
register: matrix_client_commet_image_build_result

- name: Ensure Commet global_config.json is installed
ansible.builtin.template:
src: "{{ role_path }}/templates/global_config.json.j2"
dest: "{{ matrix_client_commet_config_path }}/global_config.json"
mode: "0644"
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_client_commet_config_result

- name: Ensure Commet support files are installed
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ matrix_client_commet_base_path }}/{{ item.name }}"
mode: "0644"
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
with_items:
- {src: "{{ role_path }}/templates/labels.j2", name: "labels"}
- {src: "{{ role_path }}/templates/env.j2", name: "env"}
register: matrix_client_commet_support_files_result

- name: Ensure Commet container network is created
community.general.docker_network:
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
name: "{{ matrix_client_commet_container_network }}"
driver: bridge
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"

- name: Ensure matrix-client-commet.service is installed
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/matrix-client-commet.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-commet.service"
mode: "0644"
register: matrix_client_commet_systemd_service_result

- name: Determine whether Commet needs a restart
ansible.builtin.set_fact:
matrix_client_commet_restart_necessary: >-
{{
matrix_client_commet_config_result.changed | default(false)
or matrix_client_commet_support_files_result.changed | default(false)
or matrix_client_commet_systemd_service_result.changed | default(false)
or matrix_client_commet_image_build_result.changed | default(false)
or matrix_client_commet_image_pull_result.changed | default(false)
}}

+ 29
- 0
roles/custom/matrix-client-commet/tasks/setup_uninstall.yml Datei anzeigen

@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: 2026 MDAD project contributors
#
# SPDX-License-Identifier: AGPL-3.0-or-later

---

- name: Check existence of matrix-client-commet.service
ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-commet.service"
register: matrix_client_commet_service_stat

- when: matrix_client_commet_service_stat.stat.exists | bool
block:
- name: Ensure matrix-client-commet is stopped
ansible.builtin.service:
name: matrix-client-commet
state: stopped
enabled: false
daemon_reload: true

- name: Ensure matrix-client-commet.service doesn't exist
ansible.builtin.file:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-commet.service"
state: absent

- name: Ensure Commet path doesn't exist
ansible.builtin.file:
path: "{{ matrix_client_commet_base_path }}"
state: absent

+ 12
- 0
roles/custom/matrix-client-commet/templates/env.j2 Datei anzeigen

@@ -0,0 +1,12 @@
{#
SPDX-FileCopyrightText: 2026 MDAD project contributors

SPDX-License-Identifier: AGPL-3.0-or-later
#}

{#
Environment variables for the matrix-client-commet container.
Add custom variables by appending to matrix_client_commet_environment_variables_extension.
#}

{{ matrix_client_commet_environment_variables_extension | default('') }}

+ 3
- 0
roles/custom/matrix-client-commet/templates/global_config.json.j2 Datei anzeigen

@@ -0,0 +1,3 @@
{
"default_homeserver": "{{ matrix_client_commet_default_homeserver }}"
}

+ 3
- 0
roles/custom/matrix-client-commet/templates/global_config.json.j2.license Datei anzeigen

@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2026 MDAD project contributors

SPDX-License-Identifier: AGPL-3.0-or-later

+ 60
- 0
roles/custom/matrix-client-commet/templates/labels.j2 Datei anzeigen

@@ -0,0 +1,60 @@
{#
SPDX-FileCopyrightText: 2026 MDAD project contributors

SPDX-License-Identifier: AGPL-3.0-or-later
#}

{#
Traefik labels for matrix-client-commet.
#}

{% if matrix_client_commet_container_labels_traefik_enabled %}
traefik.enable=true

{% if matrix_client_commet_container_labels_traefik_docker_network %}
traefik.docker.network={{ matrix_client_commet_container_labels_traefik_docker_network }}
{% endif %}

traefik.http.services.matrix-client-commet.loadbalancer.server.port={{ matrix_client_commet_container_port }}

{% set middlewares = [] %}

{% if matrix_client_commet_container_labels_traefik_compression_middleware_enabled %}
{% set middlewares = middlewares + [matrix_client_commet_container_labels_traefik_compression_middleware_name] %}
{% endif %}

{% if matrix_client_commet_container_labels_traefik_path_prefix != '/' %}
traefik.http.middlewares.matrix-client-commet-slashless-redirect.redirectregex.regex=({{ matrix_client_commet_container_labels_traefik_path_prefix | quote }})$
traefik.http.middlewares.matrix-client-commet-slashless-redirect.redirectregex.replacement=${1}/
{% set middlewares = middlewares + ['matrix-client-commet-slashless-redirect'] %}
{% endif %}

{% if matrix_client_commet_container_labels_traefik_path_prefix != '/' %}
traefik.http.middlewares.matrix-client-commet-strip-prefix.stripprefix.prefixes={{ matrix_client_commet_container_labels_traefik_path_prefix }}
{% set middlewares = middlewares + ['matrix-client-commet-strip-prefix'] %}
{% endif %}

{% if matrix_client_commet_container_labels_traefik_additional_response_headers.keys() | length > 0 %}
{% for name, value in matrix_client_commet_container_labels_traefik_additional_response_headers.items() %}
traefik.http.middlewares.matrix-client-commet-add-headers.headers.customresponseheaders.{{ name }}={{ value }}
{% endfor %}
{% set middlewares = middlewares + ['matrix-client-commet-add-headers'] %}
{% endif %}

traefik.http.routers.matrix-client-commet.rule={{ matrix_client_commet_container_labels_traefik_rule }}
{% if matrix_client_commet_container_labels_traefik_priority | int > 0 %}
traefik.http.routers.matrix-client-commet.priority={{ matrix_client_commet_container_labels_traefik_priority }}
{% endif %}
traefik.http.routers.matrix-client-commet.service=matrix-client-commet
{% if middlewares | length > 0 %}
traefik.http.routers.matrix-client-commet.middlewares={{ middlewares | join(',') }}
{% endif %}
traefik.http.routers.matrix-client-commet.entrypoints={{ matrix_client_commet_container_labels_traefik_entrypoints }}
traefik.http.routers.matrix-client-commet.tls={{ matrix_client_commet_container_labels_traefik_tls | to_json }}
{% if matrix_client_commet_container_labels_traefik_tls %}
traefik.http.routers.matrix-client-commet.tls.certResolver={{ matrix_client_commet_container_labels_traefik_tls_certResolver }}
{% endif %}

{% endif %}

{{ matrix_client_commet_container_labels_additional_labels }}

+ 58
- 0
roles/custom/matrix-client-commet/templates/systemd/matrix-client-commet.service.j2 Datei anzeigen

@@ -0,0 +1,58 @@
{#
SPDX-FileCopyrightText: 2026 MDAD project contributors

SPDX-License-Identifier: AGPL-3.0-or-later
#}

#jinja2: lstrip_blocks: True
[Unit]
Description=Matrix Commet web client
{% for service in matrix_client_commet_systemd_required_services_list %}
Requires={{ service }}
After={{ service }}
{% endfor %}
DefaultDependencies=no

[Service]
Type=simple
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-client-commet 2>/dev/null || true'
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-commet 2>/dev/null || true'

ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--rm \
--name=matrix-client-commet \
--log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--read-only \
--network={{ matrix_client_commet_container_network }} \
{% if matrix_client_commet_container_http_host_bind_port %}
-p {{ matrix_client_commet_container_http_host_bind_port }}:{{ matrix_client_commet_container_port }} \
{% endif %}
--label-file={{ matrix_client_commet_base_path }}/labels \
--env-file={{ matrix_client_commet_base_path }}/env \
--tmpfs=/tmp:rw,noexec,nosuid,size=10m \
--tmpfs=/var/cache/nginx:rw,mode=777 \
--tmpfs=/var/run:rw,mode=777 \
--mount type=bind,src={{ matrix_client_commet_config_path }}/global_config.json,dst=/usr/share/nginx/html/assets/assets/config/global_config.json,ro \
{% for arg in matrix_client_commet_container_extra_arguments %}
{{ arg }} \
{% endfor %}
{{ matrix_client_commet_container_image }}

{% for network in matrix_client_commet_container_additional_networks %}
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-commet
{% endfor %}

ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-commet

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-commet 2>/dev/null || true'
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-commet 2>/dev/null || true'

Restart=always
RestartSec=30
SyslogIdentifier=matrix-client-commet

[Install]
WantedBy=multi-user.target

+ 3
- 1
roles/custom/matrix-client-element/templates/config.json.j2 Datei anzeigen

@@ -3,10 +3,12 @@
"m.homeserver": {
"base_url": {{ matrix_client_element_default_hs_url | string | to_json }},
"server_name": {{ matrix_client_element_default_server_name | string | to_json }}
},
}
{% if matrix_client_element_default_is_url %},
"m.identity_server": {
"base_url": {{ matrix_client_element_default_is_url | string | to_json }}
}
{% endif %}
},
"setting_defaults": {
"custom_themes": {{ matrix_client_element_setting_defaults_custom_themes | to_json }}


+ 2
- 0
setup.yml Datei anzeigen

@@ -106,8 +106,10 @@
- custom/matrix-prometheus-services-connect
- custom/matrix-registration
- custom/matrix-client-element
- custom/matrix-client-commet
- galaxy/hydrogen
- galaxy/cinny
- galaxy/sable
- custom/matrix-client-schildichat
- custom/matrix-client-fluffychat
- galaxy/jitsi


Laden…
Abbrechen
Speichern