mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2025-03-13 16:20:28 +01:00
Compare commits
4 Commits
7a6fcaa402
...
006920882c
Author | SHA1 | Date | |
---|---|---|---|
|
006920882c | ||
|
69d702643f | ||
|
252ca52f60 | ||
|
3f52cec25c |
group_vars
roles/custom
matrix-client-element
matrix-element-call
defaults
tasks
templates
vars
matrix-static-files
@ -4498,6 +4498,14 @@ matrix_client_element_enable_presence_by_hs_url: |-
|
||||
|
||||
matrix_client_element_jitsi_preferred_domain: "{{ matrix_server_fqn_jitsi if jitsi_enabled else '' }}"
|
||||
|
||||
matrix_client_element_features_feature_video_rooms: "{{ matrix_element_call_enabled }}"
|
||||
matrix_client_element_features_feature_group_calls: "{{ matrix_element_call_enabled }}"
|
||||
matrix_client_element_features_feature_element_call_video_rooms: "{{ matrix_element_call_enabled }}"
|
||||
matrix_client_element_features_feature_oidc_native_flow: "{{ matrix_authentication_service_enabled }}"
|
||||
|
||||
matrix_client_element_element_call_enabled: "{{ matrix_element_call_enabled }}"
|
||||
matrix_client_element_element_call_url: "{{ matrix_element_call_public_url if matrix_element_call_enabled else '' }}"
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# /matrix-client-element
|
||||
@ -5922,6 +5930,8 @@ matrix_static_files_file_matrix_client_property_org_matrix_msc4143_rtc_foci_auto
|
||||
|
||||
matrix_static_files_file_matrix_server_property_m_server: "{{ matrix_server_fqn_matrix_federation }}:{{ matrix_federation_public_port }}"
|
||||
|
||||
matrix_static_files_file_element_element_json_property_call_widget_url: "{{ matrix_element_call_public_url if matrix_element_call_enabled else '' }}"
|
||||
|
||||
matrix_static_files_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}"
|
||||
|
||||
matrix_static_files_self_check_hostname_matrix: "{{ matrix_server_fqn_matrix }}"
|
||||
@ -6036,10 +6046,12 @@ traefik_certs_dumper_ssl_dir_path: "{{ traefik_ssl_dir_path if traefik_enabled e
|
||||
# #
|
||||
########################################################################
|
||||
|
||||
# Matrix Element Call Configuration
|
||||
matrix_element_call_enabled: false # Default is false; should be enabled in host_vars as needed
|
||||
matrix_element_call_enabled: false
|
||||
|
||||
matrix_element_call_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}"
|
||||
|
||||
matrix_element_call_version: "latest" # Default version; can be overridden in host_vars
|
||||
matrix_element_call_scheme: "https" # Scheme for Element Call (e.g., https)
|
||||
|
||||
matrix_element_call_hostname: "call.{{ matrix_domain }}" # Default hostname; should be overridden in host_vars if different
|
||||
matrix_element_call_path_prefix: "/" # Path prefix for Element Call
|
||||
matrix_element_call_base_path: "{{ matrix_base_data_path }}/element-call" # Base path for storing Element Call-related files
|
||||
|
@ -180,6 +180,67 @@ matrix_client_element_branding_auth_header_logo_url: "{{ matrix_client_element_w
|
||||
# URL to Wallpaper, shown in background of welcome page
|
||||
matrix_client_element_branding_welcome_background_url: ~ # noqa var-naming
|
||||
|
||||
# Controls the `features` section of the Element Web configuration.
|
||||
matrix_client_element_features: "{{ matrix_client_element_features_default | combine(matrix_client_element_features_auto, recursive=True) | combine(matrix_client_element_features_custom, recursive=True) }}"
|
||||
matrix_client_element_features_default: |-
|
||||
{{
|
||||
{}
|
||||
|
||||
| combine(
|
||||
{'feature_video_rooms': true} if matrix_client_element_features_feature_video_rooms else {}
|
||||
)
|
||||
| combine(
|
||||
{'feature_group_calls': true} if matrix_client_element_features_feature_group_calls else {}
|
||||
)
|
||||
| combine(
|
||||
{'feature_element_call_video_rooms': true} if matrix_client_element_features_feature_element_call_video_rooms else {}
|
||||
)
|
||||
| combine(
|
||||
{'feature_oidc_native_flow': true} if matrix_client_element_features_feature_oidc_native_flow else {}
|
||||
)
|
||||
}}
|
||||
|
||||
matrix_client_element_features_auto: {}
|
||||
matrix_client_element_features_custom: {}
|
||||
|
||||
matrix_client_element_features_feature_video_rooms: false
|
||||
matrix_client_element_features_feature_group_calls: false
|
||||
matrix_client_element_features_feature_element_call_video_rooms: false
|
||||
matrix_client_element_features_feature_oidc_native_flow: false
|
||||
|
||||
matrix_client_element_element_call_enabled: false
|
||||
matrix_client_element_element_call: "{{ matrix_client_element_element_call_default | combine(matrix_client_element_element_call_auto, recursive=True) | combine(matrix_client_element_element_call_custom, recursive=True) }}"
|
||||
matrix_client_element_element_call_default: |-
|
||||
{{
|
||||
{}
|
||||
| combine(
|
||||
{'url': matrix_client_element_element_call_url} if matrix_client_element_element_call_url else {}
|
||||
)
|
||||
| combine(
|
||||
{'participant_limit': matrix_client_element_element_call_participant_limit} if matrix_client_element_element_call_participant_limit else {}
|
||||
)
|
||||
| combine(
|
||||
{'brand': matrix_client_element_element_call_brand} if matrix_client_element_element_call_brand else {}
|
||||
)
|
||||
| combine(
|
||||
{'use_exclusively': matrix_client_element_element_call_use_exclusively} if matrix_client_element_element_call_use_exclusively else {}
|
||||
)
|
||||
}}
|
||||
matrix_client_element_element_call_auto: {}
|
||||
matrix_client_element_element_call_custom: {}
|
||||
|
||||
# Controls the `element_call.url` setting in the Element Web configuration.
|
||||
matrix_client_element_element_call_url: ''
|
||||
|
||||
# Controls the `element_call.participant_limit` setting in the Element Web configuration.
|
||||
matrix_client_element_element_call_participant_limit: 8
|
||||
|
||||
# Controls the `element_call.brand` setting in the Element Web configuration.
|
||||
matrix_client_element_element_call_brand: "Element Call"
|
||||
|
||||
# Controls the `element_call.use_exclusively` setting in the Element Web configuration.
|
||||
matrix_client_element_element_call_use_exclusively: true
|
||||
|
||||
matrix_client_element_page_template_welcome_path: "{{ role_path }}/templates/welcome.html.j2"
|
||||
|
||||
# By default, there's no Element Web homepage (when logged in). If you wish to have one,
|
||||
|
@ -44,5 +44,7 @@
|
||||
"auth_footer_links": {{ matrix_client_element_branding_auth_footer_links | to_json }},
|
||||
"auth_header_logo_url": {{ matrix_client_element_branding_auth_header_logo_url | to_json }},
|
||||
"welcome_background_url": {{ matrix_client_element_branding_welcome_background_url | to_json }}
|
||||
}
|
||||
},
|
||||
"features": {{ matrix_client_element_features | to_json }},
|
||||
"element_call": {{ (matrix_client_element_element_call if matrix_client_element_element_call_enabled else {}) | to_json }}
|
||||
}
|
||||
|
@ -2,10 +2,11 @@
|
||||
# Enable or disable matrix-element-call deployment
|
||||
matrix_element_call_enabled: false
|
||||
|
||||
matrix_element_call_scheme: https
|
||||
matrix_element_call_hostname: "call.{{ matrix_domain }}"
|
||||
|
||||
# Base path configuration
|
||||
matrix_element_call_base_path: "{{ matrix_base_data_path }}/element-call"
|
||||
matrix_homeserver_config_path: "{{ matrix_base_data_path }}/synapse/config/homeserver.yaml"
|
||||
element_web_config_path: "{{ matrix_base_data_path }}/client-element/config.json"
|
||||
|
||||
# Docker network configuration
|
||||
matrix_element_call_container_network: ''
|
||||
@ -18,16 +19,10 @@ matrix_element_call_image: "ghcr.io/element-hq/element-call:latest"
|
||||
# Ports
|
||||
matrix_element_call_port: "8093"
|
||||
|
||||
# Well-known paths and domains (derived from matrix_domain)
|
||||
matrix_element_call_domain: "call.{{ matrix_domain }}"
|
||||
matrix_element_call_well_known_client_path: "{{ matrix_base_data_path }}/static-files/public/.well-known/matrix/client"
|
||||
matrix_element_call_well_known_element_path: "{{ matrix_base_data_path }}/static-files/public/.well-known/element/element.json"
|
||||
matrix_element_call_base_url: "https://{{ matrix_element_call_domain }}"
|
||||
|
||||
# Traefik Configuration for Element Call
|
||||
matrix_element_call_container_labels_traefik_enabled: true
|
||||
matrix_element_call_container_labels_traefik_docker_network: "{{ matrix_element_call_container_network }}"
|
||||
matrix_element_call_container_labels_traefik_hostname: "{{ matrix_element_call_domain }}"
|
||||
matrix_element_call_container_labels_traefik_hostname: "{{ matrix_element_call_hostname }}"
|
||||
# The path prefix must either be `/` or not end with a slash (e.g. `/element`).
|
||||
matrix_element_call_container_labels_traefik_path_prefix: "{{ matrix_element_call_path_prefix }}"
|
||||
matrix_element_call_container_labels_traefik_rule: "Host(`{{ matrix_element_call_container_labels_traefik_hostname }}`){% if matrix_element_call_container_labels_traefik_path_prefix != '/' %} && PathPrefix(`{{ matrix_element_call_container_labels_traefik_path_prefix }}`){% endif %}"
|
||||
|
@ -24,8 +24,8 @@
|
||||
|
||||
- name: Ensure matrix-element-call Docker labels file is in place
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/element-call-labels.j2"
|
||||
dest: "{{ matrix_element_call_base_path }}/element-call-labels"
|
||||
src: "{{ role_path }}/templates/labels.j2"
|
||||
dest: "{{ matrix_element_call_base_path }}/labels"
|
||||
mode: 0640
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
@ -47,47 +47,3 @@
|
||||
src: "{{ role_path }}/templates/systemd/matrix-element-call.service.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-element-call.service"
|
||||
mode: 0644
|
||||
|
||||
# Update homeserver.yaml for Element Call
|
||||
- name: Add listeners section for Element Call to homeserver.yaml
|
||||
ansible.builtin.blockinfile:
|
||||
path: "{{ matrix_homeserver_config_path }}"
|
||||
block: |
|
||||
listeners:
|
||||
- port: 8008
|
||||
tls: false
|
||||
type: http
|
||||
x_forwarded: true
|
||||
resources:
|
||||
- names: [client, federation, openid]
|
||||
compress: false
|
||||
marker: "# ANSIBLE MANAGED BLOCK - Element Call listeners"
|
||||
mode: '0644'
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
when: matrix_element_call_enabled | bool
|
||||
|
||||
- name: Ensure serve_server_wellknown is enabled in homeserver.yaml
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ matrix_homeserver_config_path }}"
|
||||
line: "serve_server_wellknown: true"
|
||||
insertafter: EOF
|
||||
state: present
|
||||
mode: '0644'
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
when: matrix_element_call_enabled | bool
|
||||
|
||||
# Create .well-known/element/element.json for Element Call
|
||||
- name: Create the well-known element.json file
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/well_known_element.json.j2"
|
||||
dest: "{{ matrix_base_data_path }}/static-files/public/.well-known/element/element.json"
|
||||
mode: '0644'
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
# Update Element Web config.json with Element Call settings
|
||||
- name: Update Element Web config.json
|
||||
ansible.builtin.include_tasks: "tasks/update_element_web_config.yml"
|
||||
when: matrix_element_call_enabled | bool
|
||||
|
@ -1,40 +0,0 @@
|
||||
- name: Read Element Web config.json
|
||||
ansible.builtin.slurp:
|
||||
src: "{{ element_web_config_path }}"
|
||||
register: element_web_config_content
|
||||
|
||||
- name: Load JSON data from config.json
|
||||
ansible.builtin.set_fact:
|
||||
element_web_config: "{{ element_web_config_content['content'] | b64decode | from_json }}"
|
||||
|
||||
- name: Update Element Call configuration in config.json
|
||||
ansible.builtin.set_fact:
|
||||
updated_element_call_config: >
|
||||
{{
|
||||
{
|
||||
"element_call": {
|
||||
"url": "https://{{ matrix_element_call_domain }}",
|
||||
"participant_limit": 8,
|
||||
"brand": "Element Call",
|
||||
"use_exclusively": true
|
||||
},
|
||||
"features": {
|
||||
"feature_video_rooms": true,
|
||||
"feature_new_room_decoration_ui": true,
|
||||
"feature_group_calls": true,
|
||||
"feature_element_call_video_rooms": true
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
- name: Merge updated Element Call configuration with existing config.json
|
||||
ansible.builtin.set_fact:
|
||||
element_web_config: "{{ element_web_config | combine(updated_element_call_config, recursive=True) }}"
|
||||
|
||||
- name: Write updated Element Web config.json
|
||||
ansible.builtin.copy:
|
||||
content: "{{ element_web_config | to_nice_json }}"
|
||||
dest: "{{ element_web_config_path }}"
|
||||
mode: '0644'
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
@ -24,7 +24,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
||||
{% if matrix_element_call_container_http_host_bind_port %}
|
||||
-p {{ matrix_element_call_container_http_host_bind_port }}:8080 \
|
||||
{% endif %}
|
||||
--label-file={{ matrix_element_call_base_path }}/element-call-labels \
|
||||
--label-file={{ matrix_element_call_base_path }}/labels \
|
||||
{% for arg in matrix_element_call_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"call": {
|
||||
"widget_url": "https://{{ matrix_element_call_domain }}"
|
||||
}
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
---
|
||||
# roles/custom/matrix-element-call/vars/main.yml
|
||||
|
||||
# Variables specific to matrix-element-call, like service configurations, can go here.
|
||||
# Any environment-specific values can be overridden here.
|
||||
matrix_element_call_public_url: "{{ matrix_element_call_scheme }}://{{ matrix_element_call_hostname }}"
|
||||
|
@ -15,6 +15,7 @@ matrix_static_files_config_path: "{{ matrix_static_files_base_path }}/config"
|
||||
matrix_static_files_public_path: "{{ matrix_static_files_base_path }}/public"
|
||||
matrix_static_files_public_well_known_path: "{{ matrix_static_files_public_path }}/.well-known"
|
||||
matrix_static_files_public_well_known_matrix_path: "{{ matrix_static_files_public_well_known_path }}/matrix"
|
||||
matrix_static_files_public_well_known_element_path: "{{ matrix_static_files_public_well_known_path }}/element"
|
||||
|
||||
# List of systemd services that matrix-static-files.service depends on
|
||||
matrix_static_files_systemd_required_services_list: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
|
||||
@ -360,6 +361,56 @@ matrix_static_files_file_matrix_support_configuration: "{{ matrix_static_files_f
|
||||
########################################################################
|
||||
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
# Related to /.well-known/element/element.json #
|
||||
# #
|
||||
########################################################################
|
||||
|
||||
# Controls whether a `/.well-known/element/element.json` file is generated and used at all.
|
||||
matrix_static_files_file_element_element_json_enabled: true
|
||||
|
||||
# Controls the call.widget_url property in the /.well-known/element/element.json file
|
||||
matrix_static_files_file_element_element_json_property_call_widget_url: ''
|
||||
|
||||
# Default /.well-known/element/element.json 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_static_files_file_matrix_support_configuration_extension_json`)
|
||||
# or completely replace this variable with your own template.
|
||||
matrix_static_files_file_element_element_json_configuration_json: "{{ lookup('template', 'templates/public/.well-known/element/element.json.j2') }}"
|
||||
|
||||
# Your custom JSON configuration for /.well-known/element/element.json should go to `matrix_static_files_file_element_element_json_configuration_extension_json`.
|
||||
# This configuration extends the default starting configuration (`matrix_static_files_file_matrix_support_configuration_extension_json`).
|
||||
#
|
||||
# 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_static_files_file_matrix_support_configuration_json`.
|
||||
#
|
||||
# Example configuration extension follows:
|
||||
#
|
||||
# matrix_static_files_file_element_element_json_configuration_extension_json: |
|
||||
# {
|
||||
# "call": {
|
||||
# "url": "value"
|
||||
# }
|
||||
# }
|
||||
matrix_static_files_file_element_element_json_configuration_extension_json: '{}'
|
||||
|
||||
matrix_static_files_file_element_element_json_configuration_extension: "{{ matrix_static_files_file_element_element_json_configuration_extension_json | from_json if matrix_static_files_file_element_element_json_configuration_extension_json | from_json is mapping else {} }}"
|
||||
|
||||
# Holds the final /.well-known/matrix/support configuration (a combination of the default and its extension).
|
||||
# You most likely don't need to touch this variable. Instead, see `matrix_static_files_file_element_element_json_configuration_json` or `matrix_static_files_file_element_element_json_configuration_extension_json`.
|
||||
matrix_static_files_file_element_element_json_configuration: "{{ matrix_static_files_file_element_element_json_configuration_json | combine(matrix_static_files_file_element_element_json_configuration_extension, recursive=True) }}"
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
# /Related to /.well-known/element/element.json #
|
||||
# #
|
||||
########################################################################
|
||||
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
# Related to index.html #
|
||||
|
@ -2,17 +2,19 @@
|
||||
|
||||
- name: Ensure matrix-static-files paths exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- "{{ matrix_static_files_base_path }}"
|
||||
- "{{ matrix_static_files_config_path }}"
|
||||
- "{{ matrix_static_files_public_path }}"
|
||||
- "{{ matrix_static_files_public_well_known_path }}"
|
||||
- "{{ matrix_static_files_public_well_known_matrix_path }}"
|
||||
- {path: "{{ matrix_static_files_base_path }}", when: true}
|
||||
- {path: "{{ matrix_static_files_config_path }}", when: true}
|
||||
- {path: "{{ matrix_static_files_public_path }}", when: true}
|
||||
- {path: "{{ matrix_static_files_public_well_known_path }}", when: true}
|
||||
- {path: "{{ matrix_static_files_public_well_known_matrix_path }}", when: true}
|
||||
- {path: "{{ matrix_static_files_public_well_known_element_path }}", when: true}
|
||||
when: "item.when | bool"
|
||||
|
||||
- name: Ensure matrix-static-files is configured
|
||||
ansible.builtin.template:
|
||||
@ -52,6 +54,10 @@
|
||||
dest: "{{ matrix_static_files_public_well_known_matrix_path }}/support"
|
||||
when: "{{ matrix_static_files_file_matrix_support_enabled }}"
|
||||
|
||||
- content: "{{ matrix_static_files_file_element_element_json_configuration | to_nice_json }}"
|
||||
dest: "{{ matrix_static_files_public_well_known_element_path }}/element.json"
|
||||
when: "{{ matrix_static_files_file_element_element_json_enabled }}"
|
||||
|
||||
# This one will not be deleted if `matrix_static_files_file_index_html_enabled` flips to `false`.
|
||||
# See the comment for `matrix_static_files_file_index_html_enabled` to learn why.
|
||||
- content: "{{ matrix_static_files_file_index_html_template }}"
|
||||
@ -70,6 +76,12 @@
|
||||
state: absent
|
||||
when: "not matrix_static_files_file_matrix_support_enabled | bool"
|
||||
|
||||
- name: Ensure /.well-known/element/element.json file deleted if not enabled
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_static_files_public_well_known_element_path }}/element.json"
|
||||
state: absent
|
||||
when: "not matrix_static_files_file_element_element_json_enabled | bool"
|
||||
|
||||
- name: Ensure matrix-static-files container image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_static_files_container_image }}"
|
||||
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
{% if matrix_static_files_file_element_element_json_property_call_widget_url %}
|
||||
"call": {
|
||||
"widget_url": {{ matrix_static_files_file_element_element_json_property_call_widget_url | to_json }}
|
||||
}
|
||||
{% endif %}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user