| @@ -28,21 +28,15 @@ Ensure that the following DNS names have a public IP/FQDN: | |||||
| Add the following configuration to your `inventory/host_vars/matrix.DOMAIN/vars.yml` file: | Add the following configuration to your `inventory/host_vars/matrix.DOMAIN/vars.yml` file: | ||||
| ```yaml | ```yaml | ||||
| # Enable dependent services | |||||
| keydb_enabled: true | |||||
| matrix_element_call_enabled: true | matrix_element_call_enabled: true | ||||
| matrix_livekit_server_enabled: true | |||||
| matrix_jwt_service_enabled: true | |||||
| # Set a secure key for LiveKit authentication | # Set a secure key for LiveKit authentication | ||||
| matrix_element_call_livekit_dev_key: 'your-secure-livekit-key' | matrix_element_call_livekit_dev_key: 'your-secure-livekit-key' | ||||
| ``` | ``` | ||||
| ## External databases | |||||
| If your setup utilizes an external database, you may need to adjust the default configuration for Redis used by Element Call. Modify the defaults in group_vars/matrix_servers.yml or host_vars to suit your setup: | |||||
| ```yaml | |||||
| matrix_element_call_redis_hostname: 'localhost' | |||||
| matrix_element_call_redis_port: 6379 | |||||
| matrix_element_call_redis_password: '' | |||||
| ``` | |||||
| ## Installing | ## Installing | ||||
| After potentially adjusting DNS records and configuring the playbook, run the installation command again: | After potentially adjusting DNS records and configuring the playbook, run the installation command again: | ||||
| ```yaml | ```yaml | ||||
| @@ -5,7 +5,7 @@ matrix_element_call_enabled: false | |||||
| # Base path configuration | # Base path configuration | ||||
| matrix_element_call_base_path: "{{ matrix_base_data_path }}/element-call" | matrix_element_call_base_path: "{{ matrix_base_data_path }}/element-call" | ||||
| matrix_homeserver_config_path: "{{ matrix_base_data_path }}/synapse/config/homeserver.yaml" | matrix_homeserver_config_path: "{{ matrix_base_data_path }}/synapse/config/homeserver.yaml" | ||||
| element_web_config_path: "{{ matrix_base_data_path }}/static-files/public/.well-known/matrix/client" | |||||
| element_web_config_path: "{{ matrix_base_data_path }}/client-element/config.json" | |||||
| # Docker network configuration | # Docker network configuration | ||||
| matrix_element_call_container_network: '' | matrix_element_call_container_network: '' | ||||
| @@ -79,20 +79,10 @@ | |||||
| when: matrix_element_call_enabled | bool | when: matrix_element_call_enabled | bool | ||||
| # Update the well-known client file for Element Call (adding RTC FOCI) | # Update the well-known client file for Element Call (adding RTC FOCI) | ||||
| - name: Update the existing well-known client file for Element Call (RTC FOCI) | |||||
| ansible.builtin.blockinfile: | |||||
| path: "{{ matrix_base_data_path }}/static-files/public/.well-known/matrix/client" | |||||
| block: | | |||||
| "org.matrix.msc4143.rtc_foci": [ | |||||
| { | |||||
| "type": "livekit", | |||||
| "livekit_service_url": "{{ matrix_jwt_service_url }}" | |||||
| } | |||||
| ] | |||||
| marker: "# ANSIBLE MANAGED BLOCK - Element Call RTC FOCI" | |||||
| mode: '0644' | |||||
| owner: "{{ matrix_user_username }}" | |||||
| group: "{{ matrix_user_groupname }}" | |||||
| - name: Update the well-known client file for Element Call | |||||
| ansible.builtin.include_tasks: update_well_known_client.yml | |||||
| when: matrix_element_call_enabled | bool | |||||
| # Create .well-known/element/element.json for Element Call | # Create .well-known/element/element.json for Element Call | ||||
| - name: Create the well-known element.json file | - name: Create the well-known element.json file | ||||
| @@ -105,22 +95,6 @@ | |||||
| # Update Element Web config.json with Element Call settings | # Update Element Web config.json with Element Call settings | ||||
| - name: Update Element Web config.json | - name: Update Element Web config.json | ||||
| ansible.builtin.blockinfile: | |||||
| path: "{{ element_web_config_path }}" | |||||
| block: | | |||||
| "features": { | |||||
| "feature_video_rooms": true, | |||||
| "feature_new_room_decoration_ui": true, | |||||
| "feature_group_calls": true, | |||||
| "feature_element_call_video_rooms": true | |||||
| }, | |||||
| "element_call": { | |||||
| "url": "https://{{ matrix_element_call_domain }}", | |||||
| "participant_limit": 8, | |||||
| "brand": "Element Call", | |||||
| "use_exclusively": true | |||||
| } | |||||
| marker: "# ANSIBLE MANAGED BLOCK - Element Call settings" | |||||
| mode: '0644' | |||||
| owner: "{{ matrix_user_username }}" | |||||
| group: "{{ matrix_user_groupname }}" | |||||
| ansible.builtin.include_tasks: "tasks/update_element_web_config.yml" | |||||
| when: matrix_element_call_enabled | bool | |||||
| @@ -0,0 +1,27 @@ | |||||
| - name: Update Element Web config.json settings | |||||
| vars: | |||||
| additional_settings: | | |||||
| { | |||||
| "features": { | |||||
| "feature_video_rooms": true, | |||||
| "feature_new_room_decoration_ui": true, | |||||
| "feature_group_calls": true, | |||||
| "feature_element_call_video_rooms": true | |||||
| }, | |||||
| "element_call": { | |||||
| "url": "https://{{ matrix_element_call_domain }}", | |||||
| "participant_limit": 8, | |||||
| "brand": "Element Call", | |||||
| "use_exclusively": true | |||||
| } | |||||
| } | |||||
| set_fact: | |||||
| updated_element_web_config: "{{ (element_web_config_content.content | b64decode | from_json) | combine(additional_settings | from_json, recursive=True) }}" | |||||
| - name: Write updated Element Web config.json | |||||
| copy: | |||||
| content: "{{ updated_element_web_config | to_nice_json }}" | |||||
| dest: "{{ element_web_config_path }}" | |||||
| mode: '0644' | |||||
| owner: "{{ matrix_user_username }}" | |||||
| group: "{{ matrix_user_groupname }}" | |||||
| @@ -0,0 +1,21 @@ | |||||
| --- | |||||
| - name: Read the existing well-known client file | |||||
| ansible.builtin.slurp: | |||||
| path: "{{ matrix_base_data_path }}/static-files/public/.well-known/matrix/client" | |||||
| register: client_file_content | |||||
| - name: Load the existing JSON content | |||||
| ansible.builtin.set_fact: | |||||
| client_json: "{{ client_file_content['content'] | b64decode | from_json }}" | |||||
| - name: Update the existing well-known client file for Element Call (RTC FOCI) | |||||
| ansible.builtin.set_fact: | |||||
| updated_client_json: "{{ client_json | combine({'org.matrix.msc4143.rtc_foci': [{'type': 'livekit', 'livekit_service_url': matrix_jwt_service_url}]}, recursive=True) }}" | |||||
| - name: Write the updated well-known client file | |||||
| ansible.builtin.copy: | |||||
| content: "{{ updated_client_json | to_nice_json }}" | |||||
| dest: "{{ matrix_base_data_path }}/static-files/public/.well-known/matrix/client" | |||||
| mode: '0644' | |||||
| owner: "{{ matrix_user_username }}" | |||||
| group: "{{ matrix_user_groupname }}" | |||||