diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index dd1c9d389..5e7b9f1e3 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -4671,6 +4671,8 @@ matrix_client_fluffychat_container_labels_traefik_tls_certResolver: "{{ traefik_ matrix_client_fluffychat_self_check_validate_certificates: "{{ matrix_playbook_ssl_enabled }}" +matrix_client_fluffychat_config_defaultHomeserver: "{{ matrix_domain }}" + ###################################################################### # # /matrix-client-fluffychat diff --git a/roles/custom/matrix-client-fluffychat/defaults/main.yml b/roles/custom/matrix-client-fluffychat/defaults/main.yml index 9c44771f7..96904059b 100644 --- a/roles/custom/matrix-client-fluffychat/defaults/main.yml +++ b/roles/custom/matrix-client-fluffychat/defaults/main.yml @@ -13,15 +13,16 @@ matrix_client_fluffychat_container_image_self_build_repo: "https://github.com/et matrix_client_fluffychat_container_image_self_build_version: "{{ 'main' if matrix_client_fluffychat_version == 'latest' else matrix_client_fluffychat_version }}" # renovate: datasource=docker depName=ghcr.io/etkecc/fluffychat-web -matrix_client_fluffychat_version: v2.4.0 +matrix_client_fluffychat_version: v2.4.1 matrix_client_fluffychat_docker_image: "{{ matrix_client_fluffychat_docker_image_registry_prefix }}etkecc/fluffychat-web:{{ matrix_client_fluffychat_version }}" matrix_client_fluffychat_docker_image_registry_prefix: "{{ 'localhost/' if matrix_client_fluffychat_container_image_self_build else matrix_client_fluffychat_docker_image_registry_prefix_upstream }}" matrix_client_fluffychat_docker_image_registry_prefix_upstream: "{{ matrix_client_fluffychat_docker_image_registry_prefix_upstream_default }}" matrix_client_fluffychat_docker_image_registry_prefix_upstream_default: ghcr.io/ matrix_client_fluffychat_docker_image_force_pull: "{{ matrix_client_fluffychat_docker_image.endswith(':latest') }}" -matrix_client_fluffychat_data_path: "{{ matrix_base_data_path }}/client-fluffychat" -matrix_client_fluffychat_container_src_files_path: "{{ matrix_client_fluffychat_data_path }}/docker-src" +matrix_client_fluffychat_base_path: "{{ matrix_base_data_path }}/client-fluffychat" +matrix_client_fluffychat_config_path: "{{ matrix_client_fluffychat_base_path }}/config" +matrix_client_fluffychat_container_src_files_path: "{{ matrix_client_fluffychat_base_path }}/docker-src" # The base container network matrix_client_fluffychat_container_network: '' @@ -148,3 +149,6 @@ matrix_client_fluffychat_path_prefix: / # Controls whether the self-check feature should validate SSL certificates. matrix_client_fluffychat_self_check_validate_certificates: true + +# Controls the default homeserver domain (not URL) used in the FluffyChat Web configuration. +matrix_client_fluffychat_config_defaultHomeserver: ~ diff --git a/roles/custom/matrix-client-fluffychat/tasks/setup_install.yml b/roles/custom/matrix-client-fluffychat/tasks/setup_install.yml index 3fd3e71af..142279947 100644 --- a/roles/custom/matrix-client-fluffychat/tasks/setup_install.yml +++ b/roles/custom/matrix-client-fluffychat/tasks/setup_install.yml @@ -12,7 +12,8 @@ owner: "{{ matrix_user_name }}" group: "{{ matrix_group_name }}" with_items: - - {path: "{{ matrix_client_fluffychat_data_path }}", when: true} + - {path: "{{ matrix_client_fluffychat_base_path }}", when: true} + - {path: "{{ matrix_client_fluffychat_config_path }}", when: true} - {path: "{{ matrix_client_fluffychat_container_src_files_path }}", when: "{{ matrix_client_fluffychat_container_image_self_build }}"} when: "item.when | bool" @@ -52,12 +53,13 @@ - name: Ensure FluffyChat Web config files installed ansible.builtin.template: src: "{{ item.src }}" - dest: "{{ matrix_client_fluffychat_data_path }}/{{ item.name }}" + dest: "{{ item.dest }}" mode: 0644 owner: "{{ matrix_user_name }}" group: "{{ matrix_group_name }}" with_items: - - {src: "{{ role_path }}/templates/labels.j2", name: "labels"} + - {src: "{{ role_path }}/templates/labels.j2", dest: "{{ matrix_client_fluffychat_base_path }}/labels"} + - {src: "{{ role_path }}/templates/config.json.j2", dest: "{{ matrix_client_fluffychat_config_path }}/config.json"} when: "item.src is not none" - name: Ensure FluffyChat Web container network is created diff --git a/roles/custom/matrix-client-fluffychat/tasks/setup_uninstall.yml b/roles/custom/matrix-client-fluffychat/tasks/setup_uninstall.yml index 140c95344..9002ea5d5 100644 --- a/roles/custom/matrix-client-fluffychat/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-client-fluffychat/tasks/setup_uninstall.yml @@ -25,5 +25,5 @@ - name: Ensure FluffyChat Web path doesn't exist ansible.builtin.file: - path: "{{ matrix_client_fluffychat_data_path }}" + path: "{{ matrix_client_fluffychat_base_path }}" state: absent diff --git a/roles/custom/matrix-client-fluffychat/templates/config.json.j2 b/roles/custom/matrix-client-fluffychat/templates/config.json.j2 new file mode 100644 index 000000000..120e3c46a --- /dev/null +++ b/roles/custom/matrix-client-fluffychat/templates/config.json.j2 @@ -0,0 +1,3 @@ +{ + "defaultHomeserver": {{ matrix_client_fluffychat_config_defaultHomeserver | to_json }} +} diff --git a/roles/custom/matrix-client-fluffychat/templates/config.json.j2.license b/roles/custom/matrix-client-fluffychat/templates/config.json.j2.license new file mode 100644 index 000000000..ed4a74493 --- /dev/null +++ b/roles/custom/matrix-client-fluffychat/templates/config.json.j2.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2026 Nikita Chernyi + +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 b/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 index f7cbdaa1c..5ac30839c 100644 --- a/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 +++ b/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 @@ -24,7 +24,8 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% if matrix_client_fluffychat_container_http_host_bind_port %} -p {{ matrix_client_fluffychat_container_http_host_bind_port }}:{{ matrix_client_fluffychat_container_http_port }} \ {% endif %} - --label-file={{ matrix_client_fluffychat_data_path }}/labels \ + --label-file={{ matrix_client_fluffychat_base_path }}/labels \ + --mount type=bind,src={{ matrix_client_fluffychat_config_path }}/config.json,dst=/var/public/config.json,ro \ --tmpfs=/tmp:rw,noexec,nosuid,size=10m \ {% for arg in matrix_client_fluffychat_container_extra_arguments %} {{ arg }} \